Ultrasonic
The Ultrasonic node reads an HC-SR04-style sonar sensor and publishes distance as a standard ROS2 Range message.
Range: ~2 cm to 4 m
Configuration​
ultrasonic:
enabled: true
sensors: ["front"]
front:
ping: 8
echo: 9
frame_id: "front_link"
Parameters​
| Parameter | Description |
|---|---|
ping | DIO channel for the trigger/ping pin (range 0 – 21) |
echo | DIO channel for the echo pin (range 0 – 21) |
frame_id | TF frame ID included in the message header |
Topics​
Published​
| Topic | Type | Description | Rate |
|---|---|---|---|
/<name>/range | sensor_msgs/Range | Distance in metres. Out-of-range readings published as inf. | 20 Hz |
Service​
Service name: /<name>/ultrasonic_cmd
Type: studica_control/SetData
| Command | Description |
|---|---|
get_distance | Distance in millimetres |
get_distance_inches | Distance in inches |
get_distance_millimeters | Distance in millimetres |