You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Different frame_id when calculating Pilz CIRC distance between start-center and goal-center #411
The goal pose goal frame_id will be changed from newport_tabletop to tabletop which is constructed from the constructGoalConstraints function. But the path constraints frame_id will remain to newport_tabletop. Pilz will then compare the distance from the center of circle with the goal and the start, but not in the same frame, thus throwing this error : Distances between start-center and goal-center are different. A circle cannot be created.
This error does not necessarily belong to MTC, but if you construct your goals wrt. the root of the robot model, should the path constraints also be changed to the same frame ? Maybe this change should be done in MoveIt. At least checking that each frame is wrt. the same frames should be done in the pilz_industrial_motion_planner package.
KDL::Path PathCircleGenerator::circleFromCenter(
constKDL::Frame& start_pose, // wrt. the planning frameconstKDL::Frame& goal_pose, // wrt. the planning frameconstKDL::Vector& center_point, // potentially wrt. to an alternate framedouble eqradius)
{
double a = (start_pose.p - center_point).Norm();
double b = (goal_pose.p - center_point).Norm();
double c = (start_pose.p - goal_pose.p).Norm();
if (fabs(a - b) > MAX_RADIUS_DIFF)
{
throwErrorMotionPlanningCenterPointDifferentRadius();
}
...
When the center of circle (center point) is wrt. the planning frame it succeeds. If not, then you could have something like this which should work but does not.
The solution would be to check if the start, goal and center point are all wrt. the same frame (should be the planning frame). If not, change the frame to be wrt. the planning frame.
When the center of circle (center point) is wrt. the planning frame it succeeds. If not, then you could have something like this which should work but does not.
The method assumes that all entities (start_pose, goal_pose, and center_point) are represented w.r.t. the same frame.
This cannot work if they are represented in different frames.
The method assumes that all entities (start_pose, goal_pose, and center_point) are represented w.r.t. the same frame.
This cannot work if they are represented in different frames.
They are represented in the same frame (not the planning frame) at the user level ! Down the road the start and goal are changed to the planning frame, but not the center point.
I consider this a bug. Either we add a check/transform in the Pilz section or we transform the path constraints frames wrt. the planning frame somewhere in MoveIt and/or MTC ?
They are represented in the same frame (not the planning frame) at the user level! Down the road the start and goal are changed to the planning frame, but not the center point.
If the frames are converted, the center point should be too. Did you find where the frames are converted?
Yup. Only the start pose is transformed in the Pilz for cartesian constraints. The center point is never transformed in Pilz, the planning frame is assumed. The goal pose is never transformed in Pilz. Obviously, there is no need to transform from a link that can change after computing the goal joints with the IK. But all the other transforms, that are fixed and before the first active joint, are perfectly valid.
The goal pose is transformed in the MTC move_to stage wrt. the planning frame.
Have already fixed these issues, will add tests this weekend.
Activity
captain-yoshi commentedon Dec 11, 2022
Seems to be related to moveit/moveit1#3035.
DaniGarciaLopez commentedon Jul 4, 2023
Hi @captain-yoshi, I'm getting the same error with a CIRC motion when setting the constraint in a different frame. Any updates?
captain-yoshi commentedon Oct 30, 2023
Sorry for the delay... Getting back from a long internship!
I think the best approach would be to fix the behavior in the Pilz Industrial Motion Planner. Will make a PR in the weeks to come.
rhaschke commentedon Oct 30, 2023
@captain-yoshi, I think moveit/moveit1#3519 tackles that?
captain-yoshi commentedon Oct 30, 2023
Ah yes! It's only missing the CIRC implementation. I will test the PR once it is finished.
rhaschke commentedon Oct 30, 2023
I think he attempts to do the CIRC implementation as well. At least I have seen changes to corresponding files too.
captain-yoshi commentedon Nov 2, 2023
After reading into moveit/moveit1#3519, I think it does not does not tackle this bug.
Here is where the error is triggered:
When the center of circle (center point) is wrt. the planning frame it succeeds. If not, then you could have something like this which should work but does not.
The solution would be to check if the start, goal and center point are all wrt. the same frame (should be the planning frame). If not, change the frame to be wrt. the planning frame.
rhaschke commentedon Nov 2, 2023
The method assumes that all entities (start_pose, goal_pose, and center_point) are represented w.r.t. the same frame.
This cannot work if they are represented in different frames.
captain-yoshi commentedon Nov 2, 2023
They are represented in the same frame (not the planning frame) at the user level ! Down the road the start and goal are changed to the planning frame, but not the center point.
I consider this a bug. Either we add a check/transform in the Pilz section or we transform the path constraints frames wrt. the planning frame somewhere in MoveIt and/or MTC ?
rhaschke commentedon Nov 2, 2023
If the frames are converted, the center point should be too. Did you find where the frames are converted?
captain-yoshi commentedon Nov 3, 2023
Yup. Only the start pose is transformed in the Pilz for cartesian constraints. The center point is never transformed in Pilz, the planning frame is assumed. The goal pose is never transformed in Pilz. Obviously, there is no need to transform from a link that can change after computing the goal joints with the IK. But all the other transforms, that are fixed and before the first active joint, are perfectly valid.
The goal pose is transformed in the MTC move_to stage wrt. the planning frame.
Have already fixed these issues, will add tests this weekend.
captain-yoshi commentedon Mar 28, 2024
@DaniGarciaLopez This should now work as expected. It is working on my end.
rhaschke commentedon Mar 30, 2024
Fixed via moveit/moveit1#3522