Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I was able to get the pose of the collision objects by making a service request to /get_planning_scene. Added code snippet below.

  get_planning_scene_client = collision_nh_.serviceClient<moveit_msgs::GetPlanningScene>("/get_planning_scene");
  moveit_msgs::PlanningScene planning_scene_;
  moveit_msgs::GetPlanningScene srv; 
  srv.request.components.components = moveit_msgs::PlanningSceneComponents::WORLD_OBJECT_GEOMETRY;

  if (get_planning_scene_client.call(srv))
  {
    ROS_INFO("Got planning scene from move group.");
    planning_scene_ = srv.response.scene;
  }
  else
  {
    ROS_ERROR("Failed to get planning scene from move group.");
  }

  geometry_msgs::Pose CollisionObjectMeshPose = planning_scene_.world.collision_objects[0].mesh_poses[0];
  std::cout << CollisionObjectMeshPose << std::endl;