RobotSpecManager
Reads a robot spec XML file and outputs the dimensions and mass of the robot (SMSL_RobotSpec) and, if the file has them, its motion limits (SMSL_RobotMotionLimits), once at the start.
Processing
- At the start the component reads the file given by spec_file, checks it and outputs the robot spec once. It then waits until the diagram stops. The components that use the robot take the values by wire, so they need no properties for the size of the robot.
- The outline (footprint) of the robot body is given as a rectangle (distances from the robot origin to the front, rear, left and right edges), a circle or a polygon (3 to 32 vertices, ROS footprint style). The output outline is always counterclockwise. The inscribed radius is the shortest distance from the origin to an edge and the circumscribed radius is the longest distance from the origin to a vertex. For a circle both are the radius (the outline is a regular 16-gon containing the circle).
- The robot type (differential, omni, ackermann or drone) selects which attributes of the body and motion elements are required, optional or not allowed. The body element gives the height, the mass and center of gravity, and the wheel layout. The motion element gives the limits of the machine: maximum velocities, accelerations, decelerations (including the emergency deceleration), yaw rate and, for a drone, the tilt angle; for an Ackermann robot, the maximum rate of steering. A direction in which the robot cannot move is 0 in the output.
- The values are shown in the log at the start because the structures cannot be seen in DataViewer.
- The component stops with an error when the file cannot be read, when an attribute is missing or does not fit the type, when a value is not a finite number or is out of range, when the polygon crosses itself or has no area, or when the robot origin is not inside the outline.
Usage
- Typical outputs:
robot_spec→rings_pose_estimation_icp.robot_spec;robot_motion_limits→rings_pose_estimation_icp.robot_motion_limits;robot_spec→rings_pose_estimation_p2plane.robot_spec;robot_motion_limits→rings_pose_estimation_p2plane.robot_motion_limits.
Data format
- Robot coordinates: right-handed, X forward, Y left, Z up, in meters. The origin is the point that the robot pose (pose2D) refers to. For a ground robot z = 0 is the ground.
- File: UTF-8 XML. The root element is robot_spec with the attribute type. It has one footprint element (attribute shape: rectangle, circle or polygon), and optionally one body element and one motion element. The type attribute is required when body or motion is written. Unknown elements and attributes are errors.
- Output robot_spec: custom structure SMSL_RobotSpec (632 bytes): vertex count, type, inscribed and circumscribed radii, up to 32 vertices (x, y, counterclockwise), then the values of the body element (0 when not written or not used by the type). Output robot_motion_limits: custom structure SMSL_RobotMotionLimits (120 bytes), made only when the motion element is written; velocities and accelerations are 0 or more.
- Samples for the four types are in the example folder (robot_spec_differential.xml, robot_spec_omni.xml, robot_spec_ackermann.xml, robot_spec_drone.xml).
Notes
- The sensor mounts (position and orientation of each sensor) are not given by this component. Use the RTMaps standard component Sensor Calibration File Parser and connect its matrix output to Rotation3D (Matrix Input). See the Topic "Robot spec and sensor mounting".
- The motion element holds the limits of the machine only. The speed you use today stays in the properties of the component that uses it, below the limit.
- The friction coefficient is not part of the robot spec: it belongs to the floor.
- If you add or remove the motion element in the file, select spec_file again so that the output robot_motion_limits is made or removed.
Properties
| Name | Description |
|---|---|
spec_file | Path of the robot spec XML file (UTF-8). See the description of the component for the format. |
Outputs
| Name | Description |
|---|---|
robot_spec | Dimensions and mass of the robot as the custom structure SMSL_RobotSpec: outline, inscribed and circumscribed radii, type and the values of the body element. Output once at the start. Type: SMSL_RobotSpec |
robot_motion_limits | Motion limits of the robot as the custom structure SMSL_RobotMotionLimits (maximum velocities, accelerations, decelerations, yaw rate, tilt angle). Made only when the motion element is written in the file; output once at the start. Type: SMSL_RobotMotionLimits |
RTMaps Toolkits Documentation