View Single Post
  #38   Spotlight this post!  
Unread 13-04-2010, 09:59
buchanan buchanan is offline
Registered User
FRC #2077 (Laser Robotics)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2007
Location: Wales, WI
Posts: 66
buchanan is just really nicebuchanan is just really nicebuchanan is just really nicebuchanan is just really nice
Re: Mecanum or Swerve?

Quote:
Originally Posted by artdutra04 View Post
Programming "absolute" mecanum/swerve, as in you push the joystick left and no matter what way the robot is oriented it moves left relative to how the drivers are facing, is more difficult. This latter case involves the use of a gyro to track current robot heading, and a lot of trig functions for each of the wheel outputs.
More difficult, but not all that much so for a mecanum/holonomic. 2077's field-relative stick code looks like:
Code:
double x = stick3.getX();
double y = stick3.getY();
double angle = (gyro_.getAngle()+180)/180.*Math.PI;
stick3.setX(x * Math.cos(angle) - y * Math.sin(angle));
stick3.setY(x * Math.sin(angle) + y * Math.cos(angle));
driveTrain_.drive(stick3, stick2.getX());
It's interesting to listen to the emerging consensus (with which I don't disagree) that a swerve drive wins virtually all the pure physics comparisons, but comes off worst or near-worst in:
  • Hardware Complexity
  • Weight
  • Cost
  • Reliability
  • Development Time
  • Software Complexity
In other words, practically every engineering factor other than pure physics. Don't forget making a robot is engineering, of which theoretical physics is a part, but only a part.