ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
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 (
    ROS_INFO("Got planning scene from move group.");
    planning_scene_ = srv.response.scene;
    ROS_ERROR("Failed to get planning scene from move group.");

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