Ask Your Question
0

Where is the source code for (e.g.) compute_cartesian_path ?

asked 2015-12-08 09:06:13 -0500

Sietse gravatar image

updated 2015-12-08 09:21:30 -0500

lucasw gravatar image

I try to get my arm to perform cartesian paths with a simple 4DF robot. I try to understand the python code to get it to work. I start from the moveit examples from "ROS By Example" volume 2, which uses python.

First you do:

right_arm = moveit_commander.MoveGroupCommander('arm')

Then at some point:

      (plan, fraction) = right_arm.compute_cartesian_path ( ....  )

If I look up this code in the API, I find in line 431 of move_group.py the definition with:

  (ser_path, fraction) = self._g.compute_cartesian_path([conversions.pose_to_list(p) for p in waypoints], eef_step, jump_threshold, avoid_collisions)

The _g is defined in the __init_ as:

self._g = _moveit_move_group_interface.MoveGroup(name, "robot_description")

We see:

 from moveit_ros_planning_interface import _moveit_move_group_interface

Now i'm lost. I can find a shared library in

/opt/ros/indigo/lib/python2.7/dist-packages/moveit_ros_planning_interface

But where is the (source) code or documentation? It probably is generated from the C++ code?

I can find computeCartesianPath in the C++ api ( http://docs.ros.org/jade/api/moveit_r... ). But the function name is not the same as in python, so how are they connected? I cannot find the function definition for any of the _g functions.

In which package can I find how the code for these functions is generated?

Please help. Sietse

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-08 09:24:51 -0500

lucasw gravatar image

updated 2015-12-10 16:00:52 -0500

This looks like the conecting code: https://github.com/ros-planning/movei...

  bool (MoveGroupWrapper::*setPathConstraints_1)(const std::string&) = &MoveGroupWrapper::setPathConstraints;
 ...
  MoveGroupClass.def("compute_cartesian_path", &MoveGroupWrapper::computeCartesianPathPython);

which leads to https://github.com/ros-planning/movei...

edit flag offensive delete link more

Comments

Thanks, thats what I needed to know! I now see how a python function is "converted" to the C++ version.

Sietse gravatar image Sietse  ( 2015-12-09 06:05:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-12-08 09:06:13 -0500

Seen: 354 times

Last updated: Dec 10 '15