Camera & Lidar#
The Honey Badger robot can be equipped with a camera, a Livox MID-360 lidar and LEDs. All of them are handled by the ROS 2 payload_node (package hb50_payload), which runs on the APC (Jetson Orin) in a ROS 2 Jazzy Docker container.
The software is installed on the APC from the hb50-payload package and configured in /etc/hb50/payload.yaml, see Configuration and Installation.
Remote controller interface#
The CAMERA MENU, LIDAR MENU and LEDS MENU buttons appear in the left menu of the HB50 Remote application automatically when the robot detects the payload, that is when payload_node is running. The LIDAR MENU button appears only when lidar.config is set, and the LEDS MENU button only when leds.device is set.
The camera, the lidar and the LEDs are off by default and have to be turned on each time payload_node starts.
When the enabled camera sends no pictures for 3 s, for example after it was unplugged, it is reconnected automatically as soon as it is available again.
Rosbag recording#
payload_node can record a rosbag, started and stopped with the /hb50/payload/rosbag/record service (std_srvs/srv/SetBool) or the rosbag buttons in the LIDAR MENU. The rosbag is saved in MCAP format on the APC in ~/rosbags/payload_<date>_<time> of the user the payload runs as, and contains the topics:
/hb50/bridge_state_10hz,/hb50/robot_state_10hz,/hb50/payload/camera/locomotion/compressed,/hb50/payload/lidar/points, whenlidar.configis set.
The camera and the lidar are not enabled by the recording, enable them first to record their data.
Warning
Always stop the recording before turning off the robot or the APC, otherwise the rosbag can be damaged. Stopping or restarting the hb50-payload service closes an open rosbag properly.
Camera and lidar topics#
payload_node and the lidar driver publish to the following topics:
Topic |
Message Type |
QoS |
Publish Rate |
|---|---|---|---|
|
|
Reliable, depth 1 |
camera mode frame rate |
|
|
Reliable |
10 hz |
|
|
Reliable |
200 hz |
|
|
Reliable, depth 1 |
10 hz |
|
|
Reliable |
as needed |
The camera images are JPEG compressed. The camera topic name contains camera.name, locomotion by default.
/hb50/payload/lidar/points contains the full Livox point cloud. /hb50/payload/lidar/points_preview contains only the x, y, z coordinates of every lidar.preview_decimation-th point, and is meant for viewing the point cloud over Wi-Fi, for example in RViz. It is published only while there is a subscriber.
Note
For precise definition of QoS check: Quality of Service.
Payload services#
Service |
Interface Type |
Function |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Example of use:
ros2 service call /hb50/payload/camera/enable std_srvs/srv/SetBool "{data: true}"
The response to enabling the lidar is sent when the first lidar data arrives, which can take a few seconds.
Configuration#
The payload is configured in the following files:
File |
Contents |
|---|---|
|
Camera, lidar and LED settings. |
|
Lidar and APC network addresses. |
|
Robot name ( |
ROBOT_NS and ROS_DOMAIN_ID must match the robot settings, see Platform. Changes are applied with:
sudo systemctl restart hb50-payload
Package updates keep changed configuration files. When a new version also changes a default, it is saved next to the changed file as <file>.dpkg-dist.
The default /etc/hb50/payload.yaml:
/**:
ros__parameters:
camera:
device: /dev/video0
name: locomotion
mode: walk
modes:
walk: [640, 480, 30, 50]
inspect: [1920, 1080, 5]
rotate_180: false
mount: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
lidar:
config: mid360.json
mount: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
preview_decimation: 10
leds:
device: "1a86:7523"
Parameter |
Function |
|---|---|
|
Video4Linux device of the camera. The camera must support MJPEG. |
|
Camera name, used in the image topic and the camera frame name. The |
|
Active camera mode, one of |
|
Camera mode: width, height, frame rate and optional JPEG quality ( |
|
Rotates the camera picture by 180°, for a camera mounted upside down. |
|
Camera position relative to the |
|
Livox driver configuration file. Relative paths point to the folder of |
|
Lidar position relative to the |
|
Every Nth lidar point is kept in the preview point cloud. |
|
USB |
Only camera.mode, camera.modes.<name> and camera.rotate_180 can be changed at runtime, for example:
ros2 param set /hb50/payload_node camera.mode inspect
Changing the other parameters requires a restart of the hb50-payload service.
The camera and lidar positions are published as static transforms from <robot>/body to <robot>/camera_<name> and <robot>/lidar, see Geometry & Frames.
If the requested resolution is not supported by the camera, the closest supported one is used and a warning is logged. The camera always captures at 30 fps or more, and lower frame rates are achieved by dropping frames. When camera.rotate_180 is on and no quality is set, the frames are re-encoded with quality 85.
The network settings of the lidar are stored in /etc/hb50/mid360.json. By default, the lidar uses the address 10.11.0.169 and sends data to the APC (10.11.0.11). If the lidar does not send data within 10 s of being enabled, the driver is stopped and an error suggesting a check of the connection and the addresses in mid360.json is returned.
Installation#
The payload software is installed on the APC from the hb50-payload_<version>_arm64.deb package supplied by MAB. The first start downloads the ROS 2 Docker image, so the APC needs internet access during installation. Copy the package to the APC and install it (see Network for the APC address):
scp hb50-payload_<version>_arm64.deb hb-orin@10.11.0.11:
ssh hb-orin@10.11.0.11
sudo apt install ./hb50-payload_<version>_arm64.deb
The payload software runs as the hb50-payload systemd service. It starts right after the installation and after every boot, and restarts automatically 2 s after a crash. Its state and logs are available with:
systemctl status hb50-payload
journalctl -u hb50-payload -f
Newer versions are installed with the same apt install command, which also restarts the service. The package is removed with sudo apt remove hb50-payload, or with sudo apt purge hb50-payload to delete the configuration files too.