Log in

View Full Version : TalonSRX invert?


FRC2501
05-02-2015, 09:41
We program in C++ and I was wondering if there is a way to invert TalonSRXs in programming because out Omni drive needs both right motors to be inverted or it acts weird

Ty Tremblay
05-02-2015, 10:14
I wouldn't recommend inverting the speed controllers. Just make sure your math takes into account the the fact that your right motors need to rotate in the opposite direction and invert the signal you're sending it.

LeftMotor.set(1)

RightMotor.set(-1)

Alan Anderson
05-02-2015, 10:41
We program in C++ and I was wondering if there is a way to invert TalonSRXs in programming because out Omni drive needs both right motors to be inverted or it acts weird

I think you're looking for the setInvertedMotor() function. It works with any Robot Drive object regardless of what kind of speed controller you have on your drivebase.

FRC2501
05-02-2015, 16:29
I think you're looking for the setInvertedMotor() function. It works with any Robot Drive object regardless of what kind of speed controller you have on your drivebase.

The SetInvertedMotor() function seems to be broken to me, it doesn't like either driveSystem.SetInvertedMotor(kFrontRightMotor, true); or driveSystem.SetInvertedMotor(rightFrontDriveTalon, true);

Ether
05-02-2015, 16:45
The SetInvertedMotor() function seems to be broken to me, it doesn't like either driveSystem.SetInvertedMotor(kFrontRightMotor, true); or driveSystem.SetInvertedMotor(rightFrontDriveTalon, true);

Lowercase "s"? setInvertedMotor

FRC2501
05-02-2015, 17:07
Lowercase "s"? setInvertedMotor

I looked in the RobotDrive.h and it is a capital S, the error I get is that it isn't a Motor Type

baumgartensam
05-02-2015, 17:25
I looked in the RobotDrive.h and it is a capital S, the error I get is that it isn't a Motor Type

A number of the method names are capitalized. It drives me crazy (pun intended) as the Java naming convention is a lowercased first letter and then the rest of the word is camel cased. The CANTalonSRX class has a few of these incorrectly named methods as well but it's a fairly minor issue in the scheme of things.

RyanCahoon
05-02-2015, 18:03
The SetInvertedMotor() function seems to be broken to me, it doesn't like either driveSystem.SetInvertedMotor(kFrontRightMotor, true); or driveSystem.SetInvertedMotor(rightFrontDriveTalon, true);

Unless you have using statements, I believe you need to qualify the constant names:
driveSystem.SetInvertedMotor(RobotDrive::kFrontRig htMotor, true);

FRC2501
05-02-2015, 18:26
Unless you have using statements, I believe you need to qualify the constant names:
driveSystem.SetInvertedMotor(RobotDrive::kFrontRig htMotor, true);

Thanks! It now works