Measure

Introduction

The Measure module allows measuring of depth values in a specific region of interest.

The Measure module is an on-board module of the rc_visard.

Measuring Depth

The Measure module provides functionality to measure depth values in the current scene in a 2D region of interest. Optionally, the region of interest can be subdivided into up to 100 cells, for which separate depth measurements are returned in addition to the overall depth measurements of the whole region.

A depth measurement consist of the average depth mean_z, the minimum depth min_z and the maximum depth max_z, each containing 3D coordinates. The coordinates of the min_z and max_z measurements correspond to the point in the cell or overall region with the minimum and maximum distance from the camera, respectively. The x and y coordinates of the mean_z measurements define a point in the center of the cell or the overall region and the z coordinate is determined by the average of all depth value measurements (distances from the camera) in this region. Additionally, a coverage value is returned for each cell and the overall region, which is a number between 0 and 1 that reflects the fraction of valid depth values inside the respective region. A coverage value of 0 means that the cell is invalid and no depth value could be computed.

When the external pose_frame is used for the depth measurements, all 3D coordinates are computed as described above, but then transformed to the external frame. That means, the depth is always measured along the line of sight of the camera, independently of the chosen pose frame.

Interaction with other modules

Internally, the Measure module depends on, and interacts with other on-board modules as listed below.

Note

All changes and configuration updates to these modules will affect the performance of the Measure module.

Depth Images

The Measure module internally makes use of the following data:

IO and Projector Control

In case the rc_visard is used in conjunction with an external random dot projector and the IO and Projector Control module (rc_iocontrol), it is recommended to connect the projector to GPIO Out 1 and set the stereo-camera module’s acquisition mode to SingleFrameOut1 (see Stereo matching parameters), so that on each image acquisition trigger an image with and without projector pattern is acquired.

Alternatively, the output mode for the GPIO output in use should be set to ExposureAlternateActive (see Description of run-time parameters).

In either case, the Auto Exposure Mode exp_auto_mode should be set to AdaptiveOut1 to optimize the exposure of both images (see Stereo camera parameters).

No additional changes are required to use the Measure module in combination with a random dot projector.

Hand-eye calibration

In case the camera has been calibrated to a robot, the Measure module can automatically provide points in the robot coordinate frame. For the Measure node’s Services, the frame of the output points can be controlled with the pose_frame argument.

Two different pose_frame values can be chosen:

  1. Camera frame (camera). All points provided by the module are in the camera frame, and no prior knowledge about the pose of the camera in the environment is required. It is the user’s responsibility to update the configured points if the camera frame moves (e.g. with a robot-mounted camera).
  2. External frame (external). All points provided by the module are in the external frame, configured by the user during the hand-eye calibration process. The module relies on the on-board Hand-eye calibration module to retrieve the sensor mounting (static or robot mounted) and the hand-eye transformation. If the mounting is static, no further information is needed. If the sensor is robot-mounted, the robot_pose is required to transform poses to and from the external frame.

Note

If no hand-eye calibration is available, all pose_frame values should be set to camera.

All pose_frame values that are not camera or external are rejected.

Parameters

The Measure module is called rc_measure in the REST-API and is represented in the Web GUI under Modules ‣ Measure.

Parameter overview

This module has no run-time parameters.

Status values

The Measure module reports the following status values:

Table 21 The rc_measure module’s status values
Name Description
data_acquisition_time Time in seconds required to acquire depth image
last_timestamp_processed The timestamp of the last processed depth image
processing_time Processing time of the last measurement in seconds

Services

The user can explore and call the Measure module’s services, e.g. for development and testing, using the REST-API interface or the rc_visard Web GUI on the Measure page under Modules.

The Measure module offers the following services.

measure_depth

Computes the mean, minimum and maximum depth in a given region of interest, which can optionally be subdivided into cells.

Details

Return codes

Each service response contains a return_code, which consists of a value plus an optional message. A successful service returns with a return_code value of 0. Negative return_code values indicate that the service failed. Positive return_code values indicate that the service succeeded with additional information. The smaller value is selected in case a service has multiple return_code values, but all messages are appended in the return_code message.

The following table contains a list of common codes:

Table 22 Return codes of the Measure module’s services
Code Description
0 Success
-1 An invalid argument was provided