rsdriver.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* -*- mode: C++ -*- */
  2. /*
  3. * Copyright (C) 2012 Austin Robot Technology, Jack O'Quin
  4. * Copyright (C) 2017 Robosense, Tony Zhang
  5. *
  6. * License: Modified BSD Software License Agreement
  7. *
  8. * $Id$
  9. */
  10. /** \file
  11. *
  12. * ROS driver interface for the RSLIDAR 3D LIDARs
  13. */
  14. #ifndef _RSDRIVER_H_
  15. #define _RSDRIVER_H_
  16. #include "input.h"
  17. //#include <diagnostic_updater/diagnostic_updater.h>
  18. //#include <diagnostic_updater/publisher.h>
  19. //#include <dynamic_reconfigure/server.h>
  20. //#include <pcl/point_types.h>
  21. //#include <pcl_conversions/pcl_conversions.h>
  22. //#include <pcl_ros/impl/transforms.hpp>
  23. //#include <ros/package.h>
  24. //#include <ros/ros.h>
  25. //#include <rslidar_driver/rslidarNodeConfig.h>
  26. #include <string>
  27. #include "boost/thread.hpp"
  28. namespace rs_driver {
  29. struct lidarscan
  30. {
  31. double stamp;
  32. std::string frame_id;
  33. std::vector<m1packet> packets;
  34. };
  35. class rslidarDriver {
  36. public:
  37. /**
  38. * @brief rslidarDriver
  39. * @param node raw packet output topic
  40. * @param private_nh 通过这个节点传参数
  41. */
  42. // rslidarDriver(ros::NodeHandle node, ros::NodeHandle private_nh);
  43. rslidarDriver();
  44. ~rslidarDriver() {}
  45. bool poll(std::shared_ptr<lidarscan> & rawscan);
  46. void difopPoll(void);
  47. private:
  48. /// Callback for dynamic reconfigure
  49. // void callback(rslidar_driver::rslidarNodeConfig &config, uint32_t level);
  50. // /// Pointer to dynamic reconfigure service srv_
  51. // boost::shared_ptr<
  52. // dynamic_reconfigure::Server<rslidar_driver::rslidarNodeConfig>>
  53. // srv_;
  54. // configuration parameters
  55. struct {
  56. std::string frame_id; ///< tf frame ID
  57. std::string model; ///< device model name
  58. int npackets; ///< number of packets to collect
  59. double rpm; ///< device rotation rate (RPMs)
  60. double time_offset; ///< time in seconds added to each time stamp
  61. bool start_from_edge;
  62. } config_;
  63. boost::shared_ptr<Input> msop_input_;
  64. boost::shared_ptr<Input> difop_input_;
  65. // ros::Publisher msop_output_;
  66. // ros::Publisher difop_output_;
  67. boost::shared_ptr<boost::thread> difop_thread_;
  68. // Converter convtor_;
  69. /** diagnostics updater */
  70. // diagnostic_updater::Updater diagnostics_;
  71. // double diag_min_freq_;
  72. // double diag_max_freq_;
  73. // boost::shared_ptr<diagnostic_updater::TopicDiagnostic> diag_topic_;
  74. };
  75. } // namespace rs_driver
  76. #endif