Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   TalonSRX invert? (http://www.chiefdelphi.com/forums/showthread.php?t=134015)

FRC2501 05-02-2015 09:41

TalonSRX invert?
 
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

Re: TalonSRX invert?
 
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

Re: TalonSRX invert?
 
Quote:

Originally Posted by FRC2501 (Post 1438667)
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

Re: TalonSRX invert?
 
Quote:

Originally Posted by Alan Anderson (Post 1438700)
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
Code:

driveSystem.SetInvertedMotor(kFrontRightMotor, true);
or
Code:

driveSystem.SetInvertedMotor(rightFrontDriveTalon, true);

Ether 05-02-2015 16:45

Re: TalonSRX invert?
 
Quote:

Originally Posted by FRC2501 (Post 1438878)
The SetInvertedMotor() function seems to be broken to me, it doesn't like either
Code:

driveSystem.SetInvertedMotor(kFrontRightMotor, true);
or
Code:

driveSystem.SetInvertedMotor(rightFrontDriveTalon, true);

Lowercase "s"? setInvertedMotor

FRC2501 05-02-2015 17:07

Re: TalonSRX invert?
 
Quote:

Originally Posted by Ether (Post 1438895)
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

Re: TalonSRX invert?
 
Quote:

Originally Posted by FRC2501 (Post 1438911)
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

Re: TalonSRX invert?
 
Quote:

Originally Posted by FRC2501 (Post 1438878)
The SetInvertedMotor() function seems to be broken to me, it doesn't like either
Code:

driveSystem.SetInvertedMotor(kFrontRightMotor, true);
or
Code:

driveSystem.SetInvertedMotor(rightFrontDriveTalon, true);

Unless you have using statements, I believe you need to qualify the constant names:
Code:

driveSystem.SetInvertedMotor(RobotDrive::kFrontRightMotor, true);

FRC2501 05-02-2015 18:26

Re: TalonSRX invert?
 
Quote:

Originally Posted by RyanCahoon (Post 1438949)
Unless you have using statements, I believe you need to qualify the constant names:
Code:

driveSystem.SetInvertedMotor(RobotDrive::kFrontRightMotor, true);

Thanks! It now works


All times are GMT -5. The time now is 01:42.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi