Go to Post The robot uprising has begun. - SpoonMechanic [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-03-2009, 16:01
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Autonomous Driving

What our robot currently does is move around randomly.

This is that code

Code:
		m_robotDrive->Drive(ajoysticky,aajx);
			Wait(2.0);
			aajx = aajx * .5;
			m_robotDrive->Drive(ajoysticky,aajx);
			Wait(3.0);
			aajx = aajx * -.1;
			m_robotDrive->Drive(ajoysticky,aajx);
			Wait(4.0);
			aajx = aajx * -.1;
			m_robotDrive->Drive(ajoysticky,aajx);
			Wait(6.0);
			aajx = aajx * -.8;
			m_robotDrive->Drive(ajoysticky,aajx);
			Wait(5.0);
			aajx = aajx * -1.2;
			m_robotDrive->Drive(ajoysticky,aajx);
That works perfectly for what its for, but what we want our robot to do instead is move forward for a few seconds and spin in circles and I was wondering what would be the proper technique.



I would assume something similar to this
Code:
RobotDrive *m_robotDrive;
Jaguar* rightmotor;
Jaguar* leftmotor;

m_robotDrive = new RobotDrive(1,2);
rightmotor = new Jaguar(1);
leftmotor = new Jaguar(2);

m_robotDrive->Drive(1,0)
Wait(3.0);
(Set right motor and left motor to 1) so it will cause one side to go forward and the other to go in reverse

(Both are 1 because one cim has to go in reverse)
Im not sure of the proper syntax to set the jaguars speed and I dont have access to the robot so any insight would be much appreciated

-Dan
Reply With Quote
  #2   Spotlight this post!  
Unread 01-03-2009, 16:48
excel2474's Avatar
excel2474 excel2474 is offline
Registered User
AKA: Aaron Stewart
FRC #2474 (Excel)
Team Role: Engineer
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Niles, Michigan
Posts: 177
excel2474 is a jewel in the roughexcel2474 is a jewel in the roughexcel2474 is a jewel in the roughexcel2474 is a jewel in the rough
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.
__________________
"Find some thing you like to do and EXCEL at it with dilligence."

University of Notre Dame- Mechanical Engineering.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-03-2009, 18:56
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Re: Autonomous Driving

Thanks I will let you know how it goes when I test it on our robot!
Reply With Quote
  #4   Spotlight this post!  
Unread 03-03-2009, 22:24
Analog's Avatar
Analog Analog is offline
Registered User
AKA: Bob Most
FRC #2619 (The Charge)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Midland, Michigan
Posts: 53
Analog will become famous soon enoughAnalog will become famous soon enough
Re: Autonomous Driving

The spin move seems to be popular.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-03-2009, 01:17
brianelite brianelite is offline
Registered User
FRC #2898
 
Join Date: Feb 2009
Location: oregon
Posts: 36
brianelite has a spectacular aura aboutbrianelite has a spectacular aura aboutbrianelite has a spectacular aura about
Re: Autonomous Driving

Haha, I used a timer class instead of Wait. Why didn't I use wait
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Driving Tips? Betty_Krocker General Forum 40 23-02-2008 10:12
Driving, What to do? shorterboarder General Forum 0 19-02-2006 18:35
Driving at Last! The_Goodie Robot Showcase 4 10-02-2005 20:23
driving at noon Adam Collet General Forum 6 20-09-2003 23:40
Driving a clutch Kevin A Chit-Chat 18 03-07-2003 16:02


All times are GMT -5. The time now is 02:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi