Universal Robots Forum

How to controll Digital I/O outputs


how can i control digital outputs with rostopics?

i have following rostopics by start the driver:


I dont see topic like: set_io - this service i found in documentary, but how can i start it, to publish simple command to activate one of the pin?

set_io is a service, not a topic, so rostopic list won’t list it. See the message documentation on how to use it.

For example, the following ROS call would set the digital output at pin 2 to true:

rosservice call /ur_hardware_interface/set_io "fun: 1
pin: 2
state: 1.0"
1 Like

If I’m using configurable output Co1, what numeric ID should I use for the pin?

Thank you in advance.

According to our implementation pins 8 to 15 are used for the configurable outputs, so Co1 would be pin 9.

However, that should be documented better!

Edit: See Document pin mapping in SetIO service by fmauch · Pull Request #16 · ros-industrial/ur_msgs · GitHub

1 Like

Thank you so much @mauch.