Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add powerboard measurements to Solo12 sensor data #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions include/solo/solo12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,37 @@ class Solo12
return imu_linear_acceleration_;
}

/**
* @brief Get current [A] measurement from the power board.
*
* Will be zero if no power board is used.
*/
float get_powerboard_current() const
{
return main_board_ptr_->powerboard_current();
}

/**
* @brief Get voltage [V] measurement from the power board.
*
* Will be zero if no power board is used.
*/
float get_powerboard_voltage() const
{
return main_board_ptr_->powerboard_voltage();
}

/**
* @brief Get energy [J] consumed since start as measured by the power
* board.
*
* Will be zero if no power board is used.
*/
float get_powerboard_energy() const
{
return main_board_ptr_->powerboard_energy();
}

/*
* Hardware Status
*/
Expand Down
3 changes: 3 additions & 0 deletions src/dynamic_graph_manager/dgm_solo12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ void DGMSolo12::get_sensors_to_map(dynamic_graph_manager::VectorDGMap& map)
map.at("imu_gyroscope") = solo_.get_imu_gyroscope();
map.at("imu_attitude") = solo_.get_imu_attitude();
map.at("imu_linear_acceleration") = solo_.get_imu_linear_acceleration();
map.at("powerboard_current")[0] = solo_.get_powerboard_current();
map.at("powerboard_voltage")[0] = solo_.get_powerboard_voltage();
map.at("powerboard_energy")[0] = solo_.get_powerboard_energy();

/**
* Robot status.
Expand Down