studywolf / blog Goto Github PK
View Code? Open in Web Editor NEWfor code created as part of http://studywolf.wordpress.com
License: GNU General Public License v3.0
for code created as part of http://studywolf.wordpress.com
License: GNU General Public License v3.0
In the ur5.py code, the following methods have x as an unused argument:
def _calc_Tx(self, name, x, lambdify=True)
def _calc_T_inv(self, name, x, lambdify=True)
Also, thanks for all the excellent educational material!
self.J_orientation = [[0, 0, 10], # joint 0 rotates around z axis
[10, 0, 0], # joint 1 rotates around x axis
[10, 0, 0], # joint 2 rotates around x axis
[10, 0, 0], # joint 3 rotates around x axis
[0, 0, 10], # joint 4 rotates around z axis
[1, 0, 0]] # joint 5 rotates around x axis
I guess the orientation axis should be normed, so 10 ->1
.
Hi Travis,
Excellent blog as always.
I was playing around with your ur5_ctrl.py
example and I am running into this funny error where I can run the code from outside an IDE like so:
[90] โ python ur5_ctrl.py
Connected to remote API server
Generating transform function for EE
connection closed...
Traceback (most recent call last):
File "ur5_ctrl.py", line 364, in <module>
ax.plot([track_hand[0, 0]],
IndexError: too many indices for array
If I then run it inside and IDE like sublime or a notebook, I get the same error above once, but then if I try to run it again I get this rather worrying chunk of stuff:
Connected to remote API server
Generating transform function for EE
connection closed...
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-d8786628c253> in <module>()
149 # calculate position of the end-effector
150 # derived in the ur5 calc_TnJ class
--> 151 xyz = robot_config.Tx('EE', q)
152
153 # calculate the Jacobian for the end effector
/Users/nd/cloud/control/src/vrep/ur5.pyc in Tx(self, name, q, x)
213 # both have their own transform calculated with this check
214 self._Tx[name] = self._calc_Tx(
--> 215 name, x=x)
216 parameters = tuple(q) + tuple(x)
217 return self._Tx[name](*parameters)[:-1].flatten()
/Users/nd/cloud/control/src/vrep/ur5.pyc in _calc_Tx(self, name, x, lambdify)
384 if (os.path.isfile('%s/%s.T' % (self.config_folder, name))):
385 Tx = cloudpickle.load(open('%s/%s.T' %
--> 386 (self.config_folder, name), 'rb'))
387 else:
388 T = self._calc_T(name=name)
/Users/nd/anaconda2/lib/python2.7/pickle.pyc in load(file)
1382
1383 def load(file):
-> 1384 return Unpickler(file).load()
1385
1386 def loads(str):
/Users/nd/anaconda2/lib/python2.7/pickle.pyc in load(self)
862 while 1:
863 key = read(1)
--> 864 dispatch[key](self)
865 except _Stop, stopinst:
866 return stopinst.value
/Users/nd/anaconda2/lib/python2.7/pickle.pyc in load_reduce(self)
1137 args = stack.pop()
1138 func = stack[-1]
-> 1139 value = func(*args)
1140 stack[-1] = value
1141 dispatch[REDUCE] = load_reduce
/Users/nd/anaconda2/lib/python2.7/site-packages/sympy/core/numbers.pyc in __new__(cls, num, prec)
823 else:
824 _mpf_ = mpmath.mpf(
--> 825 S.NegativeOne**num[0]*num[1]*2**num[2])._mpf_
826 elif isinstance(num, Float):
827 _mpf_ = num._mpf_
TypeError: can't multiply sequence by non-int of type 'float'
Do you know why it might be doing that?
EDIT:
The issue seems to be with cloudpickle
If I do
Tx = cloudpickle.load((open('%s/%s.T' % ('ur5_config', 'EE'), 'rb')))
I get
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-d19e02c244b8> in <module>()
----> 1 Tx = cloudpickle.load((open('%s/%s.T' % ('ur5_config', 'EE'), 'rb')))
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in load(file)
1382
1383 def load(file):
-> 1384 return Unpickler(file).load()
1385
1386 def loads(str):
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in load(self)
862 while 1:
863 key = read(1)
--> 864 dispatch[key](self)
865 except _Stop, stopinst:
866 return stopinst.value
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.pyc in load_reduce(self)
1137 args = stack.pop()
1138 func = stack[-1]
-> 1139 value = func(*args)
1140 stack[-1] = value
1141 dispatch[REDUCE] = load_reduce
/usr/local/lib/python2.7/site-packages/sympy/core/numbers.pyc in __new__(cls, num, prec)
823 else:
824 _mpf_ = mpmath.mpf(
--> 825 S.NegativeOne**num[0]*num[1]*2**num[2])._mpf_
826 elif isinstance(num, Float):
827 _mpf_ = num._mpf_
TypeError: can't multiply sequence by non-int of type 'float'
I think, possibly, maybe, there is an issue with the files in ur5_config/
- surely I should be able to use the ones on this repo and not process them myself (it takes a few hours as you have noted :)
Could you please upload the corresponding MapleSim Model to reproduce the presented workflow? Thx in advance
You might want to make egoMouseLook.py
executable and remove the executable flag from the others.
You could make this a its own repository and add it here as a subrepository.
I've also just "forked" this part of your repository: https://github.com/MartinThoma/cat-vs-mouse
Your blog theme is very good, very simple and regular, people like to read. Is your blog theme open source? I like it very much and want to use your blog. thank you.
I read your posts in your blog. It is exciting, but you rarely explain your code and I cannot understand absolutely
I am so sorry for opening yet another of these. This really must be the issue at my end, but just in case it is not; the two-link arm example is not running out of the box either:
The second link, top, is continuously reflecting about the top joint, suggesting there is a sign that's gone wrong somewhere.
sir i have read your code. i have certain issues
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.