rslidar_node.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Austin Robot Technology, Jack O'Quin
3  * Copyright (C) 2017 Robosense, Tony Zhang
4  *
5  * License: Modified BSD Software License Agreement
6  *
7 
8  Copyright (C) 2010-2013 Austin Robot Technology, and others
9  All rights reserved.
10 
11 
12 Modified BSD License:
13 --------------------
14 
15  Redistribution and use in source and binary forms, with or without
16  modification, are permitted provided that the following conditions
17  are met:
18 
19  * Redistributions of source code must retain the above copyright
20  notice, this list of conditions and the following disclaimer.
21 
22  * Redistributions in binary form must reproduce the above
23  copyright notice, this list of conditions and the following
24  disclaimer in the documentation and/or other materials provided
25  with the distribution.
26 
27  * Neither the names of the University of Texas at Austin, nor
28  Austin Robot Technology, nor the names of other contributors may
29  be used to endorse or promote products derived from this
30  software without specific prior written permission.
31 
32  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
35  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
36  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
37  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
38  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
40  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
42  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43 POSSIBILITY OF SUCH DAMAGE.
44  */
45 
50 #include <ros/ros.h>
51 #include "rsdriver.h"
52 #include "std_msgs/String.h"
53 
54 using namespace rslidar_driver;
55 volatile sig_atomic_t flag = 1;
56 
57 static void my_handler(int sig)
58 {
59  flag = 0;
60 }
61 
62 int main(int argc, char** argv)
63 {
64  ros::init(argc, argv, "rsdriver");
65  ros::NodeHandle node;
66  ros::NodeHandle private_nh("~");
67 
68  signal(SIGINT, my_handler);
69 
70  // start the driver
71  rslidar_driver::rslidarDriver dvr(node, private_nh);
72  // loop until shut down or end of file
73  while (ros::ok() && dvr.poll())
74  {
75  ros::spinOnce();
76  }
77 
78  return 0;
79 }
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
volatile sig_atomic_t flag
static void my_handler(int sig)
ROSCPP_DECL bool ok()
ROSCPP_DECL void spinOnce()


rslidar_driver
Author(s): Tony Zhang , Tony Zhang
autogenerated on Mon Jun 10 2019 14:41:07