Package ftclib.sensor
Class FtcSparkFunOtos
java.lang.Object
ftclib.sensor.FtcSparkFunOtos
- All Implemented Interfaces:
TrcDriveBaseOdometry
This class implements a DriveBase Odometry device using the SparkFun Optical Tracking Odometry Sensor.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final com.qualcomm.hardware.sparkfun.SparkFunOTOSfinal TrcDbgTrace -
Constructor Summary
ConstructorsConstructorDescriptionFtcSparkFunOtos(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, FtcSparkFunOtos.Config config) Constructor: Creates an instance of the object.FtcSparkFunOtos(String instanceName) Constructor: Creates an instance of the object with default configuration.FtcSparkFunOtos(String instanceName, FtcSparkFunOtos.Config config) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the DriveBase position.This method returns the DriveBase velocity.voidreset()This method resets the DriveBase position.voidsetPosition(TrcPose2D pose) This method sets the DriveBase position.toString()This method returns the instance name.voidThis method is called once at the beginning of the INPUT_TASK loop.
-
Field Details
-
tracer
-
instanceName
-
otos
private final com.qualcomm.hardware.sparkfun.SparkFunOTOS otos
-
-
Constructor Details
-
FtcSparkFunOtos
public FtcSparkFunOtos(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, FtcSparkFunOtos.Config config) Constructor: Creates an instance of the object.- Parameters:
hardwareMap- specifies the global hardware map.instanceName- specifies the instance name.config- specifies the sensor configuration.
-
FtcSparkFunOtos
Constructor: Creates an instance of the object.- Parameters:
instanceName- specifies the instance name.config- specifies the sensor configuration.
-
FtcSparkFunOtos
Constructor: Creates an instance of the object with default configuration.- Parameters:
instanceName- specifies the instance name.
-
-
Method Details
-
toString
This method returns the instance name. -
updateCache
public void updateCache()This method is called once at the beginning of the INPUT_TASK loop. Odometry device can update their cache at this time.- Specified by:
updateCachein interfaceTrcDriveBaseOdometry
-
reset
public void reset()This method resets the DriveBase position.- Specified by:
resetin interfaceTrcDriveBaseOdometry
-
getPosition
This method returns the DriveBase position.- Specified by:
getPositionin interfaceTrcDriveBaseOdometry- Returns:
- DriveBase position.
-
setPosition
This method sets the DriveBase position.- Specified by:
setPositionin interfaceTrcDriveBaseOdometry- Parameters:
pose- specifies the DriveBase position.
-
getVelocity
This method returns the DriveBase velocity.- Specified by:
getVelocityin interfaceTrcDriveBaseOdometry- Returns:
- DriveBase velocity.
-