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

NameError: name 'L1' is not defined #29

Closed
songhongxiang opened this issue Apr 19, 2020 · 3 comments
Closed

NameError: name 'L1' is not defined #29

songhongxiang opened this issue Apr 19, 2020 · 3 comments

Comments

@songhongxiang
Copy link

Hi,

I am trying to run the my code step by step in the Python Shell.
When I put rbt.calc_base_parms(), I got the following errors.
Please give me any advice to fix this issue.

generating geometric model
generating kinematic model
generating inverse dynamics code
generating gravity term code
generating coriolis term code
generating coriolis matrix code
generating inertia matrix code
generating regressor matrix code
generating friction term code
done
Traceback (most recent call last):
File ".\symbotics_test.py", line 22, in
rbt.calc_base_parms()
File "D:\Program Files\python3.7\lib\site-packages\sympybotics-1.0.dev0-py3.7.egg\sympybotics\robotmodel.py", line 122, in calc_base_parms
File "D:\Program Files\python3.7\lib\site-packages\sympybotics-1.0.dev0-py3.7.egg\sympybotics\dynamics\dynamics.py", line 55, in calc_base_parms
File "D:\Program Files\python3.7\lib\site-packages\sympybotics-1.0.dev0-py3.7.egg\sympybotics\dynamics\dyn_parm_dep.py", line 22, in find_dyn_parm_deps
File "", line 6, in regressor_func
NameError: name 'L1' is not defined

This is my code:

import sympy
import sympybotics
from sympybotics._compatibility_ import exec_

pi = sympy.pi
q = sympybotics.robotdef.q
L1,L2 = sympy.symbols('L1,L2')


twolink = sympybotics.RobotDef('twolink',[(0,0,0,q),
                                         (0,L1,0,q)],
                              dh_convention='modified')

twolink.frictionmodel = {'Coulomb', 'viscous'}
twolink.gravityacc = sympy.Matrix([0.0, 0.0, 'g'])
rbt = sympybotics.RobotDynCode(twolink, verbose=True)

rbt.calc_base_parms()
rbt.dyn.baseparms
@cdsousa
Copy link
Owner

cdsousa commented Apr 26, 2020

This is the same problem as #23

The dynamics part is not supposed to work with symbols, you have to replace those 'L1', 'L2' by the actual numeric values!

@cdsousa cdsousa closed this as completed Apr 26, 2020
@songhongxiang
Copy link
Author

songhongxiang commented Apr 26, 2020 via email

@ohmyjesus
Copy link

This is the same problem as #23

The dynamics part is not supposed to work with symbols, you have to replace those 'L1', 'L2' by the actual numeric values!

ok, thanks very much!

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

3 participants