10 #include <nav_msgs/Odometry.h>
11 #include <sensor_msgs/JointState.h>
12 #include <std_msgs/Float64.h>
13 #include <std_msgs/Int8MultiArray.h>
17 #include "std_msgs/UInt32.h"
18 #include "rm_msgs/VisualizeStateData.h"
19 #include "rm_msgs/CustomControllerData.h"
20 #include "rm_msgs/VTKeyboardMouseData.h"
21 #include "rm_msgs/VTReceiverControlData.h"
47 ROS_ERROR(
"Cannot open image transmitter port");
52 uint8_t
getCRC8CheckSum(
unsigned char* pch_message,
unsigned int dw_length,
unsigned char uc_crc_8)
54 unsigned char uc_index;
57 uc_index = uc_crc_8 ^ (*pch_message++);
65 unsigned char uc_expected;
66 if ((pch_message ==
nullptr) || (dw_length <= 2))
69 return (uc_expected == pch_message[dw_length - 1]);
75 if ((pch_message ==
nullptr) || (dw_length <= 2))
78 pch_message[dw_length - 1] = uc_crc;
84 if (pch_message ==
nullptr)
88 chData = *pch_message++;
89 (w_crc) = (
static_cast<uint16_t
>(w_crc) >> 8) ^
90 rm_vt::wCRC_table[(
static_cast<uint16_t
>(w_crc) ^
static_cast<uint16_t
>(chData)) & 0x00ff];
98 if ((pch_message ==
nullptr) || (dw_length <= 2))
101 return ((w_expected & 0xff) == pch_message[dw_length - 2] &&
102 ((w_expected >> 8) & 0xff) == pch_message[dw_length - 1]);
108 if ((pch_message ==
nullptr) || (dw_length <= 2))
111 pch_message[dw_length - 2] =
static_cast<uint8_t
>((wCRC & 0x00ff));
112 pch_message[dw_length - 1] =
static_cast<uint8_t
>(((wCRC >> 8) & 0x00ff));