Tinca/Docs/Widgets/Custom Button

Custom Button

FREE
CONTROL · 28 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
  • 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_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 PROAdds Hold, Toggle, and Service modes. Service is the only way to call a ROS 2 service, like /reset_odom.

Topictopic

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

Message Typestring

The ROS message type, like sensor_msgs/msg/Image. Fills in when you pick a topic.

Messagejson

shown when Mode is Tap (publish once)

Messagejson

shown when Mode is Hold (continuous)

ON Messagejson
OFF Messagejson
Publish Rate (Hz)PROnumber

shown when Mode is Hold (continuous)

Messages per second while active. 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

shown when Keep Publishing while ON is on

Messages per second while active. Higher is smoother but uses more bandwidth.

Service Nameservice

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

Requestjson
Confirm Before Callboolean

Ask before calling. Use for services 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 PROSee the robot's actual value as a ghost next to your command, live as it moves.

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.

Max Message Rate (Hz)number

Messages per second this widget takes from the feedback topic. Lower saves data, higher tracks closer.

0.1 to 60, step 0.1
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