43 #include <nav_msgs/Odometry.h>
44 #include <sensor_msgs/JointState.h>
45 #include <std_msgs/Float64.h>
46 #include <std_msgs/Int8MultiArray.h>
50 #include "std_msgs/UInt32.h"
51 #include "rm_msgs/VisualizeStateData.h"
55 #include <rm_msgs/ShootCmd.h>
56 #include <rm_msgs/ShootState.h>
57 #include <rm_msgs/DbusData.h>
58 #include <rm_msgs/StateCmd.h>
59 #include <rm_msgs/EventData.h>
60 #include <rm_msgs/GimbalCmd.h>
61 #include <rm_msgs/RobotHurt.h>
62 #include <rm_msgs/ShootData.h>
63 #include <rm_msgs/DartStatus.h>
64 #include <rm_msgs/ChassisCmd.h>
65 #include <rm_msgs/GameStatus.h>
66 #include <rm_msgs/RfidStatus.h>
67 #include <rm_msgs/EngineerUi.h>
68 #include <rm_msgs/GameRobotHp.h>
69 #include <rm_msgs/BalanceState.h>
70 #include <rm_msgs/DartClientCmd.h>
71 #include <rm_msgs/ActuatorState.h>
72 #include <rm_msgs/MapSentryData.h>
73 #include <rm_msgs/RadarMarkData.h>
74 #include <rm_msgs/PowerHeatData.h>
75 #include <rm_msgs/GimbalDesError.h>
76 #include <rm_msgs/BulletAllowance.h>
77 #include <rm_msgs/GameRobotStatus.h>
78 #include <rm_msgs/ManualToReferee.h>
79 #include <rm_msgs/ClientMapSendData.h>
80 #include <rm_msgs/RobotsPositionData.h>
81 #include <rm_msgs/DartInfo.h>
82 #include <rm_msgs/StatusChangeRequest.h>
83 #include <rm_msgs/ClientMapReceiveData.h>
84 #include <rm_msgs/SupplyProjectileAction.h>
85 #include <rm_msgs/IcraBuffDebuffZoneStatus.h>
86 #include <rm_msgs/GameRobotPosData.h>
87 #include "rm_msgs/SentryInfo.h"
88 #include "rm_msgs/SentryCmd.h"
89 #include "rm_msgs/RadarInfo.h"
90 #include "rm_msgs/Buff.h"
91 #include "rm_msgs/TrackData.h"
92 #include "rm_msgs/SentryAttackingTarget.h"
93 #include "rm_msgs/RadarToSentry.h"
94 #include <rm_msgs/PowerManagementSampleAndStatusData.h>
95 #include <rm_msgs/PowerManagementSystemExceptionData.h>
96 #include <rm_msgs/PowerManagementInitializationExceptionData.h>
97 #include <rm_msgs/PowerManagementProcessStackOverflowData.h>
98 #include <rm_msgs/PowerManagementUnknownExceptionData.h>
141 uint8_t
getCRC8CheckSum(
unsigned char* pch_message,
unsigned int dw_length,
unsigned char uc_crc_8)
143 unsigned char uc_index;
146 uc_index = uc_crc_8 ^ (*pch_message++);
154 unsigned char uc_expected;
155 if ((pch_message ==
nullptr) || (dw_length <= 2))
158 return (uc_expected == pch_message[dw_length - 1]);
163 unsigned char uc_crc;
164 if ((pch_message ==
nullptr) || (dw_length <= 2))
167 pch_message[dw_length - 1] = uc_crc;
173 if (pch_message ==
nullptr)
177 chData = *pch_message++;
178 (w_crc) = (
static_cast<uint16_t
>(w_crc) >> 8) ^
187 if ((pch_message ==
nullptr) || (dw_length <= 2))
190 return ((w_expected & 0xff) == pch_message[dw_length - 2] &&
191 ((w_expected >> 8) & 0xff) == pch_message[dw_length - 1]);
197 if ((pch_message ==
nullptr) || (dw_length <= 2))
200 pch_message[dw_length - 2] =
static_cast<uint8_t
>((wCRC & 0x00ff));
201 pch_message[dw_length - 1] =
static_cast<uint8_t
>(((wCRC >> 8) & 0x00ff));