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!