SymPyBotics icon indicating copy to clipboard operation
SymPyBotics copied to clipboard

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

Open ycho80 opened this issue 5 years ago • 12 comments

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'

ycho80 avatar Jan 29 '20 03:01 ycho80

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

cdsousa avatar Jan 29 '20 09:01 cdsousa

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.

ycho80 avatar Jan 30 '20 19:01 ycho80

Viscouse friction, and Coulomb/constant friction

cdsousa avatar Jan 30 '20 20:01 cdsousa

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

ycho80 avatar Jan 30 '20 22:01 ycho80

No, it is not known in advance and cannot be "directly" estimated. It is indirectly estimated as l_1 / m_1

On Thu, Jan 30, 2020 at 10:29 PM ycho80 [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cdsousa/SymPyBotics/issues/26?email_source=notifications&email_token=AACRNT5GWEWXFR2VJHR3CRTRANIDXA5CNFSM4KM5Z622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKMZYNA#issuecomment-580492340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRNT5EEOAXWUU7LQ4M5CTRANIDXANCNFSM4KM5Z62Q .

cdsousa avatar Jan 30 '20 22:01 cdsousa

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 ?

ycho80 avatar Jan 30 '20 23:01 ycho80

They are the x,y,z components of the "first moment of inertia" vector. Such "first moment of inertia" vector is equal to the center-of-mass position (x,y,z) multiplied by the value of the mass.

On Thu, Jan 30, 2020 at 11:02 PM ycho80 [email protected] wrote:

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 ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cdsousa/SymPyBotics/issues/26?email_source=notifications&email_token=AACRNTZTPCYDQDQYMTO6O23RANMAZA5CNFSM4KM5Z622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKM4JVQ#issuecomment-580502742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRNT3TVMK2HEWPYDV7YOLRANMAZANCNFSM4KM5Z62Q .

cdsousa avatar Jan 30 '20 23:01 cdsousa

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 avatar Jan 31 '20 00:01 ycho80

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

ycho80 avatar Jan 31 '20 00:01 ycho80

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?

QNjeason avatar Jul 12 '20 11:07 QNjeason

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

guri-dominic avatar Jul 27 '20 17:07 guri-dominic

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

...

ohmyjesus avatar Aug 10 '20 13:08 ohmyjesus