So I am trying to make one CAN Talon from Cross the Road follow another. According to their documentation you can use (in C++)
motor->SetControlMode(motor->kFollower);
motor->Set(canId);
to make it follow the motor with the canId specified. When I try to run this on the robot the motor I set to follower doesn’t do anything. Am I missing something?
Can you post more code please?
This is all the code to make our robot move forward the specified feet. leftMot is on id 4, rightMot is on id 3 and diameter is just a constant.
void driveFeet(double feet=10,double speed=.5){
leftMot->SetPosition(0);
rightMot->SetPosition(0);
rightMot->SetControlMode(rightMot->kFollower);
rightMot->Set(4);
double distance=abs(feet/(3.1415*diameter)1000.0);
while(abs(leftMot->GetEncPosition())<distance){
leftMot->Set((feet>0?speed:-speed)(1-(abs(leftMot->GetEncPosition())/distance)));
}
leftMot->Set(0);
}
Be sure to update your Talon SRX Firmware to latest.
We are having a similar problem… can’t get slave/follower talon to work follow masters. Individually the talons all work if we make them masters. All fw is up to date. Don’t see any faults in web ui. We tried steps in sw manual section "16.31.3. Confirm Slave/Follower Talons are driving ". When the master is output signal, the follower is doing nothing. We don’t see leds change from solid orange. We use smartdashboard to change the follower to be in percentvbus mode and talon works fine. When talon is in follower mode, the webui self-test shows mode as “mode 5 follower”. All this used to work and we aren’t sure what may have broken it. Any ideas what to check next?
Thanks.
-Maciej