View Single Post
  #3   Spotlight this post!  
Unread 02-12-2013, 16:48
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
Re: Help with Test Robot program (NetBeans)

One thing I noticed that might affect your PWM outputs is that you are using the wrong constructor for RobotDrive. When you pass the RobotDrive constructor port numbers as the parameters, it creates internal instances of the Jaguar class for the speed controllers. Your code then creates Victors using the same PWM ports as the Jaguars that RobotDrive created:
Code:
driveTrain = new RobotDrive(2, 1);
leftVictor = new Victor(2);
rightVictor = new Victor(1);
Instead, you should create your Victors first, and then pass them to the RobotDrive constructor:
Code:
leftVictor = new Victor(2);
rightVictor = new Victor(1);
driveTrain = new RobotDrive(leftVictor, rightVictor);
Also, as opposed to using the watchdog, you may want to use the MotorSafety methods provided by the RobotDrive class.The RobotDrive#setSafetyEnabled() and RobotDrive#setExpiration() methods should provide similar functionality without using the global watchdog.
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)


Last edited by Domenic Rodriguez : 02-12-2013 at 16:56. Reason: Added info on MotorSafety methods
Reply With Quote