|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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.
|
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
Re: Roborio issues??
Quote:
I have been using TalonSRX's over CAN without problem. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|