Skip to content

Commit 62f4539

Browse files
add bms msg
1 parent fd728d4 commit 62f4539

File tree

15 files changed

+384
-271
lines changed

15 files changed

+384
-271
lines changed

include/ugv_sdk/details/interface/bunker_interface.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ struct BunkerActuatorState {
3434
ActuatorStateMessageV1 actuator_state[2];
3535
};
3636

37+
struct BunkerCommonSensorState {
38+
SdkTimePoint time_stamp;
39+
40+
BmsBasicMessage bms_basic_state;
41+
BmsExtendedMessage bms_extended_state;
42+
};
3743
struct BunkerInterface {
3844
virtual ~BunkerInterface() = default;
3945

@@ -42,6 +48,8 @@ struct BunkerInterface {
4248
// get robot state
4349
virtual BunkerCoreState GetRobotState() = 0;
4450
virtual BunkerActuatorState GetActuatorState() = 0;
51+
virtual BunkerCommonSensorState GetCommonSensorState() = 0;
52+
4553
};
4654
} // namespace westonrobot
4755

include/ugv_sdk/details/interface/scout_interface.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ struct ScoutCommonSensorState {
4040
SdkTimePoint time_stamp;
4141

4242
BmsBasicMessage bms_basic_state;
43+
BmsExtendedMessage bms_extended_state;
4344
};
4445

4546
struct ScoutInterface {

include/ugv_sdk/details/interface/tracer_interface.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ struct TracerActuatorState {
3232
ActuatorHSStateMessage actuator_hs_state[2];
3333
ActuatorLSStateMessage actuator_ls_state[2];
3434
};
35+
struct TracerCommonSensorState {
36+
SdkTimePoint time_stamp;
37+
38+
BmsBasicMessage bms_basic_state;
39+
BmsExtendedMessage bms_extended_state;
40+
};
3541

3642
struct TracerInterface {
3743
virtual ~TracerInterface() = default;
@@ -43,6 +49,8 @@ struct TracerInterface {
4349
// get robot state
4450
virtual TracerCoreState GetRobotState() = 0;
4551
virtual TracerActuatorState GetActuatorState() = 0;
52+
virtual TracerCommonSensorState GetCommonSensorState() = 0;
53+
4654
};
4755
} // namespace westonrobot
4856

include/ugv_sdk/details/protocol_v1/protocol_v1_parser.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ using ScoutMiniProtocolV1Parser = ProtocolV1Parser<ScoutMiniLimits>;
7676
using BunkerProtocolV1Parser = ProtocolV1Parser<BunkerLimits>;
7777

7878
using HunterProtocolV1Parser = ProtocolV1Parser<HunterV1Limits>;
79+
using TracerProtocolV1Parser = ProtocolV1Parser<BunkerLimits>;
7980

8081
} // namespace westonrobot
8182

include/ugv_sdk/details/robot_base/bunker_base.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@ class BunkerBase : public AgilexBase<ParserType>, public BunkerInterface {
6060
}
6161
return bunker_actuator;
6262
}
63+
64+
BunkerCommonSensorState GetCommonSensorState() override {
65+
auto common_sensor =
66+
AgilexBase<ParserType>::GetCommonSensorStateMsgGroup();
67+
68+
BunkerCommonSensorState bunker_bms;
69+
70+
bunker_bms.time_stamp = common_sensor.time_stamp;
71+
bunker_bms.bms_basic_state = common_sensor.bms_basic_state;
72+
73+
return bunker_bms;
74+
}
75+
76+
6377
};
6478
} // namespace westonrobot
6579

0 commit comments

Comments
 (0)