7 #include "pr2_power_board/PowerBoardCommand.h" 8 #include "pr2_power_board/PowerBoardCommand2.h" 9 #include "pr2_msgs/BatteryServer2.h" 10 #include "boost/thread/mutex.hpp" 21 int Init(
const std::string &address_str);
37 void setTransitionMessage(
const TransitionMessage &newtmsg);
43 void setPowerMessage(
const PowerMessage &newpmsg);
49 TransitionMessage tmsg;
59 bool commandCallback( pr2_power_board::PowerBoardCommand::Request &req_,
60 pr2_power_board::PowerBoardCommand::Response &res_);
61 bool commandCallback2( pr2_power_board::PowerBoardCommand2::Request &req_,
62 pr2_power_board::PowerBoardCommand2::Response &res_);
64 void collectMessages();
66 int collect_messages();
67 int process_message(
const PowerMessage *
msg,
int len);
68 int process_transition_message(
const TransitionMessage *msg,
int len);
69 const char* master_state_to_str(
char state);
70 const char* cb_state_to_str(
char state);
71 int list_devices(
void);
72 int send_command(
int circuit_breaker,
const std::string &
command,
unsigned flags);
73 int requestMessage(
const unsigned int message);
90 void batteryCB(
const pr2_msgs::BatteryServer2::ConstPtr &msgPtr);
92 pr2_power_board::PowerBoardCommand::Request req_;
93 pr2_power_board::PowerBoardCommand::Response res_;
94 boost::mutex library_lock_;
int Init(sockaddr_in *port_address, sockaddr_in *broadcast_address)
void init(const M_string &remappings)
std::map< int, float > battery_temps_
const TransitionMessage & getTransitionMessage()
bool IsReadSet(fd_set set) const
const PowerMessage & getPowerMessage()
void AddToReadSet(fd_set &set, int &max_sock) const
ros::ServiceServer service2
ros::Subscriber battery_sub_