Skip to content

Commit

Permalink
Merge pull request westonrobot#46 from westonrobot/bugfix-scout_bms
Browse files Browse the repository at this point in the history
src: fix scout bms feedback interface
  • Loading branch information
hanskw-weston authored Feb 5, 2024
2 parents b764db0 + 20fdbe9 commit ef1225f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5.1)
project(ugv_sdk VERSION 0.5.0)
project(ugv_sdk VERSION 0.6.0)

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
Expand Down
4 changes: 2 additions & 2 deletions doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "My Project"
PROJECT_NAME = "ugv_sdk"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER =
PROJECT_NUMBER = "v0.6.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
1 change: 1 addition & 0 deletions include/ugv_sdk/details/interface/scout_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct ScoutInterface {
// get robot state
virtual ScoutCoreState GetRobotState() = 0;
virtual ScoutActuatorState GetActuatorState() = 0;
virtual ScoutCommonSensorState GetCommonSensorState() = 0;
};

struct ScoutOmniInterface {
Expand Down
12 changes: 12 additions & 0 deletions include/ugv_sdk/details/robot_base/scout_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ class ScoutBase : public AgilexBase<ParserType>, public ScoutInterface {
}
return scout_actuator;
}

ScoutCommonSensorState GetCommonSensorState() override {
auto common_sensor =
AgilexBase<ParserType>::GetCommonSensorStateMsgGroup();

ScoutCommonSensorState scout_bms;

scout_bms.time_stamp = common_sensor.time_stamp;
scout_bms.bms_basic_state = common_sensor.bms_basic_state;

return scout_bms;
}
};

template <typename ParserType>
Expand Down
1 change: 1 addition & 0 deletions include/ugv_sdk/mobile_robot/scout_robot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ScoutRobot : public RobotCommonInterface, public ScoutInterface {
// get robot state
ScoutCoreState GetRobotState() override;
ScoutActuatorState GetActuatorState() override;
ScoutCommonSensorState GetCommonSensorState() override;

protected:
RobotCommonInterface* robot_;
Expand Down
4 changes: 4 additions & 0 deletions src/mobile_robot/scout_robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ ScoutActuatorState ScoutRobot::GetActuatorState() {
auto scout = dynamic_cast<ScoutInterface*>(robot_);
return scout->GetActuatorState();
}
ScoutCommonSensorState ScoutRobot::GetCommonSensorState() {
auto scout = dynamic_cast<ScoutInterface*>(robot_);
return scout->GetCommonSensorState();
}

///////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit ef1225f

Please sign in to comment.