7.12.1. pose_estimator.CallPoseEstimatorService

class pose_estimator.CallPoseEstimatorService

Bases: object

This class provides a service that calls a pose estimator to estimate the pose of objects in an image.

The service sends an action goal to the pose estimator with the input image, bounding box detections, and mask detections. The pose estimator returns the estimated poses of the objects in the image.

Parameters:
  • rgb (sensor_msgs.msg.Image) – RGB image of the scene

  • depth (sensor_msgs.msg.Image) – Depth image of the scene

  • bb_detections (list of sensor_msgs.msg.RegionOfInterest) – Bounding box detections of the objects in the image

  • mask_detections (list of sensor_msgs.msg.Image) – Masks of the objects in the image

  • class_names (list of str) – Names of the detected objects

  • class_confidences (list of float) – Confidence scores of the detected objects

bridge

Converts between ROS Image messages and OpenCV images

Type:

CvBridge

srv

Service that calls the pose estimator when called

Type:

rospy.Service

res_vis_service

Service that visualizes the pose estimation result

Type:

rospy.ServiceProxy

Parameters:

res_vis_service_name (str) – Topic of the result visualization service. Loaded from the ‘result_visualization_service_name’ parameter

Returns:

  • class_confidences (list of float) – Confidence scores of the detected objects

  • class_names (list of str) – Names of the detected objects

  • pose_results (list of geometry_msgs.msg.Pose) – Estimated poses of the detected objects in the image frame.

__init__()

Methods

__init__()

execute(req)

Calls the pose estimator to estimate the pose of objects in the input image.

visualize_pose_estimation_result(rgb, ...)

Visualizes the pose estimation result using the pose estimator result visualization service.

execute(req)

Calls the pose estimator to estimate the pose of objects in the input image.

Parameters:

req (grasping_pipeline_msgs.srv.CallPoseEstimatorRequest) – Request containing the input images, bounding box detections, and mask detections, class names, and class confidences

Returns:

Response containing the estimated poses of the objects in the image, class names and class confidences

Return type:

grasping_pipeline_msgs.srv.CallPoseEstimatorResponse

visualize_pose_estimation_result(rgb, model_poses, model_names)

Visualizes the pose estimation result using the pose estimator result visualization service.

The service creates and publishes an image with a contour of the detected objects and their object names. This is only possible for known objects because the object’s model is used to determine the object’s contour.

Parameters:
  • rgb (sensor_msgs.msg.Image) – The rgb image.

  • model_poses (list of geometry_msgs.msg.Pose) – The poses of the detected objects.

  • model_names (list of str) – The names of the detected objects. Used to lookup the object’s model which is used to determine the object’s contour.