Go to Post Competition isn't about the resources you don't have, it's making the most out of what you do have. - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2017, 20:36
robot_rover robot_rover is offline
Registered User
FRC #2225
 
Join Date: Jan 2017
Location: Minnesota
Posts: 4
robot_rover is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2017, 20:41
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 154
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: Get Control Mode from Talon SRX

Quote:
Originally Posted by robot_rover View Post
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?
Code:
CANTalon.getControlMode();
http://www.ctr-electronics.com/downl...tControlMode--
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 28-01-2017, 10:19
robot_rover robot_rover is offline
Registered User
FRC #2225
 
Join Date: Jan 2017
Location: Minnesota
Posts: 4
robot_rover is an unknown quantity at this point
Re: Get Control Mode from Talon SRX

Is there a labview equivalent of this?
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2017, 10:55
Jacob C. Jacob C. is offline
Engineer at CTR Electronics
FRC #4130 (The Blue Devils)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2009
Location: Richmond, MI
Posts: 21
Jacob C. is a glorious beacon of lightJacob C. is a glorious beacon of lightJacob C. is a glorious beacon of lightJacob C. is a glorious beacon of lightJacob C. is a glorious beacon of light
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?
__________________
FiM Volunteer
Since 2015: Controls Mentor for FRC 4130, The Blue Devils (Richmond, MI)
2009-2014: FRC Team 1718, The Fighting Pi

Full Disclosure: I am an Engineer for CTR Electronics
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2017, 16:41
robot_rover robot_rover is offline
Registered User
FRC #2225
 
Join Date: Jan 2017
Location: Minnesota
Posts: 4
robot_rover is an unknown quantity at this point
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 28-01-2017, 16:43
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,940
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2017, 16:48
thatnameistaken thatnameistaken is offline
Registered User
AKA: Joshua Johnston
FRC #2191 (Flux Core)
Team Role: College Student
 
Join Date: Oct 2012
Rookie Year: 2013
Location: Hamilton, NJ
Posts: 62
thatnameistaken is on a distinguished road
Re: Get Control Mode from Talon SRX

Quote:
Originally Posted by robot_rover View Post
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.
If you always want speed mode in teleop, you could just set it to speed regardless of mode. There's no issue with redundant mode change calls.

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.
Reply With Quote
  #8   Spotlight this post!  
Unread 28-01-2017, 16:50
robot_rover robot_rover is offline
Registered User
FRC #2225
 
Join Date: Jan 2017
Location: Minnesota
Posts: 4
robot_rover is an unknown quantity at this point
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/
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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