View Single Post
  #4   Spotlight this post!  
Unread 02-04-2011, 22:43
Dacilndak's Avatar
Dacilndak Dacilndak is offline
Matt'); DROP TABLE Users; --
AKA: Matthew Haney
FRC #3729 (Red Knights)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Denver, Colorado
Posts: 12
Dacilndak is an unknown quantity at this point
Re: Switching Drive System While Driving

Well, you could do something like

Code:
if (joystick1.GetZ() < 1.0 && joystick1.GetZ() >= 0.33)
{
	// tank drive
}
else if (joystick1.GetZ() < 0.33 && joystick1.GetZ() >= -0.33)
{
	// arcade drive
}
else // if (joystick1.GetZ() < -0.33 && joystick1.GetZ() >= -1.0)
{
	// holonomic drive (?) ... whatever else
}
Ideally, then, in the middle of driving you could turn the Z wheel (towards the bottom of the joystick closest to you, like davidthefat said), thus switching drive modes.

I wouldn't recommend using buttons to switch drive modes, as the change in speed can be sudden and you could tear up your drivetrain if the driver isn't careful and/or you aren't ramping your joystick inputs.
__________________
Team 3729 - Raiders - Programming Team Co-Captain
2011 Colorado Regional Semifinalist
2011 Colorado Regional Rookie All-Star Award
2011 Colorado Regional Highest Rookie Seed Award

Last edited by Dacilndak : 02-04-2011 at 22:45. Reason: Clarification.
Reply With Quote