Go to Post Will we finally get to play music on our robots for once!? - Hitchhiker 42 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-04-2008, 10:17
1337.etoile 1337.etoile is offline
Registered User
FRC #2092
 
Join Date: Apr 2008
Location: Beaufort
Posts: 2
1337.etoile is an unknown quantity at this point
Programming help

Now that team 2092's regional compettition is over we are to program the two robots we have to be able to go through a section of the school without touching the walls and it has to run automynously. We will be using easyc for this and would like help on how to do this.

The team is divided into two teams and unlucky for my team we dont have the programer. The other side does. Since I am highly inexperience with programming I would appreciate any and all help given to me.

I need to know how to write the program and if at all possible I would like a template for the program that I could just tweak to match our robot.

The robot uses two wheel drive. The rear wheels are traction while the front wheels are omnidirectional.

Though we are using the robot from the competition we are taking off the forklift so the only thing we are driving around is the base.

If you need anymore info to help me I'll be more than happy to give it. If you would prefer to email me or IM me about this to explain things...

My Yahoo ID is lightofdragon17@yahoo.com
My gmail ID is 1337.etoile@gmail.com
My hotmail ID is etoile.1337@hotmail.com
My AIM ID is saikozettaibogyo@aol.com
  #2   Spotlight this post!  
Unread 03-04-2008, 10:39
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Programming n3wb needs help

Do you have any sort of feedback from the robot? Like two encoders?
  #3   Spotlight this post!  
Unread 03-04-2008, 11:30
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 511
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Re: Programming n3wb needs help

Do you have any sensors to work with? You will need a way to find the walls to avoid, or open areas to drive towards.

If starting from scratch I would probably use an ultrasonic sensor like this:http://www.maxbotix.com/ either 1 on a servo to sweep the area, or 2 pointed at the walls.

If the walls and floor are different colors, you might want to try a prior year's camera. However I think the software would be more complex.
  #4   Spotlight this post!  
Unread 04-04-2008, 10:24
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Programming n3wb needs help

Maybe if you don't have The Programmer and so need a Mechanical solution (unfair, they don't let you touch the walls!) you could just run a rope through your robot and stretch it tightly down the hallway? (Just kidding).

I agree about the Maxbotix ultrasonic sensors. They output various types of signals, but the easiest to use is the analog output which you connect to Analog Inputs on the robot controller. You will have to solder a PWM cable to the Maxbotix sensor board.

One easy thing to start with is a very simple EasyC program, that reads joystick inputs into a variable, and then copies the variable to the PWM outputs for the Victors. You ought to be able to get your robot drivable with the joystick in less than a dozen lines of code.

Next, mount two Maxbotix sensors to the front corners of your robot and aim them outwards towards the wall. Connect the PWM cables (you soldered previously) to two Analog inputs. Change your EasyC program to read the inputs and Print them so you know they are working, and what values you get at various distances from the wall.

Now it's a "simple" matter of trying to have the robot steer to keep the analog input readings fairly equal. You will have to experiment with this, but to start with I suggest subtracting the left sensor value from the right sensor value to get the "error". Use a signed variable, so that the error value can be positive or negative depending on which sensor has the higher value.

Now add this error variable to one PWM output value, and subtract it from the other. This will cause the robot to swerve - if you get the directions right, and steer in a very wiggly path down the hallway.

I recommend using the joystick fwd/rev motion to control speed, and to leave the steering joystick axis alone.

This should get you started.
  #5   Spotlight this post!  
Unread 05-04-2008, 14:27
AmoryG AmoryG is offline
Registered User
FRC #2423 (KwarQs)
Team Role: Alumni
 
Join Date: Mar 2008
Rookie Year: 2008
Location: Watertown, MA
Posts: 221
AmoryG has much to be proud ofAmoryG has much to be proud ofAmoryG has much to be proud ofAmoryG has much to be proud ofAmoryG has much to be proud ofAmoryG has much to be proud ofAmoryG has much to be proud ofAmoryG has much to be proud of
Re: Programming n3wb needs help

I realize this is probably very unhelpful, but when I began learning how to program this year I found that easy c was extreamly unhelpful in programming an actual robot. I only found it useful when programming a vex bot from a kit. Maybe download a c compiler and a text editor and download the code that helps you get started provided by first robotics?

I realize most of what I just said is probably hard for anyone new to do. Definately would be for me.
  #6   Spotlight this post!  
Unread 05-04-2008, 18:12
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Programming n3wb needs help

Start in the getting started section of the help file. This will teach you enough to be able to program the robot to do most of the common tasks, like driver/operator controls, and a basic autonomous modes. Quite a few rookie teams were able to dead reckon their way around the field in autonomous this year. There is as also some sample code in the easyC forum below this one.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 05-04-2008 at 18:17.
  #7   Spotlight this post!  
