1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 10:00:48 +02:00

Ignore malformed messages from UR5 running 1.8.X.

This commit is contained in:
Jethro Tan
2015-12-02 14:08:51 +01:00
parent 952ed2146c
commit 1064510bd1

View File

@@ -327,6 +327,14 @@ void RobotStateRT::unpack(uint8_t * buf) {
val_lock_.unlock(); val_lock_.unlock();
return; return;
} }
if (version_ > 1.8 & version_ < 1.9 & len != 812) {
// In 1.8.14035, every 17th and 18th package is 560 and 9 bytes long/malformed.
//printf("Len: %i\n", len);
val_lock_.unlock();
return;
}
memcpy(&unpack_to, &buf[offset], sizeof(unpack_to)); memcpy(&unpack_to, &buf[offset], sizeof(unpack_to));
time_ = RobotStateRT::ntohd(unpack_to); time_ = RobotStateRT::ntohd(unpack_to);
offset += sizeof(double); offset += sizeof(double);