Custom Button
FREETap, hold, toggle, or call services
When to reach for it
Custom Button is the catch-all publish widget: Tap is free and fires once per press; Hold, Toggle, and Service (Pro) add continuous republish, a latched state, and one-shot service calls. For a plain latched bool, Toggle Switch is simpler. For a long-running goal with progress and cancel, use Action Client (Pro) instead.
Worked example: arm / disarm
Mode Toggle (Pro), Topic /cmd_arm, Message Type std_msgs/msg/Bool. ON Message { "data": true }, OFF Message { "data": false }, ON Text Armed, OFF Text Disarmed, ON Color Red, OFF Color Gold. This alone tracks only the last press, not the robot's real state: add Track Robot State (Pro) with Feedback Topic /arm_status and Feedback Field data so another client or an e-stop disarming it shows up too.
Watch out for
- At 50 Hz, Hold mode can overload a slow bridge. Start at 10 Hz and raise it once the link keeps up.
- Show Responseis on by default in Service mode, useful while wiring a call up to see what came back. Turn it off once trusted, so the button reads as "did the thing" rather than raw response text.
- Service mode pairs naturally with Confirm Before Call for one-shot services like
/clear_costmapyou cannot undo.
Configuration fields
How the button publishes when pressed.
WITH PROAdds Hold, Toggle, and Service modes. Service is the only way to call a ROS 2 service, like /reset_odom.
The topic this widget publishes to. While connected, tap to pick one the robot advertises.
The ROS message type, like sensor_msgs/msg/Image. Fills in when you pick a topic.
shown when Mode is Tap (publish once)
shown when Mode is Hold (continuous)
shown when Mode is Hold (continuous)
Messages per second while active. Higher is smoother but uses more bandwidth.
While ON, keep republishing the ON message at the publish rate instead of sending once.
shown when Keep Publishing while ON is on
Messages per second while active. Higher is smoother but uses more bandwidth.
The ROS 2 service to call, e.g. /set_mode.
Ask before calling. Use for services you do not want to fire by accident.
Briefly show the service response on the button after calling.
How long to show the response, in seconds.
1 to 30, step 1Show the robot's actual value as a ghost indicator alongside your command.
WITH PROSee the robot's actual value as a ghost next to your command, live as it moves.
Topic carrying the robot's actual value, drawn as a ghost alongside your command.
Field path on the feedback topic to read as the actual value.
Messages per second this widget takes from the feedback topic. Lower saves data, higher tracks closer.
0.1 to 60, step 0.1Turn the ghost into an on/off state by comparing the feedback against a threshold.
The value the feedback is compared against.
Treat readings below the threshold as ON instead of above.
Text shown on the button in the ON state.
Text shown on the button in the OFF state.
Button color in the ON state.
Button color in the OFF state.
The color used to draw this widget.