|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Custom RobotDrive
When subclassing you need to call a super constructor with the proper arguments. This has a few impacts. First of all, in your constructor, you need to call super(cone, ctwo, cthree, cfour). You should also not need your own instance variables to keep track of those jaguars, since RobotDrive already does.
If my train of thought was a little confusing let me know. Here is how I would modify the code. /* * 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 { public DriveTrainMecanum(int cone, int ctwo, int cthree, int cfour){ super(cone, ctwo, cthree, cfour); } } |
|
#2
|
||||
|
||||
|
Re: Custom RobotDrive
What do you mean by "super constructor"?
|
|
#3
|
||||
|
||||
|
Re: Custom RobotDrive
|
|
#4
|
|||
|
|||
|
Re: Custom RobotDrive
Personally, I always just deal with the PWM class. I don't even bother with anything higher level than that. It just simplifies things by writing everything from scratch.
|
|
#5
|
|||
|
|||
|
Re: Custom RobotDrive
Quote:
Using the PWM class is the least simple way to control your robot drive base. Joe |
|
#6
|
||||
|
||||
|
Re: Custom RobotDrive
Quote:
|
|
#7
|
||||
|
||||
|
Re: Custom RobotDrive
But what about the rest of the programming team? |
|
#8
|
|||
|
|||
|
Re: Custom RobotDrive
Comments, comments, comments. Just like how the rest of the world does it.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|