#include <ArLocalizationTask.h>
Inheritance diagram for ArLocalizationTask:

The localization software can be used to localize a robot in a given map using the laser rangefinder. The system is meant to be used along with ARIA.
The localization system uses Monte Carlo Localization Algorithm to accurately localize the robot in the given map using its laser data. The localization task is meant to be initialized and run in a separate thread in ARIA. It can be used with a real robot or with a simulator.
In order to get the localization task thread going, the ArLocalizationTask class needs an instantiated ArRobot, ArRangeDevice and a map file of the robot's environment. The output of the localization will be reflected directly in the pose of the ArRobot. (unless explicitly set to not do so)
The basic MCL localization system has also been augmented with a Kalman filter which will fuse the wheel encoder data with the reflections from known laser reflecting landmarks (these are constructed with special reflective plastic manufactured by laser) in the map. To use this functionality you will need a map with reflector positions in it, and will have to configure the laser to return reflectance information. ARNL will incrementally incorporate the reflections from the landmarks using a EKF formulation. See the main ARNL overview page for details on this extra feature, including how to enable reflectance data in the laser.
ArLocalizationTask automatically creates and runs its background thread when constructed.
ArNetworking callback methods | |
| (used by server classes in ArServerClasses.cpp) | |
| void | drawRangePoints (ArServerClient *client, ArNetPacket *packet) |
| Draws range data used for localization. | |
| void | drawReflectorRays (ArServerClient *client, ArNetPacket *packet) |
| Draw rays from the robot to the reflector. | |
| void | drawSamplePoses (ArServerClient *client, ArNetPacket *packet) |
| Draws debugging objects if filled. | |
| void | drawSampleBounds (ArServerClient *client, ArNetPacket *packet) |
| Draws the sample bounds. | |
| void | drawKalmanVariance (ArServerClient *client, ArNetPacket *packet) |
| Draws the sample bounds. | |
| void | drawMCLVariance (ArServerClient *client, ArNetPacket *packet) |
| Draws the sample bounds. | |
| virtual int | getPoseInterpPosition (ArTime timeStamp, ArPose *position) |
| void | setMultiRobotCallback (ArRetFunctor< std::list< ArMultiRobotPoseAndRadius > > *func) |
| Sets the callback function for localization to know about other robots. | |
Public Member Functions | |
| ArLocalizationTask (ArRobot *robot, ArRangeDevice *laser, char *mapName) | |
| Base constructor with all the necessary inputs. | |
| ArLocalizationTask (ArRobot *robot, ArRangeDevice *laser, ArMapInterface *ariaMap, bool noReflectors=false) | |
| Base constructor with all the necessary inputs. | |
| virtual | ~ArLocalizationTask (void) |
| Base destructor. | |
| bool | localizeRobotInMapInit (ArPose given, int numSamples, double stdX, double stdY, double stdT, double thresFactor, bool warn=true, bool setInitializedToFalse=true, bool rayTrace=true) |
| Localization function mainly for initialization of robot at given pose. | |
| bool | localizeRobotInMapMoved (int numSamples, double distFactor, double angFactor, double thresFactor) |
| Function used to do the localization after motion (normally called automatically by the background task). | |
| bool | localizeRobotAtHomeBlocking (double distSpread, double angleSpread, double probThreshold) |
| Try initial localization at each home point at the map, and set the robot pose to the point with best score, using given parameter values instead of values previously configured. | |
| bool | localizeRobotAtHomeBlocking (double spreadX, double spreadY, double angleSpread, double probThreshold) |
| instead of values previously configured | |
| virtual bool | localizeRobotAtHomeBlocking (double distSpread, double angleSpread) |
| The common function call from above. | |
| virtual bool | localizeRobotAtHomeBlocking () |
| Try initial localization at each home point at the map, \ and set the robot pose to the point with best score. | |
| bool | localizeRobotAtHomeNonBlocking (void) |
| Request that the task later localize the robot at a map home \ position, then return immediately. | |
| virtual ArPose | getRobotHome (void) |
| Gets the pose that robot was localized to. | |
| void | setForceUpdateParams (int numSamples, double xStd, double yStd, double tStd) |
| Sets the force update parameters. | |
| void | forceUpdatePose (ArPose forcePose, bool rayTrace=true) |
| Force an update in thread instead of waiting for distance-angle trigger. | |
| void | addFailedLocalizationCB (ArFunctor1< int > *functor) |
| Adds a callback which will be called when loca fails. | |
| void | remFailedLocalizationCB (ArFunctor1< int > *functor) |
| Removes a callback. | |
| bool | setGridResolution (double res, ArMapInterface *ariaMap) |
| Sets the occupancy grid with the new map. | |
| void | setFailedCallBack (ArFunctor1< int > *fcb) |
| Sets tracking failed Callback. | |
| virtual LocalizationState | getState (void) |
| Gets the state of localization. | |
| bool | getIdleFlag (void) |
| Gets the idle flag. | |
| bool | getReloadingMapFlag (void) |
| Gets the map reloading flag. | |
| ArMapInterface * | readMapFromFile (char *mapName) |
| Read the Map data from a map file. | |
| ArMapInterface * | readAriaMap (ArMapInterface *ariaMap) |
| Read the Map data from ArMap. | |
| bool | loadParamFile (const char *file) |
| Load parameters from the given filename into ArConfig. | |
| bool | saveParams (char *filename) |
| Saves all parameter values from ArConfig to the given file. | |
Modifiers for configuration values. | |
Normally these values are automatically set via ArConfig (e.g.
by loading them from a file or other source) in the "Localization" section, and these methods would only be used internally by ARNL. However, they can be used if you are not using ArConfig or wish to override a setting. | |
| void | setTriggerDelR (double tr) |
| Sets the motion trigger value for distance. | |
| void | setTriggerDelT (double tt) |
| Sets the motion trigger value for angle. | |
| void | setTriggerTimeFlag (bool tt) |
| Sets the flag to trigger on idle. | |
| void | setTriggerTime (double tt) |
| Sets the idle trigger time in millisecs. | |
| void | setTriggerTimeX (double tt) |
| Sets the X range when localization triggers due to idle time. | |
| void | setTriggerTimeY (double tt) |
| Sets the Y range when localization triggers due to idle time. | |
| void | setTriggerTimeTh (double tt) |
| Sets the Theta range when localization triggers due to idle time. | |
| void | setNumSamples (int n) |
| Set the number of samples to use in the MCL. | |
| void | setNumSamplesAtInit (int n) |
| Set the number of samples to use during initialization. | |
| void | setRayTraceAtInit (bool f) |
| Set the flag which decides on ray tracing for localize at init. | |
| void | setCurrentNumSamples (int n) |
| Set the variable number of samples (usually adjusted automatically). | |
| void | setPassThreshold (double f) |
| Sets the pass threshold for fraction of laser points matched to env. | |
| void | setSensorBelief (double sensorBelief) |
| Sets the sensor belief. | |
| void | setCurrentLocaPose (double x, double y, double th) |
| Sets the current pose. | |
| void | setCurrentLocaPose (ArPose p) |
| Sets the current pose. | |
| void | setVerboseFlag (bool a) |
| Sets the verbose flag value. (for debugging). | |
| void | setAngleIncrement (double f) |
| Sets the laser increments. | |
| void | setKillThreshold (double f) |
| void | setRecoverOnFailedFlag (bool f) |
| Sets the recoverOnFailed flag. | |
| void | setIdleFlag (bool f) |
| Sets the idle flag. | |
| void | setReloadingMapFlag (bool f) |
| Sets the map reloading flag. | |
| void | setEnableReflectorLocalizationFlag (bool f) |
| Sets the flag to fuse all sensors. | |
| void | setReflectorVar (double f) |
| Sets the variance in the XY for the reflector centers. | |
| void | setReflectorMatchDist (double f) |
| Sets the radius to search for a reflector to match a given reflection. | |
| void | setReflectorMatchAngle (double f) |
| Sets the angle to search for a reflector to match a given reflection. | |
| void | setReflectorMaxRange (double f) |
| Sets the maximum distance the reflector can be seen. | |
| void | setReflectorMaxAngle (double f) |
| Sets the maximum incident angle the reflector can be seen. | |
| void | setReflectorSize (double f) |
| Sets the reflector size. | |
| void | setReflectanceThreshold (int f) |
| Sets the reflectance threshold. | |
| void | setBypassMCLFlag (bool f) |
| Sets the flag which decides to bypasses MCL and use reflectors. | |
Accessors for current configuration values. | |
These values are normally set via ArConfig (the "Localization" section) by loading a file or other means, or by calling the modifier functions above. | |
| void | getForceUpdateParams (ArPose &forcePose, int &numSamples, double &xStd, double &yStd, double &tStd) |
| Get the params to do the localization from the class. | |
| bool | getVerboseFlag (void) |
| Gets the verbose flag. (for debugging only). | |
| bool | getInitializedFlag (void) |
| Gets the initialized flag indicating if localization thread is on. | |
| int | getNumSamples (void) |
| Get the maximum number of samples used in the MCL. | |
| int | getNumSamplesAtInit (void) |
| Get the number of samples used in the MCL during initialization. | |
| bool | getRayTraceAtInit (void) |
| Get the flag which decides on ray tracing for localize at init. | |
| int | getCurrentNumSamples (void) |
| Get the variable number of samples if adjusted during move. | |
| ArPose | getRobotMaxProbPose (void) |
| Get the current computed best robot pose. | |
| double | getTriggerDelR (void) |
| Gets the min distance to localize. | |
| double | getTriggerDelT (void) |
| Gets the min angle to localize. | |
| bool | getTriggerTimeFlag (void) |
| Gets the flag indicating if localization should trigger on idle. | |
| double | getTriggerTime (void) |
| Gets the min time in millisecs to be idle. | |
| double | getTriggerTimeX (void) |
| Gets the X range of samples when localization triggers on idle. | |
| double | getTriggerTimeY (void) |
| Gets the Y range of samples when localization triggers on idle. | |
| double | getTriggerTimeTh (void) |
| Gets the Theta range of samples when localization triggers on idle. | |
| double | getPassThreshold (void) |
| Gets the Pass threshold for localization success. | |
| double | getUsingPassThreshold (void) |
| Gets the Pass threshold for localization success being used right now. | |
| void | setTempPassThreshold (double passThreshold) |
| Sets the Pass threshold to use until it is reset to config. | |
| double | getTempPassThreshold (void) |
| Gets the temporary pass threshold to use until it is reset to config. | |
| void | clearTempPassThreshold (void) |
| Resets the Pass threshold to config. | |
| virtual double | getLocalizationScore (void) |
| Gets the higher of MCL and Reflector based localization. | |
| virtual double | getLocalizationThreshold (void) |
| Gets the localization threshold. | |
| double | getMCLocalizationScore (void) |
| Gets the localization score based on Monte Carlo only. | |
| double | getRefLocalizationScore (void) |
| Gets the localization score based on reflectors only. | |
| double | getSensorBelief (void) |
| Gets the sensor belief. | |
| ArPose | getCurrentLocaPose (void) |
| Gets the last successful MCLocalized pose. | |
| double | getStdX (void) const |
| double | getStdY (void) const |
| double | getStdTh (void) const |
| double | getErrorMmPerMm (void) const |
| double | getErrorDegPerDeg (void) const |
| double | getErrorDegPerMm (void) const |
| double | getSensorBelief (void) const |
| double | getPeakFactor (void) const |
| double | getOccThreshold (void) const |
| double | getGridRes (void) const |
| char * | getMapName (void) |
| double | getPeturbRangeX (void) const |
| double | getPeturbRangeY (void) const |
| double | getPeturbRangeTh (void) const |
| double | getFailedRangeX (void) const |
| double | getFailedRangeY (void) const |
| double | getFailedRangeTh (void) const |
| double | getPeakStdX (void) const |
| double | getPeakStdY (void) const |
| double | getPeakStdTh (void) const |
| double | getAngleIncrement (void) const |
| double | getKillThreshold (void) const |
| ArMapInterface * | getAriaMap (void) |
| int | getBufferSize (void) |
| Scan Buffer size. (internal laser scan buffer). | |
| std::vector< ArPose > | getXYBuffer (void) |
| Scan Buffer XY. | |
| ArPose | getBufferPose (void) |
| Scan Buffer pose taken. (internal laser scan buffer). | |
| ArOccGrid * | getOccGridPtr (void) |
| Returns pointer to the occgrid. | |
| virtual std::list< ArPose > | getCurrentSamplePoses (void) |
| Gets the pose samples for client. | |
| bool | getRecoverOnFailedFlag (void) |
| Gets the recoverOnFailed flag. | |
| bool | getIgnoreIllegalPoseFlag (void) |
| Gets the flag which allows poses overlaping occupied points on map. | |
| bool | getAdjustNumSamplesFlag (void) |
| Gets the flag which allows for changing numSamples with loca score. | |
| int | getMinNumSamples (void) |
| Gets the minimum no of samples the localization will drop to. | |
| double | getNumSamplesAngleFactor (void) |
| Gets the rotation factor for adjusting no of samples with score. | |
| bool | getSensorSetFlag (void) |
| Gets the value of the sensor set flag which indicates new cycle. | |
| bool | getEnableReflectorLocalizationFlag (void) |
| Gets the flag to fuse all sensors. | |
| double | getReflectorVar (void) |
| Gets the variance in the XY for the reflector centers. | |
| double | getReflectorMatchDist (void) |
| Gets the radius to search for a reflector to match a given reflection. | |
| double | getReflectorMatchAngle (void) |
| Sets the angle to search for a reflector to match a given reflection. | |
| double | getReflectorMaxRange (void) |
| Gets the maximum distance the reflector can be seen. | |
| double | getReflectorMaxAngle (void) |
| Gets the maximum incident angle the reflector can be seen. | |
| double | getReflectorSize (void) |
| Gets the reflector size param. | |
| int | getReflectanceThreshold (void) |
| Gets the reflectance threshold. | |
| bool | getBypassMCLFlag (void) |
| Gets the flag which decides to bypasses MCL and use reflectors. | |
| double | getReflectorTriDistLimit (void) |
| Gets the triangulation dist limit. | |
| double | getReflectorTriAngLimit (void) |
| Gets the triangulation angle limit. | |
| double | getBadReflectorFactor (void) |
| Gets the bad reflector factor. | |
| ArMatrix | getQParams (void) |
| Gets the bad reflector factor. | |
Functions used internally by ARNL | |
| bool | fillHistogram (double *&hist, double *&cumSum, int &numSamples) |
| Fill prob distribution histogram for debugging. | |
| bool | scanToGlobalCoords (ArPose robPose, std::vector< ArPose > &xyLrf) |
| Convert the laser data to x and y coord array. | |
| ArTime | getLastLocaTime (void) |
| Gets the last loca time to now. | |
| bool | setLocaParams (double xStd, double yStd, double tStd, double kMmPerMm, double kDegPerDeg, double kDegPerMm, double sensorBelief) |
| Set all the parameters for localization. | |
| void | setIgnoreIllegalPoseFlag (bool f) |
| Sets the flag which allows poses overlaping occupied points on map. | |
| void | setAdjustNumSamplesFlag (bool f) |
| Sets the flag which changes numSamples with the localization score. | |
| void | setMinNumSamples (int n) |
| Sets the minimum no of samples the localization will drop to. | |
| void | setNumSamplesAngleFactor (double f) |
| Sets the rotation factor for adjusting no of samples with score. | |
| void | setLastLocaTimeToNow (void) |
| Sets the last loca time to now. | |
| void | setSensorSetFlag (bool p) |
| Sets the value of the sensor set flag which indicates new cycle. | |
| bool | computeLastLocaMeanVar (ArPose &mean, ArMatrix &Var) |
| The compute the mean and var as soon as MCL finds a pose. | |
| bool | findMCLMeanVar (ArPose &mean, ArMatrix &Var) |
| Finds the mean and var of MCL after moving to present pose. | |
| virtual bool | findLocalizationMeanVar (ArPose &mean, ArMatrix &Var) |
| The actual mean var calculator for the virtual in the base class. | |
| virtual void | setCorrectRobotFlag (bool f) |
| Sets the flag deciding whether to reflect localized pose onto the robot. | |
| virtual void | setRobotPose (ArPose pose, ArPose spread=ArPose(0, 0, 0), int nSam=0) |
| Used to set the robot pose usually at the start of localization. | |
| virtual bool | getRobotIsLostFlag (void) |
| Gets the lost flag. | |
| virtual void | setLocalizationIdle (bool f) |
| Set the localization idle. | |
| virtual ArTransform | getEncoderToLocalizationTransform (void) |
| Gets the transform from the encoder to the laser. | |
Protected Member Functions | |
| void | basicInitialization (ArRobot *robot, ArRangeDevice *laser) |
| Basic initializer (internal use only). | |
| virtual void * | runThread (void *ptr) |
| Function used to run the task as a thread. | |
| bool | correctPoseFromSensor (double increment, bool rayTrace, bool ignoreBadProb) |
| Function which does the main eqn for the actual MCL localization. | |
| bool | getLocalizedFlag (void) |
| Gets the localized flag. (do not use). | |
| bool | getLocalizingFlag (void) |
| Gets the localizing flag value. To avoid multiple localizing threads. | |
| bool | getRobotMovedFlag (void) |
| Gets the robot moved flag value. (Moved after last localization). | |
| bool | getCorrectRobotFlag (void) |
| Gets the flag indicating if localization result will be set on robot. | |
| bool | getLogFlag (void) |
| Gets the flag indicating if logging. | |
| void | setLocalizedFlag (bool a) |
| Sets the localized flag value. (do not use). | |
| void | setInitializedFlag (bool a) |
| Sets the initialized flag value indicating robot was localized or not. | |
| void | setRobotMovedFlag (bool a) |
| Sets the robot moved flag to set off MCL. | |
| bool | initializeSamples (int numSamples) |
| Initialize the MCL samples. | |
| bool | scanLaserIntoArray (void) |
| Get the laser buffer into data structure. | |
| ArOccGrid * | initializeOccGrid (double res, ArMapInterface *ariaMap, bool lockMap=true) |
| Set resolution of the occupancy grid and fill it. | |
| void | killBadSamples (double obsThreshold) |
| Legalize samples to eliminate illegal location such as on obstacles. | |
| void | saveSamples (bool saveFile=false) |
| Save samples for backup. | |
| int | findBestPoses (ArRobotPoseSamples *mrsp, double factor) |
| Find the best poses by looking at prob distribution peaks. | |
| int | getNumBestPoses (ArRobotPoseSamples *mrsp) |
| Get the number of peaks. | |
| bool | findSamplesStatistics (double &xMean, double &yMean, double &thMean, double &xStd, double &yStd, double &tStd) |
| Compute statistics of samples after localization. | |
| bool | findKalmanMeanVar (ArPose &mean, ArMatrix &var) |
| Return the state. | |
| bool | fuseTwoDistributions (ArPose m1, ArMatrix V1, ArPose m2, ArMatrix V2, ArPose &mean, ArMatrix &Var) |
| Fuses the stats of two uniform dists into one. | |
| unsigned int | getLocaTime () |
| Return time of last good localization. | |
| void | setMotionErrorParam (int index, double value) |
| Set motion error params. | |
| double | getMotionErrorParam (int index) |
| Get motion error params. | |
| void | robotCallBack (void) |
| The sensor interpretation callback. Called every 100msec. | |
| bool | configureLaser (void) |
| Needed if the laser does not connect first. | |
| bool | reconfigureLocalization (void) |
| Needed if the params are changed or loaded again. | |
| void | setupLocalizationParams (bool noReflectors=false) |
| Setup the path planing params with values from ArConfig. | |
| void | failedLocalization (int times) |
| Actual thing that gets called when localization failed. | |
| int | dynamicallyAdjustNumSamples (double dr, double dt) |
| Change the sample size to reflect localization score. | |
| void | mapChanged (void) |
| Function for the things to do if map changes. | |
| bool | findPoseFromLandmarks (const std::vector< ArPose > &global, const std::vector< ArPose > &local, ArPose &rPose, ArMatrix &Var) |
| Solve the triangulation eqn. | |
| bool | kalmanFilter (const std::vector< ArPose > &global, const std::vector< ArPose > &local, ArPose &pose, ArPose &deltaPose, ArPose &delta, bool failedLocalization, ArPose &mean, ArPose &stdDev, ArPose &maxInnov, double &refScore) |
| Solve the Kalman thing. | |
| int | getReflectionCoords (ArPose &poseTaken, ArPose &rPose, std::vector< ArPose > &gList, std::vector< ArPose > &lList) |
| Find the reflectors in local and global coords. | |
| int | getReflectorCenterCoords (ArPose &poseTaken, ArPose &rPose, std::vector< ArPose > &gList, std::vector< ArPose > &lList) |
| Find the reflector centers in local and global coords. | |
| bool | fuseSensorWithOdometry (bool failedLocalization) |
| Fuse all the sensor information. | |
| void | setFlagsAndCallbacksOnFail (int ntimes) |
| Set the flags and call the right callbacks when loca fails ntimes. | |
|
||||||||||||||||
|
Base constructor with all the necessary inputs. Constructor.
|
|
||||||||||||||||||||
|
Base constructor with all the necessary inputs. Constructor.
|
|
|
Base destructor. Destructor. |
|
|
Adds a callback which will be called when loca fails. After localization has failed these callbacks will be called. This function adds the a pointer to a function to this list.
|
|
||||||||||||
|
Basic initializer (internal use only). Basic initializer to avoid duplication in the two constructors. |
|
||||||||||||
|
The compute the mean and var as soon as MCL finds a pose. Compute the mean and variance from the MCL samples.
|
|
|
Needed if the laser does not connect first. A function to setup the laser if it wasnt connected first time around.
|
|
||||||||||||||||
|
Function which does the main eqn for the actual MCL localization. Correct the sample poses by using the data from the sensor. This is the second of the two important steps in Localization. Correlation window is only 1 pixel wide per ray.
|
|
||||||||||||
|
Draws the sample bounds. Draws the Reflector Kalman mean pose and var position rectangle with angle cone. |
|
||||||||||||
|
Draws the sample bounds. Draws the MCL's mean pose and var position rectangle with angle cone. |
|
||||||||||||
|
Draws range data used for localization. ArNetworking callback providing sample points to draw in a GUI for troubleshooting or debugging. |
|
||||||||||||
|
Draw rays from the robot to the reflector. Draws the rays to the landmarks.
MPL changes so kathleen always gets packet |
|
||||||||||||
|
Draws the sample bounds. Draws the boundary around the samples.
MPL changes so kathleen always gets packet |
|
||||||||||||
|
Draws debugging objects if filled. MPL changes so kathleen always gets packet |
|
||||||||||||
|
Change the sample size to reflect localization score. Dynamically reduce the number of samples when the localization score is good and increase it when the score is lower. Mostly for internal use only.
|
|
|
Actual thing that gets called when localization failed. Things to do when localization fails. |
|
||||||||||||||||
|
Fill prob distribution histogram for debugging. Fill histogram arrays. For display purposes during debugging.
|
|
||||||||||||
|
Find the best poses by looking at prob distribution peaks. Finds the most probable poses from the results of the MCL by looking at the samples and their characteristics. Uses the fact that after resampling, the probabilties must be non zero for only one or a few poses.
|
|
||||||||||||
|
Return the state. Return the current mean pose of the kalman and its variance.
|
|
||||||||||||
|
The actual mean var calculator for the virtual in the base class. Virtual function which will pull the current state of the loca.
Reimplemented from ArBaseLocalizationTask. |
|
||||||||||||
|
Finds the mean and var of MCL after moving to present pose. Finds the MCL mean and variance at the current pose.
|
|
||||||||||||||||||||
|
Solve the triangulation eqn. Solve the pose equation from the landmark triangulation. Unlike the earlier method, this uses no matrix inversion and hence is a lot more stable and accurate.
|
|
||||||||||||||||||||||||||||
|
Compute statistics of samples after localization. Compute the statistics from the samples.
|
|
||||||||||||
|
Force an update in thread instead of waiting for distance-angle trigger. Forces the thread to go from move localization to set localization with a new pose. Force a change in robot position, and a stationary relocalization at that point (instead of moving localization). This function is neccesary to cleanly resume localization after forcing a change in robot position (or at initial localization if neither localizeRobotAtHomeBlocking() or localizeRobotAtHomeNonBlocking() are used). You can use setForceUpdateParams() to explictly net new values used for parameters.
|
|
|
Fuse all the sensor information. Fuse the odometry into the current observations about the reflectors. using kalman filtering.
Interpolating the light pose at any given time. |
|
||||||||||||||||||||||||||||
|
Fuses the stats of two uniform dists into one. Combines two gaussian distributions into one.
|
|
|
Gets the pose samples for client. Gets the Robot pose samples before sensor correction.
Reimplemented from ArBaseLocalizationTask. |
|
||||||||||||||||||||||||
|
Get the params to do the localization from the class. Fills the 5 relevant parameters from the force update set. |
|
|
Gets the higher of MCL and Reflector based localization. Returns the best of monte carlo localization and kalman filter based localization using reflectors.
Reimplemented from ArBaseLocalizationTask. |
|
|
Gets the localization threshold. Returns the localization threshold.
Reimplemented from ArBaseLocalizationTask. |
|
|
Gets the localization score based on Monte Carlo only. Returns the goodness of the last localization result. No of matched laser points in the environment to the total no of laser points.
|
|
|
Get motion error params. Gets all error parameters needed to do the MCL localization. [Kr, Kt, Kd] treated as a vector.
|
|
||||||||||||
|
Reimplemented from ArBaseLocalizationTask. |
|
|
Gets the bad reflector factor. Gets the variance values that decay with time. |
|
||||||||||||||||||||
|
Find the reflectors in local and global coords. Function to get all the reflections in global and local coords at the current robot pose.
|
|
||||||||||||||||||||
|
Find the reflector centers in local and global coords. Function to get the reflectors centers in global and local coords if any.
|
|
|
Gets the localization score based on reflectors only. Returns the localization score based on reflectors alone.
|
|
|
Gets the pose that robot was localized to. Function to get stored home pose (used internally during reset etc.)
Reimplemented from ArBaseLocalizationTask. |
|
|
Get the current computed best robot pose. Gets the most probable pose of the robot as computed by the last localization.
|
|
||||||||||||||||
|
Set resolution of the occupancy grid and fill it. Fills the occupancy grid with data from the map.
|
|
|
Initialize the MCL samples. Initialize the robot samples for MCL to start.
|
|
|
Legalize samples to eliminate illegal location such as on obstacles. Kill all bad samples by setting their probs to zero.
|
|
|
Load parameters from the given filename into ArConfig. It Aria::getConfig()->parseFile(file, false, true), and also stores the ArConfig object returned by Aria::getConfig() as a (possibly new) ArConfig object for ArLocalizationTask to use in the future.
|
|
|
Try initial localization at each home point at the map, \ and set the robot pose to the point with best score. Attempt to localize the robot in the most likely home position: first it checks the robot's current pose and then checks all of the home positions in the map. The position with the highest score is then used. Call this function after the localization thread has been initialized but needs to be reset, or an initial localization (i.e. at program start up) is needed. This function blocks while the localization takes place, and returns after it either succeeds (Either localization at a home position succeeds, or all fail.)
Reimplemented from ArBaseLocalizationTask. |
|
||||||||||||||||||||
|
instead of values previously configured Attempt to localize the robot in the most likely home position: first it checks the robot's current pose and then checks all of the home positions in the map. The position with the highest score is then used. Call this function after the localization thread has been initialized but needs to be reset, or an initial localization (i.e. at program start up) is needed. This function blocks while the localization takes place, and returns after it either succeeds (Either localization at a home position succeeds, or all fail.)
|
|
||||||||||||||||
|
Try initial localization at each home point at the map, and set the robot pose to the point with best score, using given parameter values instead of values previously configured.
|
|
|
Request that the task later localize the robot at a map home \ position, then return immediately. Initiate background localization of the robot at the first home pose as defined in the Aria Map. Call this function after the localization thread has been initialized, and needs to be reset, or an initial localization (e.g. at program start) needs to be performed. This function moves the robot to the first home point in the map, and requests that the localization thread perform a new localization, then returns immediately The localization thread will then later attept to localize, starting at the home point.
MPL this can't know the score yet... so it just has to set it and continue with life |
|
||||||||||||||||||||||||||||||||||||||||
|
Localization function mainly for initialization of robot at given pose. Perform an initial map localization. This function is meant to find a robot in the map without motion. The error parameters fed to the localization are temporary and will be reset to the old values after the localization. This is mostly for internal use, or to do a localization after forcing a change in robot pose with alternative values for parameters given (used instead of values from ArConfig).
Interpolating the pose at any given time. |
|
||||||||||||||||||||
|
Function used to do the localization after motion (normally called automatically by the background task). This is the actual function doing the Monte Carlo Markov Localization during most of the time once the localization is initialized and the robot is moving. This function calls the appropriate functions in the ArRobotPoseSamples to compute the most likely pose given a current robot pose and the sensor reading. Interpolating the pose at any given time. |
|
|
Function for the things to do if map changes. Things to do if map changes. |
|
|
Read the Map data from ArMap. Read the map given the Aria map.
|
|
|
Read the Map data from a map file. Read the map given the file name.
|
|
|
Needed if the params are changed or loaded again. A function to setup the laser if it wasnt connected first time around.
|
|
|
Removes a callback. Removes a FailedLocalizationCB, see addFailedLocalizationCB for details.
|
|
|
The sensor interpretation callback. Called every 100msec. Updates the true current robot pose. Called every 100msec from ArRobot. |
|
|
Function used to run the task as a thread. The main loop for the background localization thread. |
|
|
Saves all parameter values from ArConfig to the given file.
|
|
|
Save samples for backup. Backup samples before they are resampled. Resampling usually flattens the probability distribution to a single location.
|
|
|
Get the laser buffer into data structure. Moves the laser range buffer into the robot and laser class.
|
|
||||||||||||
|
Convert the laser data to x and y coord array. Converts the range points into X and Y coord arrays.
|
|
|
Set the flags and call the right callbacks when loca fails ntimes. One stop for all failed localization in runThread. |
|
||||||||||||||||||||
|
Sets the force update parameters. Sets new localization parameters used after an pose update is forced by forceUpdatePose().
|
|
||||||||||||||||||||||||||||||||
|
Set all the parameters for localization. Sets all error parameters needed to do the MCL localization.
|
|
||||||||||||
|
Set motion error params. Sets all error parameters needed to do the MCL localization. [Kr, Kt, Kd] treated as a vector.
|
|
||||||||||||||||
|
Used to set the robot pose usually at the start of localization. This one with a spread around the set pose. Reimplemented from ArBaseLocalizationTask. |
1.4.0