View Single Post
  #2   Spotlight this post!  
Unread 18-02-2015, 15:10
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: NavX Labview Programming Guide?

Field-oriented driving is as easy as wiring the yaw value to the Mecanum Drive function's gyro input. I think you will have to do your own "North" reset, by subtracting a saved offset whenever you need to use the yaw value, and storing the current yaw as the offset value when you want to reset it.

Rotating to a given heading and correcting for rotational drift are both accomplished by the same scheme: closed-loop control of direction. Use the NavX's yaw value as the process variable of a PID function, and have a desired heading as the control value. The output of the PID gets wired to the Mecanum Drive function's rotation input.

To permit manual control of rotation is simple. Whenever the driver is not calling for rotation, use the PID output. When the driver does want to rotate, use the joystick or gamepad axis value, and simultaneously copy the current yaw to be the desired heading so the robot will hold that direction when the driver releases the control.

I hope that is enough of a clue to get you going where you want to go. If you have specific questions on how to implement some of this, ask again with more detail.
Reply With Quote