192 bool& outThereIsObservation,
194 bool& hardwareError)
override;
295 const std::string& iniSection)
override;
void setScanInterval(unsigned int skipScanCount)
Set the skip scan count (0 means send all scans).
const std::string getSerialPort()
Returns the currently set serial port.
std::string m_com_port
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
uint32_t m_timeStartUI
Time of the first data packet, for synchronization purposes.
int m_firstRange
The first and last ranges to consider from the scan.
void setReducedFOV(const double fov)
If called (before calling "turnOn"), the field of view of the laser is reduced to the given range (in...
std::string m_rcv_data
temp buffer for incoming data packets
bool m_intensity
Get intensity from lidar scan (default: false)
unsigned int getScanInterval() const
mrpt::containers::circular_buffer< uint8_t > m_rx_buffer
Auxiliary buffer for readings.
~CHokuyoURG() override
Destructor: turns the laser off.
Contains classes for various device interfaces.
bool turnOn() override
Enables the scanning mode (which may depend on the specific laser device); this must be called before...
bool ensureStreamIsOpen()
Returns true if there is a valid stream bound to the laser scanner, otherwise it first try to open th...
bool switchLaserOn()
Switchs the laser on.
void closeStreamConnection()
Called upon dtor, or when trying to recover from a disconnected sensor.
unsigned int m_port_dir
If set to non-empty and m_ip_dir too, the program will try to connect to a Hokuyo using Ethernet comm...
std::string m_lastSentMeasCmd
The last sent measurement command (MDXXX), including the last 0x0A.
mrpt::gui::CDisplayWindow3D::Ptr m_win
bool m_disable_firmware_timestamp
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
void doProcessSimple(bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError) override
Specific laser scanner "software drivers" must process here new data from the I/O stream...
This class allows loading and storing values and vectors of different types from a configuration text...
void setSerialPort(const std::string &port_name)
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
bool turnOff() override
Disables the scanning mode (this can be used to turn the device in low energy mode, if available)
bool displaySensorInfo(CHokuyoURG::TSensorInfo *out_data=nullptr)
Ask to the device, and print to the debug stream, details about the sensor model. ...
Used in CHokuyoURG::displayVersionInfo.
bool setIntensityMode(bool enabled)
If true scans will capture intensity.
bool displayVersionInfo()
Ask to the device, and print to the debug stream, details about the firmware version,serial number,...
int m_timeStartSynchDelay
Counter to discard to first few packets before setting the correspondence between device and computer...
bool enableSCIP20()
Enables the SCIP2.0 protocol (this must be called at the very begining!).
mrpt::system::TTimeStamp m_timeStartTT
bool switchLaserOff()
Switchs the laser off.
int m_motorSpeed_rpm
The motor speed (default=600rpm)
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
This is the base, abstract class for "software drivers" interfaces to 2D scanners (laser range finder...
void purgeBuffers()
Empties the RX buffers of the serial port.
int scan_first
First, last, and front step of the scanner angular span.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
bool startScanningMode()
Start the continuous scanning mode, using parameters stored in the object (loaded from the ...
bool ensureBufferHasBytes(const size_t nDesiredBytes)
Assures a minimum number of bytes in the input buffer, reading from the serial port only if required...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void setIPandPort(const std::string &ip, const unsigned int &port)
Set the ip direction and port to connect using Ethernet communication.
void initialize() override
Turns the laser on.
bool setMotorSpeed(int motoSpeed_rpm)
Changes the motor speed in rpm's (default 600rpm)
double d_min
Min/Max ranges, in meters.
This software driver implements the protocol SCIP-2.0 for interfacing HOKUYO URG/UTM/UXM/UST laser sc...
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters.
bool setHighBaudrate()
Passes to 115200bps bitrate.
poses::CPose3D m_sensorPose
The sensor 6D pose:
unsigned int m_scan_interval
TSensorInfo m_sensor_info
The information gathered when the laser is first open.
bool m_highSensMode
High sensitivity [HS] mode (default: false)
std::string model
The sensor model.
double m_reduced_fov
Used to reduce artificially the interval of scan ranges.
int motor_speed_rpm
Standard motor speed, rpm.
bool parseResponse()
Parses the response from the device from raw bytes in m_rx_buffer, and stored the received frame in m...
bool setHighSensitivityMode(bool enabled)
Changes the high sensitivity mode (HS) (default: false)
void sendCmd(const char *str)
std::string m_ip_dir
If set to non-empty and m_port_dir too, the program will try to connect to a Hokuyo using Ethernet co...
int scans_per_360deg
Number of measuremens per 360 degrees.