|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Get Control Mode from Talon SRX
I have been looking through the methods and the documentation and for the life of me I cannot find where you can get the current control mode of a talon SRX. Does anyone know how to obtain this?
|
|
#2
|
||||
|
||||
|
Re: Get Control Mode from Talon SRX
Quote:
Code:
CANTalon.getControlMode(); |
|
#3
|
|||
|
|||
|
Re: Get Control Mode from Talon SRX
Is there a labview equivalent of this?
|
|
#4
|
|||
|
|||
|
Re: Get Control Mode from Talon SRX
There isn't actually a LabVIEW equivalent right now.
The control mode is part of the signals that get sent to the Talon SRX over CAN - the java/c++ calls are just returning the member variable of the software object, not a value returned from the Talon itself. Right now the Get Status VI for Talon SRX only returns the cluster of signals that are being received from the CAN bus, not those being sent. It's something that we might be able to add if it makes sense. What application are you trying to get the control mode for? |
|
#5
|
|||
|
|||
|
Re: Get Control Mode from Talon SRX
Currently I was trying to get the control mode to see if it needed to be changed in teleop. When our bot is in auto it sets the mode to position. What I was trying to do was set the mode to speed in the teleop vi only if it wasn't already in Speed mode. Right now I have a workaround where it only runs the change mode code if the bot has been disabled since the last time the teleop vi was called.
|
|
#6
|
|||||
|
|||||
|
Re: Get Control Mode from Talon SRX
You could just maintain a record of the last mode set in a Global variable.
Then check it when you go to set a mode to see if it's different. |
|
#7
|
|||
|
|||
|
Re: Get Control Mode from Talon SRX
Quote:
Edit: what Mark said above would also work for the way you're trying to go about it. Edit again: Additionally, if you're only changing out of speed mode in auto, another solution would be to set the talons to speed mode at the very end of the routine. Last edited by thatnameistaken : 28-01-2017 at 16:51. |
|
#8
|
|||
|
|||
|
Re: Get Control Mode from Talon SRX
I suppose since it's a value the robotic sends it will not matter how often it is change. That's nice and easy. Thanks all o/
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|