Unread 05-04-2008, 20:07
bilal1219's Avatar
bilal1219 bilal1219 is offline
Registered User
AKA: Bilal
FRC #1219 (Iron Eagles)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Canada
Posts: 56
bilal1219 is an unknown quantity at this point
Re: Programming n3wb needs help

well, There is something called COPYCAT code.What happens is the code is executed with the trig of joystick 2. Joystick 1 will be used for driving as usual. What it does is it records the exact movements of the robot while that trigis pressed. so after doing the recording reset the robot and run the autonomus mode.

There is no Time limit to the copycat code,as you explained that the bot has to go through a door. So what you can do it put the robot in the starting position and driver the robot as you would usually do in the teleoperated mode and mke it go throught the doors. after you done recording, bring the robot back to its starting position, and start your auto.
__________________


<a href="http://www.thebluealliance.net/tbatv/team.php?team=1219" style="border: 0"><img src="http://www.thebluealliance.net/tbatv/teambadge/gen/1219/FF3300/0066FF/teambadge.png" alt="Team 1219" /></a>

Robots Might Lose But Teams Never Do
  #8   Spotlight this post!  
Unread 05-04-2008, 20:35
Branden Ghena's Avatar
Branden Ghena Branden Ghena is offline
Previously: tawnos23
FRC #0240 (TEMPEST)
Team Role: College Student
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Houghton, Michigan (MTU)
Posts: 303
Branden Ghena has a spectacular aura aboutBranden Ghena has a spectacular aura aboutBranden Ghena has a spectacular aura about
Re: Programming n3wb needs help

Quote:
Originally Posted by bilal1219 View Post
There is something called COPYCAT code
How would the controller save the variables after reset? You would either have to type all the recorded distances and angles into the code by hand, or else you would have to use EEPROM, a bit difficult for a rookie team using EasyC.

As a suggestion, you should try hooking up a gyro and geartooth sensors. I have been very impressed with how well EasyC reads these sensors and gives you usable data. You could then write a drive function and a turn function, and use these, along with angles and distances, to run a successful autonomous mode.


As a side note: is there any way to use EEPROM with EasyC? That would be really useful.
__________________
Branden Ghena - Michigan Tech Student and Team 240 Alumnus
Working Towards: Electrical Engineering and Computer Engineering Double Major

"All we have to decide is what to do with the time that is given to us." - Gandalf
  #9   Spotlight this post!  
Unread 05-04-2008, 23:19
bilal1219's Avatar
bilal1219 bilal1219 is offline
Registered User
AKA: Bilal
FRC #1219 (Iron Eagles)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Canada
Posts: 56
bilal1219 is an unknown quantity at this point
Re: Programming n3wb needs help

Quote:
Originally Posted by tawnos23 View Post
How would the controller save the variables after reset? You would either have to type all the recorded distances and angles into the code by hand, or else you would have to use EEPROM, a bit difficult for a rookie team using EasyC.

As a suggestion, you should try hooking up a gyro and geartooth sensors. I have been very impressed with how well EasyC reads these sensors and gives you usable data. You could then write a drive function and a turn function, and use these, along with angles and distances, to run a successful autonomous mode.


As a side note: is there any way to use EEPROM with EasyC? That would be really useful.
well, sorry, i meant the copy cat code works in C.you have to code it like you said. Its a very complex code. me and my other partner worked hard on it.but as you said its hard for a rookie team to do it. so i think they are better off with GTS and gyro sensor with easy C.Becuase we tried to run GTS
on C and we couldnt run it.we thought there is a some problem in the sensor. Therefore we did not use is, instead we ended u using the copy cat code,which actually worked well for us. we were able to cross 2 lines with the delay of 5 secnds.
__________________


<a href="http://www.thebluealliance.net/tbatv/team.php?team=1219" style="border: 0"><img src="http://www.thebluealliance.net/tbatv/teambadge/gen/1219/FF3300/0066FF/teambadge.png" alt="Team 1219" /></a>

Robots Might Lose But Teams Never Do
  #10   Spotlight this post!  
Unread 06-04-2008, 23:53
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Programming n3wb needs help

You can use an ultrasonic ranging sensor, like the one recommended above, or an infrared proximity sensor (I recommend the Sharp GP line, available from a number of retailers if you google "sharp infrared sensor").

The easiest solution is to put one sensor looking to the left, one sensor looking to the right, and one looking dead ahead. Alternatively, put one sensor looking forward and to the left, and the other forward and to the right (both on 45 degree angles). You could also put a single sensor on a servo and scan back and forth, but this is a bit more complicated.

