Example/demonstration of ArActionTriangleDriveTo, which drives the robot towards a specially shaped triangular targetPress g or G to use ArActionTriangleDriveTo to detect and drive towards a triangular target shape. Press s or S to stop. See ArActionTriangleDriveTo for more information about the triangular target and what the action does and its parameters.
#include "Aria.h"
int main(int argc, char **argv)
{
{
return 1;
}
&ArActionTriangleDriveTo::activate);
&ArActionTriangleDriveTo::deactivate);
{
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 'g' key it'll go find a triangle, if you press 's' it'll stop.\n");
return 0;
}
Compatability class used to access SICK LMS-200 laser rangefinder device in versions of ARIA prior to...
Definition: ArSick.h:48
int, enable (1) or disable (0) sonar
Definition: ArCommands.h:63
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
Action to drive up to a triangle target (e.g. docking station) found from an ArLineFinder.
Definition: ArActionTriangleDriveTo.h:71
Legacy connector for robot and laser.
Definition: ArSimpleConnector.h:51
bool comInt(unsigned char command, short int argument)
Sends a command to the robot with an int for argument.
Definition: ArRobot.cpp:5634
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 parseArgs(void)
Function to parse the arguments given in the constructor.
Definition: ArSimpleConnector.cpp:83
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
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
void logOptions(void) const
Log the options the simple connector has.
Definition: ArSimpleConnector.cpp:175
Keep track of recent sonar readings from a robot as an ArRangeDevice.
Definition: ArSonarDevice.h:51
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
bool addAction(ArAction *action, int priority)
Adds an action to the list with the given priority.
Definition: ArRobot.cpp:3278
This action will use the keyboard arrow keys for input to drive the robot.
Definition: ArActionKeydrive.h:37
Action to limit the backwards motion of the robot based on range sensor readings.
Definition: ArActionLimiterBackwards.h:40
Action for stopping the robot.
Definition: ArActionStop.h:37
void attachKeyHandler(ArKeyHandler *keyHandler, bool exitOnEscape=true, bool useExitNotShutdown=true)
Attachs a key handler.
Definition: ArRobot.cpp:6641
int, enable (1) or disable (0) motors
Definition: ArCommands.h:43
Action to limit the forwards motion of the robot based on range sensor readings.
Definition: ArActionLimiterForwards.h:39
WaitState waitForRunExit(unsigned int msecs=0)
Suspend calling thread until the ArRobot run loop has exited.
Definition: ArRobot.cpp:2923