12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef C2_UART_DRIVER_H_
- #define C2_UART_DRIVER_H_
- #include <free_lidar/lidar_struct.h>
- #include <free_lidar/lidar_driver.h>
- #include <serial/serial.h>
- #include <string>
- #include <deque>
- #include <stdint.h>
- #define C2_UART_ROS_VER "2.00.00.008"
- const uint32_t baudrate[3] = {460800, 921600, 1500000};
- namespace free_optics{
- class C2UartDriver : public LidarDriver
- {
- public:
- C2UartDriver();
- ~C2UartDriver();
- bool connect(const std::string portname);
- void disconnect();
- bool getBaudrate();
- bool getDeviceState(uint8_t &state);
- bool getDeviceName(std::string &name);
- bool getFirmwareVersion(uint32_t &version);
- bool getSerialNumber(uint32_t &sn);
- bool login(uint8_t &state);
- bool getScanAngle(int32_t &start_angle, int32_t &stop_angle);
- bool setScanAngle(int32_t start_angle, int32_t stop_angle);
- bool setScanConfig(uint16_t frequency, uint16_t resolution);
- bool getMeasureRange(float &range_min, float &range_max);
- bool getScanData(uint8_t state);
- bool scanDataReceiver();
- private:
- serial::Serial sp_;
- };
- }
- #endif
|