ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

I can plan and excute to a target pose in the motion planning of rviz, but can not using move_group c++ interface

asked 2020-11-05 08:02:38 -0600

TouchDeeper gravatar image

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:

image description

However, If I use motion planning, I can move to this pose as you can see from this image:

image description

The config of the motion planning is:

image description image description

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-05 11:02:03 -0600

Abhinavgandhi09 gravatar image

updated 2020-11-05 11:04:52 -0600

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/movei...

edit flag offensive delete link more

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.

TouchDeeper gravatar image TouchDeeper  ( 2020-11-05 23:30:20 -0600 )edit

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.

Abhinavgandhi09 gravatar image Abhinavgandhi09  ( 2020-11-06 08:38:51 -0600 )edit

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.

TouchDeeper gravatar image TouchDeeper  ( 2020-11-07 03:36:10 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-11-05 08:02:38 -0600

Seen: 471 times

Last updated: Nov 05 '20