lslidar_n301_driver.h
Go to the documentation of this file.
1 /*
2  * This file is part of lslidar_n301 driver.
3  *
4  * The driver is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * The driver is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with the driver. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef LSLIDAR_N301_DRIVER_H
19 #define LSLIDAR_N301_DRIVER_H
20 
21 #include <unistd.h>
22 #include <stdio.h>
23 #include <netinet/in.h>
24 #include <string>
25 
26 #include <boost/shared_ptr.hpp>
27 
28 #include <ros/ros.h>
31 
32 #include <lslidar_n301_msgs/LslidarN301Packet.h>
33 
35 
36 //static uint16_t UDP_PORT_NUMBER = 8080;
37 static uint16_t PACKET_SIZE = 1206;
38 
40 public:
41 
44 
45  bool initialize();
46  bool polling();
47 
50 
51 private:
52 
53  bool loadParameters();
54  bool createRosIO();
55  bool openUDPPort();
56  int getPacket(lslidar_n301_msgs::LslidarN301PacketPtr& msg);
57 
58  // Ethernet relate variables
59  std::string device_ip_string;
60  in_addr device_ip;
62  int socket_id;
63 
64  // ROS related variables
67 
68  std::string frame_id;
70 
71  // Diagnostics updater
74  double diag_min_freq;
75  double diag_max_freq;
76 };
77 
80 
81 } // namespace lslidar_driver
82 
83 #endif // _LSLIDAR_N301_DRIVER_H_
int getPacket(lslidar_n301_msgs::LslidarN301PacketPtr &msg)
boost::shared_ptr< LslidarN301Driver > LslidarN301DriverPtr
boost::shared_ptr< const LslidarN301Driver > LslidarN301DriverConstPtr
static uint16_t PACKET_SIZE
diagnostic_updater::Updater diagnostics
boost::shared_ptr< diagnostic_updater::TopicDiagnostic > diag_topic
LslidarN301Driver(ros::NodeHandle &n, ros::NodeHandle &pn)


lslidar_n301_driver
Author(s): Nick Shu
autogenerated on Thu Sep 26 2019 03:58:32