So, I am a main fabricator on our comp-bot, and and I have almost no clue how to code, can someone explain to me how to get our bot to do Arcade Drive. I need to use it for an experiment regarding our weight distribution and our programmers are busy doing other stuff so I thought that in the mean time while everyone is working I would learn to code. I thought I should start with basic drive code. So, that is what I am asking help for. I am going to start from scratch they have their code saved so when I’m done with my experiment they can upload their code to the robot and do what they have to do. I just want to know how to code a drive system. If someone could help me with this it would ge greatly appreciated.
Edit: it is a KOP drive train 6 wheel long chassis with the KOP gearboxes 2 sims for one side
Edit 2: I am looking for a drive system that has back and forth on one stick or axis and lefttand right on the other. Arcade has many different types LMAO.
In vscode, command pallette (Ctrl shift p) and something about a new robot program.
Template, java, timed skeleton advanced.
Save to a different folder than main code for game.
Import motor controllers (Victor, spark, or talon), Joystick, and DifferentialDrive similar to how TimedRobot is imported at top of code.
In first braces, declare motor controllers objects and a differential drive. Basically:
// Imports out here
public class Robot extends TimedRobot() {
Victor rightF; // Victor for example
Victor rightR;
Victor leftF;
Victor leftR
DifferentialDrive d;
Joystick s;
public void robotInit() {
rightF = new Victor(0); //pwm ports
//Repeat for others
//Create motor controllers groups (I've never done this part before. should be easy)
d = new DifferentialDrive(//groups...
s = new Joystick(0);
public void teleopPeriodic() {
d.arcadeDrive(s.getRawAxis(1), s.getRawAxis(2));
Make sure you read the appropriate documentation (and don’t skip sections!). If there’s anything you don’t understand, feel free to ask and we’ll attempt to explain it to you or at least point you toward the appropriate resource.
Documentation for these controllers are great! Tons of examples, if you would like more some including command based this github has tons of different examples.