/*
MobileRobots Advanced Robotics Navigation and Localization (ARNL)
Version 1.7.1

Copyright (C) 2004, 2005 ActivMedia Robotics LLC
Copyright (C) 2006, 2007, 2008, 2009 MobileRobots Inc.

All Rights Reserved.

MobileRobots Inc does not make any representations about the
suitability of this software for any purpose.  It is provided "as is"
without express or implied warranty.

The license for this software is distributed as LICENSE.txt in the top
level directory.

robots@mobilerobots.com
MobileRobots
10 Columbia Drive
Amherst, NH 03031
800-639-9481

*/
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.29
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.mobilerobots.BaseArnl;

  import com.mobilerobots.Aria.*;
  import com.mobilerobots.ArNetworking.*;

public class ArBaseLocalizationTask extends ArASyncTask {
  private long swigCPtr;

  /* for internal use by swig only */
  public ArBaseLocalizationTask(long cPtr, boolean cMemoryOwn) {
    super(BaseArnlJavaJNI.SWIGArBaseLocalizationTaskUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  /* for internal use by swig only */
  public static long getCPtr(ArBaseLocalizationTask obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      BaseArnlJavaJNI.delete_ArBaseLocalizationTask(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  public boolean findLocalizationMeanVar(ArPose mean, SWIGTYPE_p_ArMatrix var) {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_findLocalizationMeanVar(swigCPtr, ArPose.getCPtr(mean), SWIGTYPE_p_ArMatrix.getCPtr(var));
  }

  public void setCorrectRobotFlag(boolean f) {
    BaseArnlJavaJNI.ArBaseLocalizationTask_setCorrectRobotFlag(swigCPtr, f);
  }

  public void setRobotPose(ArPose pose, ArPose spread, int nSam) {
    BaseArnlJavaJNI.ArBaseLocalizationTask_setRobotPose__SWIG_0(swigCPtr, ArPose.getCPtr(pose), ArPose.getCPtr(spread), nSam);
  }

  public void setRobotPose(ArPose pose, ArPose spread) {
    BaseArnlJavaJNI.ArBaseLocalizationTask_setRobotPose__SWIG_1(swigCPtr, ArPose.getCPtr(pose), ArPose.getCPtr(spread));
  }

  public void setRobotPose(ArPose pose) {
    BaseArnlJavaJNI.ArBaseLocalizationTask_setRobotPose__SWIG_2(swigCPtr, ArPose.getCPtr(pose));
  }

  public boolean getRobotIsLostFlag() {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_getRobotIsLostFlag(swigCPtr);
  }

  public ArPose getRobotHome() {
    return new ArPose(BaseArnlJavaJNI.ArBaseLocalizationTask_getRobotHome(swigCPtr), true);
  }

  public SWIGTYPE_p_ArRetFunctorTArPose_t getRobotHomeCallback() {
    long cPtr = BaseArnlJavaJNI.ArBaseLocalizationTask_getRobotHomeCallback(swigCPtr);
    return (cPtr == 0) ? null : new SWIGTYPE_p_ArRetFunctorTArPose_t(cPtr, false);
  }

  public ArPose getHomePose() {
    return new ArPose(BaseArnlJavaJNI.ArBaseLocalizationTask_getHomePose(swigCPtr), true);
  }

  public boolean localizeRobotAtHomeBlocking(double distSpread, double angleSpread) {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_localizeRobotAtHomeBlocking__SWIG_0(swigCPtr, distSpread, angleSpread);
  }

  public boolean localizeRobotAtHomeBlocking() {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_localizeRobotAtHomeBlocking__SWIG_1(swigCPtr);
  }

  public ArPoseList getCurrentSamplePoses() {
    return new ArPoseList(BaseArnlJavaJNI.ArBaseLocalizationTask_getCurrentSamplePoses(swigCPtr), true);
  }

  public ArBaseLocalizationTask.LocalizationState getState() {
    return ArBaseLocalizationTask.LocalizationState.swigToEnum(BaseArnlJavaJNI.ArBaseLocalizationTask_getState(swigCPtr));
  }

  public double getLocalizationScore() {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_getLocalizationScore(swigCPtr);
  }

  public double getLocalizationThreshold() {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_getLocalizationThreshold(swigCPtr);
  }

  public boolean checkLocalizationIdle() {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_checkLocalizationIdle(swigCPtr);
  }

  public void setLocalizationIdle(boolean f) {
    BaseArnlJavaJNI.ArBaseLocalizationTask_setLocalizationIdle(swigCPtr, f);
  }

  public void setLocalizationThreshold(double t) {
    BaseArnlJavaJNI.ArBaseLocalizationTask_setLocalizationThreshold(swigCPtr, t);
  }

  public ArTransform getEncoderToLocalizationTransform() {
    return new ArTransform(BaseArnlJavaJNI.ArBaseLocalizationTask_getEncoderToLocalizationTransform(swigCPtr), true);
  }

  public String getName() {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_getName(swigCPtr);
  }

  public int getPoseInterpPosition(ArTime timeStamp, ArPose position) {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_getPoseInterpPosition(swigCPtr, ArTime.getCPtr(timeStamp), ArPose.getCPtr(position));
  }

  public SWIGTYPE_p_ArRetFunctor2Tint_ArTime_ArPose_p_t getPoseInterpPositionCallback() {
    long cPtr = BaseArnlJavaJNI.ArBaseLocalizationTask_getPoseInterpPositionCallback(swigCPtr);
    return (cPtr == 0) ? null : new SWIGTYPE_p_ArRetFunctor2Tint_ArTime_ArPose_p_t(cPtr, false);
  }

  public boolean convertLLA2RobotCoords(double lat, double lon, double alt, SWIGTYPE_p_double ea, SWIGTYPE_p_double no, SWIGTYPE_p_double up) {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_convertLLA2RobotCoords(swigCPtr, lat, lon, alt, SWIGTYPE_p_double.getCPtr(ea), SWIGTYPE_p_double.getCPtr(no), SWIGTYPE_p_double.getCPtr(up));
  }

  public boolean convertRobot2LLACoords(double ea, double no, double up, SWIGTYPE_p_double lat, SWIGTYPE_p_double lon, SWIGTYPE_p_double alt) {
    return BaseArnlJavaJNI.ArBaseLocalizationTask_convertRobot2LLACoords(swigCPtr, ea, no, up, SWIGTYPE_p_double.getCPtr(lat), SWIGTYPE_p_double.getCPtr(lon), SWIGTYPE_p_double.getCPtr(alt));
  }

  public final static class LocalizationState {
    public final static LocalizationState NOT_INITIALIZED = new LocalizationState("NOT_INITIALIZED");
    public final static LocalizationState LOCALIZATION_FAILED = new LocalizationState("LOCALIZATION_FAILED");
    public final static LocalizationState LOCALIZATION_SUCCESS = new LocalizationState("LOCALIZATION_SUCCESS");
    public final static LocalizationState LOCALIZATION_INIT_COMPUTING = new LocalizationState("LOCALIZATION_INIT_COMPUTING");
    public final static LocalizationState LOCALIZATION_MOVE_COMPUTING = new LocalizationState("LOCALIZATION_MOVE_COMPUTING");
    public final static LocalizationState LOCALIZATION_IDLE = new LocalizationState("LOCALIZATION_IDLE");
    public final static LocalizationState INVALID = new LocalizationState("INVALID");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static LocalizationState swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + LocalizationState.class + " with value " + swigValue);
    }

    private LocalizationState(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private LocalizationState(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private LocalizationState(String swigName, LocalizationState swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static LocalizationState[] swigValues = { NOT_INITIALIZED, LOCALIZATION_FAILED, LOCALIZATION_SUCCESS, LOCALIZATION_INIT_COMPUTING, LOCALIZATION_MOVE_COMPUTING, LOCALIZATION_IDLE, INVALID };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
