MessageType

Message type for grid to enable message passing and consistency

MessageType

MessageType()

Generic class for any message type.

Returns

Position

Inherits from: MessageType

A class to represent the position of the robot

Position

Position(x_val: float, y_val: float, z_val: float)

A class to represent the position of the robot

Arguments
x_val (float)
required

x-coordinate value (meters)

y_val (float)
required

y-coordinate value (meters)

z_val (float)
required

z-coordinate value (meters)

Returns

Orientation

Inherits from: MessageType

A class to represent the orientation as a quaternion

Orientation

Orientation(x: float, y: float, z: float, w: float)

Initialize orientation as a unit quaternion

Arguments
x (float)
required

x component of quaternion

y (float)
required

y component of quaternion

z (float)
required

z component of quaternion

w (float)
required

w component of quaternion (scalar)

Returns

from_euler

Orientation.from_euler(cls, roll: float, pitch: float, yaw: float)

Create orientation from Euler angles (roll, pitch, yaw)

Arguments
roll (float)
required

roll angle around x-axis (radians)

pitch (float)
required

pitch angle around y-axis (radians)

yaw (float)
required

yaw angle around z-axis (radians)

Returns

Orientation

quaternion representation of the orientation

Examples


    >>> orientation = Orientation.from_euler(0, 0, 0)

to_euler

Orientation.to_euler(axes)

Convert quaternion to Euler angles (roll, pitch, yaw)

Returns

Euler angles in radians in (x, y, z) order

to_list

Orientation.to_list()

Convert orientation to a list of floats

Returns

List of floats representing the orientation

Pose

Inherits from: MessageType

A class to represent the pose of the robot (Position and Orientation)

Pose

Pose(position: Position, orientation: Orientation)

A class to represent the pose of the robot (Position and Orientation)

Arguments
position (Position)
required

Position

The x, y, z position of the robot

orientation (Orientation)
required

Orientation

The orientation as a quaternion

Returns

Velocity

Inherits from: MessageType

A class to represent the velocity of the robot in NED frame

Velocity

Velocity(x_vel: float, y_vel: float, z_vel: float)

A class to represent the velocity of the robot in NED frame

Arguments
x_vel (float)
required

x-axis velocity (m/s)

y_vel (float)
required

y-axis velocity (m/s)

z_vel (float)
required

z-axis velocity (m/s)

Returns

Image

Inherits from: MessageType

A class to represent an image

Image

Image(data, capture_params: dict, img_type: str)

A class to represent an image

Arguments
data
required

image data

capture_params (dict), optional

the parameters of image capture

img_type (str)
required

type of the image (‘rgb’, ‘depth’, ‘segmentation’)

Returns

Twist

Inherits from: MessageType

A class to represent angular and linear velocity in 3D space.

Twist

Twist(linear: Position, angular: Position)

Initialize a Twist message

Arguments
linear (Position)
required

Position

The linear velocity in x, y, z

angular (Position)
required

Position

The angular velocity in x, y, z

Returns

to_dict

Twist.to_dict()

Convert to ROS message dictionary format

Returns

Dictionary matching ROS message format

PointCloud

Inherits from: MessageType

A class to represent a point cloud

PointCloud

PointCloud(points: np.ndarray, fields: list)

Initialize a point cloud object

Arguments
points (np.ndarray)
required

Array of points with shape (N, 3+)

fields (list), optional

List of field names. Defaults to [‘x’, ‘y’, ‘z’]

Returns

HeightMap

Inherits from: MessageType

A class to represent a height map from LiDAR data

HeightMap

HeightMap(data: np.ndarray, resolution: float, origin: Position)

Initialize the height map

Arguments
data (np.ndarray)
required

2D array of height values

resolution (float)
required

meters per cell

origin (Position)
required

Position

position of the height map origin in world coordinates

process

HeightMap.process()

Process the height map to return coordinates accounting for resolution and origin

Returns

Tuple containing: np.ndarray: X coordinates grid np.ndarray: Y coordinates grid np.ndarray: Height values

Was this page helpful?