Aria  2.8.0
Aria Class Reference

Contains global initialization, deinitialization and other global functions. More...

#include <ariaInternal.h>

Public Types

enum  SigHandleMethod { SIGHANDLE_SINGLE, SIGHANDLE_THREAD, SIGHANDLE_NONE }
 

Static Public Member Functions

static void addExitCallback (ArFunctor *functor, int position=50)
 Adds a functor to by called before program exit by Aria::exit() More...
 
static void addInitCallBack (ArFunctor *cb, ArListPos::Pos position)
 Adds a callback to call when Aria is initialized using init() More...
 
static void addLogOptionsCB (ArFunctor *functor, int position=50)
 Adds a callback for when we log options.
 
static void addParseArgsCB (ArRetFunctor< bool > *functor, int position=50)
 Adds a callback for when we parse arguments.
 
static void addRobot (ArRobot *robot)
 Add a robot to the global list of robots.
 
static void addUninitCallBack (ArFunctor *cb, ArListPos::Pos position)
 Adds a callback to call when Aria is uninititialized using uninit() More...
 
static bool batteryAddCreator (const char *batteryType, ArRetFunctor2< ArBatteryMTX *, int, const char *> *creator)
 Adds a type of battery for Aria to be able to create. More...
 
static ArBatteryMTXbatteryCreate (const char *batteryType, int batteryNumber, const char *prefix="Aria::batteryCreate")
 Creates a battery of the given type. More...
 
static const char * batteryGetChoices (void)
 Gets a list of the possible battery types (for use in the config) More...
 
static const char * batteryGetTypes (void)
 Gets a list of the possible battery types. More...
 
static void callExitCallbacks (void)
 Internal, calls the exit callbacks.
 
static void delRobot (ArRobot *robot)
 Remove a robot from the global list of robots.
 
static bool deviceConnectionAddCreator (const char *deviceConnectionType, ArRetFunctor3< ArDeviceConnection *, const char *, const char *, const char *> *creator)
 Adds a type of deviceConnection for Aria to be able to create. More...
 
static ArDeviceConnectiondeviceConnectionCreate (const char *deviceConnectionType, const char *port, const char *defaultInfo, const char *prefix="Aria::deviceConnectionCreate")
 Creates a deviceConnection of the given type. More...
 
static const char * deviceConnectionGetChoices (void)
 Gets a list of the possible deviceConnection types (for use in the config) More...
 
static const char * deviceConnectionGetTypes (void)
 Gets a list of the possible deviceConnection types. More...
 
static void exit (int exitCode=0)
 Shutdown all Aria processes/threads, call exit callbacks, and exit the program. More...
 
static void exitOld (int exitCode=0)
 Force an exit of all Aria processes/threads (the old way) More...
 
static ArRobotfindRobot (char *name)
 Finds a robot in the global list of robots, by name. More...
 
static ArConfiggetConfig (void)
 Gets the ArConfig for this program. More...
 
static const char * getDirectory (void)
 Gets the directory that ARIA resides in. More...
 
static const char * getIdentifier (void)
 Gets the identifier (for humans) used for this instance of Aria.
 
static ArStringInfoGroupgetInfoGroup (void)
 Gets the ArStringInfoGroup for this program. More...
 
static ArJoyHandlergetJoyHandler (void)
 Get a pointer to the joystick handler if one has been set with setJoyHandler() More...
 
static ArKeyHandlergetKeyHandler (void)
 Gets a pointer to the global key handler, if one has been set with setKeyHandler() More...
 
static int getMaxNumBatteries (void)
 Gets the maximum number of batteris to use. More...
 
static int getMaxNumLasers (void)
 Gets the maximum number of lasers to use. More...
 
static int getMaxNumLCDs (void)
 Gets the maximum number of lcds to use. More...
 
static size_t getMaxNumPTZs ()
 Set maximum limit on PTZ or PTU devices, used by ArPTZConnector.
 
static int getMaxNumSonarBoards (void)
 Gets the maximum number of sonars to use. More...
 
static size_t getMaxNumVideoDevices ()
 Get maximum limit on video devices (used by ArVideo library)
 
static ArRobotJoyHandlergetRobotJoyHandler (void)
 Gets the robot joystick handler if one has been set. More...
 
static std::list< ArRobot * > * getRobotList ()
 Get a copy of the global robot list.
 
static bool getRunning (void)
 Sees if Aria is still running (mostly for the thread in main) More...
 
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 signal handlers on Linux, initializing sockets library on Windows, etc. More...
 
static bool laserAddCreator (const char *laserType, ArRetFunctor2< ArLaser *, int, const char *> *creator)
 Adds a type of laser for Aria to be able to create. More...
 
static ArLaserlaserCreate (const char *laserType, int laserNumber, const char *prefix="Aria::laserCreate")
 Creates a laser of the given type. More...
 
static const char * laserGetChoices (void)
 Gets a list of the possible laser types (for use in the config) More...
 
static const char * laserGetTypes (void)
 Gets a list of the possible laser types. More...
 
static bool lcdAddCreator (const char *lcdType, ArRetFunctor2< ArLCDMTX *, int, const char *> *creator)
 Adds a type of lcd for Aria to be able to create. More...
 
static ArLCDMTXlcdCreate (const char *lcdType, int lcdNumber, const char *prefix="Aria::lcdCreate")
 Creates a lcd of the given type. More...
 
static const char * lcdGetChoices (void)
 Gets a list of the possible lcd types (for use in the config) More...
 
static const char * lcdGetTypes (void)
 Gets a list of the possible lcd types. More...
 
static void logOptions (void)
 Logs all the options for the program (Calls all the callbacks added with addLogOptionsCB()) More...
 
static bool parseArgs (void)
 Parses the arguments for the program (calls all the callbacks added with addParseArgsCB()) More...
 
static void remExitCallback (ArFunctor *functor)
 Removes a functor to by called before program exit by Aria::exit() More...
 
static void setDirectory (const char *directory)
 Sets the directory that ARIA resides in, to override default. More...
 
static void setExitCallbacksLogLevel (ArLog::LogLevel level)
 Sets the log level for the exit callbacks.
 
static void setIdentifier (const char *identifier)
 Sets the identifier (for humans) used for this instance of Aria.
 
static void setJoyHandler (ArJoyHandler *joyHandler)
 Sets the joystick handler, so that other classes can find it using getJoyHandler() More...
 
static void setKeyHandler (ArKeyHandler *keyHandler)
 Sets the key handler, so that other classes can find it using getKeyHandler() More...
 
static void setMaxNumBatteries (int maxNumBatteries)
 Sets the maximum number of batteries to use. More...
 
static void setMaxNumLasers (int maxNumLasers)
 Sets the maximum number of lasers to use. More...
 
static void setMaxNumLCDs (int maxNumLCDs)
 Sets the maximum number of batteries to use. More...
 
static void setMaxNumPTZs (size_t n)
 Set maximum limit on PTZ or PTU devices, used by ArPTZConnector. Call before connecting to PTZ devices with ArPTZConnector.
 
static void setMaxNumSonarBoards (int maxNumSonarBoards)
 Sets the maximum number of sonars to use. More...
 
static void setMaxNumVideoDevices (size_t n)
 Set maximum limit on video devices (used by ArVideo library)
 
static void setParseArgLogLevel (ArLog::LogLevel level)
 Sets the log level for the parsing function.
 
static void setRobotJoyHandler (ArRobotJoyHandler *robotJoyHandler)
 Sets the robot joystick handler, so that other classes can find it. More...
 
static void shutdown ()
 Shutdown all Aria processes/threads. More...
 
static void signalHandlerCB (int sig)
 Internal, the callback for the signal handling.
 
static bool sonarAddCreator (const char *sonarType, ArRetFunctor2< ArSonarMTX *, int, const char *> *creator)
 Adds a type of sonar for Aria to be able to create. More...
 
static ArSonarMTXsonarCreate (const char *sonarType, int sonarNumber, const char *prefix="Aria::sonarCreate")
 Creates a sonar of the given type. More...
 
static const char * sonarGetChoices (void)
 Gets a list of the possible sonar types (for use in the config) More...
 
static const char * sonarGetTypes (void)
 Gets a list of the possible sonar types. More...
 
static void uninit ()
 Performs OS-specific deinitialization, used by shutdown() and exit(). More...
 

Static Protected Attributes

static std::string ourBatteryChoices = "Choices:"
 
static std::map< std::string, ArRetFunctor2< ArBatteryMTX *, int, const char * > *, ArStrCaseCmpOpourBatteryCreatorMap
 
static std::string ourBatteryTypes
 
static ArConfig ourConfig
 
static std::string ourDeviceConnectionChoices = "Choices:"
 
static std::map< std::string, ArRetFunctor3< ArDeviceConnection *, const char *, const char *, const char * > *, ArStrCaseCmpOpourDeviceConnectionCreatorMap
 
static std::string ourDeviceConnectionTypes
 
static std::string ourDirectory =""
 
static std::multimap< int, ArFunctor * > ourExitCallbacks
 
static ArLog::LogLevel ourExitCallbacksLogLevel = ArLog::Verbose
 
static ArMutex ourExitCallbacksMutex
 
static bool ourExiting =false
 
static std::string ourIdentifier = "generic"
 
static ArStringInfoGroup ourInfoGroup
 
static std::list< ArFunctor * > ourInitCBs
 
static bool ourInited = false
 
static ArJoyHandlerourJoyHandler = NULL
 
static ArKeyHandlerourKeyHandler = NULL
 
static std::string ourLaserChoices = "Choices:"
 
static std::map< std::string, ArRetFunctor2< ArLaser *, int, const char * > *, ArStrCaseCmpOpourLaserCreatorMap
 
static std::string ourLaserTypes
 
static std::string ourLCDChoices = "Choices:"
 
static std::map< std::string, ArRetFunctor2< ArLCDMTX *, int, const char * > *, ArStrCaseCmpOpourLCDCreatorMap
 
static std::string ourLCDTypes
 
static std::multimap< int, ArFunctor * > ourLogOptionsCBs
 
static int ourMaxNumBatteries = 1
 
static int ourMaxNumLasers = 2
 
static int ourMaxNumLCDs = 1
 
static size_t ourMaxNumPTZs = 8
 
static int ourMaxNumSonarBoards = 1
 
static size_t ourMaxNumVideoDevices = 8
 
static std::multimap< int, ArRetFunctor< bool > * > ourParseArgCBs
 
static ArLog::LogLevel ourParseArgsLogLevel = ArLog::Verbose
 
static ArRobotJoyHandlerourRobotJoyHandler = NULL
 
static std::list< ArRobot * > ourRobots
 
static bool ourRunning = false
 
static bool ourShuttingDown =false
 
static ArMutex ourShuttingDownMutex
 
static bool ourSigHandleExitNotShutdown = true
 
static ArGlobalFunctor1< int > ourSignalHandlerCB
 
static std::string ourSonarChoices = "Choices:"
 
static std::map< std::string, ArRetFunctor2< ArSonarMTX *, int, const char * > *, ArStrCaseCmpOpourSonarCreatorMap
 
static std::string ourSonarTypes
 
static std::list< ArFunctor * > ourUninitCBs
 

Detailed Description

Contains global initialization, deinitialization and other global functions.

Member Enumeration Documentation

◆ SigHandleMethod

Enumerator
SIGHANDLE_SINGLE 

Setup signal handlers in a global, non-thread way.

SIGHANDLE_THREAD 

Setup a dedicated signal handling thread.

SIGHANDLE_NONE 

Do no signal handling.

Member Function Documentation

◆ addExitCallback()

void Aria::addExitCallback ( ArFunctor functor,
int  position = 50 
)
static

Adds a functor to by called before program exit by Aria::exit()

Note, an exit callback may be called at any time; it should not block or wait on any locked mutexes or similar.

Examples:
gpsRobotTaskExample.cpp.

◆ addInitCallBack()

void Aria::addInitCallBack ( ArFunctor cb,
ArListPos::Pos  position 
)
static

Adds a callback to call when Aria is initialized using init()

This will add a callback to the list of callbacks to call when Aria has been initialized.

It can be called before anything else.

◆ addUninitCallBack()

void Aria::addUninitCallBack ( ArFunctor cb,
ArListPos::Pos  position 
)
static

Adds a callback to call when Aria is uninititialized using uninit()

This will add a callback to the list of callbacks to call right before Aria is un-initialized.

It can be called before anything else. This facilitates code that in operating system signal handlers simply calls Aria::uninit() and packages that are based on Aria are unitited as well. It simplifies the entire uninit process.

◆ batteryAddCreator()

bool Aria::batteryAddCreator ( const char *  batteryType,
ArRetFunctor2< ArBatteryMTX *, int, const char *> *  creator 
)
static

Adds a type of battery for Aria to be able to create.

This adds a functor which can create a battery of a given type.

Parameters
batteryTypeThe battery type that the creator will make (these are always checked case insensitively). If there is already a creator for this type, then the old one is replaced and the new one is used.
creatorA functor which takes an int (battery number) and a const char * (logPrefix) and returns a new battery of the batteryType

◆ batteryCreate()

ArBatteryMTX * Aria::batteryCreate ( const char *  batteryType,
int  batteryNumber,
const char *  logPrefix = "Aria::batteryCreate" 
)
static

Creates a battery of the given type.

Creates a battery of a given type, with the given batteryNumber, and uses the logPrefix for logging what happens.

This is mostly for internal use by ArBatteryConnector.

Parameters
batteryTypeThe type of battery to create
batteryNumberThe battery number to use for the created battery
logPrefixThe prefix to use when logging

◆ batteryGetChoices()

const char * Aria::batteryGetChoices ( void  )
static

Gets a list of the possible battery types (for use in the config)

Gets a string that is the types of batteries that can be created separated by ;; characters.

Mostly for internal use by the config.

◆ batteryGetTypes()

const char * Aria::batteryGetTypes ( void  )
static

Gets a list of the possible battery types.

Gets a string that is the types of batteries that can be created separated by | characters.

Mostly for internal use by ArBatteryConnector.

◆ deviceConnectionAddCreator()

bool Aria::deviceConnectionAddCreator ( const char *  deviceConnectionType,
ArRetFunctor3< ArDeviceConnection *, const char *, const char *, const char *> *  creator 
)
static

Adds a type of deviceConnection for Aria to be able to create.

This adds a functor which can create a deviceConnection of a given type.

Parameters
deviceConnectionTypeThe deviceConnection type that the creator will make (these are always checked case insensitively). If there is already a creator for this type, then the old one is replaced and the new one is used.
creatorA functor which takes a const char * (port name), a const char * (defaultInfo, for example default tcp port), a const char * (logPrefix) and returns a new deviceConnection of the deviceConnectionType if it can create the desired connection. If the connection failes then it should return NULL.

◆ deviceConnectionCreate()

ArDeviceConnection * Aria::deviceConnectionCreate ( const char *  deviceConnectionType,
const char *  port,
const char *  defaultInfo,
const char *  logPrefix = "Aria::deviceConnectionCreate" 
)
static

Creates a deviceConnection of the given type.

Creates a device connection of a given type, connecting to a given port, with the given defaultInfo, logging messages with the given prefix.

This is mostly for internal use by ArLaserConnector

