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

Revision history [back]

click to hide/show revision 1
initial version

Hi Gengoz,

basically it should work. I'm doing it similarily and moveit knows about these objects and is avoiding collisions. Maybe you get in trouble when coding

      geometry_msgs::Pose pose;
      pose.position.x =  0.75;
      pose.position.y =  0;
      pose.position.z =  0.525;
      co.primitive_poses.push_back(pose);

As you have no primitive but a mesh, try

co.mesh_poses[0].position.x = 0.0;
co.mesh_poses[0].position.y = 0.0;
co.mesh_poses[0].position.z = 0.0;
co.mesh_poses[0].orientation.w= 1.0;
co.mesh_poses[0].orientation.x= 0.0;
co.mesh_poses[0].orientation.y= 0.0;
co.mesh_poses[0].orientation.z= 0.0;

co.meshes.push_back(co_mesh);
co.mesh_poses.push_back(co.mesh_poses[0]);
co.operation = co.ADD;
add_collision_object_pub.publish(co);

Best Regards