nrg948 / nrgrobot2019 Goto Github PK
View Code? Open in Web Editor NEWNewport Robotic Group's code for FIRST FRC 2019 game: DEEP SPACE.
Newport Robotic Group's code for FIRST FRC 2019 game: DEEP SPACE.
We have a start on PathFinder/PathWeaver integration, but the code is commented out. To finish it out and get it a point where we can test it, we need to make some small changes, add a new command, FollowTrajectory
, and derive two classes from it: FollowPathWeaverFile
and FollowWaypoints
.
Drive.followTrajectoryInit
:Trajectory
parameter instead of a String
. The method signature should now be public void followTrajectoryInit(Trajectory trajectory)
.FollowTrajectory
command to load the PathWeaver-generated file.pathTrajectory
.FollowTrajectory
:Trajectory
object as a parameter and store it in a member variable named trajectory
.initialize
method will call the Drive.followTrajectoryInit
method passing trajectory
as its parameter,execute
method will call the Drive.followTrajectoryExecute
method.isFinished
method will return the result of the Drive.followTrajectoryIsFinished
method.end
method will call the Drive.followTrajectoryEnd
method.interrupted
method will call the end
method as usual.FollowPathWeaverFile
derived from FollowTrajectory
private static Trajectory LoadTrajectoryFromCsvFile(String filename)
method that loads the PathWeaver file, and creates and returns Trajectory
object (using the Drive.java
lines 110-111 that we removed previously) .String
parameter which is the name of a PathWeaver file that we'll create and place in the deploy
directory of the project.LoadTrajectoryFromCsvFile
passing the returned Trajectory
object to base class constructor (accessible through the super
keyword).FollowWaypoints
:private static Trajectory CreateTrajectory(Waypoint[] waypoints)
method that creates and returns a Trajectory
object from the array of jaci.pathfinder.Waypoint
object. See Pathfinder Java Wrapper for an example. We'll need to create constants for the time step, max velocity, max acceleration and max jerk parameters. Make a best guess now, and we'll work them out empirically with the robot later. Store the Trajectory
object in a trajectory
member variable.jaci.pathfinder.Waypoint
object.LoadTrajectoryFromCsvFile
passing the returned Trajectory
object to base class constructor (accessible through the super
keyword).FollowTrajectory
and attach them to buttons or put them to the SmartDashboard.We've calibrated the drive encoders to inches, so keep that in mind when creating the Waypoint
array and PathWeaver files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.