|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Custom RobotDrive
Hi CD, I was wondering how to make a new class that implements the obejcts and methods from the RobotDrive. Right now all the code, which runs works fine, is all in one file. Which is not very neat so I am trying to create seperate classes for everything such as the arm ,etc. Since we used mecanum we had to invert the motors and set the pwm channels and everything which took up a lot of space, so, I want to make something like this: (just as an example)
DriveTrainMecanum DriveSystem = new DriveTrainMecanum(1,2,3,4); In which DriveTrainMecanum implements all the methods and objects from RobotDrive but it also does the inverting of the motors and everything else. This is what i have so far but its saying "no suitable constructor" :S How do i fix this: This is what i have written so far: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.wpi.first.wpilibj.templates; import edu.wpi.first.wpilibj.RobotDrive; import edu.wpi.first.wpilibj.Jaguar; import edu.wpi.first.wpilibj.SimpleRobot; public class DriveTrain extends RobotDrive { //This is going to be set by the user but iam just making it for now Jaguar frontLeft = new Jaguar(1); Jaguar frontRight = new Jaguar(2); Jaguar rearLeft = new Jaguar(3); Jaguar rearRight = new Jaguar(4); public DriveTrainMecanum(int cone, int ctwo, int cthree, int cfour){ } } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|