c2_eth_driver.h 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef C2_ETH_DRIVER_H_
  2. #define C2_ETH_DRIVER_H_
  3. #include <free_lidar/lidar_struct.h>
  4. #include <free_lidar/lidar_driver.h>
  5. #include <string>
  6. #include <deque>
  7. #include <stdint.h>
  8. #define C2_ETH_ROS_VER "2.00.00.008"
  9. namespace free_optics{
  10. class C2EthDriver : public LidarDriver
  11. {
  12. public:
  13. C2EthDriver();
  14. ~C2EthDriver();
  15. bool connect(const std::string hostname, int port=2111);
  16. void disconnect();
  17. bool getDeviceState(uint8_t &state);
  18. bool getDeviceName(std::string &name);
  19. bool getFirmwareVersion(uint32_t &version);
  20. bool getSerialNumber(uint32_t &sn);
  21. bool login(uint8_t &state);
  22. bool getScanAngle(int32_t &start_angle, int32_t &stop_angle);
  23. bool setScanAngle(int32_t start_angle, int32_t stop_angle);
  24. bool setScanConfig(uint16_t frequency, uint16_t resolution);
  25. bool getMeasureRange(float &range_min, float &range_max);
  26. bool getScanData(uint8_t state);
  27. bool scanDataReceiver();
  28. private:
  29. int socket_fd_;
  30. };
  31. }
  32. #endif