I can plan and excute to a target pose in the motion planning of rviz, but can not using move_group c++ interface
Hello,
I want to control the ur5 by move_group c++ interface. The code is below:
static const std::string PLANNING_GROUP = "left_ur_arm";
moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP)
move_group.setPoseTarget(target_pose);
moveit::planning_interface::MoveGroupInterface::Plan my_plan;
move_group.setGoalTolerance(0.1);
move_group.setMaxAccelerationScalingFactor(1);
move_group.setMaxVelocityScalingFactor(1);
move_group.setNumPlanningAttempts(10);
move_group.setPlanningTime(5);
bool success = (move_group.plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
move_group.move();
the output is:
ros.moveit_ros_planning_interface.move_group_interface: Fail: ABORTED: No motion plan found. No execution attempted.
ros.betago_calibration.tutorial: Visualizing plan 1 (pose goal) FAILED
ros.betago_calibration.tutorial: Visualizing plan 1 as trajectory line
ros.moveit_ros_planning_interface.move_group_interface: ABORTED: No motion plan found. No execution attempted.
As you can see, I can not move to this pose. the pose I visualized in rviz is:
However, If I use motion planning, I can move to this pose as you can see from this image:
The config of the motion planning is:
I don't know why has the difference in performance between the move_group c++ interface and motion planning in rviz. Could you please provide some advice? Thanks a lot!
Asked by TouchDeeper on 2020-11-05 09:02:38 UTC
Answers
I had similar issues with move_group.move() so I tried working with move_group.execute() instead and this seems to work fine. Only, for execute(), you want to generate the trajectory before and send it to the execute function as a plan. Something like this should work. I was able to fix my issue with it.
moveit::planning_interface::MoveGroupInterface::Plan myplan;
myplan.trajectory_ = trajectory;
group.execute(myplan);
Here is the original post from where I learnt about this: https://github.com/ros-planning/moveit/issues/797
Asked by Abhinavgandhi09 on 2020-11-05 12:02:03 UTC
Comments
Thanks for your answer. But new error occured:
ros.betago_calibration: pose 0.397771 0.286498 0.795493 0.597188 0.505990 0.388892 0.485905
ros.betago_calibration.tutorial: Visualizing plan 4 (Cartesian path) (50.00% acheived)
ros.moveit_ros_planning_interface.move_group_interface: ABORTED: Solution found but controller failed
during execution
The solution is found, but the controller failed.
Asked by TouchDeeper on 2020-11-06 00:30:20 UTC
What controllers are you using? Please ensure you are not using fake controllers and that you have ros controller packages installed on your system. You might need to do some digging on the forum for this I'm sure there are some similar questions that have been answered before.
Asked by Abhinavgandhi09 on 2020-11-06 09:38:51 UTC
I'm sure that is not a fake controller. I can control my robot in the gazebo by moveit. The controller of the arm group is effort_congtrollers/FollowJointTrajector.
Asked by TouchDeeper on 2020-11-07 04:36:10 UTC
Comments