Go to the documentation of this file.
35 cout <<
"SICK LMS thru serial port test application." << endl << endl;
39 cout <<
"Enter the serial port name (e.g. COM1, ttyS0, ttyUSB0, "
45 cout <<
"Using serial port: " <<
SERIAL_NAME << endl;
58 #if MRPT_HAS_WXWIDGETS
65 cout <<
"Trying to initialize the laser..." << endl;
67 cout <<
"Initialized OK!" << endl;
71 bool thereIsObservation, hardError;
78 catch (
const std::exception& e)
80 cerr << e.what() << endl;
84 if (hardError) printf(
"[TEST] Hardware error=true!!\n");
86 if (thereIsObservation)
89 "[TEST] Observation received (%u ranges over %.02fdeg, "
99 #if MRPT_HAS_WXWIDGETS
100 std::vector<float> xs, ys, zs;
102 win.plot(xs, ys,
".b3");
106 std::this_thread::sleep_for(15ms);
124 catch (
const std::exception& e)
131 printf(
"Another exception!!");
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
void initialize() override
Set-up communication with the laser.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
bool insertObservation(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr)
Insert the observation information into this map.
float minDistBetweenLaserPoints
The minimum distance between points (in 3D): If two points are too close, one of them is not inserted...
const float & getScanRange(const size_t i) const
The range values of the scan, in meters.
size_t getScanSize() const
Get number of scan rays.
Contains classes for various device interfaces.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void getAllPoints(VECTOR &xs, VECTOR &ys, VECTOR &zs, size_t decimation=1) const
Returns a copy of the 2D/3D points as a std::vector of float coordinates.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This namespace contains representation of robot actions and observations.
void setScanFOV(int fov_degrees)
Set the scanning field of view - possible values are 100 or 180 (default) (call prior to 'doProcess')...
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
mrpt::gui::CDisplayWindow3D::Ptr win
constexpr double RAD2DEG(const double x)
Radians to degrees.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
Classes for creating GUI windows for 2D and 3D visualization.
This "software driver" implements the communication protocol for interfacing a SICK LMS 2XX laser sca...
Create a GUI window and display plots with MATLAB-like interfaces and commands.
void setScanResolution(int res_1_100th_degree)
Set the scanning resolution, in units of 1/100 degree - Possible values are 25, 50 and 100,...
void setBaudRate(int baud)
Changes the serial port baud rate (call prior to 'doProcess'); valid values are 9600,...
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
bool turnOff() override
Disables the scanning mode (in this class this has no effect).
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
The namespace for 3D scene representation and rendering.
void setSerialPort(const std::string &port)
Changes the serial port to connect to (call prior to 'doProcess'), for example "COM1" or "ttyS0".
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,...
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020 | |