Ask Your Question
0

How to set pin domain(current or voltage) of UR robot with ur_msgs

asked 2020-02-12 05:23:44 -0600

stefvanlierop gravatar image

updated 2020-02-12 05:25:32 -0600

Hi, I am currently working with a UR10 robot and i want to set the pin mode or domain as it is called to voltage instead of current for the analog output pins. In the ur_msgs/Analog documentation you can see that the Analog message has a pin and a domain which sets the pin mode to either voltage or current. This is not included in the ur_msgs/setIO service of the Universal_robot_driver far as i could see. Am i correct in this or am i not looking at it correctly? If this is not implemented, would it be a good idea to write a program to sets up a temporary socket connetion to the UR robot to force the pin mode/domain to voltage? Would ROS reset this when i would write a value to that pin with the ur_msgs/setIO service?

p.s. i am only talking about the Analog outputs of the UR10

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-02-26 08:54:49 -0600

stefvanlierop gravatar image

updated 2020-02-26 08:58:18 -0600

gvdhoorn gravatar image

At the moment this does not seem to be implemented, but the pin domain can be set with the ur_hardware_interface/script_command topic. Example code:

// include
from std_msgs.msg import String 

// the function 
def apply_vacuum(self):
rospy.init_node("apply_vacum_node") 
publisher1 = rospy.Publisher('/ur_hardware_interface/script_command', String, queue_size=2)

try:
   // first 1 is the pin number and second number is the state of the pin 
    message = "sec MyProgram():" + "\n" + "set_standard_digital_out(1,1)" + "\n" + "end " + "\n"
    publisher1.publish(message)  
except rospy.ServiceException, e:
    print "Something went wrong: %s"%e

this will work but make sure you read the scripting manual for the functions that you can use in this format. make sure that you input the correct information. The format i used can be seen here.

you only need to the use the required function for the pin domain that you can find in the mentioned scripting manual in said post.

edit flag offensive delete link more

Comments

As this question is the one in which you actually asked about this, I thought it would be best to duplicate your answer from the question you linked here.

gvdhoorn gravatar imagegvdhoorn ( 2020-02-26 08:57:49 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-02-12 05:23:44 -0600

Seen: 16 times

Last updated: yesterday