![]() |
[C++] Use CAN Talons in RobotDrive
We are using CAN for the first time and after a few hours of learning how to do it, wiring, and formatting the Talons, our drive code didn't work. I tried controlling each motor individually and it works perfectly, but we would like to use RobotDrive because we are using Mecanum wheels with a gyro. Here is the non-working code:
Code:
class Robot: public SampleRobot {Code:
class Robot: public SampleRobot { |
Re: [C++] Use CAN Talons in RobotDrive
Have you tried connecting the TalonSRXs via the PWM? That may alleviate your problem. Could also check if your TalonSRXs have the latest firmware.
Check here: http://crosstheroadelectronics.com/T...7s%20Guide.pdf |
Re: [C++] Use CAN Talons in RobotDrive
Maybe grab the self test from the Rio web based configuration? Maybe its not in percent throttle mode. I don't have the implementation of robot drive in front of me but I think it just uses Set().
|
Re: [C++] Use CAN Talons in RobotDrive
What sort of problems are you encountering when you try to run the mecanum drive code? Does it simply not do anything at all, does it move the motors around but not in the way you expect, or something else? If the motors are running but the robot is responding how you expect, you should double check that everything is plugged into the right ports, that all the motors are turning the right direction, etc.
|
Re: [C++] Use CAN Talons in RobotDrive
Quote:
Quote:
Quote:
|
Re: [C++] Use CAN Talons in RobotDrive
try calling
robotDrive.SetSafetyEnabled(false); before the while loop in OperatorControl. Edit: actually, try calling that in the Robot() constructor. It's possible that the Talons are getting disabled before you start running the robot but that they aren't getting properly re-enabled. |
Re: [C++] Use CAN Talons in RobotDrive
Quote:
|
Re: [C++] Use CAN Talons in RobotDrive
If you are seeing kNoDrive then most likely set is not being called. See software reference manual for more details.
|
Re: [C++] Use CAN Talons in RobotDrive
Quote:
|
Re: [C++] Use CAN Talons in RobotDrive
Are you calling Wait(.01) in your code? That may cause the code to do nothing.
|
Re: [C++] Use CAN Talons in RobotDrive
Could also try creating a new project. Sometimes projects get messed up. On the surface, it may not seem like it matters, but it could be worth a try.
I reccomend you switch from using the SampleRobot project to using IterativeRobot and try the code again. |
Re: [C++] Use CAN Talons in RobotDrive
This should work, but as I don't have a bot with TalonSRXs, I can't confirm this, but you could try it. I have used the IterativeRobot class.
Code:
class Robot: public IterativeRobot |
Re: [C++] Use CAN Talons in RobotDrive
Quote:
|
Re: [C++] Use CAN Talons in RobotDrive
Quote:
Either way, you should add some sleep to your loop, otherwise you'll starve the rest of the threads on your system and you'll encounter problems. I'd recommend using iterative robot instead though, then you don't have to worry about things like that. |
Re: [C++] Use CAN Talons in RobotDrive
Quote:
|
| All times are GMT -5. The time now is 01:49. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi