CYdLidar.h
#pragma once
#include "utils.h"
#include "ydlidar_driver.h"
#include <math.h>
#define PropertyBuilderByName(type, name, access_permission)\
access_permission:\
type m_##name;\
public:\
inline void set##name(type v) {\
m_##name = v;\
}\
inline type get##name() {\
return m_##name;\
}\
using namespace ydlidar;
class YDLIDAR_API CYdLidar {
PropertyBuilderByName(float, MaxRange,
private)
PropertyBuilderByName(float, MinRange,
private)
PropertyBuilderByName(float, MaxAngle,
private)
PropertyBuilderByName(float, MinAngle,
private)
PropertyBuilderByName(float, OffsetTime, private)
PropertyBuilderByName(bool, FixedResolution,
private)
PropertyBuilderByName(bool, Reversion,
private)
PropertyBuilderByName(bool, AutoReconnect,
private)
PropertyBuilderByName(bool, GlassNoise,
private)
PropertyBuilderByName(bool, SunNoise, private)
PropertyBuilderByName(int, SerialBaudrate,
private)
PropertyBuilderByName(std::string, SerialPort,
private)
PropertyBuilderByName(std::vector<float>, IgnoreArray,
private)
PropertyBuilderByName(int, AbnormalCheckCount,
private)
public:
CYdLidar();
virtual ~CYdLidar();
bool initialize();
// Return true if laser data acquistion succeeds, If it's not
bool doProcessSimple(LaserScan &scan_msg, bool &hardwareError);
//Turn on the motor enable
bool turnOn();
//Turn off the motor enable and close the scan
bool turnOff();
//get fixed resolution node size
int getFixedSize() const;
bool getDeviceHealth() const;
bool getDeviceInfo(int &type);
bool checkHeartBeat() const;
bool checkScanFrequency();
//Turn off lidar connection
void disconnecting();
protected:
bool checkCOMMs();
bool checkStatus();
bool checkHardware();
bool checkLidarAbnormal();
private:
bool isScanning;
bool isConnected;
YDlidarDriver *lidarPtr;
uint32_t m_pointTime;
uint64_t last_node_time;
int m_FixedSize;
}; // End of class
ydlidar
Definition: v8stdint.h:199
LaserScan
Definition: ydlidar_protocol.h:148
ydlidar::YDlidarDriver
Definition: ydlidar_driver.h:21
CYdLidar
Definition: CYdLidar.h:22