Universal Robots Forum

How to controll Digital I/O outputs

Hello,

how can i control digital outputs with rostopics?

i have following rostopics by start the driver:

/joint_group_vel_controller/command
/joint_states
/pos_joint_traj_controller/command
/pos_joint_traj_controller/follow_joint_trajectory/cancel
/pos_joint_traj_controller/follow_joint_trajectory/feedback
/pos_joint_traj_controller/follow_joint_trajectory/goal
/pos_joint_traj_controller/follow_joint_trajectory/result
/pos_joint_traj_controller/follow_joint_trajectory/status
/pos_joint_traj_controller/state
/rosout
/rosout_agg
/scaled_pos_joint_traj_controller/command
/scaled_pos_joint_traj_controller/follow_joint_trajectory/cancel
/scaled_pos_joint_traj_controller/follow_joint_trajectory/feedback
/scaled_pos_joint_traj_controller/follow_joint_trajectory/goal
/scaled_pos_joint_traj_controller/follow_joint_trajectory/result
/scaled_pos_joint_traj_controller/follow_joint_trajectory/status
/scaled_pos_joint_traj_controller/state
/speed_scaling_factor
/tf
/tf_static
/ur_hardware_interface/io_states
/ur_hardware_interface/robot_mode
/ur_hardware_interface/robot_program_running
/ur_hardware_interface/safety_mode
/ur_hardware_interface/script_command
/ur_hardware_interface/set_mode/cancel
/ur_hardware_interface/set_mode/feedback
/ur_hardware_interface/set_mode/goal
/ur_hardware_interface/set_mode/result
/ur_hardware_interface/set_mode/status
/ur_hardware_interface/tool_data
/wrench

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.