LogoLogo
v1.1.0
v1.1.0
  • Welcome
  • Installation
  • Features
    • Hardware
      • Motors
    • Gamepad
    • Drivebases
    • Geometry
    • Controllers
    • Computer Vision
    • Utility Functions
  • Kinematics
    • Odometry
    • WPILib Kinematics
      • Differential Drive Kinematics
      • Differential Drive Odometry
      • Swerve Drive Kinematics
      • Swerve Drive Odometry
      • Mecanum Drive Kinematics
      • Mecanum Drive Odometry
  • Pathing
    • Pure Pursuit
    • Trajectory
      • Trajectory Generation
      • Trajectory Constraints
      • Manipulating Trajectories
      • Transforming Trajectories
      • Ramsete Controller
  • Command Base
    • Command System
      • Subsystems
      • Command
      • Command Groups
      • Command Scheduler
      • Binding Commands to Triggers
      • Robot and CommandOpMode
    • Old Commands
  • Support FTCLib
  • Additional Reading
Powered by GitBook
On this page
  • External Encoders
  • Gyro Extensions
  • Sensors
  • Servos

Was this helpful?

  1. Features

Hardware

package com.arcrobotics.ftclib.hardware

PreviousInstallationNextMotors

Last updated 4 years ago

Was this helpful?

Each hardware device in FTCLib is based on the HardwareDevice interface. This comes with two methods inherited by every device:

  • disable(): disables the device

  • getDeviceType(): returns a String characterization of the device

FTCLib offers a lot of hardware devices that can be implemented or customized into your program. The best advice we can give to users is to take a look at the in the FTCLib repository. Here is the list of devices we currently have available (not including motors):

External Encoders

An external encoder is one that does not come built-in with the motor being used. For example, this could be a . There is an abstract class that has the following methods;

  • getCounts(): returns the encoder count

  • syncEncoder(): synchronizes the recorded counts with the current count

  • resetEncoder(): resets the encoder value

We currently have a sample implementation that can be found in the class.

Gyro Extensions

The GyroEx class is an extended gyro that allows users to add more configurable methods and possible control to their gyro. An example would be creating a ModernRoboticsGyro class. The abstract class has the following methods:

  • init(): initializes the gyro and sets the current direction to the 0 heading

  • getHeading(): returns the heading of the robot compared to the last reset

  • getAbsoluteHeading(): returns the absolute heading relative to the initial direction

  • getAngles(): returns the x, y, and z orientation of the gyro. This is functionally the same as yaw, pitch, and roll.

  • getRotation2d(): transforms the heading into a Rotation2d object

  • reset(): applies an offset so that getHeading() returns the 0 position

Sensors

There are a few sensors that are offered in FTCLib:

The SensorColor class is just an extension for the ColorSensor class that is in the SDK.

SensorDistance and SensorDistanceEx are interfaces for creating custom distance sensors if desired. An implementation of the SensorDistanceEx interface is SensorRevTOFDistance which utilizes the time-of-flight mechanic to track distance.

The RevColorSensorV3 is a combination of a TOF sensor and a color sensor.

Servos

A useful implementation of this is the class for the built-in imu on your REV hub.

&

The interface allows for more methods and actions than the normal servo class in the SDK. You can change the position of the servo relative to the last position or set it to an absolute position. You can either specify a position within the range of the servo's motion or have it rotate in degrees.

An example implementation of this can be found in the class.

hardware package
REV Through Bore Encoder
JSTEncoder
RevIMU
SensorColor
SensorDistance
SensorDistanceEx
SensorRevTOFDistance
RevColorSensorV3
ServoEx
SimpleServo