0
$\begingroup$

Rosanswers logo

Hello all,

I am using the move_arm package to plan and execute trajectories for the arm of the KUKA youbot robot. Everything is working fine.

In some cases, I want to pick up a cube and place it on the back of the youbot. So when I pick the cube, I am adding it as an attached object on the robot using the code from the Attaching Virtual Objects to the Robot tutorial, in order to avoid collisions when I am going to place it on the back of the youbot. However, when I call the move_arm action server afterwards to move the arm to the place position the attached object is not taken into consideration for the trajectory plan.

I call the get_planning_scene service with the attached object and then I call the set_planning_scene_diff service with the resulted planning scene. This is not suppose to forward the updated scene to all components?

arm_navigation_msgs::GetPlanningScene planning_scene;
planning_scene.request.planning_scene_diff.attached_collision_objects.push_back(att_object);
if(!get_planning_scene_client.call(planning_scene))
{
    ROS_WARN("Can't get planning scene");
    return false;
}

arm_navigation_msgs::SetPlanningSceneDiff srv;
srv.request.planning_scene_diff = planning_scene.response.planning_scene;
if(!set_planning_scene_client.call(srv))
{
    ROS_WARN("Can't set planning scene");
    return false;
}

PS. The planning scene from the response contains the object. I validate it using the collision models and visualise the attached collision objects markers.


Originally posted by clantos on ROS Answers with karma: 11 on 2012-07-30

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

move_arm also calls SetPlanningSceneDiff, so if you want to supply a diff to it you need to set the planning_scene_diff field in the MoveArmGoal. You shouldn't actually need the other two calls to the environment server - just put the attached object in the MoveArmGoal.planning_scene_diff and you should get the desired behavior.


Originally posted by egiljones with karma: 2031 on 2012-07-30

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by clantos on 2012-07-30:
Thank you very much!!! Didn't notice that MoveArmGoal had a planning_scene_diff :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.