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 ()
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_
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 58 of file power_monitor.h.


Constructor & Destructor Documentation

PowerMonitor::PowerMonitor (  ) 

Definition at line 40 of file power_monitor.cpp.


Member Function Documentation

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

Definition at line 87 of file power_monitor.cpp.

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

Definition at line 116 of file power_monitor.cpp.

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

Definition at line 93 of file power_monitor.cpp.

PowerObservation PowerMonitor::extractObservation (  )  [private]

Definition at line 151 of file power_monitor.cpp.

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

Definition at line 138 of file power_monitor.cpp.

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

Definition at line 198 of file power_monitor.cpp.

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

Definition at line 125 of file power_monitor.cpp.

void PowerMonitor::publishPowerState (  )  [private]

Definition at line 203 of file power_monitor.cpp.

bool PowerMonitor::setActiveEstimator ( PowerStateEstimator::Type  estimator_type  ) 

Definition at line 98 of file power_monitor.cpp.


Member Data Documentation

Definition at line 84 of file power_monitor.h.

Definition at line 88 of file power_monitor.h.

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

Definition at line 79 of file power_monitor.h.

Definition at line 73 of file power_monitor.h.

Definition at line 81 of file power_monitor.h.

Definition at line 82 of file power_monitor.h.

Definition at line 78 of file power_monitor.h.

Definition at line 91 of file power_monitor.h.

Definition at line 89 of file power_monitor.h.

Definition at line 87 of file power_monitor.h.

Definition at line 86 of file power_monitor.h.

Definition at line 76 of file power_monitor.h.

Definition at line 75 of file power_monitor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


power_monitor
Author(s): Tim Field, Curt Meyers
autogenerated on Fri Jan 11 10:08:44 2013