mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
renamed GetProtocolVersion() to GetParserProtocolVersion()
This commit is contained in:
@@ -26,7 +26,7 @@ struct can_frame {
|
||||
|
||||
#include "ugv_sdk/details/interface/agilex_message.h"
|
||||
|
||||
enum class ProtocolVersion { AGX_V1, AGX_V2 };
|
||||
enum class ProtocolVersion { UNKONWN, AGX_V1, AGX_V2 };
|
||||
|
||||
template <ProtocolVersion VersionNumber = ProtocolVersion::AGX_V2>
|
||||
class ParserInterface {
|
||||
@@ -54,7 +54,7 @@ class ParserInterface {
|
||||
return 0;
|
||||
};
|
||||
|
||||
ProtocolVersion GetProtocolVersion() { return VersionNumber; }
|
||||
ProtocolVersion GetParserProtocolVersion() { return VersionNumber; }
|
||||
};
|
||||
|
||||
#endif /* PASER_INTERFACE_HPP */
|
||||
|
||||
@@ -50,7 +50,7 @@ class RobotCommonInterface {
|
||||
// do nothing if no light on robot
|
||||
}
|
||||
|
||||
virtual ProtocolVersion GetProtocolVersion() = 0;
|
||||
virtual ProtocolVersion GetParserProtocolVersion() = 0;
|
||||
|
||||
protected:
|
||||
/****** functions not available/valid to all robots ******/
|
||||
|
||||
@@ -60,7 +60,7 @@ class AgilexBase : public RobotCommonInterface {
|
||||
if (can_connected_) {
|
||||
// motion control message
|
||||
AgxMessage msg;
|
||||
if (parser_.GetProtocolVersion() == ProtocolVersion::AGX_V1) {
|
||||
if (parser_.GetParserProtocolVersion() == ProtocolVersion::AGX_V1) {
|
||||
msg.type = AgxMsgMotionCommandV1;
|
||||
msg.body.v1_motion_command_msg.control_mode = CONTROL_MODE_CAN;
|
||||
msg.body.v1_motion_command_msg.clear_all_error = false;
|
||||
@@ -70,7 +70,8 @@ class AgilexBase : public RobotCommonInterface {
|
||||
std::abs(angular_vel) > std::abs(steering_angle) ? angular_vel
|
||||
: steering_angle;
|
||||
msg.body.v1_motion_command_msg.lateral = lateral_velocity;
|
||||
} else if (parser_.GetProtocolVersion() == ProtocolVersion::AGX_V2) {
|
||||
} else if (parser_.GetParserProtocolVersion() ==
|
||||
ProtocolVersion::AGX_V2) {
|
||||
msg.type = AgxMsgMotionCommand;
|
||||
msg.body.motion_command_msg.linear_velocity = linear_vel;
|
||||
msg.body.motion_command_msg.angular_velocity = angular_vel;
|
||||
@@ -133,8 +134,8 @@ class AgilexBase : public RobotCommonInterface {
|
||||
|
||||
void ResetRobotState() override {}
|
||||
|
||||
ProtocolVersion GetProtocolVersion() override {
|
||||
return parser_.GetProtocolVersion();
|
||||
ProtocolVersion GetParserProtocolVersion() override {
|
||||
return parser_.GetParserProtocolVersion();
|
||||
}
|
||||
|
||||
CoreStateMsgGroup GetRobotCoreStateMsgGroup() override {
|
||||
|
||||
@@ -29,7 +29,7 @@ class BunkerRobot : public RobotCommonInterface, public BunkerInterface {
|
||||
|
||||
void ResetRobotState() override;
|
||||
|
||||
ProtocolVersion GetProtocolVersion() override;
|
||||
ProtocolVersion GetParserProtocolVersion() override;
|
||||
|
||||
// get robot state
|
||||
BunkerCoreState GetRobotState() override;
|
||||
|
||||
@@ -29,7 +29,7 @@ class HunterRobot : public RobotCommonInterface, public HunterInterface {
|
||||
|
||||
void ResetRobotState() override;
|
||||
|
||||
ProtocolVersion GetProtocolVersion() override;
|
||||
ProtocolVersion GetParserProtocolVersion() override;
|
||||
|
||||
// get robot state
|
||||
HunterCoreState GetRobotState() override;
|
||||
|
||||
@@ -34,7 +34,7 @@ class ScoutRobot : public RobotCommonInterface, public ScoutInterface {
|
||||
|
||||
void ResetRobotState() override;
|
||||
|
||||
ProtocolVersion GetProtocolVersion() override;
|
||||
ProtocolVersion GetParserProtocolVersion() override;
|
||||
|
||||
// get robot state
|
||||
ScoutCoreState GetRobotState() override;
|
||||
|
||||
Reference in New Issue
Block a user