|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Inverse Motors?
First time working with the WPIlib, not exactly sure how to inverse the motors when using the simple Arcade drive. Any ideas?
|
|
#2
|
|||
|
|||
|
Re: Inverse Motors?
Use the RobotDrive::SetInvertedMotor(RobotDrive::MotorType , bool) function.
Something like: Code:
//joystick - fill in usb port number
Joystick joy;
//declare jags - fill in ports in constructors
Jaguar left_front, left_rear, right_front, right_rear;
//declare RobotDrive object
RobotDrive drive(left_front, left_rear, right_front, right_rear);
//set motor inversion
drive.SetInvertedMotor(RobotDrive::kFrontLeftMotor, false);
drive.SetInvertedMotor(RobotDrive::kFrontRightMotor, true);
drive.SetInvertedMotor(RobotDrive::kRearLeftMotor, false);
drive.SetInvertedMotor(RobotDrive::kRearRightMotor, true);
//drive
while (true) {
drive.ArcadeDrive(joy);
}
Last edited by rbmj : 16-02-2012 at 13:45. |
|
#3
|
|||
|
|||
|
Exactly what I needed, thanks! Now all I need to do is figure out why the Axis Camera isn't working.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|