View Single Post
  #2   Spotlight this post!  
Unread 07-03-2009, 00:11
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,050
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Traction Control in Autonomous?

Something that we've been doing quite successfully is something to this effect:

Code:
double start = GetTime();

while (IsAutonomous())
{
	double time_elapsed = GetTime() - start;

	if (time_elaped < 0.5)
	{
		// time period of 0-0.5 seconds
		speed = .25;
		angle = some_N;
		rotation = some_N;
	}
	else if (time_elapsed < 1)
	{
		// time period of 0.5 to 1 seconds
		speed = .5;
		angle = some_N;
		rotation = some_N;
	}

	// ... and so on until 15 seconds
	
	myDrive.Drive( speed, rotation );
}
Doing it this way allows you to manually say what speed you want it to go at any given point, and as long as you ramp it up slowly you should be good. Clearly having real traction control would be better, but this works well enough for us and gets us out of the reach of the human player.

As a bonus, we use the gyro to get the angle of the robot, and some things that can set the rotation parameter of our bot based on our current angle relative to the field so we can say "point the nose in this direction". Of course we have swerve/crab drive the so rotation stuff is a bit easier to implement since we can specify a heading and a rotation value.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote