Teams FRC 6498's 2023 Robot code
2023's robot uses a basic arcade drive style drive system using the wiplib DifferentialDrive class
Simulation code for this years project is housed in the Simluation folder which itself is split into 2 parts
- DriveSim.java
- VisionSim.java
These files together calculate odometry and robot pose through 2 different methods -
- Simulated odometry using odometry data gathered from simulated motors (DriveSim.java)
- Simulated vision cameras using apriltag positions and Photonvision (VisionSim.java)
This class includes a constructor that takes in 1 motor on each side of the robot's drivetrain and creates two simulated Falcon500s along with their integrated encoders. The data from these encoders is taken from the falcons and passed into a DifferentialDriveOdometry object here
SimOdometry.update(
gyro.getRotation2d(),
Conversions.nativeUnitsToDistanceMeters(leftMotor.getSelectedSensorPosition()), /*update distance the left side of the robot has traveled*/
Conversions.nativeUnitsToDistanceMeters(rightMotor.getSelectedSensorPosition()) /*update distance the right side of the robot has traveled*/
);
this computes the position of the robot on the field using odometry input only.
This class is also responsible for moving the robot around the robot field during simulation.
This class takes an AprilTagFieldLayout and simulated PhotonVision enabled camera and computes the pose of the robot based on what the simulated robot camera can see.
(after instantiating both objects) Simpily call
SimVisionSystem visionSystem;
Pose2d robotPose;
and
visionSystem.processFrame(robotPose);
2023's robot uses 2 different methods to manipulate game pieces (cube and cone)
- cowcatcher
- extending arm with spinning intake
The cowcatcher is a very simple mechanism that allows the robot to push around game pieces on the floor. It is just a piece of thin plywood with a cone shape cut into it. This is intended to center the game piece. There are