Skip to content

jazonshou/4253B-Change-Up-Late-Season

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

4253B Change Up Late Season Code

This repository contains the software VRC team 4253B used in the 2020-21 season, Change Up. We used VEX's proprietary coding software, VEXCode Pro, to program our software.

Code Highlights

We used 2 tracking wheels, to measure distance, and 1 inertial measurement unit (IMU), to measure rotation. The sensor inputs give feedback that can be used to calculate the robot's position during autonomous. This tracking algorithm allows us to have incredibly accurate movements that can dynamically adapt to outside influence.

See more regarding odometry here (Introduction to Position Tracking, VRC Team 5225A)

As powerful as odometry may seem, it is still good practice to maneuver the robot relative to field elements. With the help of computer vision, we can accurately turn towards target field elements without completely relying on our tracking wheel odometry. The turn algorithm uses PID for even more accurate movements.

PID essentially works by taking a mechanism's current state and comparing the state to the desired state. For example, with a drivetrain, the current location might be (0, 0) and the target location might be (5, 0). PID then computes the desired power the motors need to be at.

PID diagram

In VEX, the traditional approach to movement consists of point turns and lateral movement. While it may be simple, the approach is quite slow as you need to wait for PID to slow down in both turns and lateral movements. Thus, we created a custom algorithm that combines turns and lateral movements into smooth curves. Instead of turning and moving, the chassis moves in a smooth arc to get to its desired location. We attempted to achieve this result by combining the turn and lateral movement PID. Our implementation can be found in line 151 at the function moveToCurve.

A key element of Change Up is being able to index the right colored ball as fast as possible. We achieved this by using color sensors placed around the robot to provide feedback as to where and what color the ball(s) are. Then, we dynamically change the movement of the rollers to remove opponent balls from our robot and/or index our alliance's balls. Our implementation of this algorithm can be found on line 27 in the function autoIndex.

We experimented with the v5 Brain's screen with mini-projects such as creating a Pong game. The screen was especially useful in applications like our auton selector, making selecting autons much easier.

Installation

  1. Install VEXCode Pro here
  2. Download code:
Git Installed No Git Installed
Run git clone https://github.com/Yessir120/4253B-Change-Up-Late-Season.git in your terminal Click the green Code button and select Download ZIP
  1. Compile & download to v5 Brain
  2. Enjoy!

License

MIT

Releases

No releases published

Packages

No packages published