irsim.msg.messages#
ROS-style, dependency-free messages for simulation snapshots. Used for exchanging data with ROS and other simulators, and for logging and playback.
The classes in this module are plain dataclasses. They intentionally do not depend on ROS, which keeps them usable in regular Python, learning, and batch simulation workflows while providing familiar topic names and message shapes.
Classes#
Base class that provides JSON-compatible message serialization. |
|
Version-neutral metadata shared by all IR-SIM messages. |
|
ROS |
|
ROS |
|
ROS |
|
ROS |
|
ROS |
|
ROS |
|
ROS |
|
ROS |
|
Shared |
|
Topic-shaped messages and simulator metadata for one object. |
|
Complete point-in-time state of an IR-SIM environment. |
Module Contents#
- class irsim.msg.messages.Message[源代码]#
Base class that provides JSON-compatible message serialization.
- class irsim.msg.messages.Header[源代码]#
Bases:
MessageVersion-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.messages.Point[源代码]#
Bases:
MessageROS
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.messages.Vector3[源代码]#
Bases:
MessageROS
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.messages.Quaternion[源代码]#
Bases:
MessageROS
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.
- class irsim.msg.messages.Pose[源代码]#
Bases:
MessageROS
geometry_msgs/Pose-shaped position and orientation.- ros_type: ClassVar[str] = 'geometry_msgs/Pose'#
- orientation: Quaternion#
- class irsim.msg.messages.PoseWithCovariance[源代码]#
Bases:
MessageROS
geometry_msgs/PoseWithCovariance-shaped pose.- ros_type: ClassVar[str] = 'geometry_msgs/PoseWithCovariance'#
- covariance: numpy.ndarray#
- class irsim.msg.messages.Twist[源代码]#
Bases:
MessageROS
geometry_msgs/Twist-shaped linear and angular velocity.- ros_type: ClassVar[str] = 'geometry_msgs/Twist'#
- class irsim.msg.messages.TwistWithCovariance[源代码]#
Bases:
MessageROS
geometry_msgs/TwistWithCovariance-shaped velocity.- ros_type: ClassVar[str] = 'geometry_msgs/TwistWithCovariance'#
- covariance: numpy.ndarray#
- class irsim.msg.messages.Odometry[源代码]#
Bases:
MessageROS
nav_msgs/Odometry-shaped object pose and velocity.- ros_type: ClassVar[str] = 'nav_msgs/Odometry'#
- 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.poseandtwist.twist.- 返回:
An independent, validated IR-SIM odometry message.
- 返回类型:
- 抛出:
TypeError -- If
msgdoes 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.objis 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
objkeeps the one it already had.- 参数:
obj -- The simulation object whose layout the arrays must match.
- 返回:
The new
(state, velocity)arrays forobj.- 返回类型:
tuple
- 抛出:
ValueError -- If
objhas fewer than three state values, an Ackermann object has no steering value, or the orientation defines no rotation.
- class irsim.msg.messages.LaserScan[源代码]#
Bases:
MessageShared
sensor_msgs/LaserScanfields for a LiDAR snapshot.- ros_type: ClassVar[str] = 'sensor_msgs/LaserScan'#
- 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#
- class irsim.msg.messages.ObjectState[源代码]#
Bases:
MessageTopic-shaped messages and simulator metadata for one object.
- id: int#
- name: str#
- role: str#
- kinematics: str | None#
- shape: str#
- goal: numpy.ndarray | None#
- static: bool#
- arrive: bool#
- collision: bool#
- collision_ids: list[int] = []#
- classmethod from_object(obj: Any, *, stamp: float = 0.0, seq: int = 0, frame_id: str = 'world') ObjectState[源代码]#
Capture an object as conventional
odomandscantopics.
- class irsim.msg.messages.WorldState[源代码]#
Bases:
MessageComplete point-in-time state of an IR-SIM environment.
- 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.