Go to the documentation of this file.
36 std::cout <<
"Enter the serial port name (e.g. COM1, ttyS0, ttyUSB0, "
38 getline(cin, serName);
42 std::cout <<
"Using serial port: " <<
SERIAL_NAME << endl;
53 printf(
"Turning laser ON...\n");
55 printf(
"Initialization OK!\n");
58 printf(
"Initialization failed!\n");
62 cout <<
"Press any key to stop capturing..." << endl;
69 bool thereIsObservation, hardError;
74 if (hardError) printf(
"[TEST] Hardware error=true!!\n");
76 if (thereIsObservation)
78 double FPS = 1.0 / tictac.
Tac();
81 "Scan received: %u ranges, FOV: %.02fdeg, %.03fHz: mid "
91 std::this_thread::sleep_for(5ms);
104 catch (
const std::exception& e)
111 printf(
"Another exception!!");
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
bool turnOn() override
See base class docs.
A high-performance stopwatch, with typical resolution of nanoseconds.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
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 showPreview(bool enable=true)
Enables GUI visualization in real-time.
This namespace contains representation of robot actions and observations.
double Tac() noexcept
Stops the stopwatch.
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 ...
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
constexpr double RAD2DEG(const double x)
Radians to degrees.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void Tic() noexcept
Starts the stopwatch.
Classes for creating GUI windows for 2D and 3D visualization.
Interfaces a Robo Peak LIDAR laser scanner.
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...
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
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.4 at Fri Jul 17 08:43:33 UTC 2020 | |