depth_data¶
This is the only node which interacts with the expansion board (robot). It is responsible for controlling the robot’s movement and arm movements.
Subscribed topics
/camera/depth/points (PointCloud2) - The depth data from the camera
get_depth (GetDepth) - Enable the transfer of depth data for 1 image
Published topics
depth_data (DepthData) - The compressed depth data from the camera
depth data¶
- class robot.src.depth_data.depth_data.depth_data.DepthDataNode(*args: Any, **kwargs: Any)¶
- handle_get_depth(msg) None ¶
Enable the get_depth functionality.
- Parameters:
msg – GetDepth message
- handle_depth_points(msg) None ¶
Get the depth data from the camera, compresses it and publishes the data.
- Parameters:
msg – PointCloud2 message
- robot.src.depth_data.depth_data.depth_data.main(args=None)¶
utils¶
- robot.src.depth_data.depth_data.utils._get_struct_fmt(is_bigendian: bool, fields, field_names: tuple[str] = None)¶
Get struct format string from a list of PointFields.
- Parameters:
is_bigendian – Whether the data is big-endian.
fields – List of PointFields.
field_names – List of field names to include in the format string.
- Returns:
Format string for struct.unpack from the given fields.
- robot.src.depth_data.depth_data.utils.read_points(cloud, field_names: tuple[str] = None, skip_nans: bool = False, uvs=[])¶
Read points from a L{sensor_msgs.PointCloud2} message.
- Parameters:
cloud – The point cloud to read from.
field_names – The names of fields to read. If None, read all fields.
skip_nans – If True, then don’t return any point with a NaN value.
uvs – If specified, then only return the points at the given coordinates.
- Returns:
Generator which yields a list of values for each point.