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
Orientationquaternion 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
PositionThe x, y, z position of the robot
orientation (Orientation)
required
OrientationThe 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
PositionThe linear velocity in x, y, z
angular (Position)
required
PositionThe 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
Positionposition 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

Force

Inherits from: MessageType Represents a force in 3D cartesian space (Newtons).

Force

Force(x: float, y: float, z: float)
Initialize a force vector.
Arguments
x (float)
required
x-component of force (Newtons)
y (float)
required
y-component of force (Newtons)
z (float)
required
z-component of force (Newtons)

Torque

Inherits from: MessageType Represents a torque in 3D cartesian space (Newton-meters).

Torque

Torque(x: float, y: float, z: float)
Initialize a torque vector.
Arguments
x (float)
required
x-component of torque (Newton-meters)
y (float)
required
y-component of torque (Newton-meters)
z (float)
required
z-component of torque (Newton-meters)