View Single Post
  #4   Spotlight this post!  
Unread 29-02-2012, 13:09
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Programming Mecanum Wheels - 4 Victors

By default, the RobotDrive class will instantiate Jaguars as its motor controllers. If you are using Victors you need to explicitly instantiating them yourself and use the following constructor instead:
Code:
RobotDrive(SpeedController *frontLeftMotor,
           SpeedController *rearLeftMotor,
           SpeedController *frontRightMotor,
           SpeedController *rearRightMotor);
In other words:
Code:
class MyRobot: public SimpleRobot
{
    Victor leftFrontMotor;
    Victor leftRearMotor;
    Victor rightFrontMotor;
    Victor rightRearMotor;
    RobotDrive drive;
 
    MyRobot():
        leftFrontMotor(1),
        leftRearMotor(2),
        rightFrontMotor(3),
        rightRearMotor(4),
        drive(&leftFrontMotor, &leftRearMotor, &rightFrontMotor, &rightRearMotor)
    {
    }
    ....
}
__________________

Last edited by mikets : 29-02-2012 at 13:17.
Reply With Quote