Skip to content

Commit

Permalink
src: rename sensorstate to commonsensorstate
Browse files Browse the repository at this point in the history
  • Loading branch information
hanskw-weston committed Jan 15, 2024
1 parent 8c97c60 commit f467e9b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions include/ugv_sdk/details/interface/hunter_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct HunterActuatorState {
ActuatorStateMessageV1 actuator_state[3];
};

struct HunterSensorState {
struct HunterCommonSensorState {
SdkTimePoint time_stamp;

BmsBasicMessage bms_basic_state;
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions include/ugv_sdk/details/interface/ranger_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct RangerActuatorState {
ActuatorLSStateMessage actuator_ls_state[8];
};

struct RangerSensorState {
struct RangerCommonSensorState {
SdkTimePoint time_stamp;

BmsBasicMessage bms_basic_state;
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion include/ugv_sdk/details/interface/scout_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct ScoutActuatorState {
ActuatorStateMessageV1 actuator_state[4];
};

struct ScoutSensorState {
struct ScoutCommonSensorState {
SdkTimePoint time_stamp;

BmsBasicMessage bms_basic_state;
Expand Down
10 changes: 5 additions & 5 deletions include/ugv_sdk/details/robot_base/agilex_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -183,7 +183,7 @@ class AgilexBase : public RobotCommonInterface {
return actuator_state_msgs_;
}

SensorStateMsgGroup GetSensorStateMsgGroup() {
CommonSensorStateMsgGroup GetCommonSensorStateMsgGroup() {
std::lock_guard<std::mutex> guard(common_sensor_state_mtx_);
return common_sensor_state_msgs_;
}
Expand All @@ -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_;
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -381,7 +381,7 @@ class AgilexBase : public RobotCommonInterface {
}
}

void UpdateSensorState(const AgxMessage &status_msg) {
void UpdateCommonSensorState(const AgxMessage &status_msg) {
std::lock_guard<std::mutex> guard(common_sensor_state_mtx_);
// std::cout << common_sensor_state_msgs_.bms_basic_state.battery_soc<<
// std::endl;
Expand Down
6 changes: 3 additions & 3 deletions include/ugv_sdk/details/robot_base/hunter_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class HunterBase : public AgilexBase<ParserType>, public HunterInterface {
return hunter_actuator;
}

HunterSensorState GetSensorState() override {
HunterCommonSensorState GetCommonSensorState() override {
auto common_sensor =
AgilexBase<ParserType>::GetSensorStateMsgGroup();
AgilexBase<ParserType>::GetCommonSensorStateMsgGroup();

HunterSensorState hunter_bms;
HunterCommonSensorState hunter_bms;

hunter_bms.time_stamp = common_sensor.time_stamp;

Expand Down
6 changes: 3 additions & 3 deletions include/ugv_sdk/details/robot_base/ranger_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ class RangerBaseV2 : public AgilexBase<ProtocolV2Parser>,
return ranger_actuator;
}

RangerSensorState GetSensorState() override {
RangerCommonSensorState GetCommonSensorState() override {
auto common_sensor =
AgilexBase<ProtocolV2Parser>::GetSensorStateMsgGroup();
AgilexBase<ProtocolV2Parser>::GetCommonSensorStateMsgGroup();

RangerSensorState ranger_bms;
RangerCommonSensorState ranger_bms;

ranger_bms.time_stamp = common_sensor.time_stamp;

Expand Down
2 changes: 1 addition & 1 deletion include/ugv_sdk/mobile_robot/hunter_robot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
2 changes: 1 addition & 1 deletion include/ugv_sdk/mobile_robot/ranger_robot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
4 changes: 2 additions & 2 deletions src/mobile_robot/hunter_robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ HunterActuatorState HunterRobot::GetActuatorState() {
auto hunter = dynamic_cast<HunterInterface*>(robot_);
return hunter->GetActuatorState();
}
HunterSensorState HunterRobot::GetSensorState() {
HunterCommonSensorState HunterRobot::GetCommonSensorState() {
auto hunter = dynamic_cast<HunterInterface*>(robot_);
return hunter->GetSensorState();
return hunter->GetCommonSensorState();
}
} // namespace westonrobot
4 changes: 2 additions & 2 deletions src/mobile_robot/ranger_robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ RangerActuatorState RangerRobot::GetActuatorState() {
auto ranger = dynamic_cast<RangerInterface*>(robot_);
return ranger->GetActuatorState();
}
RangerSensorState RangerRobot::GetSensorState() {
RangerCommonSensorState RangerRobot::GetCommonSensorState() {
auto ranger = dynamic_cast<RangerInterface*>(robot_);
return ranger->GetSensorState();
return ranger->GetCommonSensorState();
}
} // namespace westonrobot

0 comments on commit f467e9b

Please sign in to comment.