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
Set constraint link_name as the attached object #191
I want to add a constraint in one of my Connect stage. The constraint fails when the link_name is an attached object attached via the ModifyPlanningScene stage:
Your code should "just work" but apparently it doesn't. This has nothing to do with any notion of "EndEffector" in the MoveGroupInterface code you quote.
It might actually be a bug in your planner configuration. Do you have have the ResolveConstraintFrames adapter loaded in the planning pipeline?
My apologies. I made a mistake, the orientation constraint was not wrt the mesh. After the fix the planning solves correctly. But the console reports this errors on a successful solution for the connect stage:
[DEBUG] [1596556607.717987725]: Computing stage 'filtered'
[ INFO] [1596556607.719912078]: Planner configuration 'left_eef' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1596556607.720311533]: left_eef: Allocating specialized state sampler for state space
[ INFO] [1596556607.720422833]: left_eef/left_eef: Starting planning with 1 states already in datastructure
[ INFO] [1596556608.246790618]: left_eef/left_eef: Created 4 states (2 start + 2 goal)
[ INFO] [1596556608.246864900]: Solution found in 0.526790 seconds
[ INFO] [1596556608.450591070]: SimpleSetup: Path simplification took 0.203637 seconds and changed from 3 to 2 states
[ERROR] [1596556608.464468861]: Link 'cuvette' not found in model 'ur3_dual_eef'
[ WARN] [1596556608.464553573]: Could not find link model for link name cuvette
I guess that this is not really an error because a solution was found. But there are some solutions that does not respect the constraints. This happens when there appears to have multiple segments in one solution (See gif). I can open up another issue if you prefer.
The object cuvette mesh has the same orientation frame as the frame id optical_table (See pictures). Fixed code:
[ERROR] [1596556608.464468861]: Link 'cuvette' not found in model 'ur3_dual_eef'
If this actually talks about oc.link_name you are probably still missing the ResolveConstraintFrames adapter.
To verify whether this is an MTC issue, try to reproduce this planning request in MoveIt (using the MoveGroupInterface).
I would expect it will fail as well (which would mean this is not an issue with MTC, but with your setup or MoveIt general).
Do you have have the ResolveConstraintFrames adapter loaded in the planning pipeline?
Yes I do!
If this actually talks about oc.link_name
The only place I see not found in model when grepping the moveit repo is in the robot_model.cpp file. There is a good chance that this is related to the oc.link_name.
I would expect it will fail as well (which would mean this is not an issue with MTC, but with your setup or MoveIt general).
It does not fail with MTC. It gives good solutions. I will investigate this further and report back.
There is a good chance that this is related to the` oc.link_name`.
You can easily check by changing the string and observing the warning. :)
It does not fail with MTC. It gives good solutions.
I will investigate this further and report back.
If it *also* generates bad solutions it rather fails in my opinion.
Of course it could also be some independent warning and the constraint planning works as it should...
If it also generates bad solutions it rather fails in my opinion.
I agree!
I would expect it will fail as well (which would mean this is not an issue with MTC, but with your setup or MoveIt general).
You are right! This has nothing to do with MTC. When adding path constraints in the Connect stage with a link_name from an attached object, MoveIt silence the ConstraintEvaluationResult to success. I will add a pull request by the end of the week. My initial fix fixes this issue, but I will do more testing.
On the other hand the ComputeIK stage can retrieve the attached object because it uses the getWorld function to calculate the transformation.
Backtrace for Connect stage
(gdb) backtrace
#0 moveit::core::RobotModel::getLinkModel (this=0x555556f0b730, name="cuvette", has_link=0x0) at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_model/src/robot_model.cpp:1162
#1 0x00007ffff3891c41 in moveit::core::RobotModel::getLinkModel (this=0x555556f0b730, name="cuvette", has_link=0x0)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_model/src/robot_model.cpp:1137
#2 0x00007ffff2b3e686 in kinematic_constraints::OrientationConstraint::configure (this=0x55555d4f56d0, oc=..., tf=...)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/kinematic_constraints/src/kinematic_constraint.cpp:501
#3 0x00007ffff2b44f52 in kinematic_constraints::KinematicConstraintSet::add (this=0x7fffffff8880, oc=std::vector of length 1, capacity 1 = {...}, tf=...)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/kinematic_constraints/src/kinematic_constraint.cpp:1111
#4 0x00007ffff2b45241 in kinematic_constraints::KinematicConstraintSet::add (this=0x7fffffff8880, c=..., tf=...)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/kinematic_constraints/src/kinematic_constraint.cpp:1140
#5 0x00007ffff72d8da1 in planning_scene::PlanningScene::isPathValid (this=0x55555d005d30, trajectory=..., path_constraints=..., goal_constraints=std::vector of length 0, capacity 0, group="left_eef",
verbose=false, invalid_index=0x7fffffff8a50) at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/planning_scene/src/planning_scene.cpp:2170
#6 0x00007ffff72d941a in planning_scene::PlanningScene::isPathValid (this=0x55555d005d30, trajectory=..., path_constraints=..., group="left_eef", verbose=false, invalid_index=0x7fffffff8a50)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/planning_scene/src/planning_scene.cpp:2232
#7 0x00007fffe9e0465a in planning_pipeline::PlanningPipeline::generatePlan(std::shared_ptr<planning_scene::PlanningScene const> const&, moveit_msgs::MotionPlanRequest_<std::allocator<void> > const&, planning_interface::MotionPlanResponse&, std::vector<unsigned long, std::allocator<unsigned long> >&) const () from /home/bob/ws/ros/catkin_ws/devel/lib/libmoveit_planning_pipeline.so.1.1.0
#8 0x00007fffe9e057a1 in planning_pipeline::PlanningPipeline::generatePlan(std::shared_ptr<planning_scene::PlanningScene const> const&, moveit_msgs::MotionPlanRequest_<std::allocator<void> > const&, planning_interface::MotionPlanResponse&) const () from /home/bob/ws/ros/catkin_ws/devel/lib/libmoveit_planning_pipeline.so.1.1.0
#9 0x00007fffedea4dba in moveit::task_constructor::solvers::PipelinePlanner::plan (this=0x5555570fa6e0, from=std::shared_ptr<const planning_scene::PlanningScene> (use count 8, weak count 1) = {...},
to=std::shared_ptr<const planning_scene::PlanningScene> (use count 3, weak count 1) = {...}, jmg=0x555556f0d310, timeout=5, result=std::shared_ptr<robot_trajectory::RobotTrajectory> (empty) = {...},
path_constraints=...) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/solvers/pipeline_planner.cpp:113
#10 0x00007fffed85e550 in moveit::task_constructor::stages::Connect::compute (this=0x55555718b0b0, from=..., to=...)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/stages/connect.cpp:157
#11 0x00007fffede31a8a in moveit::task_constructor::ConnectingPrivate::compute (this=0x5555570ee510) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/stage.cpp:672
#12 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555570ee510)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#13 0x00007fffeddbe529 in moveit::task_constructor::WrapperBase::compute (this=0x555557100b30) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:696
#14 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555570da480) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#15 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555570da480)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#16 0x00007fffeddbd113 in moveit::task_constructor::SerialContainer::compute (this=0x55555717f830) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:531
#17 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x55555701a780) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#18 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x55555701a780)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#19 0x00007fffeddbd113 in moveit::task_constructor::SerialContainer::compute (this=0x555555f01c60) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:531
#20 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555559da4d0) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#21 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555559da4d0)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#22 0x00007fffede48052 in moveit::task_constructor::Task::compute (this=0x5555570e9f80) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/task.cpp:285
#23 0x00007fffede48128 in moveit::task_constructor::Task::plan (this=0x5555570e9f80, max_solutions=30) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/task.cpp:297
#24 0x00007fffee365a18 in MtcPlanner::plan (this=0x7fffffffaa00, task_name="action0", c=..., max_solutions=30) at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/mtc/mtc_planner.cpp:655
#25 0x00007ffff5a92f49 in ProtocolPlanner::plan (this=0x7fffffffb640, action_block=std::vector of length 5, capacity 5 = {...}, max_solutions=30)
at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/protocol_planner/protocol_planner.cpp:280
#26 0x00005555556657be in test_dual_eef_protocol2 () at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/pp.cpp:560
#27 0x000055555567fb82 in main (argc=1, argv=0x7fffffffc168) at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/pp.cpp:1970
Backtrace for ComputeIk stage
(gdb) backtrace
#0 moveit::core::RobotModel::getLinkModel (this=0x555556f0b6f0, name="cuvette", has_link=0x7fffffff8b7e) at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_model/src/robot_model.cpp:1163
#1 0x00007ffff3891c41 in moveit::core::RobotModel::getLinkModel (this=0x555556f0b6f0, name="cuvette", has_link=0x7fffffff8b7e)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_model/src/robot_model.cpp:1137
#2 0x00007ffff1b424e3 in moveit::core::RobotState::getFrameInfo (this=0x555557e38cb0, frame_id="cuvette", robot_link=@0x7fffffff8b80: 0x5555570a2670, frame_found=@0x7fffffff8b7e: false)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_state/src/robot_state.cpp:1063
#3 0x00007ffff1b42118 in moveit::core::RobotState::getFrameTransform (this=0x555557e38cb0, frame_id="cuvette", frame_found=0x7fffffff8c4f)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_state/src/robot_state.cpp:1040
#4 0x00007ffff72d6ff9 in planning_scene::PlanningScene::getFrameTransform (this=0x555556d1c290, state=..., frame_id="cuvette")
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/planning_scene/src/planning_scene.cpp:1875
#5 0x00007ffff72d6f3e in planning_scene::PlanningScene::getFrameTransform (this=0x555556d1c290, frame_id="cuvette")
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/planning_scene/src/planning_scene.cpp:1864
#6 0x00007fffed84ca2c in moveit::task_constructor::stages::ComputeIK::compute_ (this=0x55555712f720) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/stages/compute_ik.cpp:276
#7 0x00007fffed84ebdf in moveit::task_constructor::stages::ComputeIK::compute (this=0x55555712f720) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/stages/compute_ik.cpp:454
#8 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555571b8530) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#9 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555571b8530)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#10 0x00007fffeddbe6eb in moveit::task_constructor::Alternatives::compute (this=0x55555719ff80) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:712
#11 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x555557135d20) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#12 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x555557135d20)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#13 0x00007fffeddbd113 in moveit::task_constructor::SerialContainer::compute (this=0x5555570a0490) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:531
#14 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555571c11c0) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#15 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555571c11c0)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#16 0x00007fffeddbd113 in moveit::task_constructor::SerialContainer::compute (this=0x555556d2a280) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:531
#17 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555559da4d0) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#18 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555559da4d0)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#19 0x00007fffede48052 in moveit::task_constructor::Task::compute (this=0x555557196bf0) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/task.cpp:285
#20 0x00007fffede48128 in moveit::task_constructor::Task::plan (this=0x555557196bf0, max_solutions=30) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/task.cpp:297
#21 0x00007fffee365a18 in MtcPlanner::plan (this=0x7fffffffaa00, task_name="action0", c=..., max_solutions=30) at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/mtc/mtc_planner.cpp:655
#22 0x00007ffff5a92f49 in ProtocolPlanner::plan (this=0x7fffffffb640, action_block=std::vector of length 5, capacity 5 = {...}, max_solutions=30)
at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/protocol_planner/protocol_planner.cpp:280
#23 0x00005555556657be in test_dual_eef_protocol2 () at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/pp.cpp:560
#24 0x000055555567fb82 in main (argc=1, argv=0x7fffffffc168) at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/pp.cpp:1970
Basically what I wrote was something that resembles the ResolveConstraintFrames function before I fond out that the ResolveConstraintFrames is not always triggered! So for the same Connect stage the planning has completly different backtraces
Here is a backtrace that does not triggers the ResolveConstraintFrames
(gdb) backtrace
#0 moveit::core::RobotModel::getLinkModel (this=0x555556f0b730, name="cuvette", has_link=0x0) at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_model/src/robot_model.cpp:1162
#1 0x00007ffff3891c41 in moveit::core::RobotModel::getLinkModel (this=0x555556f0b730, name="cuvette", has_link=0x0)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/robot_model/src/robot_model.cpp:1137
#2 0x00007ffff2b3e686 in kinematic_constraints::OrientationConstraint::configure (this=0x55555d4f56d0, oc=..., tf=...)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/kinematic_constraints/src/kinematic_constraint.cpp:501
#3 0x00007ffff2b44f52 in kinematic_constraints::KinematicConstraintSet::add (this=0x7fffffff8880, oc=std::vector of length 1, capacity 1 = {...}, tf=...)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/kinematic_constraints/src/kinematic_constraint.cpp:1111
#4 0x00007ffff2b45241 in kinematic_constraints::KinematicConstraintSet::add (this=0x7fffffff8880, c=..., tf=...)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/kinematic_constraints/src/kinematic_constraint.cpp:1140
#5 0x00007ffff72d8da1 in planning_scene::PlanningScene::isPathValid (this=0x55555d005d30, trajectory=..., path_constraints=..., goal_constraints=std::vector of length 0, capacity 0, group="left_eef",
verbose=false, invalid_index=0x7fffffff8a50) at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/planning_scene/src/planning_scene.cpp:2170
#6 0x00007ffff72d941a in planning_scene::PlanningScene::isPathValid (this=0x55555d005d30, trajectory=..., path_constraints=..., group="left_eef", verbose=false, invalid_index=0x7fffffff8a50)
at /home/bob/ws/ros/catkin_ws/src/moveit/moveit_core/planning_scene/src/planning_scene.cpp:2232
#7 0x00007fffe9e0465a in planning_pipeline::PlanningPipeline::generatePlan(std::shared_ptr<planning_scene::PlanningScene const> const&, moveit_msgs::MotionPlanRequest_<std::allocator<void> > const&, planning_interface::MotionPlanResponse&, std::vector<unsigned long, std::allocator<unsigned long> >&) const () from /home/bob/ws/ros/catkin_ws/devel/lib/libmoveit_planning_pipeline.so.1.1.0
#8 0x00007fffe9e057a1 in planning_pipeline::PlanningPipeline::generatePlan(std::shared_ptr<planning_scene::PlanningScene const> const&, moveit_msgs::MotionPlanRequest_<std::allocator<void> > const&, planning_interface::MotionPlanResponse&) const () from /home/bob/ws/ros/catkin_ws/devel/lib/libmoveit_planning_pipeline.so.1.1.0
#9 0x00007fffedea4dba in moveit::task_constructor::solvers::PipelinePlanner::plan (this=0x5555570fa6e0, from=std::shared_ptr<const planning_scene::PlanningScene> (use count 8, weak count 1) = {...},
to=std::shared_ptr<const planning_scene::PlanningScene> (use count 3, weak count 1) = {...}, jmg=0x555556f0d310, timeout=5, result=std::shared_ptr<robot_trajectory::RobotTrajectory> (empty) = {...},
path_constraints=...) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/solvers/pipeline_planner.cpp:113
#10 0x00007fffed85e550 in moveit::task_constructor::stages::Connect::compute (this=0x55555718b0b0, from=..., to=...)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/stages/connect.cpp:157
#11 0x00007fffede31a8a in moveit::task_constructor::ConnectingPrivate::compute (this=0x5555570ee510) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/stage.cpp:672
#12 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555570ee510)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#13 0x00007fffeddbe529 in moveit::task_constructor::WrapperBase::compute (this=0x555557100b30) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:696
#14 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555570da480) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#15 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555570da480)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#16 0x00007fffeddbd113 in moveit::task_constructor::SerialContainer::compute (this=0x55555717f830) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:531
#17 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x55555701a780) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#18 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x55555701a780)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#19 0x00007fffeddbd113 in moveit::task_constructor::SerialContainer::compute (this=0x555555f01c60) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:531
#20 0x00007fffeddb9ac1 in moveit::task_constructor::ContainerBasePrivate::compute (this=0x5555559da4d0) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/container.cpp:106
#21 0x00007fffeddc4215 in moveit::task_constructor::StagePrivate::runCompute (this=0x5555559da4d0)
at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/include/moveit/task_constructor/stage_p.h:152
#22 0x00007fffede48052 in moveit::task_constructor::Task::compute (this=0x5555570e9f80) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/task.cpp:285
#23 0x00007fffede48128 in moveit::task_constructor::Task::plan (this=0x5555570e9f80, max_solutions=30) at /home/bob/ws/ros/catkin_ws/src/moveit_task_constructor/core/src/task.cpp:297
#24 0x00007fffee365a18 in MtcPlanner::plan (this=0x7fffffffaa00, task_name="action0", c=..., max_solutions=30) at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/mtc/mtc_planner.cpp:655
#25 0x00007ffff5a92f49 in ProtocolPlanner::plan (this=0x7fffffffb640, action_block=std::vector of length 5, capacity 5 = {...}, max_solutions=30)
at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/protocol_planner/protocol_planner.cpp:280
#26 0x00005555556657be in test_dual_eef_protocol2 () at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/pp.cpp:560
#27 0x000055555567fb82 in main (argc=1, argv=0x7fffffffc168) at /home/bob/ws/ros/catkin_ws/src/bob/bob_planner/src/pp.cpp:1970
Here is a backtrace that triggers the ResolveConstraintFrames (Line 26)
Do you know why there are times that the ResolveConstraintFrames is not always triggered for the same Connect stage?
No. The adapter_chain_ is loaded from ROS parameters and should not change at any point in the lifetime of the pipeline.
I suspect an issue in your setup (possibly you have multiple pipelines and one does not define a chain?) but there might be some underlying issue in MoveIt.
you might have found a shortcoming in the ResolveConstraintFrames adapter that should be fixed in the upstream package.
The original authors likely forgot to apply and verify path constraints when they added the plugin.
Looking at the sources though, at first glance it seems to transform path constraints as expected.
But planning_scene->isPathValid does not pass through the adapter.
That's true. Implementing the frame resolver here will also render the ResolveConstraintsFrame request adapter obsolete, because if you have to transform the request in the scope of that method anyway, you might as well do it *before* passing them into the pipeline...
Could you please create an issue and/or pull-request in the MoveIt repository?
Activity
[-]Set constraint link name wrt an attached object[/-][+]Set constraint link name as the attached object[/+][-]Set constraint link name as the attached object[/-][+]Set constraint link_name as the attached object[/+]v4hn commentedon Aug 4, 2020
Sorry for the late response.
Your code should "just work" but apparently it doesn't. This has nothing to do with any notion of "EndEffector" in the MoveGroupInterface code you quote.
It might actually be a bug in your planner configuration. Do you have have the
ResolveConstraintFramesadapter loaded in the planning pipeline?captain-yoshi commentedon Aug 4, 2020
My apologies. I made a mistake, the orientation constraint was not wrt the mesh. After the fix the planning solves correctly. But the console reports this errors on a successful solution for the connect stage:
I guess that this is not really an error because a solution was found. But there are some solutions that does not respect the constraints. This happens when there appears to have multiple segments in one solution (See gif). I can open up another issue if you prefer.
The object
cuvettemesh has the same orientation frame as the frame idoptical_table(See pictures). Fixed code:v4hn commentedon Aug 4, 2020
If this actually talks about
oc.link_nameyou are probably still missing theResolveConstraintFramesadapter.To verify whether this is an MTC issue, try to reproduce this planning request in MoveIt (using the MoveGroupInterface).
I would expect it will fail as well (which would mean this is not an issue with MTC, but with your setup or MoveIt general).
captain-yoshi commentedon Aug 4, 2020
Yes I do!
The only place I see
not found in modelwhen grepping the moveit repo is in therobot_model.cppfile. There is a good chance that this is related to theoc.link_name.It does not fail with MTC. It gives good solutions. I will investigate this further and report back.
v4hn commentedon Aug 4, 2020
captain-yoshi commentedon Aug 5, 2020
I agree!
You are right! This has nothing to do with MTC. When adding path constraints in the
Connectstage with a link_name from an attached object, MoveIt silence the ConstraintEvaluationResult to success. I will add a pull request by the end of the week. My initial fix fixes this issue, but I will do more testing.On the other hand the
ComputeIKstage can retrieve the attached object because it uses the getWorld function to calculate the transformation.Backtrace for Connect stage
Backtrace for ComputeIk stage
v4hn commentedon Aug 5, 2020
Thanks! Looking forward to review it.
yes, it's a very different code path.
captain-yoshi commentedon Aug 8, 2020
Basically what I wrote was something that resembles the
ResolveConstraintFramesfunction before I fond out that the ResolveConstraintFrames is not always triggered! So for the same Connect stage the planning has completly different backtracesHere is a backtrace that does not triggers the ResolveConstraintFrames
Here is a backtrace that triggers the ResolveConstraintFrames (Line 26)
It seems that the adaptAndPlan is not always triggered depending on the
adapter_chain_variable...Do you know why there are times that the
ResolveConstraintFramesis not always triggered for the same Connect stage?v4hn commentedon Aug 10, 2020
No. The
adapter_chain_is loaded from ROS parameters and should not change at any point in the lifetime of the pipeline.I suspect an issue in your setup (possibly you have multiple pipelines and one does not define a chain?) but there might be some underlying issue in MoveIt.
captain-yoshi commentedon Aug 10, 2020
The
adapter_chain_is loaded correctly. My mistake, the adaptAndPlan is always triggered.There are 2 paths when planning using generatePlan:
OrientationConstraintmsg link_name and orientation will be changed if the link_name is a sub-frame.OrientationConstraintmsg is not changedAfter validating the State, it tries to validate the Path but if the
OrientationConstraintlink_name is a sub-frame, it fails to retrieve it.For
Statevalidation the resolvedConstraints is applied, but for thePathvalidation it is not.Is the above the intended behavior?
v4hn commentedon Aug 10, 2020
O.o No!
EDIT:
you might have found a shortcoming in the
ResolveConstraintFramesadapter that should be fixed in the upstream package.The original authors likely forgot to apply and verify path constraints when they added the plugin.
Looking at the sources though, at first glance it seems to transform path constraints as expected.
captain-yoshi commentedon Aug 10, 2020
Yes that is correct. But the planning_scene->isPathValid does not pass through the adapter.
v4hn commentedon Aug 10, 2020
captain-yoshi commentedon Aug 12, 2020
Yes first thing in the morning!