|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Programming Mecanum
Do you need to set the motors on one side inverted? When we first just tried we noticed the wheels on one side were reversed and we needed to add:
setInvertedMotor(RobotDrive.MotorType motor, boolean isInverted) |
|
#2
|
||||
|
||||
|
Re: Programming Mecanum
Can someone please post the java scource code for the holonomicDrive Function?
|
|
#3
|
|||
|
|||
|
Re: Programming Mecanum
Quote:
Code:
public void holonomicDrive(double magnitude, double direction, double rotation) {
double frontLeftSpeed, rearLeftSpeed, frontRightSpeed, rearRightSpeed;
magnitude = limit(magnitude);
double cosD = Math.cos((direction + 45.0) * 3.14159 / 180.0);
double sinD = Math.cos((direction - 45.0) * 3.14159 / 180.0);
frontLeftSpeed = limit((sinD * magnitude + rotation));
rearLeftSpeed = limit((cosD * magnitude + rotation));
frontRightSpeed = limit((cosD * magnitude - rotation));
rearRightSpeed = limit((sinD * magnitude - rotation));
m_frontLeftMotor.set(frontLeftSpeed * m_invertedMotors[MotorType.kFrontLeft_val]);
m_frontRightMotor.set(frontRightSpeed * m_invertedMotors[MotorType.kFrontRight_val]);
m_rearLeftMotor.set(rearLeftSpeed * m_invertedMotors[MotorType.kRearLeft_val]);
m_rearRightMotor.set(rearRightSpeed * m_invertedMotors[MotorType.kRearRight_val]);
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mecanum Programming Help | Mars | Programming | 8 | 27-02-2008 15:41 |
| Bizarre Mecanum Programming Bug | manderson5192 | Programming | 10 | 08-02-2008 22:11 |
| Mecanum drivetrain programming problems | Mr. Freeman | Programming | 4 | 21-03-2007 17:11 |
| mecanum programming | mrmummert | Programming | 27 | 28-01-2007 13:45 |
| programming motors with programming kit | BorisTheBlade | FIRST Tech Challenge | 4 | 01-11-2005 19:03 |