Go to the documentation of this file.
44 cout <<
"Specify the type of the Hokuyo connection, usb or ethernet: ";
50 cout <<
"Incorrect type" << endl;
51 cout <<
"Specify the type of the Hokuyo connection, usb or ethernet: ";
57 <<
"HOKUYO laser range finder test application." << endl
64 cout <<
"Enter the serial port name (e.g. COM1, ttyS0, ttyUSB0, "
66 getline(cin, serName);
70 cout <<
"Using serial port: " <<
SERIAL_NAME << endl;
79 cout <<
"Enter the ip direction: ";
82 cout <<
"Enter the port number: ";
89 cout << endl << endl <<
"Enable intensity [y/n]:";
90 getline(cin, intensity);
95 printf(
"[TEST] Turning laser ON...\n");
97 printf(
"[TEST] Initialization OK!\n");
100 printf(
"[TEST] Initialization failed!\n");
104 #if MRPT_HAS_WXWIDGETS
108 cout <<
"Press any key to stop capturing..." << endl;
115 bool thereIsObservation, hardError;
120 if (hardError) printf(
"[TEST] Hardware error=true!!\n");
122 if (thereIsObservation)
124 double FPS = 1.0 / tictac.
Tac();
144 #if MRPT_HAS_WXWIDGETS
145 std::vector<float> xs, ys, zs;
147 win.plot(xs, ys,
".b3");
154 std::this_thread::sleep_for(15ms);
172 catch (
const std::exception& e)
179 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...
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...
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.
bool turnOff() override
Disables the scanning mode (this can be used to turn the device in low energy mode,...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This namespace contains representation of robot actions and observations.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
std::string lowerCase(const std::string &str)
Returns an lower-case version of a string.
bool turnOn() override
Enables the scanning mode (which may depend on the specific laser device); this must be called before...
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 ...
mrpt::gui::CDisplayWindow3D::Ptr win
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
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,...
bool setIntensityMode(bool enabled)
If true scans will capture intensity.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
void Tic() noexcept
Starts the stopwatch.
Classes for creating GUI windows for 2D and 3D visualization.
Create a GUI window and display plots with MATLAB-like interfaces and commands.
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
This software driver implements the protocol SCIP-2.0 for interfacing HOKUYO URG/UTM/UXM/UST laser sc...
void setIPandPort(const std::string &ip, const unsigned int &port)
Set the ip direction and port to connect using Ethernet communication.
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.
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |