lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

I am using Lua for Dynamic Simulation of Baxter Robot. For this purpose, I need to calculate Mass Inertia Matrix from URDF file. Earlier, I was using pykdl [1] in ros (python), which has a function for calculating inertia matrix [2,3]. pykdl uses KDL structure internally, which can be initialized from URDF file.

The python library pykdl, internally uses Orocos Kinematics Dynamics library [4], which is written in CPP. At this moment, I can think of two possible solutions to calculate Mass Inertia Matrix from URDF file-

1. Write the code completely in Lua
2. Call the CPP library from Lua

In case of point 1, I need to first read the URDF (xml) file and construct the KDL structure. then using this structure calculate the Mass Inertia Matrix as done in [4]. This is looking like re-inventing the wheel again. In case of point 2, I doubt on the efficiency.

Any idea please.

References-
[1] http://wiki.ros.org/pykdl_utils
[2] https://github.com/gt-ros-pkg/hrl-kdl/blob/hydro/pykdl_utils/src/pykdl_utils/kdl_kinematics.py#L293
[3] https://github.com/rethink-kmaroney/baxter_pykdl/blob/master/scripts/baxter_kinematics.py#L68
[4] https://github.com/orocos/orocos_kinematics_dynamics/blob/master/orocos_kdl/src/chaindynparam.cpp#L46


Thanks

-
Ravi