irsim.msg#

Public message types for dependency-free snapshots.

Submodules#

Classes#

Header

Version-neutral metadata shared by all IR-SIM messages.

LaserScan

Shared sensor_msgs/LaserScan fields for a LiDAR snapshot.

Message

Base class that provides JSON-compatible message serialization.

ObjectState

Topic-shaped messages and simulator metadata for one object.

Odometry

ROS nav_msgs/Odometry-shaped object pose and velocity.

Point

ROS geometry_msgs/Point-shaped Cartesian position.

Pose

ROS geometry_msgs/Pose-shaped position and orientation.

PoseWithCovariance

ROS geometry_msgs/PoseWithCovariance-shaped pose.

Quaternion

ROS geometry_msgs/Quaternion-shaped orientation.

Twist

ROS geometry_msgs/Twist-shaped linear and angular velocity.

TwistWithCovariance

ROS geometry_msgs/TwistWithCovariance-shaped velocity.

Vector3

ROS geometry_msgs/Vector3-shaped Cartesian vector.

WorldState

Complete point-in-time state of an IR-SIM environment.

Package Contents#

class irsim.msg.Header[源代码]#

Bases: Message

Version-neutral metadata shared by all IR-SIM messages.

ros_type: ClassVar[str] = 'std_msgs/Header'#
seq: int = 0#
stamp: float = 0.0#
frame_id: str = 'world'#
class irsim.msg.LaserScan[源代码]#

Bases: Message

Shared sensor_msgs/LaserScan fields for a LiDAR snapshot.

ros_type: ClassVar[str] = 'sensor_msgs/LaserScan'#
header: Header#
angle_min: float#
angle_max: float#
angle_increment: float#
time_increment: float#
scan_time: float#
range_min: float#
range_max: float#
ranges: numpy.ndarray#
intensities: numpy.ndarray#
classmethod from_sensor(sensor: Any, *, stamp: float = 0.0, seq: int = 0, frame_id: str | None = None) LaserScan[源代码]#

Capture a LiDAR sensor without sharing its mutable arrays.

class irsim.msg.Message[源代码]#

Base class that provides JSON-compatible message serialization.

to_dict() dict[str, Any][源代码]#

Return the complete message as JSON-compatible built-in values.

class irsim.msg.ObjectState[源代码]#

Bases: Message

Topic-shaped messages and simulator metadata for one object.

header: Header#
id: int#
name: str#
role: str#
kinematics: str | None#
shape: str#
odom: Odometry#
scan: LaserScan | None#
goal: numpy.ndarray | None#
static: bool#
arrive: bool#
collision: bool#
collision_ids: list[int] = []#
scans: list[LaserScan] = []#
classmethod from_object(obj: Any, *, stamp: float = 0.0, seq: int = 0, frame_id: str = 'world') ObjectState[源代码]#

Capture an object as conventional odom and scan topics.

property sensors: list[LaserScan]#

Return all LiDAR messages as a compatibility alias for scans.

class irsim.msg.Odometry[源代码]#

Bases: Message

ROS nav_msgs/Odometry-shaped object pose and velocity.

ros_type: ClassVar[str] = 'nav_msgs/Odometry'#
header: Header#
child_frame_id: str = ''#
pose: PoseWithCovariance#
twist: TwistWithCovariance#
classmethod from_object(obj: Any, *, stamp: float = 0.0, seq: int = 0, frame_id: str = 'world') Odometry[源代码]#

Capture an object's planar pose and body-frame velocity.

classmethod from_msg(msg: Any) Odometry[源代码]#

Adopt any ROS-compatible nav_msgs/Odometry-shaped message.

Only the planar fields IR-SIM uses are read, so native ROS messages and partial stand-ins are both accepted. Header metadata is left out, since its layout is ROS-version specific and belongs to the receiver.

参数:

msg -- An object exposing pose.pose and twist.twist.

返回:

An independent, validated IR-SIM odometry message.

返回类型:

Odometry

抛出:
  • TypeError -- If msg does not expose ROS odometry pose and twist.

  • ValueError -- If any planar value is not finite.

to_state_velocity(obj: Any) tuple[numpy.ndarray, numpy.ndarray][源代码]#

Convert this odometry into state and velocity arrays for obj.

The inverse of from_object(): the planar pose replaces the first three state values, and the body-frame twist is mapped onto the velocity layout of the object's kinematics. obj is only read, so a caller can validate several updates before applying any of them.

Ackermann steering is carried as a yaw rate, which is zero whenever the car is not moving. A stopped car therefore conveys no steering angle, and obj keeps the one it already had.

参数:

obj -- The simulation object whose layout the arrays must match.

返回:

The new (state, velocity) arrays for obj.

返回类型:

tuple

抛出:

ValueError -- If obj has fewer than three state values, an Ackermann object has no steering value, or the orientation defines no rotation.

class irsim.msg.Point[源代码]#

Bases: Message

ROS geometry_msgs/Point-shaped Cartesian position.

ros_type: ClassVar[str] = 'geometry_msgs/Point'#
x: float = 0.0#
y: float = 0.0#
z: float = 0.0#
class irsim.msg.Pose[源代码]#

Bases: Message

ROS geometry_msgs/Pose-shaped position and orientation.

ros_type: ClassVar[str] = 'geometry_msgs/Pose'#
position: Point#
orientation: Quaternion#
class irsim.msg.PoseWithCovariance[源代码]#

Bases: Message

ROS geometry_msgs/PoseWithCovariance-shaped pose.

ros_type: ClassVar[str] = 'geometry_msgs/PoseWithCovariance'#
pose: Pose#
covariance: numpy.ndarray#
class irsim.msg.Quaternion[源代码]#

Bases: Message

ROS geometry_msgs/Quaternion-shaped orientation.

ros_type: ClassVar[str] = 'geometry_msgs/Quaternion'#
x: float = 0.0#
y: float = 0.0#
z: float = 0.0#
w: float = 1.0#
classmethod from_yaw(yaw: float) Quaternion[源代码]#

Create a planar quaternion from a yaw angle in radians.

to_yaw() float[源代码]#

Return the planar yaw angle in radians, from a normalized copy.

抛出:

ValueError -- If the quaternion is zero and defines no rotation.

class irsim.msg.Twist[源代码]#

Bases: Message

ROS geometry_msgs/Twist-shaped linear and angular velocity.

ros_type: ClassVar[str] = 'geometry_msgs/Twist'#
linear: Vector3#
angular: Vector3#
class irsim.msg.TwistWithCovariance[源代码]#

Bases: Message

ROS geometry_msgs/TwistWithCovariance-shaped velocity.

ros_type: ClassVar[str] = 'geometry_msgs/TwistWithCovariance'#
twist: Twist#
covariance: numpy.ndarray#
class irsim.msg.Vector3[源代码]#

Bases: Message

ROS geometry_msgs/Vector3-shaped Cartesian vector.

ros_type: ClassVar[str] = 'geometry_msgs/Vector3'#
x: float = 0.0#
y: float = 0.0#
z: float = 0.0#
class irsim.msg.WorldState[源代码]#

Bases: Message

Complete point-in-time state of an IR-SIM environment.

header: Header#
name: str#
status: str#
step_time: float#
objects: list[ObjectState] = []#
classmethod from_env(env: Any, frame_id: str = 'world') WorldState[源代码]#

Capture the current state and sensor data from an environment.

property robots: list[ObjectState]#

Return the robot messages in this snapshot.

property obstacles: list[ObjectState]#

Return the obstacle messages in this snapshot.