141 const char *sentCmd_forEchoVerification,
145 int &rcv_dataLength);
165 bool &outThereIsObservation,
167 bool &hardwareError );
183 void setSerialPort(
const std::string &port_name) { m_com_port = port_name; }
186 void setIPandPort(
const std::string &ip,
const unsigned int &port) { m_ip_dir = ip; m_port_dir = port; }
229 const std::string &iniSection );
#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...
This software driver implements the protocol SCIP-2.0 for interfacing HOKUYO URG, UTM and UXM laser s...
TSensorInfo m_sensor_info
The information gathered when the laser is first open.
mrpt::system::TTimeStamp m_timeStartTT
bool receiveResponse(const char *sentCmd_forEchoVerification, char &rcv_status0, char &rcv_status1, char *rcv_data, int &rcv_dataLength)
Waits for a response from the device.
void purgeBuffers()
Empties the RX buffers of the serial port.
uint32_t m_timeStartUI
Time of the first data packet, for synchronization purposes.
bool displayVersionInfo()
Ask to the device, and print to the debug stream, details about the firmware version,...
bool m_highSensMode
High sensitivity [HS] mode (default: false)
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...
bool setHighSensitivityMode(bool enabled)
Changes the high sensitivity mode (HS) (default: false)
bool displaySensorInfo(CHokuyoURG::TSensorInfo *out_data=NULL)
Ask to the device, and print to the debug stream, details about the sensor model.
bool setMotorSpeed(int motoSpeed_rpm)
Changes the motor speed in rpm's (default 600rpm)
void setIPandPort(const std::string &ip, const unsigned int &port)
Set the ip direction and port to connect using Ethernet communication.
bool setHighBaudrate()
Passes to 115200bps bitrate.
std::string m_com_port
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
const std::string getSerialPort()
Returns the currently set serial port.
bool assureBufferHasBytes(const size_t nDesiredBytes)
Assures a minimum number of bytes in the input buffer, reading from the serial port only if required.
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 ...
virtual ~CHokuyoURG()
Destructor: turns the laser off.
mrpt::utils::circular_buffer< uint8_t > m_rx_buffer
Auxiliary buffer for readings.
double m_reduced_fov
Used to reduce artificially the interval of scan ranges.
poses::CPose3D m_sensorPose
The sensor 6D pose:
void setReducedFOV(const double fov)
If called (before calling "turnOn"), the field of view of the laser is reduced to the given range (in...
bool checkCOMisOpen()
Returns true if there is a valid stream bound to the laser scanner, otherwise it first try to open th...
void initialize()
Turns the laser on.
mrpt::gui::CDisplayWindow3DPtr m_win
bool enableSCIP20()
Enables the SCIP2.0 protocol (this must be called at the very begining!).
bool switchLaserOff()
Switchs the laser off.
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
void setVerbose(bool enable=true)
bool turnOn()
Enables the scanning mode (which may depend on the specific laser device); this must be called before...
bool startScanningMode()
Start the scanning mode, using parameters stored in the object (loaded from the .ini file) After this...
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...
bool turnOff()
Disables the scanning mode (this can be used to turn the device in low energy mode,...
void doProcessSimple(bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)
Specific laser scanner "software drivers" must process here new data from the I/O stream,...
int m_timeStartSynchDelay
Counter to discard to first few packets before setting the correspondence between device and computer...
bool m_I_am_owner_serial_port
std::string m_lastSentMeasCmd
The last sent measurement command (MDXXX), including the last 0x0A.
bool switchLaserOn()
Switchs the laser on.
bool m_disable_firmware_timestamp
int m_motorSpeed_rpm
The motor speed (default=600rpm)
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
This class allows loading and storing values and vectors of different types from a configuration text...
A circular buffer of fixed size (defined at construction-time), implemented with a std::vector as the...
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
struct GUI_IMPEXP CDisplayWindow3DPtr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Used in CHokuyoURG::displayVersionInfo.
std::string model
The sensor model.
int scans_per_360deg
Number of measuremens per 360 degrees.
double d_max
Min/Max ranges, in meters.
int motor_speed_rpm
Standard motor speed, rpm.