From f467e9b829a12dce1bcd5961d14fbb8c6200e1aa Mon Sep 17 00:00:00 2001 From: hanskw4267 Date: Mon, 15 Jan 2024 09:45:38 +0800 Subject: [PATCH] src: rename sensorstate to commonsensorstate --- include/ugv_sdk/details/interface/hunter_interface.hpp | 4 ++-- include/ugv_sdk/details/interface/ranger_interface.hpp | 4 ++-- include/ugv_sdk/details/interface/scout_interface.hpp | 2 +- include/ugv_sdk/details/robot_base/agilex_base.hpp | 10 +++++----- include/ugv_sdk/details/robot_base/hunter_base.hpp | 6 +++--- include/ugv_sdk/details/robot_base/ranger_base.hpp | 6 +++--- include/ugv_sdk/mobile_robot/hunter_robot.hpp | 2 +- include/ugv_sdk/mobile_robot/ranger_robot.hpp | 2 +- src/mobile_robot/hunter_robot.cpp | 4 ++-- src/mobile_robot/ranger_robot.cpp | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/ugv_sdk/details/interface/hunter_interface.hpp b/include/ugv_sdk/details/interface/hunter_interface.hpp index c8f58f07..85ffd9a9 100644 --- a/include/ugv_sdk/details/interface/hunter_interface.hpp +++ b/include/ugv_sdk/details/interface/hunter_interface.hpp @@ -34,7 +34,7 @@ struct HunterActuatorState { ActuatorStateMessageV1 actuator_state[3]; }; -struct HunterSensorState { +struct HunterCommonSensorState { SdkTimePoint time_stamp; BmsBasicMessage bms_basic_state; @@ -52,7 +52,7 @@ struct HunterInterface { // get robot state virtual HunterCoreState GetRobotState() = 0; virtual HunterActuatorState GetActuatorState() = 0; - virtual HunterSensorState GetSensorState() = 0; + virtual HunterCommonSensorState GetCommonSensorState() = 0; }; } // namespace westonrobot diff --git a/include/ugv_sdk/details/interface/ranger_interface.hpp b/include/ugv_sdk/details/interface/ranger_interface.hpp index cdf2ee8f..00a8c720 100644 --- a/include/ugv_sdk/details/interface/ranger_interface.hpp +++ b/include/ugv_sdk/details/interface/ranger_interface.hpp @@ -39,7 +39,7 @@ struct RangerActuatorState { ActuatorLSStateMessage actuator_ls_state[8]; }; -struct RangerSensorState { +struct RangerCommonSensorState { SdkTimePoint time_stamp; BmsBasicMessage bms_basic_state; @@ -69,7 +69,7 @@ struct RangerInterface { // get robot state virtual RangerCoreState GetRobotState() = 0; virtual RangerActuatorState GetActuatorState() = 0; - virtual RangerSensorState GetSensorState() = 0; + virtual RangerCommonSensorState GetCommonSensorState() = 0; }; } // namespace westonrobot diff --git a/include/ugv_sdk/details/interface/scout_interface.hpp b/include/ugv_sdk/details/interface/scout_interface.hpp index 14006e8b..c552db87 100644 --- a/include/ugv_sdk/details/interface/scout_interface.hpp +++ b/include/ugv_sdk/details/interface/scout_interface.hpp @@ -36,7 +36,7 @@ struct ScoutActuatorState { ActuatorStateMessageV1 actuator_state[4]; }; -struct ScoutSensorState { +struct ScoutCommonSensorState { SdkTimePoint time_stamp; BmsBasicMessage bms_basic_state; diff --git a/include/ugv_sdk/details/robot_base/agilex_base.hpp b/include/ugv_sdk/details/robot_base/agilex_base.hpp index 761bfe18..6c609819 100644 --- a/include/ugv_sdk/details/robot_base/agilex_base.hpp +++ b/include/ugv_sdk/details/robot_base/agilex_base.hpp @@ -44,7 +44,7 @@ struct ActuatorStateMsgGroup { MotorSpeedMessage motor_speeds; // ranger only }; -struct SensorStateMsgGroup { +struct CommonSensorStateMsgGroup { SdkTimePoint time_stamp; BmsBasicMessage bms_basic_state; BmsExtendedMessage bms_extend_state; @@ -183,7 +183,7 @@ class AgilexBase : public RobotCommonInterface { return actuator_state_msgs_; } - SensorStateMsgGroup GetSensorStateMsgGroup() { + CommonSensorStateMsgGroup GetCommonSensorStateMsgGroup() { std::lock_guard guard(common_sensor_state_mtx_); return common_sensor_state_msgs_; } @@ -205,7 +205,7 @@ class AgilexBase : public RobotCommonInterface { /* feedback group 3: common sensor */ std::mutex common_sensor_state_mtx_; - SensorStateMsgGroup common_sensor_state_msgs_; + CommonSensorStateMsgGroup common_sensor_state_msgs_; std::mutex version_str_buf_mtx_; std::string version_string_buffer_; @@ -279,7 +279,7 @@ class AgilexBase : public RobotCommonInterface { if (parser_.DecodeMessage(rx_frame, &status_msg)) { UpdateRobotCoreState(status_msg); UpdateActuatorState(status_msg); - UpdateSensorState(status_msg); + UpdateCommonSensorState(status_msg); UpdateResponseVersion(status_msg); } } @@ -381,7 +381,7 @@ class AgilexBase : public RobotCommonInterface { } } - void UpdateSensorState(const AgxMessage &status_msg) { + void UpdateCommonSensorState(const AgxMessage &status_msg) { std::lock_guard guard(common_sensor_state_mtx_); // std::cout << common_sensor_state_msgs_.bms_basic_state.battery_soc<< // std::endl; diff --git a/include/ugv_sdk/details/robot_base/hunter_base.hpp b/include/ugv_sdk/details/robot_base/hunter_base.hpp index 81460609..d3073512 100644 --- a/include/ugv_sdk/details/robot_base/hunter_base.hpp +++ b/include/ugv_sdk/details/robot_base/hunter_base.hpp @@ -61,11 +61,11 @@ class HunterBase : public AgilexBase, public HunterInterface { return hunter_actuator; } - HunterSensorState GetSensorState() override { + HunterCommonSensorState GetCommonSensorState() override { auto common_sensor = - AgilexBase::GetSensorStateMsgGroup(); + AgilexBase::GetCommonSensorStateMsgGroup(); - HunterSensorState hunter_bms; + HunterCommonSensorState hunter_bms; hunter_bms.time_stamp = common_sensor.time_stamp; diff --git a/include/ugv_sdk/details/robot_base/ranger_base.hpp b/include/ugv_sdk/details/robot_base/ranger_base.hpp index 9662f40b..3df92a8a 100644 --- a/include/ugv_sdk/details/robot_base/ranger_base.hpp +++ b/include/ugv_sdk/details/robot_base/ranger_base.hpp @@ -100,11 +100,11 @@ class RangerBaseV2 : public AgilexBase, return ranger_actuator; } - RangerSensorState GetSensorState() override { + RangerCommonSensorState GetCommonSensorState() override { auto common_sensor = - AgilexBase::GetSensorStateMsgGroup(); + AgilexBase::GetCommonSensorStateMsgGroup(); - RangerSensorState ranger_bms; + RangerCommonSensorState ranger_bms; ranger_bms.time_stamp = common_sensor.time_stamp; diff --git a/include/ugv_sdk/mobile_robot/hunter_robot.hpp b/include/ugv_sdk/mobile_robot/hunter_robot.hpp index 7b4e9651..49915efa 100644 --- a/include/ugv_sdk/mobile_robot/hunter_robot.hpp +++ b/include/ugv_sdk/mobile_robot/hunter_robot.hpp @@ -39,7 +39,7 @@ class HunterRobot : public RobotCommonInterface, public HunterInterface { // get robot state HunterCoreState GetRobotState() override; HunterActuatorState GetActuatorState() override; - HunterSensorState GetSensorState() override; + HunterCommonSensorState GetCommonSensorState() override; private: RobotCommonInterface* robot_; diff --git a/include/ugv_sdk/mobile_robot/ranger_robot.hpp b/include/ugv_sdk/mobile_robot/ranger_robot.hpp index 1d6331dd..62ad4294 100644 --- a/include/ugv_sdk/mobile_robot/ranger_robot.hpp +++ b/include/ugv_sdk/mobile_robot/ranger_robot.hpp @@ -44,7 +44,7 @@ class RangerRobot : public RobotCommonInterface, public RangerInterface { // get robot state RangerCoreState GetRobotState() override; RangerActuatorState GetActuatorState() override; - RangerSensorState GetSensorState() override; + RangerCommonSensorState GetCommonSensorState() override; private: RobotCommonInterface* robot_; diff --git a/src/mobile_robot/hunter_robot.cpp b/src/mobile_robot/hunter_robot.cpp index daea6043..4bff2fe3 100644 --- a/src/mobile_robot/hunter_robot.cpp +++ b/src/mobile_robot/hunter_robot.cpp @@ -63,8 +63,8 @@ HunterActuatorState HunterRobot::GetActuatorState() { auto hunter = dynamic_cast(robot_); return hunter->GetActuatorState(); } -HunterSensorState HunterRobot::GetSensorState() { +HunterCommonSensorState HunterRobot::GetCommonSensorState() { auto hunter = dynamic_cast(robot_); - return hunter->GetSensorState(); + return hunter->GetCommonSensorState(); } } // namespace westonrobot \ No newline at end of file diff --git a/src/mobile_robot/ranger_robot.cpp b/src/mobile_robot/ranger_robot.cpp index 53201673..8e585e7d 100644 --- a/src/mobile_robot/ranger_robot.cpp +++ b/src/mobile_robot/ranger_robot.cpp @@ -67,8 +67,8 @@ RangerActuatorState RangerRobot::GetActuatorState() { auto ranger = dynamic_cast(robot_); return ranger->GetActuatorState(); } -RangerSensorState RangerRobot::GetSensorState() { +RangerCommonSensorState RangerRobot::GetCommonSensorState() { auto ranger = dynamic_cast(robot_); - return ranger->GetSensorState(); + return ranger->GetCommonSensorState(); } } // namespace westonrobot \ No newline at end of file