Public Member Functions | Private Member Functions | Private Attributes
power_monitor::PowerMonitor Class Reference

#include <power_monitor.h>

List of all members.

Public Member Functions

void batteryServerUpdate (const boost::shared_ptr< const pr2_msgs::BatteryServer2 > &battery_server)
void configCallback (power_monitor::PowerMonitorConfig &config, uint32_t level)
 PowerMonitor ()
void powerNodeUpdate (const boost::shared_ptr< const pr2_msgs::PowerBoardState > &power_board_state)
bool setActiveEstimator (PowerStateEstimator::Type estimator_type)

Private Member Functions

void addEstimator (PowerStateEstimator *estimator)
PowerObservation extractObservation ()
ros::Time getLastBatteryUpdate () const
std::string masterStateToString (int8_t master_state) const
void onPublishTimer (const ros::TimerEvent &e)
void publishPowerState ()

Private Attributes

boost::shared_ptr
< PowerStateEstimator
active_estimator_
ros::Subscriber battery_server_sub_
std::map< int,
boost::shared_ptr< const
pr2_msgs::BatteryServer2 > > 
battery_servers_
double battery_update_timeout_
dynamic_reconfigure::Server
< power_monitor::PowerMonitorConfig > 
config_server_
std::map< std::string,
PowerStateEstimator::Type
estimator_types_
std::map
< PowerStateEstimator::Type,
boost::shared_ptr
< PowerStateEstimator > > 
estimators_
int8_t master_state_
PowerObservation observation_
ros::Subscriber power_node_sub_
ros::Publisher power_state_pub_
ros::Timer power_state_pub_timer_
boost::mutex publish_mutex_
boost::mutex update_mutex_

Detailed Description

This class listens to BatteryServer2 and PowerBoardState messages and publishes PowerState messages with estimates of the time remaining until the robot switches off (if discharging) or until the robot is fully charged (if charging).

Definition at line 59 of file power_monitor.h.


Constructor & Destructor Documentation

Definition at line 40 of file power_monitor.cpp.


Member Function Documentation

void PowerMonitor::addEstimator ( PowerStateEstimator estimator) [private]

Definition at line 88 of file power_monitor.cpp.

void PowerMonitor::batteryServerUpdate ( const boost::shared_ptr< const pr2_msgs::BatteryServer2 > &  battery_server)

Definition at line 117 of file power_monitor.cpp.

void PowerMonitor::configCallback ( power_monitor::PowerMonitorConfig &  config,
uint32_t  level 
)

Definition at line 94 of file power_monitor.cpp.

Definition at line 155 of file power_monitor.cpp.

Definition at line 202 of file power_monitor.cpp.

string PowerMonitor::masterStateToString ( int8_t  master_state) const [private]

Definition at line 142 of file power_monitor.cpp.

void PowerMonitor::onPublishTimer ( const ros::TimerEvent e) [private]

Definition at line 215 of file power_monitor.cpp.

void PowerMonitor::powerNodeUpdate ( const boost::shared_ptr< const pr2_msgs::PowerBoardState > &  power_board_state)

Definition at line 126 of file power_monitor.cpp.

void PowerMonitor::publishPowerState ( ) [private]

Definition at line 227 of file power_monitor.cpp.

Definition at line 99 of file power_monitor.cpp.


Member Data Documentation

Definition at line 95 of file power_monitor.h.

Definition at line 99 of file power_monitor.h.

std::map<int, boost::shared_ptr<const pr2_msgs::BatteryServer2> > power_monitor::PowerMonitor::battery_servers_ [private]

Definition at line 90 of file power_monitor.h.

Definition at line 104 of file power_monitor.h.

dynamic_reconfigure::Server<power_monitor::PowerMonitorConfig> power_monitor::PowerMonitor::config_server_ [private]

Definition at line 84 of file power_monitor.h.

Definition at line 92 of file power_monitor.h.

Definition at line 93 of file power_monitor.h.

Definition at line 89 of file power_monitor.h.

Definition at line 102 of file power_monitor.h.

Definition at line 100 of file power_monitor.h.

Definition at line 98 of file power_monitor.h.

Definition at line 97 of file power_monitor.h.

Definition at line 87 of file power_monitor.h.

Definition at line 86 of file power_monitor.h.


The documentation for this class was generated from the following files:


power_monitor
Author(s): Tim Field, Curt Meyers
autogenerated on Thu Jun 6 2019 21:11:01