View Single Post
  #9   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