Tinca/Docs/Widgets/Custom Button

Custom Button

FREE
CONTROL · 27 FIELDS · 2×1 DEFAULT

Tap, 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_costmap you cannot undo.

Configuration fields

ModePROselect

How the button publishes when pressed.

Tap (publish once)Hold (continuous)Toggle (on/off)Service (call once)

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.

Topictopic

The topic this widget publishes to. While connected, tap to pick from the topics the robot advertises.

Message Typestring

The ROS message type for this topic, e.g. sensor_msgs/msg/Image. Usually auto-filled when you choose a topic.

Messagejson
Messagejson
ON Messagejson
OFF Messagejson
Publish Rate (Hz)PROnumber

How many times per second this widget publishes while active (Hz). Higher is smoother but uses more bandwidth.

Keep Publishing while ONPROboolean

While ON, keep republishing the ON message at the publish rate instead of sending once.

Publish Rate (Hz)PROnumber

How many times per second this widget publishes while active (Hz). Higher is smoother but uses more bandwidth.

Service Nameservice

The ROS 2 service to call, e.g. /set_mode.

Requestjson
Confirm Before Callboolean

Ask for confirmation before calling. Use for actions you do not want to fire by accident.

Show Responseboolean

Briefly show the service response on the button after calling.

Response Duration (s)slider

How long to show the response, in seconds.

1 to 30, step 1
Track Robot StatePROboolean

Show 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.

Feedback TopicPROtopic

Topic carrying the robot's actual value, drawn as a ghost alongside your command.

Feedback FieldPROfield-path

Field path on the feedback topic to read as the actual value.

Use Threshold ComparisonPROboolean

Turn the ghost into an on/off state by comparing the feedback against a threshold.

Threshold ValuePROnumber

The value the feedback is compared against.

ON when Below ThresholdPROboolean

Treat readings below the threshold as ON instead of above.

ON TextPROstring

Text shown on the button in the ON state.

OFF TextPROstring

Text shown on the button in the OFF state.

ON ColorPROselect

Button color in the ON state.

GoldGreenRedBlue
OFF ColorPROselect

Button color in the OFF state.

GoldGreenRedBlue
Button Textstring
Colorselect

The color used to draw this widget.

GoldGreenRedBlue