Go to Post Yes, this year's championships could be decided by cheesecake. - MrJohnston [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 14-01-2015, 21:03
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Roborio issues??

Really? RobotDrive has constructors that take SpeedController objects, which includes CAN motor controllers. You should be able to declare CAN<whatever> variables for each of your motor controllers and then initialize a RobotDrive using those. Now, if you use the constructor with channel numbers as arguments [new RobotDrive(1, 2, 3, 4)], it'll assume you're trying to use PWM talons, and won't work otherwise. That's probably the problem you guys had.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2015, 23:00
AubreyA AubreyA is offline
Registered User
AKA: Aubrey Anderson
FRC #2521 (SERT)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Eugene, OR
Posts: 3
AubreyA is an unknown quantity at this point
Re: Roborio issues??

I just found a solution to a similar problem today. If you are in fact using CAN and have declared the RobotDrive using new RobotDrive(new CANJaguar(id), etc...) as alopex_rex discussed then this should work.

We discovered that in the wpilibj RobotDrive class there is a member variable m_isCANInitialized which is set to false at construction. (There is a comment by this declaration, "TODO: fix can", which worries me.) This is the variable which controls whether the CAN motor controllers get updated. When true, RobotDrive will call CANJaguar.updateSyncGroup(syncGroup) for the sync group (byte)0x80. (This is the sync group which the class sets for all motor controllers.) However this never gets set to true which is where the problem arises.

We found two possible solutions to this issue. You could extend the RobotDrive class and set m_isCANInitialized to true at construction which would update the sync group indirectly. The other option is to call CANJaguar.updateSyncGroup(syncGroup) after every time you set your drive motors.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-01-2015, 23:18
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 139
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Roborio issues??

Quote:
Originally Posted by alopex_rex View Post
Really? RobotDrive has constructors that take SpeedController objects, which includes CAN motor controllers. You should be able to declare CAN<whatever> variables for each of your motor controllers and then initialize a RobotDrive using those. Now, if you use the constructor with channel numbers as arguments [new RobotDrive(1, 2, 3, 4)], it'll assume you're trying to use PWM talons, and won't work otherwise. That's probably the problem you guys had.
This is correct. Anything that extends SpeedController (Talons, Victors, Jaguars, CANTalons, etc.) will all work. Make sure if you are using CAN to give the the SpeedController objects instead of just the ports because it will assume you mean PWM.

I have been using TalonSRX's over CAN without problem.
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 09:28.

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