Skip to content

3. ROS2 topics & services

SamVanderstraeten edited this page Apr 28, 2023 · 14 revisions

All information that can be acquired from the bots and the warehouse in the simulation scene is available on ROS2 topics and services. Users can send specific commands to the bot(s) to control it and let it complete its tasks.

Below, you can view all details about the available topics and services, along with the commands that you can send to the bots.

Warehouse services

(real-time data about the current state of the warehouse)

Navigation

Service Description Response data format
/warehouse/nodes List of all nodes to build navigation graph. [ [x1,y1,z1], [x2,y2,z2], ...]
/warehouse/graph/indices Graph data containing all valid edges, based on indices of the nodes. (see /warehouse/nodes) { 1: [2, 3], 2: [1, 4], 3: ...] }
/warehouse/graph/raw Graph data containing all valid edges, with coordinates of all nodes. { '[x1,z1]': [ [x2,z2], [x3,z3] ], '[x2,z2]': [ [x1,z1], [x4,z4] ], '[x3,z3]': ...] }

Products

Service Description Response data format
/warehouse/shelves Shelf info: product code, position & packages. {"xx": {"packages": ["xx", "tt"], "position": [1.1,2.2,3.3]}, "tt": ...}
/warehouse/docks Dock (A, B or C), available packages & position. {"A": {"packages": ["xx","tt","zz", ...], "position": [1.1,2.2,3.3]}, "B": ... }
/warehouse/dropoffs Dropoff (1-4), delivered packages & position. {"1": {"packages": ["xx","tt","zz", ...], "position": [1.1,2.2,3.3]}, "2": ... }
/warehouse/chargingstations Charging stations position & status. {"0": {"position": [1.1,2.2,3.3], "in_use": false}, "1": ...}

Bot control

(bot listening for your command)

Each robot has its own topics to listen for command. To address the correct bot with your commands, the name of the bot ({bot}) is contained in the topic name. Make sure you make this bot name easily configurable in the project. This way you will be able to adapt to new simulations or bots.

General (all bot types)

Topic Description Message type
/{bot}/cmd_vel Publish on this topic to move the bot. TwistMsg. Linear uses X, angular uses Y field.
/{bot}/cam/compressed Subscribe to receive bot camera images. CompressedImage
/{bot}/position Subscribe to receive bot position. Vector3Msg
/{bot}/facing Subscribe to receive facing direction ('forward' point from robot perspective) ```Vector3Msg
/{bot}/battery Subscribe to receive bot battery status. Float32. Percentage between 0% and 100%.

Order picker & Package sorter

Topic Description Message type
/{bot}/command * Publish GRAB command to grab box in front of bot. StringMsg
* Publish DROP to drop box in front of bot.
/{bot}/scan Subscribe to receive scanned box product code. StringMsg. 'none' if no box is present.

Pest control

Topic Description Message type
/{bot}/lasercam/aim Publish on this topic to move the laser aim cam. TwistMsg. Z rotation is ignored.
/{bot}/lasercam/compressed Subscribe to receive bot laser camera images. CompressedImage
/{bot}/command Publish ZAP command to fire laser. Laser will fire towards middle of laser cam. StringMsg