I would like to make a feature request for converting from float/int/poses to strings so that they can be sent over sockets. Here at Behco/MRM we have worked with Canon on a vision application that requires we send the position of a grasp over a socket_send_string to the Canon system. This is a tedious task that requires us to go to the grasp position and then write down the positional data and then type that positional data out into a string.
Converting from string to float or from float to string should be an easy function that will help with accessibility.
Did you try to feed a float variable to e.g. the command socket_send_string() or socket_send_line()?
It will automatically send the float with dot-notation as a string.
Thanks for the feedback. We need to be able to format the string e.g. “[var_1,var_2,var_3].” Can we do this on the UR? I know the operator ‘+’ does not work with strings in polyscope but the vision system requires this format to read.
This would send all the components you describe above, e.g. resulting in [1.23,2.34,3.45]\r\n
If this is not suitable, may I suggest creating a daemon, that could receive your variables over XML-RPC, build these into the right format, and send to the camera over socket.
Why not put the variables into a list and then simply send the list? You can read in a list as sent from an external server so why not send the list back? Since all of your values are numbers you can put them in a list. We actually send poses back and forth from an external server to the robot and vice versa, they come across as a data object with key/value pairs