View Single Post
  #5   Spotlight this post!  
Unread 02-23-2016, 05:51 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: RobotDrive class in WPILibJ

Thanks Andrew. In the past, I have seen a lot of students wrote code that did trial and error. When the motors did not go the way they wished, they negate the power. For example, I've seen students doing tankDrive(0.5, -0.5) or tankDrive(-0.5, -0.5) just to go forward. They said as long as it works, it shouldn't matter. But eventually, the code became very confusing. So when I taught my students, I always tell them to test each individual motor by setting positive power and make sure they go forward by doing setInverted on motors that spin in the wrong direction. And in theory when all motors are going forward with positive power, there should never be negative value in any kind of drive: tankDrive, arcadeDrive and mecanumDrive, when going forward. If you have to negate the power, somebody screwed up. That's why I think RobotDrive class is wrong.
__________________
Reply With Quote