-
Notifications
You must be signed in to change notification settings - Fork 37
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
Joint names for waypoints need to be ordered #454
Comments
I noticed this issue as well. In many places there is no fixed coupling between the order of joint names and values. I think it would be good to somehow make this more consistent and robust through Tesseract. |
This is intended behavior for performance reason. Forward and Inverse kinematics is called thousands of time during a motion planning and supporting unordered data at the low level would be a significant performance hit. Instead there is a task which you can added to your pipeline which will format the program to correctly work with motion planning. This way you just pay the penalty once. |
@Levi-Armstrong Thanks for the answer. Is this the |
Well I was wrong about the task existing but the following utility function exists in tesseract_motion_planners utils.cpp to format the input. I will work on creating a task which leverages this.
|
Thanks, I will have a look at the function! |
I am also running into this assertion.
How to apply this utility function? |
Make sure you add an import for the // Create a 'program' to plan for
tesseract_planning::CompositeInstruction program( ... );
// Add move instructions (with a joint waypoint) to your program
program.appendMoveInstruction( ... );
tesseract_planning::formatProgram(program, env); # I assume you have a tesseract_environement::Environment object already
// your program is now formatted and can be used for planning |
The latest commit on this repository adds a task to format the program correctly. Also all of the pipelines in the yaml file have been updated to include this task. |
I ran into some assertion errors when creating a plan using waypoints created from information from the SRDF. To be more specific, using the
tesseract_environment::Environment
I can get a group joint state from the SRDF:This information is used to create a
tesseract_planning::JointWaypoint
. I would expect it does not matter in what order I define the joint names and their values, as long as I define them all.Using this approach I sometimes run into assertion errors when creating a plan. More specifically here: tesseract_motion_planners/trajopt/src/trajopt_motion_planner.cpp#L280:
assert(checkJointPositionFormat(joint_names, move_instruction.getWaypoint()));
Inspecting the
checkJointPositionFormat
function, I see that thejoint_names
are compared to the names defined in the waypoint: tesseract_command_language/src/utils.cpp#L280-L296:Here the
joint_names
parameter seems to be retrieved from the kinematic info. Since it is using the==
operator from thestd::vector
, it check if the vectors are equal, not if they contain the same information.Expected behavior
The order of the
joint_names
does not matter, at least for theJointWaypoint
, as long as they correspond to the correct values.Additional questions
joint_names
defined? Is this just the order as they appear in the URDF/SRDF?joint_names
order? I currently use the following:std::vector<std::string> joint_names = env->getKinematicsInformation().joint_groups[group_name_];
The text was updated successfully, but these errors were encountered: