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
- Hold mode at 50Hz on a slow bridge is how you discover its backpressure threshold. Start at 10Hz and raise it once the link proves it can carry it.
- 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 PROTap (free) sends one message per press. Hold publishes continuously while pressed (great for jog commands). Toggle flips between two payloads with optional labels and colors. Service calls a ROS 2 service and waits for the response, the only widget that can trigger setup actions like /set_mode or /reset_odom.
The topic this widget publishes to. While connected, tap to pick from the topics the robot advertises.
The ROS message type for this topic, e.g. sensor_msgs/msg/Image. Usually auto-filled when you choose a topic.
How many times per second this widget publishes while active (Hz). Higher is smoother but uses more bandwidth.
While ON, keep republishing the ON message at the publish rate instead of sending once.
How many times per second this widget publishes while active (Hz). Higher is smoother but uses more bandwidth.
The ROS 2 service to call, e.g. /set_mode.
Ask for confirmation before calling. Use for actions 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 PROThe widget subscribes to a feedback topic and renders the live state as a ghost on the track. The thumb stays at your commanded value, so you see command and state diverge during motion. On first connect, the thumb snaps to the actual value so the first interaction starts from where the robot is.
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.
Turn 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.