Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with rbt = sympybotics.RobotDynCode(rbtdef, verbose=True) #26

Open
ycho80 opened this issue Jan 29, 2020 · 12 comments
Open

Error with rbt = sympybotics.RobotDynCode(rbtdef, verbose=True) #26

ycho80 opened this issue Jan 29, 2020 · 12 comments

Comments

@ycho80
Copy link

ycho80 commented Jan 29, 2020

Hi,

I am trying to run the example code step by step in the Python Shell.
When I put rbt = sympybotics.RobotDynCode(rbtdef, verbose=True), I got the following errors.
Please give me any advice to fix this issue.

generating geometric model
generating kinematic model
generating inverse dynamics code
Traceback (most recent call last):
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\SymPyBotics\example\kuka_dynamics.py", line 16, in
rbt = sympybotics.RobotDynCode(rbtdef, verbose=True)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\robotmodel.py", line 58, in init
self.dyn.gen_invdyn(invdyn_se.collect)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\dynamics.py", line 22, in gen_invdyn
self.invdyn = rne(self.rbtdef, self.geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne.py", line 29, in rne
fw_results = rne_forward(rbtdef, geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne.py", line 15, in rne_forward
return rne_forward(rbtdef, geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne_park.py", line 50, in rne_park_forward
V[i] = ifunc(Adj(geom.Tdh_inv[i], V[i - 1])) +
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\symcode\subexprs.py", line 170, in collect
out_exprs = list(map(self._parse, prep_exprs))
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\symcode\subexprs.py", line 142, in _parse
if sympy.iterables.iterable(expr):
AttributeError: module 'sympy' has no attribute 'iterables'

@cdsousa
Copy link
Owner

cdsousa commented Jan 29, 2020

This seems to be due to change in new SymPy versions. Unfortunately, this project is unmaintained, although I'll accept PRs to fix issues.

@ycho80
Copy link
Author

ycho80 commented Jan 30, 2020

rbtdef.dynparms()
[L_1xx, L_1xy, L_1xz, L_1yy, L_1yz, L_1zz, l_1x, l_1y, l_1z, m_1, fv_1, fc_1, L_2xx, L_2xy, L_2xz, L_2yy, L_2yz, L_2zz, l_2x, l_2y, l_2z, m_2, fv_2, fc_2]

Thank you for your response.
I got one quick question.
Can you tell me what the fv_1 and fc_1 represent?
Thank you in advance.

@cdsousa
Copy link
Owner

cdsousa commented Jan 30, 2020

Viscouse friction, and Coulomb/constant friction

@ycho80
Copy link
Author

ycho80 commented Jan 30, 2020

Thank you for your response.
I do not need to put the location of the center of mass for each link?

@cdsousa
Copy link
Owner

cdsousa commented Jan 30, 2020 via email

@ycho80
Copy link
Author

ycho80 commented Jan 30, 2020

Thank you.
Last question.
I_1x, I_1y and I_1z represent the length of the first link in terms of x, y, and z ?

@cdsousa
Copy link
Owner

cdsousa commented Jan 30, 2020 via email

@ycho80
Copy link
Author

ycho80 commented Jan 31, 2020

Then, I don't need to put the length of the link as a parameter?
The length of the link will be indirectly estimated based on the I_1x, I_1y, and I_1z?

@ycho80
Copy link
Author

ycho80 commented Jan 31, 2020

Now, I totally understand it.
I really appreciate your favor.
You can ignore the previous question.
Thanks a lot.

@QNjeason
Copy link

Hi,

I am trying to run the example code step by step in the Python Shell.
When I put rbt = sympybotics.RobotDynCode(rbtdef, verbose=True), I got the following errors.
Please give me any advice to fix this issue.

generating geometric model
generating kinematic model
generating inverse dynamics code
Traceback (most recent call last):
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\SymPyBotics\example\kuka_dynamics.py", line 16, in
rbt = sympybotics.RobotDynCode(rbtdef, verbose=True)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\robotmodel.py", line 58, in init
self.dyn.gen_invdyn(invdyn_se.collect)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\dynamics.py", line 22, in gen_invdyn
self.invdyn = rne(self.rbtdef, self.geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne.py", line 29, in rne
fw_results = rne_forward(rbtdef, geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne.py", line 15, in rne_forward
return rne_forward(rbtdef, geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne_park.py", line 50, in rne_park_forward
V[i] = ifunc(Adj(geom.Tdh_inv[i], V[i - 1])) +
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\symcode\subexprs.py", line 170, in collect
out_exprs = list(map(self._parse, prep_exprs))
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\symcode\subexprs.py", line 142, in _parse
if sympy.iterables.iterable(expr):
AttributeError: module 'sympy' has no attribute 'iterables'

Have you solved this problem?

@guri-dominic
Copy link

for anyone facing this problem, I had to install an older version of sympy
pip install sympy==0.7.6.1
good enough for code generation

@ohmyjesus
Copy link

Hi,

I am trying to run the example code step by step in the Python Shell.
When I put rbt = sympybotics.RobotDynCode(rbtdef, verbose=True), I got the following errors.
Please give me any advice to fix this issue.

generating geometric model
generating kinematic model
generating inverse dynamics code
Traceback (most recent call last):
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\SymPyBotics\example\kuka_dynamics.py", line 16, in
rbt = sympybotics.RobotDynCode(rbtdef, verbose=True)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\robotmodel.py", line 58, in init
self.dyn.gen_invdyn(invdyn_se.collect)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\dynamics.py", line 22, in gen_invdyn
self.invdyn = rne(self.rbtdef, self.geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne.py", line 29, in rne
fw_results = rne_forward(rbtdef, geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne.py", line 15, in rne_forward
return rne_forward(rbtdef, geom, ifunc)
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\dynamics\rne_park.py", line 50, in rne_park_forward
V[i] = ifunc(Adj(geom.Tdh_inv[i], V[i - 1])) +
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\symcode\subexprs.py", line 170, in collect
out_exprs = list(map(self._parse, prep_exprs))
File "C:\Users\ymcho\AppData\Local\Programs\Python\Python37\lib\site-packages\sympybotics\symcode\subexprs.py", line 142, in _parse
if sympy.iterables.iterable(expr):
AttributeError: module 'sympy' has no attribute 'iterables'
I found a method, when I annotation these codes, the problem is solved.
in subexprs.py
...

if sympy.iterables.iterable(expr):

return expr

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants