SintefManufacturing / python-urx

Python library to control a robot from 'Universal Robots' http://www.universal-robots.com/
GNU Lesser General Public License v3.0
526 stars 275 forks source link

add support for polyscope versions >= 3.5 #44

Closed Mofeywalker closed 6 years ago

Mofeywalker commented 6 years ago

UR added a byte for internal use in version 3.6 to RobotModeData struct. I added a case for software versions >= 3.5 and added the byte to the parser string

Mofeywalker commented 6 years ago

fixes #41 and #42

oroulet commented 6 years ago

thanks

ghost commented 6 years ago

Thanks)

ghost commented 5 years ago

Hi, can you explain how to do the same for PolyScope 3.9, for example? Where can I look at the RobotModeData struct of my PolyScope version?

Mofeywalker commented 5 years ago

Hi @MrTrushka you can find the Info on this site: here On the bottom of the site is a xlsx file linked in which the structs are described: here

But currently the linked xlsx is for CB Version 3.8 only.

I hope this will help you

Mofeywalker commented 5 years ago

I just checked the documentation and it seems to be the case that the "universal Robots internal" flag is an int since version 3.6. In 3.5 it was a char. You could change this in the parsing process similar to my commit.

ghost commented 5 years ago

Thank you very much for the links!!! Format in your commit is "!IBQ???????BBddc". Why not "IBQ???????BBdddc"?

"!IBQ???????BBddi" works! Wasted about 4 hours to change 1 character=) Thank you again!!!

Mofeywalker commented 5 years ago

I am glad it worked! Maybe you could add this fix in a Pull Request.

ghost commented 5 years ago

Hm... As you said, In 3.5 flag is an uchar. Since 3.6 flag is an int. I can't just change format becouse it will break 3.5 version. And i can't get version from psize becouse it is 47 in 3.5 and 3.6. Is there any other way to get the version? Or I can indicate that this request does not work on 3.5 version.

Mofeywalker commented 5 years ago

psize should be 50 in 3.6 upwards as integer is 4 Byte and char is 1 byte, or am I mistaken? Have you checked the actual psize? Link to python docs

ghost commented 5 years ago

It is 47, strange

Mofeywalker commented 5 years ago

You could try 'b' or 'B' for unsigned / signed char, which in fact is an int. Maybe this could also work for the older versions. I currently don't have access to a robot, so I cannot test it.

ghost commented 5 years ago

yep, "B" works.