My motors are hot for you!
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 Yesterday, 17:02
faraz5557's Avatar
faraz5557 faraz5557 is online now
BB-R8ER
AKA: Faraz Masroor
FRC #5557 (BB R8ERS)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Miami, FL.
Posts: 22
faraz5557 is an unknown quantity at this point
Joystick doesn't update, motors don't drive until button press

We have a button that activates a command to set the mode of our CANTalons (eg. Percent vs speed vs something else I cant remember) to Percent (which should be the default mode). When we deploy our code and try to run the robot in teleop, the robot doesn't move, the Joystick values don't update on the SmartDashboard (especially weird! What does the CANTalon modes have to do with the joystick readings?), until we press the button, then both of those things start working normally and expected (though sometimes the driving is noticeably slower than other times, strange.) It's using ArcadeDrive I believe.

We tried in our init methods to basically emulate the button, by creating a new modeChangeCommand object and running execute() on them (so basically the driver doesn't have to press the button to start driving) but this doesn't work, apparently it's not the same as pressing the button. Did this in multiple places.

How to fix this? This didn't happen last year. Our CANTalons are on 2.2 firmware, and downgrading them all to 2.0 didn't help. Another team member suspects something has changed on the CANTalon end about the different modes the controllers can be in.
Reply With Quote
  #2   Spotlight this post!  
Unread Yesterday, 17:04
faraz5557's Avatar
faraz5557 faraz5557 is online now
BB-R8ER
AKA: Faraz Masroor
FRC #5557 (BB R8ERS)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Miami, FL.
Posts: 22
faraz5557 is an unknown quantity at this point
Re: Joystick doesn't update, motors don't drive until button press

Another team member says:

"We have been looking into changing the settings for the Talon SRX motor controllers (using the CAN bus) and using the various control modes. Now, we changed some setting and when we initially apply the joystick input, there is no output to the wheels. However, when we push the button we programmed to change the different control modes, and switch into the PercentVBus mode, the wheels turn as expected. We have tried changing the control mode for each Talon responsible for the wheelbase in our DriveSubsystem constructor, but had no effect. When outputting the control modes, using the getControlMode() method of the CANTalon object, we get that the mode is "PercentVBus," even when we set it to Speed or Position using the previously mentioned button. We are at a loss at what to do, and have already tried updating the firmware on the Talons, but we still have this issue. While in the end we are able to drive, we'd like to make sure the correct drive mode is engaged from the very beginning."
Reply With Quote
  #3   Spotlight this post!  
Unread Yesterday, 17:44
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 948
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Joystick doesn't update, motors don't drive until button press

The CANTalon mode you choose has to do with the joystick reading because the set() method does different things based on the mode. Judging from your posts I think you want all your drive talons in Percent Vbus mode.

Read more in the Talon Reference Manual http://www.ctr-electronics.com/downl...e%20Manual.pdf
Reply With Quote
  #4   Spotlight this post!  
Unread Today, 12:20
faraz5557's Avatar
faraz5557 faraz5557 is online now
BB-R8ER
AKA: Faraz Masroor
FRC #5557 (BB R8ERS)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Miami, FL.
Posts: 22
faraz5557 is an unknown quantity at this point
Re: Joystick doesn't update, motors don't drive until button press

Using some system.out.printlns shows that the drive method in the Robot class isn't actually called until the button press. I tried simulating the button press in init() etc. to no avail. In addition, the console registers a bunch of Robot Drive... Output not updated often enough. java.lang.Thread.run(Thread.java:745) errors until the button press. Any clues?

Last edited by faraz5557 : Today at 12:25.
Reply With Quote
  #5   Spotlight this post!  
Unread Today, 14:16
dvanvoorst dvanvoorst is offline
Registered User
FRC #2771 (Code Red)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Grand Rapids, MI
Posts: 75
dvanvoorst is an unknown quantity at this point
Re: Joystick doesn't update, motors don't drive until button press

I think this problem is going to require seeing some code....or all the code. Can you post at least the Robot class, or a link to the project?
__________________

Reply With Quote
  #6   Spotlight this post!  
Unread Today, 15:42
faraz5557's Avatar
faraz5557 faraz5557 is online now
BB-R8ER
AKA: Faraz Masroor
FRC #5557 (BB R8ERS)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Miami, FL.
Posts: 22
faraz5557 is an unknown quantity at this point
Re: Joystick doesn't update, motors don't drive until button press

I would, but another team member just figured out the problem. We had a command code that woudl manage our SmartDashboard, and it had a 'require drive subsystem' type line that would interfere with the Robot drive method. And pressing the button interrupted the smartDashboard and allowed the drive to continue, starting the drive. This is consistent with the fact that before the button press, the drive method was called exactly once (instead of continuously).
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 15:45.

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