16 ROS_WARN(
"[armadillo2_hw/battery_pub]: battery hardware is disabled");
22 ROS_ERROR(
"[armadillo2_hw/battery_pub]: %s param is missing on param server. make sure that this param exist in battery_config.yaml " 23 "and that your launch includes this param file. shutting down...",
BATT_PORT_PARAM);
37 ROS_ERROR(
"[armadillo2_hw/battery_pub]: %s", exp.what());
41 ROS_INFO(
"[armadillo2_hw/battery_pub]: battery port opened successfully \nport name: %s \nbaudrate: 9600",
batt_port_.c_str());
48 ROS_INFO(
"[armadillo2_hw/battery_pub]: battery publisher is up");
64 sensor_msgs::BatteryState
msg;
67 msg.voltage = bms_data.
vbat;
68 msg.percentage = bms_data.
soc;
72 msg.power_supply_status = bms_data.
is_chrg;
73 msg.cell_voltage = bms_data.
vcells;
74 msg.location =
"base_link";
79 ROS_WARN(
"[armadillo2_hw/battery_pub]: LOW BATTERY, please connect Armadillo2 to charger");
89 ROS_ERROR(
"[armadillo2_hw/battery_pub]: %s", exp.what());
96 ROS_WARN(
"[armadillo2_hw/battery_pub]: %s", exp.what());
void publish(const boost::shared_ptr< M > &message) const
ros::Timer speak_low_batt_timer_
#define BATT_PUB_INTERVAL
ros::Publisher espeak_pub_
std::vector< float > vcells
ROSCPP_DECL bool get(const std::string &key, std::string &s)
BatteryPub(ros::NodeHandle nh)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void connect(std::string port)
void speakLowTimerCB(const ros::TimerEvent &event)
void speakMsg(std::string msg, int sleep_time)
ROSCPP_DECL void shutdown()
ros::Timer bat_pub_timer_
#define SPEAK_LOW_BAT_INTERVAL
void pubBatTimerCB(const ros::TimerEvent &event)