|
Re: New to 2CAN and Jaguar
I changed the program as you suggested (new code attached). Notice that I added the jag.Set(30.0) in there outside of the loop. When running it, I heard the motor noise like it had moved but then stopped. When I looked, nothing happened. Then I noticed my voltage is getting low and the Jags are no longer powered. I think my battery is now exhausted. Unfortunately, the mechanical mentor has the charger. So I guess I am done for tonight. But I am excited, it may mean the motor really moved but then the battery died because of the current drawn. If that's the case, it means the jag.Set() outside of the loop worked. If so, the next step is to find out why the ArcadeDrive inside the loop did not work. Since you suggested "speedJag.Set(stick.GetAxis(axis) * 150.0);", does it mean the full range of the Jag is -150.0 to 150.0? How about the ArcadeDrive call? Would the RobotDrive object do the scaling to 150, or do I need to call SetMaxOutput myself? I can't find anywhere in CANJaguar that it scales the outputValue. If that's the case, that explains why the motors didn't move because the outputValue will be below or equal to 1.0 in a full scale of 150.0. I thought everything in WPILib scaled to 1.0. Why is it that we need to multiply 150.0 in jagSpeed.Set()? If the speed mode is really in the range of -150.0 to 150.0, is there documentation somewhere telling me what range is the motor in which mode?
__________________
Last edited by mikets : 01-11-2012 at 04:29 AM.
|