View Single Post
  #3   Spotlight this post!  
Unread 11-01-2012, 04:27
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
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?
Attached Files
File Type: cpp MyRobot.cpp (2.0 KB, 17 views)
__________________

Last edited by mikets : 11-01-2012 at 04:29.
Reply With Quote