Roboguide utilizes little endian for their bytes but real production robots from the same company utilizes big endian. A) I'll have to change my socket code from test to production to account for the change of endianness and B) since I'm truncating bytes to send UInt16 from Uint32s on the robot side, it is truncating the wrong side in simulation but not production. Hopefully there is just an option to set on Roboguide to change how it handles the byte swapping because there is little I can do without having a major refactor before every robot deployment.
Anyway to change the endianness on Roboguide?
-
dnaumann -
December 22, 2021 at 4:54 PM -
Thread is Unresolved
-
-
This would be handy to have, but does not exist. Or: I've not been able to find it.
because there is little I can do without having a major refactor before every robot deployment
byte swapping a major refactor?
That should not be the case.
Many situations require swapping, so building that into a protocol implementation may be annoying, but should not be that difficult.
Karel has swapping functions, so you could also swap on the robot. You could even do that based on whether your code is running on real or simulated hardware.
-
Karel has swapping functions, so you could also swap on the robot. You could even do that based on whether your code is running on real or simulated hardware.
What method are you using to check if you are on a simulated robot? I've been checking for the existence of a system var ($UD1_PATH) that only exists on the simulated robot, but I've wondered if there is a more elegant method.
-
For Ethernet/IP connections there is a system variable named EIP_SC[].$ANALOGFMT which sets the Endianess.
I guess thats not useful to you, but maybe there is something similar for Sockets.
-
What method are you using to check if you are on a simulated robot? I've been checking for the existence of a system var ($UD1_PATH) that only exists on the simulated robot, but I've wondered if there is a more elegant method.
Nothing fundamentally different to what you're already doing.
An alternative variable would be $VIRTUALTIME, which also only exists on simulated robots.
-
Similar question. Is it possible to set the Endianess for GO/GI? Not to my knowledge.
Robot controller: R-30iB Plus with the PROFINET FANUC board