Main Page
Namespaces
Classes
Files
File List
File Members
example
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
>
6
#include <
bms_interface/bms_interface.h
>
7
8
int
main
(
int
argc,
char
**argv)
9
{
10
ros::init
(argc, argv,
"ip_estimator_node"
);
11
ros::NodeHandle
nh;
12
13
bms::BMSInterface
bms
;
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
}
ros::NodeHandle
bms::BMSException
Definition:
bms_interface.h:162
bms::BMSInterface::read
data read()
Definition:
bms_interface.cpp:53
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Rate
ROS_WARN
#define ROS_WARN(...)
main
int main(int argc, char **argv)
Definition:
bms_example.cpp:8
bms::BMSWarnException
Definition:
bms_interface.h:174
bms_interface.h
bms::BMSInterface
Definition:
bms_interface.h:181
ros::ok
ROSCPP_DECL bool ok()
bms
Definition:
bms_interface.h:119
bms::BMSInterface::connect
void connect(std::string port)
Definition:
bms_interface.cpp:10
ros.h
ros::shutdown
ROSCPP_DECL void shutdown()
bms::BMSErrorException
Definition:
bms_interface.h:168
ros::spinOnce
ROSCPP_DECL void spinOnce()
ROS_ERROR
#define ROS_ERROR(...)
bms_interface
Author(s): Jane Doe
autogenerated on Wed Jan 3 2018 03:47:54