Now all you have to do is write code to turn right when an obstacle is to the left, turn left when an obstacle is to the right.

If there's an obstacle in front of you, you can turn either way, or reverse (up to you!).

You can make this as simple or as advanced as you want. It could be as easy as what I described, or as hard as making a closed-loop control function to always keep you a certain distance away from the wall.
  #11   Spotlight this post!  
Unread 09-04-2008, 13:55
1337.etoile 1337.etoile is offline
Registered User
FRC #2092
 
Join Date: Apr 2008
Location: Beaufort
Posts: 2
1337.etoile is an unknown quantity at this point
Re: Programming n3wb needs help

thanks for the suggestions!

what do you guys think about using a limit switch?
  #12   Spotlight this post!  
Unread 09-04-2008, 14:00
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Programming n3wb needs help

Quote:
Originally Posted by 1337.etoile View Post
thanks for the suggestions!

what do you guys think about using a limit switch?

The problem with a mechanical limit switch is that it requires the switch to be depressed to change state, and that requires touching the walls. I would like to third?fourth? the suggestion of the maxbotix ultrasonic sensors. A proximity/range sensor is the one of the only ways, if not the only way to avoid walls.
__________________
  #13   Spotlight this post!  
Unread 09-04-2008, 20:13
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: Programming n3wb needs help

Quote:
Originally Posted by Abwehr View Post
You can use an ultrasonic ranging sensor, like the one recommended above, or an infrared proximity sensor (I recommend the Sharp GP line, available from a number of retailers if you google "sharp infrared sensor").

The easiest solution is to put one sensor looking to the left, one sensor looking to the right, and one looking dead ahead. Alternatively, put one sensor looking forward and to the left, and the other forward and to the right (both on 45 degree angles). You could also put a single sensor on a servo and scan back and forth, but this is a bit more complicated.

Now all you have to do is write code to turn right when an obstacle is to the left, turn left when an obstacle is to the right.

If there's an obstacle in front of you, you can turn either way, or reverse (up to you!).

You can make this as simple or as advanced as you want. It could be as easy as what I described, or as hard as making a closed-loop control function to always keep you a certain distance away from the wall.
Yes, I would highly recommend the Sharp IR proximity sensors. I have found them to be much more reliable than the Maxbotix ultrasonics (though they would probably work just fine too.) Then I would write a program (assuming you are using three sensors as outlined above) to keep your robot centered in the hall using the two side sensors. (You can also check yourself, because I'm assuming the halls are about the same width, uniformly. By reading in your two sensors, you can easily determine if there are alternate ways to go other than straight.)

Next, I would use some GTS (the KOP ONE was great.... remember the second one is broken out of the box, and requires surface-mount soldering to fix (which our AWESOME mentor Mr. Allsop was able to do !!)) to keep track of your approximate distance. That way, if you had a course of attack, you could say "go forward approximately 28.3 feet, and at that point, start looking for turns". This way it's more difficult for the bot to get caught up somewhere it doesn't know where it is.




Quote:
Originally Posted by Dad1279 View Post
If the walls and floor are different colors, you might want to try a prior year's camera. However I think the software would be more complex.
CMUcam2 could work WONDERS in this application. With just 5 or 6 easyC code blocks, you could get your camera driving your bot around using color tags. If you had the ability to post colored sheets of paper in the halls to give the bot signals to turn, that would be awesome! If not, you could EASILY find identifiable colors to use as triggers for your bot.

Just let us know what you want to do, and we'd be happy to help you out. You can always PM me for assistance, or even call! I'd be happy to help!!!

Jacob
  #14   Spotlight this post!  
Unread 07-05-2008, 08:48
Mike.Allen Mike.Allen is offline
Registered User
FRC #2092
 
Join Date: Jan 2008
Location: Beaufort, SC
Posts: 7
Mike.Allen is an unknown quantity at this point
Re: Programming n3wb needs help

I have to research the copy cat code and find out as much as I can about it. >_> my teacher wants me to learn about it even though I told him it is not something that a person at my level of programming can do. At any rate could someone please explain how it works to me?

my email is uchihaboi12@hotmail.com
Closed Thread


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
PLEASE HELP!! Need help programming arm?? amirjpl Programming 12 15-03-2007 15:11
HELP-URGENT PROGRAMMING HELP NEEDED Rohith Surampudi Lego Mindstorm Discussion 1 24-03-2006 23:05
Programming Help TravisE Programming 1 01-02-2005 19:00
Programming Help hedgehogger Programming 10 19-02-2004 12:11
programming help ronnie_82 Programming 2 10-02-2003 13:50


All times are GMT -5. The time now is 00:59.

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