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 (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);
112 int main(
int argc,
char** argv)
124 catch (std::exception& e)
126 std::cout <<
"EXCEPCION: " << e.what() << std::endl;
131 printf(
"Another exception!!");
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
bool insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
Insert the observation information into this map.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
float minDistBetweenLaserPoints
The minimum distance between points (in 3D): If two points are too close, one of them is not inserted...
void initialize()
Set-up communication with the laser.
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...
double RAD2DEG(const double x)
Radians to degrees.
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
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,...
mrpt::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_std_vector< float > > scan
The range values of the scan, in meters.
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
GLsizei const GLchar ** string
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)
Specific laser scanner "software drivers" must process here new data from the I/O stream,...
bool turnOff()
Disables the scanning mode (in this class this has no effect).
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |