#include <ArSimpleConnector.h>
This is deprecated but is left in for compatibility with old code, Instead use ArRobotConnector to set up ArRobot's connection to the robot, and ArLaserConnector to set up connections with laser rangefinder devices.
actionExample.cpp, actionGroupExample.cpp, actsColorFollowingExample.cpp, armExample.cpp, auxSerialExample.cpp, directMotionExample.cpp, dpptuExample.cpp, gotoActionExample.cpp, gpsExample.cpp, gpsRobotTaskExample.cpp, gripperExample.cpp, gyroExample.cpp, joydriveActionExample.cpp, lineFinderExample.cpp, moduleExample.cpp, robotConnectionCallbacks.cpp, robotSyncTaskExample.cpp, teleopActionsExample.cpp, and triangleDriveToActionExample.cpp.
Public Member Functions | |
ArSimpleConnector (ArArgumentParser *parser) | |
Constructor that takes argument parser. | |
ArSimpleConnector (ArArgumentBuilder *arguments) | |
Constructor that takes argument builder. | |
ArSimpleConnector (int *argc, char **argv) | |
Constructor that takes args from the main. | |
bool | connectLaser (ArSick *laser) |
Connects the laser synchronously (will take up to a minute). | |
bool | connectLaserArbitrary (ArSick *laser, int laserNumber) |
Connects the laser synchronously (make sure you setMaxNumLasers). | |
bool | connectRobot (ArRobot *robot) |
Sets up the robot then connects it. | |
bool | connectSecondLaser (ArSick *laser) |
Connects the laser synchronously (will take up to a minute). | |
void | logOptions (void) const |
Log the options the simple connector has. | |
bool | parseArgs (ArArgumentParser *parser) |
Function to parse the arguments given in an arbitrary parser. | |
bool | parseArgs (void) |
Function to parse the arguments given in the constructor. | |
void | setMaxNumLasers (int maxNumLasers=1) |
Sets the number of possible lasers. | |
bool | setupLaser (ArSick *laser) |
Sets up the laser to be connected. | |
bool | setupLaserArbitrary (ArSick *laser, int laserNumber) |
Sets up a laser t obe connected (make sure you setMaxNumLasers). | |
bool | setupRobot (ArRobot *robot) |
Sets up the robot to be connected. | |
bool | setupSecondLaser (ArSick *laser) |
Sets up a second laser to be connected. | |
~ArSimpleConnector (void) | |
Destructor. | |
Protected Member Functions | |
void | finishConstructor (void) |
Finishes the stuff the constructor needs to do. | |
Protected Attributes | |
ArLaserConnector * | myLaserConnector |
bool | myOwnParser |
ArArgumentParser * | myParser |
ArRobotConnector * | myRobotConnector |
|
Constructor that takes argument builder.
|
|
Constructor that takes argument parser.
|
|
Connects the laser synchronously (will take up to a minute). This will setup and connect the laser if the command line switch was given to do so or simply return true if no connection was wanted. |
|
Sets up the robot then connects it. Prepares the given ArRobot object for connection, then begins a blocking connection attempt. If you wish to simply prepare the ArRobot object, but not begin the connection, then use setupRobot(). |
|
Connects the laser synchronously (will take up to a minute). This will setup and connect the laser if the command line switch was given to do so or simply return true if no connection was requested. |
|
Function to parse the arguments given in an arbitrary parser. Parse command line arguments held by the given ArArgumentParser.
The following arguments are accepted for laser connections. A program may request support for more than one laser using setMaxNumLasers(); if multi-laser support is enabled in this way, then these arguments must have the laser index number appended. For example, "-laserPort" for laser 1 would instead by "-laserPort1", and for laser 2 it would be "-laserPort2".
|
|
Sets up the laser to be connected. Description of the logic for connection to the laser: If --remoteHost then the laser will a tcp connection will be opened to that remoteHost at port 8102 or --remoteLaserTcpPort if that argument is given, if this connection fails then the setup fails. If --remoteHost wasn't provided and the robot connected to a simulator as described elsewhere then the laser is just configured to be simulated, if the robot isn't connected to a simulator it tries to open a serial connection to ArUtil::COM3 or --laserPort if that argument is given. |
|
Sets up the robot to be connected. This method is normally used internally by connectRobot(), but you may use it if you wish. If -remoteHost was given, then open that TCP port. If it was not given, then try to open a TCP port to the simulator on localhost. If that fails, then use a local serial port connection. Sets the given ArRobot's device connection pointer to this object. Sets up internal settings determined by command line arguments such as serial port and baud rate, etc. After calling this function (and it returns true), then you may connect ArRobot to the robot using ArRobot::blockingConnect() (or similar).
|
|
Sets up a second laser to be connected. Description of the logic for connecting to a second laser: Given the fact that there are no parameters for the location of a second laser, the laser's port must be passed in to ArSimpleConnector from the main or from ArArgumentBuilder. Similarly, a tcp connection must be explicitly defined with the --remoteLaserTcpPort2 argument. |