main.cpp
Go to the documentation of this file.
1 #include <sbg_device.h>
2 
3 using sbg::SbgDevice;
4 
5 int main(int argc, char **argv)
6 {
7  ros::init(argc, argv, "sbg_device");
8  ros::NodeHandle node_handle;
9 
10  try
11  {
12  uint32_t loopFrequency;
13 
14  ROS_INFO("SBG DRIVER - Init node, load params and connect to the device.");
15  SbgDevice sbg_device(node_handle);
16 
17  ROS_INFO("SBG DRIVER - Initialize device for receiving data");
18  sbg_device.initDeviceForReceivingData();
19 
20  loopFrequency = sbg_device.getUpdateFrequency();
21  ROS_INFO("SBG DRIVER - ROS Node frequency : %u Hz", loopFrequency);
22  ros::Rate loop_rate(loopFrequency);
23 
24  while (ros::ok())
25  {
26  sbg_device.periodicHandle();
27  ros::spinOnce();
28  loop_rate.sleep();
29  }
30 
31  ros::shutdown();
32  return 0;
33  }
34  catch (ros::Exception const& refE)
35  {
36  ROS_ERROR("SBG_DRIVER - %s", refE.what());
37  }
38 
39  return 0;
40 }
ros::init
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
sbg::SbgDevice::initDeviceForReceivingData
void initDeviceForReceivingData()
Definition: sbg_device.cpp:492
ros::spinOnce
ROSCPP_DECL void spinOnce()
main
int main(int argc, char **argv)
Definition: main.cpp:5
ros::shutdown
ROSCPP_DECL void shutdown()
ros::Exception
ros::ok
ROSCPP_DECL bool ok()
sbg::SbgDevice::getUpdateFrequency
uint32_t getUpdateFrequency() const
Definition: sbg_device.cpp:483
ros::Rate::sleep
bool sleep()
sbg::SbgDevice::periodicHandle
void periodicHandle()
Definition: sbg_device.cpp:516
ROS_ERROR
#define ROS_ERROR(...)
ros::Rate
ROS_INFO
#define ROS_INFO(...)
sbg::SbgDevice
Definition: sbg_device.h:55
ros::NodeHandle
sbg_device.h
Implement device connection / parsing.


sbg_driver
Author(s): SBG Systems
autogenerated on Fri Oct 11 2024 02:13:40