![]() |
Autonomous Driving
What our robot currently does is move around randomly.
This is that code Code:
m_robotDrive->Drive(ajoysticky,aajx);I would assume something similar to this Code:
RobotDrive *m_robotDrive;-Dan |
Re: Autonomous Driving
under the autonomous portion of the code do something like:
rightmotor->Set(1);// motor speeds range from -1 to 1 leftmotor->Set(1);// so this sets both motors full speed forward Wait(3.0); //Both motors will remain full speed forward for 3 seconds rightmotor->Set(-1);// right motor turns backward full speed leftmotor->Set(1);// left motor turn forward full speed Wait(2.0);// So the robot will spin in circles(right) for 2 seconds rightmotor(0.0);// stop right motor leftmotor(0.0);// stop right motor I hope this helps. I put the comments in there so you can see what is going on. |
Re: Autonomous Driving
Thanks I will let you know how it goes when I test it on our robot!
|
Re: Autonomous Driving
The spin move seems to be popular.
|
Re: Autonomous Driving
Haha, I used a timer class instead of Wait. Why didn't I use wait:yikes:
|
| All times are GMT -5. The time now is 13:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi