Simple example of Aria's line-finder utility, which uses data from a laser rangefinder to detect a continues line of points.This example program will constantly search for a line-like pattern in the sensor readings of a laser rangefinder. If you press the 'f' key, those points will be saved in 'points' and 'lines' files. Use arrow keys or joystick to teleoperate the robot.
#include "Aria.h"
int main(int argc, char **argv)
{
{
return 1;
}
{
printf("Could not connect to robot... exiting\n");
return 1;
}
{
printf("Could not connect to SICK laser... exiting\n");
return 1;
}
printf("If you press the 'f' key the points and lines found will be saved\n");
printf("Into the 'points' and 'lines' file in the current working directory\n");
return 0;
}
Compatability class used to access SICK LMS-200 laser rangefinder device in versions of ARIA prior to...
Definition: ArSick.h:48
Functor for a member function.
Definition: ArFunctor.h:1825
Perform actions when keyboard keys are pressed.
Definition: ArKeyHandler.h:65
bool setupLaser(ArSick *laser)
Sets up the laser to be connected.
Definition: ArSimpleConnector.cpp:226
This class finds lines out of any range device with raw readings (lasers for instance)
Definition: ArLineFinder.h:41
Legacy connector for robot and laser.
Definition: ArSimpleConnector.h:51
virtual bool blockingConnect(void)
Connect to the laser while blocking.
Definition: ArLMS2xx.cpp:1206
static void setKeyHandler(ArKeyHandler *keyHandler)
Sets the key handler, so that other classes can find it using getKeyHandler()
Definition: Aria.cpp:624
bool connectRobot(ArRobot *robot)
Sets up the robot then connects it.
Definition: ArSimpleConnector.cpp:209
void addRangeDevice(ArRangeDevice *device)
Adds a rangeDevice to the robot's list of them, and set the ArRangeDevice object's robot pointer to t...
Definition: ArRobot.cpp:5757
static void exit(int exitCode=0)
Shutdown all Aria processes/threads, call exit callbacks, and exit the program.
Definition: Aria.cpp:367
static void log(LogLevel level, const char *str,...)
Log a message, with formatting and variable number of arguments.
Definition: ArLog.cpp:93
void setVerbose(bool verbose)
Whether to print verbose information about line decisions.
Definition: ArLineFinder.h:69
bool addKeyHandler(int keyToHandle, ArFunctor *functor)
This adds a keyhandler, when the keyToHandle is hit, functor will fire.
Definition: ArKeyHandler.cpp:144
static void init(SigHandleMethod method=SIGHANDLE_THREAD, bool initSockets=true, bool sigHandleExitNotShutdown=true)
Initialize Aria global data struture and perform OS-specific initialization, including adding OS sign...
Definition: Aria.cpp:128
Central class for communicating with and operating the robot.
Definition: ArRobot.h:82
static void logOptions(void)
Logs all the options for the program (Calls all the callbacks added with addLogOptionsCB())
Definition: Aria.cpp:794
void getLinesAndSaveThem(void)
Gets the lines, then prints them.
Definition: ArLineFinder.cpp:644
virtual void runAsync(void)
Run in its own thread.
Definition: ArRangeDeviceThreaded.h:58
void runAsync(bool stopRunIfNotConnected, bool runNonThreadedPacketReader=false)
Starts the instance to do processing in its own new thread.
Definition: ArRobot.cpp:301
static bool parseArgs(void)
Parses the arguments for the program (calls all the callbacks added with addParseArgsCB())
Definition: Aria.cpp:759
Use normal logging.
Definition: ArLog.h:62
void attachKeyHandler(ArKeyHandler *keyHandler, bool exitOnEscape=true, bool useExitNotShutdown=true)
Attachs a key handler.
Definition: ArRobot.cpp:6641
WaitState waitForRunExit(unsigned int msecs=0)
Suspend calling thread until the ArRobot run loop has exited.
Definition: ArRobot.cpp:2923