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);
95 int main(
int argc,
char** argv)
104 catch (std::exception& e)
106 std::cout <<
"EXCEPCION: " << e.what() << std::endl;
111 printf(
"Another exception!!");
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
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...
Contains classes for various device interfaces.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double RAD2DEG(const double x)
Radians to degrees.
virtual bool turnOn()
See base class docs.
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).
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.
mrpt::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_std_vector< float > > scan
The range values of the scan, in meters.
GLsizei const GLchar ** string
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
virtual 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,...
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 | |