Parameters
deviceConnectionTypeThe type of device connection to create
portThe port to connect to (for serial, an example is COM1 or /dev/ttyS0, for tcp an example is p3dx:8101)
defaultInfoDefault info to use, the only use for this right now is for a default port for a tcp connection (so that if it doesn't have hostname:port format but only hostname then it will use this port)
logPrefixThe prefix to use when logging

◆ deviceConnectionGetChoices()

const char * Aria::deviceConnectionGetChoices ( void  )
static

Gets a list of the possible deviceConnection types (for use in the config)

Gets a string that is the types of device connections that can be created separated by ;; characters.

Mostly for internal use by the config.

◆ deviceConnectionGetTypes()

const char * Aria::deviceConnectionGetTypes ( void  )
static

Gets a list of the possible deviceConnection types.

Gets a string that is the types of device connections that can be created separated by | characters.

Mostly for internal use by ArLaserConnector.

◆ exit()

Aria::exit ( int  exitCode = 0)
static

Shutdown all Aria processes/threads, call exit callbacks, and exit the program.

This will call the list of Aria exit callbacks (added by addExitCallback()) and then exit the program with the given exit code.

This method may be used as a replacement for the standard system ::exit() call (which is used by this method to finally exit the program with the given exitCode after finishing Aria shutdown steps.)

Note that this could be called from anywhere, mutexes may be locked when called– all exit callbacks MUST return and cannot wait for a lock, since this could result in the program hanging due to double-lock (deadlock).

See also
addExitCallback()
Examples:
actionExample.cpp, actionGroupExample.cpp, actsColorFollowingExample.cpp, armExample.cpp, auxSerialExample.cpp, cameraPTZExample.cpp, configExample.cpp, demo.cpp, directMotionExample.cpp, dpptuExample.cpp, gotoActionExample.cpp, gripperExample.cpp, gyroExample.cpp, imuExample.cpp, joydriveActionExample.cpp, laserConnect.cpp, lasers.cpp, lineFinderExample.cpp, moduleExample.cpp, mtxIO.cpp, mtxLCDDisplay.cpp, mtxPowerControl.cpp, mtxWheelLights.cpp, netServerExample.cpp, robotConnectionCallbacks.cpp, seekurPower.cpp, simpleConnect.cpp, simpleMotionCommands.cpp, socketClientExample.cpp, socketServerExample.cpp, soundsQueueExample.cpp, teleopActionsExample.cpp, triangleDriveToActionExample.cpp, and wander.cpp.

◆ exitOld()

void Aria::exitOld ( int  exitCode = 0)
static

Force an exit of all Aria processes/threads (the old way)

This method is roughly obsolete, it simply forces all the threads to die immediately and then exits...

The new method exit() is preferred.

This calls cancel() on all AtThread's and ArASyncTask's. It forces each thread to exit and should only be used in the case of a thread hanging or getting stuck in an infinite loop. This works fine in Linux. In Windows it is not recommended at all that this function be called. Windows can not handle cleanly killing off a thread. See the help in the VC++ compiler on the WIN32 function TerminateThread. The biggest problem is that the state of DLL's can be destroyed.

Deprecated:

◆ findRobot()

ArRobot * Aria::findRobot ( char *  name)
static

Finds a robot in the global list of robots, by name.

Parameters
namethe name of the robot you want to find
Returns
NULL if there is no robot of that name, otherwise the robot with that name

◆ getConfig()

ArConfig * Aria::getConfig ( void  )
static

Gets the ArConfig for this program.

This gets the global config aria uses.

Examples:
configExample.cpp.

◆ getDirectory()

const char * Aria::getDirectory ( void  )
static

Gets the directory that ARIA resides in.

This gets the directory that ARIA is located in, this is so ARIA can find param files and the like.

Returns
the directory ARIA is located in
See also
setDirectory

◆ getInfoGroup()

ArStringInfoGroup * Aria::getInfoGroup ( void  )
static

Gets the ArStringInfoGroup for this program.

This gets the global string group aria uses.

◆ getJoyHandler()

ArJoyHandler * Aria::getJoyHandler ( void  )
static

Get a pointer to the joystick handler if one has been set with setJoyHandler()

Gets the joy handler if one has been set.

◆ getKeyHandler()

ArKeyHandler * Aria::getKeyHandler ( void  )
static

Gets a pointer to the global key handler, if one has been set with setKeyHandler()

Gets the key handler if one has been set.

Examples:
actionGroupExample.cpp, dpptuExample.cpp, gripperExample.cpp, and gyroExample.cpp.

◆ getMaxNumBatteries()

int Aria::getMaxNumBatteries ( void  )
static

Gets the maximum number of batteris to use.

Gets the maximum number of batteries to check for and use.

◆ getMaxNumLasers()

int Aria::getMaxNumLasers ( void  )
static

Gets the maximum number of lasers to use.

Gets the maximum number of lasers to check for and use.

◆ getMaxNumLCDs()

int Aria::getMaxNumLCDs ( void  )
static

Gets the maximum number of lcds to use.

Gets the maximum number of lcds to check for and use.

◆ getMaxNumSonarBoards()

int Aria::getMaxNumSonarBoards ( void  )
static

Gets the maximum number of sonars to use.

Gets the maximum number of sonar boards to check for and use.

◆ getRobotJoyHandler()

ArRobotJoyHandler * Aria::getRobotJoyHandler ( void  )
static

Gets the robot joystick handler if one has been set.

Gets the robot joy handler if one has been set.

◆ getRunning()

bool Aria::getRunning ( void  )
static

Sees if Aria is still running (mostly for the thread in main)

returns true if ARIA is initialized (Aria::init() has been called) and has not been shut down by a call to Aria::shutdown() or Aria::exit() and an operating system signal has not occured (e.g.

external KILL signal)

Examples:
gotoActionExample.cpp, netServerExample.cpp, socketServerExample.cpp, and soundsQueueExample.cpp.

◆ init()

void Aria::init ( SigHandleMethod  method = SIGHANDLE_THREAD,
bool  initSockets = true,
bool  sigHandleExitNotShutdown = true 
)
static

Initialize Aria global data struture and perform OS-specific initialization, including adding OS signal handlers on Linux, initializing sockets library on Windows, etc.

This must be called first before any other Aria functions.

It initializes the thread layer and the signal handling method. For Windows it iniatializes the socket layer as well. This also sets the directory Aria is located in using ARIA environmental variable (or Aria registry key on Windows). For more about Aria's directory see getDirectory() and setDirectory().

For Linux the default signal handling method is to intercept OS signals in a dedicated "signal handling thread", which cleanly closes down the program, causes all the instances of ArRobot to stop their run loop and disconnect from their robot. The program will exit on the following signals: SIGHUP, SIGINT, SIGQUIT, and SIGTERM.

For Windows, there is no signal handling.

This method also adds the file /etc/Aria.args and the environment variable ARIAARGS as locations for ArArgumentParser to obtain default argument values from.

Parameters
methodthe method in which to handle signals. Defaulted to SIGHANDLE_SINGLE, or the method indicated by the ARIA_SIGHANDLE_METHOD environment variable (NONE, SINGLE or THREAD), if it exists.
initSocketsspecify whether or not to initialize the socket layer. This is only meaningfull for Windows. Defaulted to true.
sigHandleExitNotShutdownif this is true and a signal happens Aria will use exit() to quit instead of shutdown(), false will still use shutdown which is the old behavior.
See also
ArSignalHandler
ArSocket
Examples:
actionExample.cpp, actionGroupExample.cpp, actsColorFollowingExample.cpp, armExample.cpp, auxSerialExample.cpp, cameraPTZExample.cpp, configExample.cpp, demo.cpp, directMotionExample.cpp, dpptuExample.cpp, gotoActionExample.cpp, gpsExample.cpp, gpsRobotTaskExample.cpp, gripperExample.cpp, gyroExample.cpp, imuExample.cpp, joydriveActionExample.cpp, laserConnect.cpp, lasers.cpp, lineFinderExample.cpp, moduleExample.cpp, mtxIO.cpp, mtxLCDDisplay.cpp, mtxPowerControl.cpp, mtxWheelLights.cpp, netServerExample.cpp, robotConnectionCallbacks.cpp, robotSyncTaskExample.cpp, seekurPower.cpp, simpleConnect.cpp, simpleMotionCommands.cpp, socketClientExample.cpp, socketServerExample.cpp, soundsQueueExample.cpp, teleopActionsExample.cpp, threadExample.cpp, triangleDriveToActionExample.cpp, and wander.cpp.

◆ laserAddCreator()

bool Aria::laserAddCreator ( const char *  laserType,
ArRetFunctor2< ArLaser *, int, const char *> *  creator 
)
static

Adds a type of laser for Aria to be able to create.

This adds a functor which can create a laser of a given type.

Parameters
laserTypeThe laser type that the creator will make (these are always checked case insensitively). If there is already a creator for this type, then the old one is replaced and the new one is used.
creatorA functor which takes an int (laser number) and a const char * (logPrefix) and returns a new laser of the laserType

◆ laserCreate()

ArLaser * Aria::laserCreate ( const char *  laserType,
int  laserNumber,
const char *  logPrefix = "Aria::laserCreate" 
)
static

Creates a laser of the given type.

Creates a laser of a given type, with the given laserNumber, and uses the logPrefix for logging what happens.

This is mostly for internal use by ArLaserConnector.

Parameters
laserTypeThe type of laser to create
laserNumberThe laser number to use for the created laser
logPrefixThe prefix to use when logging

◆ laserGetChoices()

const char * Aria::laserGetChoices ( void  )
static

Gets a list of the possible laser types (for use in the config)

Gets a string that is the types of lasers that can be created separated by ;; characters.

Mostly for internal use by the config

◆ laserGetTypes()

const char * Aria::laserGetTypes ( void  )
static

Gets a list of the possible laser types.

Gets a string that is the types of lasers that can be created separated by | characters.

Mostly for internal use by ArLaserConnector.

◆ lcdAddCreator()

bool Aria::lcdAddCreator ( const char *  lcdType,
ArRetFunctor2< ArLCDMTX *, int, const char *> *  creator 
)
static

Adds a type of lcd for Aria to be able to create.

This adds a functor which can create a lcd of a given type.

Parameters
lcdTypeThe lcd type that the creator will make (these are always checked case insensitively). If there is already a creator for this type, then the old one is replaced and the new one is used.
creatorA functor which takes an int (lcd number) and a const char * (logPrefix) and returns a new lcd of the lcdType

◆ lcdCreate()

ArLCDMTX * Aria::lcdCreate ( const char *  lcdType,
int  lcdNumber,
const char *  logPrefix = "Aria::lcdCreate" 
)
static

Creates a lcd of the given type.

Creates a lcd of a given type, with the given lcdNumber, and uses the logPrefix for logging what happens.

This is mostly for internal use by ArLCDConnector.

Parameters
lcdTypeThe type of lcd to create
lcdNumberThe lcd number to use for the created lcd
logPrefixThe prefix to use when logging

◆ lcdGetChoices()

const char * Aria::lcdGetChoices ( void  )
static

Gets a list of the possible lcd types (for use in the config)

Gets a string that is the types of batteries that can be created separated by ;; characters.

Mostly for internal use by ArLCDConnector.

◆ lcdGetTypes()

const char * Aria::lcdGetTypes ( void  )
static

Gets a list of the possible lcd types.

Gets a string that is the types of batteries that can be created separated by | characters.

Mostly for internal use by ArLCDConnector.

◆ logOptions()

◆ parseArgs()

◆ remExitCallback()

void Aria::remExitCallback ( ArFunctor functor)
static

Removes a functor to by called before program exit by Aria::exit()

Note, an exit callback may be called at any time; it should not * block or wait on any locked mutexes or similar.

Also note that this will not actually happen if it is called while aria is exiting (ie it is walking through the list).

Since
2.7.0

◆ setDirectory()

void Aria::setDirectory ( const char *  directory)
static

Sets the directory that ARIA resides in, to override default.

This sets the directory that ARIA is located in, so ARIA can find param files and the like.

This can also be controlled by the environment variable ARIA, which this is set to (if it exists) when Aria::init is done. So for setDirectory to be effective, it must be done after the Aria::init.

Parameters
directorythe directory Aria is located in
See also
getDirectory

◆ setJoyHandler()

void Aria::setJoyHandler ( ArJoyHandler joyHandler)
static

Sets the joystick handler, so that other classes can find it using getJoyHandler()

Sets the joy handler, so that other classes can find it.

◆ setKeyHandler()

void Aria::setKeyHandler ( ArKeyHandler keyHandler)
static

Sets the key handler, so that other classes can find it using getKeyHandler()

Sets the key handler, so that other classes can find it.

Examples:
actionGroupExample.cpp, actsColorFollowingExample.cpp, demo.cpp, dpptuExample.cpp, gotoActionExample.cpp, gripperExample.cpp, gyroExample.cpp, imuExample.cpp, lineFinderExample.cpp, triangleDriveToActionExample.cpp, and wander.cpp.

◆ setMaxNumBatteries()

void Aria::setMaxNumBatteries ( int  maxNumBatteries)
static

Sets the maximum number of batteries to use.

Sets the maximum number of sonars to check for and use, if you are going to set this you should do it after the Aria::init.

◆ setMaxNumLasers()

void Aria::setMaxNumLasers ( int  maxNumLasers)
static

Sets the maximum number of lasers to use.

Sets the maximum number of lasers to check for and use, if you are going to set this you should do it after the Aria::init before you start making laser connectors or robots or robot params.

◆ setMaxNumLCDs()

void Aria::setMaxNumLCDs ( int  maxNumLCDs)
static

Sets the maximum number of batteries to use.

Sets the maximum number of sonars to check for and use, if you are going to set this you should do it after the Aria::init.

◆ setMaxNumSonarBoards()

void Aria::setMaxNumSonarBoards ( int  maxNumSonarBoards)
static

Sets the maximum number of sonars to use.

Sets the maximum number of sonars to check for and use, if you are going to set this you should do it after the Aria::init.

◆ setRobotJoyHandler()

void Aria::setRobotJoyHandler ( ArRobotJoyHandler robotJoyHandler)
static

Sets the robot joystick handler, so that other classes can find it.

Sets the robot joy handler, so that other classes can find it.

◆ shutdown()

void Aria::shutdown ( )
static

Shutdown all Aria processes/threads.

Use this function to clean up or uninitialize Aria, in particular, to stop background threads.

(Note: If you want to shutdown ARIA cleanly at the end of your program or when exiting the program due to error, use Aria::exit() instead.) This calls stop() on all ArThread's and ArASyncTask's. It will block until all ArThread's and ArASyncTask's exit. It is expected that all the tasks will obey the ArThread::myRunning variable and exit when it is false. Note, this only stop Aria's background threads, it does not exit the program. If you want to shutdown ARIA cleanly at the end of your program or when exiting the program due to error, use Aria::exit() instead.

See also
Aria::exit()
Examples:
imuExample.cpp.

◆ sonarAddCreator()

bool Aria::sonarAddCreator ( const char *  sonarType,
ArRetFunctor2< ArSonarMTX *, int, const char *> *  creator 
)
static

Adds a type of sonar for Aria to be able to create.

This adds a functor which can create a sonar of a given type.

Parameters
sonarTypeThe sonar type that the creator will make (these are always checked case insensitively). If there is already a creator for this type, then the old one is replaced and the new one is used.
creatorA functor which takes an int (sonar number) and a const char * (logPrefix) and returns a new sonar of the sonarType

◆ sonarCreate()

ArSonarMTX * Aria::sonarCreate ( const char *  sonarType,
int  sonarNumber,
const char *  logPrefix = "Aria::sonarCreate" 
)
static

Creates a sonar of the given type.

Creates a sonar of a given type, with the given sonarNumber, and uses the logPrefix for logging what happens.

This is mostly for internal use by ArSonarConnector.

Parameters
sonarTypeThe type of sonar to create
sonarNumberThe sonar number to use for the created sonar
logPrefixThe prefix to use when logging

◆ sonarGetChoices()

const char * Aria::sonarGetChoices ( void  )
static

Gets a list of the possible sonar types (for use in the config)

Gets a string that is the types of sonars that can be created separated by ;; characters.

Mostly for internal use by the config.

◆ sonarGetTypes()

const char * Aria::sonarGetTypes ( void  )
static

Gets a list of the possible sonar types.

Gets a string that is the types of sonars that can be created separated by | characters.

Mostly for internal use by ArSonarConnector.

◆ uninit()

void Aria::uninit ( )
static

Performs OS-specific deinitialization, used by shutdown() and exit().

This must be called last, after all other Aria functions.

For both Linux and Windows, it closes all the open ArModules. For Windows it deinitializes the socket layer as well.


The documentation for this class was generated from the following files: