Code Monkey home page Code Monkey logo

Comments (7)

cdsousa avatar cdsousa commented on September 11, 2024

Strange, that should have worked out of the box as 'a2' is correctly quoted. Maybe that's some issue related to newer Python/SymPy versions, I've long stopped developing/using the package.
Let me ask other users (if anyone): have someone any clue about this?

UPDATE: See my last comment

from sympybotics.

Wanghq866 avatar Wanghq866 commented on September 11, 2024

Excuse me, what version of sympy did you develop? Thank you.

from sympybotics.

cdsousa avatar cdsousa commented on September 11, 2024

I heavily used SymPyback in 2013, but I'm pretty sure SymPyBotics worked with SymPy versions from 2014 and 2015.

from sympybotics.

dbdxnuliba avatar dbdxnuliba commented on September 11, 2024

I have find the same problem。

from sympybotics.

Artourdaboi avatar Artourdaboi commented on September 11, 2024

well i have the same issue. if someone works on dynamic identification, he has to use either SYMORO or sympybotics. sympybotics is really better except this issue... i wonder if you have developed other lib these years to replace sympybotics

from sympybotics.

Artourdaboi avatar Artourdaboi commented on September 11, 2024

import sympy
import numpy
import sympybotics

rbtdef=sympybotics.RobotDef('kuka1',
[(' 0',0.00,0.435,'q'),
('-pi/2',0.0,-0.114,'q-pi/2'),
('0','a1',0.1735,'q'),
('-pi/2',0.0,0.435,'q'),
('pi/2',0,0,'q'),
('-pi/2',0,0.136,'q+pi')],
dh_convention='modified');
rbtdef.gravityacc=sympy.Matrix([0.0,0.0,-9.81]);
rbtdef.frictionmodel={'Coulomb','viscous'}
rbt=sympybotics.RobotDynCode(rbtdef,verbose=True);
rbt.calc_base_parms()
Hb_func_def = sympybotics.robotcodegen.robot_code_to_func(
'Julia', rbt.Hb_code, 'Hb', 'Hb', rbtdef)
print Hb_func_def

Traceback (most recent call last):
File "C:\bot6_2fr.py", line 16, in
rbt.calc_base_parms()
File "build\bdist.win-amd64\egg\sympybotics\robotmodel.py", line 122, in calc_base_parms
self.dyn.calc_base_parms(regressor_func)
File "build\bdist.win-amd64\egg\sympybotics\dynamics\dynamics.py", line 55, in calc_base_parms
self.dof, self.n_dynparms, regressor_func)
File "build\bdist.win-amd64\egg\sympybotics\dynamics\dyn_parm_dep.py", line 22, in find_dyn_parm_deps
regressor_func(q, dq, ddq)).reshape(dof, parm_num)
File "", line 72, in regressor_func
NameError: global name 'a1' is not defined

python==2.7.15
sympy==0.7.3
numpy==1.15.1

from sympybotics.

cdsousa avatar cdsousa commented on September 11, 2024

Well, @shaoxingmao, @dbdxnuliba and @Artourdaboi, now that I'm looking to this once again, I get what the issue is. It has, in fact, a very simple explanation, I'm terribly sorry I didn't get it at first:
that use case is simply not supposed to work!

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

When doing geometric computations, using symbolic DH parameters may work, as it is seen here https://github.com/cdsousa/SymPyBotics/blob/master/sympybotics/tests/test_results.py#L14-L25 .

However, for computations of dynamics, only numeric DH parameters are accepted, for instance https://github.com/cdsousa/SymPyBotics/blob/master/sympybotics/tests/test_results.py#L63-L74 .

from sympybotics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.