View Single Post
  #6   Spotlight this post!  
Unread 18-01-2016, 18:49
slibert slibert is online now
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 343
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: NavX mxp - can it be used without mecanum wheels

Quote:
Originally Posted by Tparbotmail View Post
The question I have is can this work well with the other classes, like arcade.
The RobotDrive arcadeDrive(double moveValue, double rotateValue) method can be used. The rotateValue would be derived from the yaw value from the navX-MXP. Since rotateValue is in units of -1 to 1, this value should be acquired from a PID controller. The navX-MXP AHRS class implements the PIDSource interface. So you can pass the AHRS class instance into the constructor of your PIDController object. Then, whenever you want to call arcadeDrive(), you'd ask your PID controller for it's latest output value, and pass that as the rotateValue to arcadeDrive().

To rotate in place, the moveValue would be 0, the rotateValue would be the output from the PID controller.

To drive straight (or rotate while moving), the moveValue would be the speed to move ahead, and the rotateValue would be the output from the PID controller.
Reply With Quote