bms_example.cpp
Go to the documentation of this file.
1 //
2 // Created by sub on 23/10/17.
3 //
4 
5 #include <ros/ros.h>
7 
8 int main(int argc, char **argv)
9 {
10  ros::init(argc, argv, "ip_estimator_node");
11  ros::NodeHandle nh;
12 
14  try
15  {
16  bms.connect("/dev/armadillo2/BMS");
17  }
18  catch (bms::BMSException exp)
19  {
20  ROS_ERROR("[bms_test]: %s", exp.what());
21  //ros::shutdown();
22  }
23 
24  ros::Rate loop_rate(2);
25 
26 
27  while (ros::ok())
28  {
29 
30  try
31  {
32  bms.read();
33  }
34  catch(bms::BMSErrorException exp)
35  {
36  ROS_ERROR("[bms_test]: %s", exp.what());
37  ros::shutdown();
38  exit(EXIT_FAILURE);
39  }
40  catch(bms::BMSWarnException exp)
41  {
42  ROS_WARN("[bms_test]: %s", exp.what());
43  }
44 
45 
46  loop_rate.sleep();
47  ros::spinOnce();
48  }
49 
50 }
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
#define ROS_WARN(...)
int main(int argc, char **argv)
Definition: bms_example.cpp:8
ROSCPP_DECL bool ok()
void connect(std::string port)
ROSCPP_DECL void shutdown()
ROSCPP_DECL void spinOnce()
#define ROS_ERROR(...)


bms_interface
Author(s): Jane Doe
autogenerated on Wed Jan 3 2018 03:47:54