2020 Wpilib Open House Rishab Veldur 12142019 Whats
2020 Wpilib Open House Rishab Veldur -- 12/14/2019
What's new in 2020? ★ ★ ★ New Command Based Framework New FRC-Docs Simulations Odometry and Kinematics Trajectory generation and following* Quality of life changes
New Command Framework ★ Command Subsystem ○ Now interfaces ○ Command. Base and Subsystem. Base are still provided ○ init. Default. Command changed to set. Default. Command ★ Replacement of Command Group ○ ○ ★ Sequential. Command. Group Parallel. Race. Group Parallel. Deadline. Group Changes to Scheduler ○ Renamed to Command. Scheduler ○ Interruptions are the responsibility of Scheduler ○ Actions can be passed to the scheduler
New FRC docs ★ Rehaul on documentation of wpilib ○ ○ ○ ★ Fixed mistakes All new features documented Community driven https: //docs. wpilib. org/
Robot Simulation ★ Ability to simulate robot code on desktop ○ ○ ○ ★ Run through VS code gradle command outside VS code Robot. is. Real() Simulation GUI
Now to the fun stuff
Required hardware ★ ★ ★ Motors and Motor Controllers Encoders (duh) ○ ○ Resolution built in encoders work fine ○ IMU ○ Standard gyros Gyro ■ Nav. X ■ Pigeon
Geometry definitions. . . ★ Pose 2 d Rotation 2 d ○ ○ ○ ★ ★ Contains an X, Y, and Rotation 2 d Radians Rotation 2 d. from. Degrees() Counter Clockwise positive Translation 2 d Twist 2 d Alliance Wall ○ ★ Y X
Creating a path to follow. . . Path Trajectory Pose 3 Pose 2 Pose 1 t = 1. 6 v = 1. 4 m/s t=1 s v = 3 m/s t = 0. 2 s v = 0. 5 m/s
Creating a path to follow ★ ★ How can we mathematically create a path from waypoints we specify? ○ Splines! ○ ○ Polynomials of some degree Quintic and Cubic Splines are available for us ○ Waypoints Hermite Splines Trajectory. Generator class Think about your Timed. Robot loop
Pathfinder throwback… ★ Anyone used Jaci’s pathfinder? ○ ○ ★ Finds length without integrals! ○ ★ Slow! Fast! You don’t have to do any math
Trajectory Constraints ★ ★ ★ Constraints to construct a trajectory ○ ○ ○ Max Velocity Max Acceleration Centripetal Acceleration Constraint Differential Drive Voltage Constraint Differential Drive Kinematics Constraint ○ ○ Pick reasonable velocities and accelerations Impact on time Be smart Trajectory. Config class
Pathweaver ★ GUI for visualizing paths ○ JSON integration ■ Points, Constraints, etc
Following a path. . .
Differential Drive Kinematics ★ ★ Forward Kinematics ○ Solves individual sides to total chassis speed ○ Solves chassis to individual sides ○ ○ f You do not have to do any math! ○ ○ Swerve Mecanum Inverse Kinematics Track width Differential. Drive. Kinematics class
Odometry ★ ★ ★ Position on the field ○ ○ Encoders Gyro ○ ○ Swerve Mecanum Differential. Drive. Odometry Global Position
Ramsete Controller ★ ★ ★ Unicycle controller ○ ○ nonlinear time-varying feedback controller Differential Drive ○ ○ d 1 ○ Time of trajectory matters ○ ○ Beta (2. 0) larger values make convergence more aggressive Zeta (0. 7) larger values provide more dampening Global Position Controller Corrective commands Uses kinematics to translate to individual sides of drive train Ramsete Constants
Velocity Control on Individual Sides ★ Simple PIDController ○ ○ ★ P and D only New PIDController class ■ Error = Desired Velocity - Current Velocity ■ encoder. get. Rate() ● Distance per pulse ● get. Velocity() of other motor controllers Feedforward + PIDController model ○ ○ k. S k. V k. A Characterization tools Simple. Motor. Feed. Forward
Ramsete Command ★ Command ○ ○ ○ ○ ○ Trajectory Odometry pose (supplier) Ramsete Controller Feedforwards Kinematics Velocities (supplier) PIDControllers Set voltage <Bi Consumer> Requirements
Safety ★ ★ Expect everything! ○ ○ ○ Alert your surroundings Robots are big and move fast! Safety glasses are important! ○ ○ ○ Start slow Limit acceleration The real world sucks… Initial Trajectory ■ Friction and air resistance exist : )
Constants ★ ★ ★ Tune the p on each side first All constants from characterization are baselines Plot desired vs actual ○ x and y
Putting it all together
Questions? Get out there and get moving!
- Slides: 23