Author Topic: Stampy robot code  (Read 8268 times)

0 Members and 1 Guest are viewing this topic.

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Stampy robot code
« on: July 07, 2007, 12:59:55 AM »
anyone can upload a programming for "Stampy the Sumo Robot" http://www.societyofrobots.com/robot_sumo.shtml, i am using atmega168 and avr studio 4, i want my sumo robot has the same function as "Stampy the Sumo Robot", pls help!!!!!


admin edit: I changed the subject to something more useful than 'Help ! need help!!!!!!'
« Last Edit: July 11, 2007, 06:57:33 PM by Admin »

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Help ! need help!!!!!!
« Reply #1 on: July 07, 2007, 05:34:57 AM »
really i need help!!!!!!

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Help ! need help!!!!!!
« Reply #2 on: July 07, 2007, 07:15:53 AM »
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Help ! need help!!!!!!
« Reply #3 on: July 07, 2007, 11:39:50 PM »
i think that one is line following robot command, i need sumo robot command. can i use http://www.societyofrobots.com/downloads/stampy_sumo_source_code.zip to program atmega168 with avr studio?

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Help ! need help!!!!!!
« Reply #4 on: July 09, 2007, 03:29:34 AM »
can i replace the icsp header with a serial port ? i do not have a iscp header!!!! how to add serial port to the circuit in http://www.societyofrobots.com/step_by_step_robot_step3C.shtml?
Pls reply, reply the above question too!!!!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #5 on: July 11, 2007, 07:02:48 PM »
FYI, my Stampy sourcecode is for a PIC16F877 and not for AVR.

Quote
how to add serial port to the circuit in http://www.societyofrobots.com/step_by_step_robot_step3C.shtml?

You will need to send serial data from the UART (tx and rx on your AVR). Then connect those to pins to a rs232 to serial adaptor (about ~$6). Just search this forum and google for those terms.

If I ever get my SparkFun parts in (they seem to be having serious shipping issues lately) Ill write a tutorial for this using AVR.

Offline Brandon121233

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 320
  • Helpful? 0
  • "Genius is %1 inspiration and %99 perspiration"
Re: Stampy robot code
« Reply #6 on: July 11, 2007, 09:16:35 PM »
Hey Admin, did you ever bother to get one of the Arduinos from them to check out? It's pretty nice for someone just staring out to get the feel of MCU's, and it's nice for people like me who don't have time to mess around with building their own prototyping board, and buying dongles and such.
Hell, there are no rules here—we're
   trying to accomplish something.

                                                                              —Thomas Edison

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #7 on: July 11, 2007, 09:19:14 PM »
Nope, but the specs looked good to me.

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Stampy robot code
« Reply #8 on: July 11, 2007, 09:29:00 PM »
Quote
(they seem to be having serious shipping issues lately)
took them a week to ship my cable.
nothing new
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Help ! need help!!!!!!
« Reply #9 on: July 12, 2007, 03:50:44 AM »
i think that one is line following robot command, i need sumo robot command. can i use http://www.societyofrobots.com/downloads/stampy_sumo_source_code.zip to program atmega168 with avr studio?

i solve the problem about icsp header by buying AVRISP AVR IN -SYSTEM PROGRAMMER http://www.rsmalaysia.com/cgi-bin/bv/rswww/searchBrowseAction.do?N=0&Ntk=I18NRSStockNumber&Ntt=4725933&Nty=1&D=4725933&callingPage=/order/OrderHistoryView.jsp&BV_SessionID=@@@@0535305059.1184232628@@@@&BV_EngineID=ccccaddlgkglfkhcefeceeldgondhgm.0&cacheID=mynetscape&Nr=avl:my , will it work?
i hope admin can upload the code for atmega in one week time, please... send an e-mail to notify me after you upload it.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #10 on: July 12, 2007, 05:05:22 AM »
You can find my Stampy code for AVR here:
http://www.societyofrobots.com/robot_50_robot_sharpIR.shtml
http://www.societyofrobots.com/downloads/robot_source_50_sharpIR_v1.zip

As for the code for serial, count on it taking me weeks not days to post it ;D

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #11 on: July 13, 2007, 06:10:04 AM »
can i use the above command which you gave with my board http://www.societyofrobots.com/step_by_step_robot_step3B.shtml, i replaced the microprocessor in that board with atmega168. Can it has 100% same function like stampy ?  :'( i really need it, the competition is coming very soon in 2 weeks !!!!!!!
really thank you. :)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #12 on: July 13, 2007, 10:24:41 AM »
You need to make a few small changes in your code, but yes it will work.

Follow the instructions here:
http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #13 on: July 14, 2007, 05:52:15 AM »
should i change the atmega 8 option into atmega 168 if i am using atmega 168
does the command included a command which do not let the sumo robot came out from the battle ring?
if no, how to add it ? i will use a photoresistor to detect the outer line.
does the command include a command which let the ir sensor rotate ?

if i want to add some command, which place should i add to?
At which point should i plug the ir sensor, servo motor (for ir), servo motors and photoresistors ?
i really a newbie, really thank you for everybody support !!!! thank you!!!! you guys are great!!!!!!!!
« Last Edit: July 14, 2007, 06:13:50 AM by sheng fatt »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #14 on: July 14, 2007, 07:08:03 AM »
Quote
should i change the atmega 8 option into atmega 168 if i am using atmega 168
yes

Quote
does the command included a command which do not let the sumo robot came out from the battle ring
the algorithm makes your robot only go to the opposing robot. there will never be a cliff between your robot and the opposing robot. therefore you do not need to ever detect a line

Quote
does the command include a command which let the ir sensor rotate
just command the servo to rotate just like you do for the wheels. all my code is well commented and should be self explanatory.

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #15 on: July 14, 2007, 10:14:09 PM »
the algorithm makes your robot only go to the opposing robot. there will never be a cliff between your robot and the opposing robot. therefore you do not need to ever detect a line

so, the robot will not move when it does not detect opponent? or after finishing rotate the ir sensor (servo motor) without any opponent detected, it will turn round like stampy? i want it to turn round like stampy, what should i add?   




i want to add four photoresistors at the side of the robot to prevent it from going out when it push the opponent out from the battle ring and when opponent want to push it out of the battle ring, what should i add?
« Last Edit: July 15, 2007, 05:20:17 AM by sheng fatt »

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #16 on: July 15, 2007, 05:32:38 AM »
this is my algorithm for the four photoresisitor with leds like mobot:

if sensor1 on the balck line, while other sensor on white surface, robot will turn right.
if sensor3 on the balck line, while other sensor on white surface, robot will turn right.
if sensor1&3 on the balck line, while other sensor on white surface, robot will turn right.
if sensor2 on the balck line, while other sensor on white surface, robot will turn left.
if sensor4 on the balck line, while other sensor on white surface, robot will turn left.
if sensor2&4 on the balck line, while other sensor on white surface, robot will turn left.
if sensor1&2(front) on the balck line, while other sensor on white surface, robot will turn right.
if sensor3&4(back) on the balck line, while other sensor on white surface, robot will move forward as usual.

when all the sensor on white line, the robot will function as usual.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #17 on: July 15, 2007, 09:18:44 AM »
Quote
so, the robot will not move when it does not detect opponent? or after finishing rotate the ir sensor (servo motor) without any opponent detected, it will turn round like stampy?
The answers to all your questions are in the tutorial.

"Algorithm
The algorithm takes data from a scanning Sharp IR Rangefinder, and uses edge detection to decide where to drive. If no target is available, it would go into a search mode and spin clockwise. Otherwise, it would attempt to drive towards the left side of the opposing robot."

Quote
i want to add four photoresistors at the side of the robot to prevent it from going out when it push the opponent out from the battle ring and when opponent want to push it out of the battle ring, what should i add?
Again, this is not necessary. With the Stampy algorithm, your robot will only drive towards the opposing robot, not over the table. The table does not end between your robot and the other robot, therefore it will never go over the table.

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #18 on: July 16, 2007, 03:12:42 AM »
Again, this is not necessary. With the Stampy algorithm, your robot will only drive towards the opposing robot, not over the table. The table does not end between your robot and the other robot, therefore it will never go over the table.

i knew the robot will not goes off from the table (battle ring),  but it will go off from the battle ring when the opponent push when it is in a spin mode or when it cannot detect the opponent.  :-\ !   the robot which went off from the ring will be qualified as loser although without any pushing from the opponents. i scare my robot will lose without reason. below show 1 condition where my robot will went off from the battle ring. :(


(the arrow show the heading / front part of the robots.)
« Last Edit: July 17, 2007, 01:16:42 AM by sheng fatt »

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #19 on: July 18, 2007, 03:15:06 AM »
any person can reply the above questions? please help me  :'(  :'(  :'(  :'(  :'(  :'(  :'(  :'(  :'(  :'(

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Stampy robot code
« Reply #20 on: July 18, 2007, 03:56:54 AM »
hi sheng fatt,
so you are suggesting adding photoresistors to the bottom of your robot so it can detect when it has reached the line and try to avoid being pushed over.
yes, that should work.
obviously you will need to modify the circuit to add the sensors and modify the program to monitor the sensors and take evasive action.

if you want people on this forum to design and write the changes for you then i'm afraid you are out of luck.
we are mostly too busy working on our own robots.

dunk.

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #21 on: July 18, 2007, 05:38:18 AM »
admin or any person, pls help me in changing the program if i want to add my algorithm above. please, please help me.  :'(  :'(  :'(  :'(  :'(  :'(  :'(  :(  :(  :(  :(  :(

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #22 on: July 18, 2007, 06:49:09 AM »
http://www.societyofrobots.com/robotforum/index.php?topic=1480.0
http://www.societyofrobots.com/robotforum/index.php?topic=602.0

Please stop sending me pm's telling me answer your post every time you make a post. If all 934 members on the forum did this, I will not have time to help anyone!

(only you can build your robot, otherwise it wouldnt be yours ;))

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #23 on: July 19, 2007, 03:06:52 AM »
i tried my self on the programming, however i face a problem,
are there any code to represent equal to "=" ?

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Stampy robot code
« Reply #24 on: July 19, 2007, 03:09:56 AM »
AFAIK, the "=" operator is an assignment operator and is used exclusively to assign the variable on the right with a value. If you are doing comparisons, like in an IF statement for eg, the you use the "==" operator which is used to compare values.

And dont PM me either please with questions. If you have them, post them in the forum. then everybody can benefit from the answers.
Imperial College Robotics Society
www.icrobotics.co.uk

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #25 on: July 24, 2007, 01:38:43 AM »
do you have any schematic circuit, i do not want the graphical circuit, http://www.societyofrobots.com/step_by_step_robot_step3B.shtml,
can i connect a normal motor to this board? where should i plug in?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #26 on: July 24, 2007, 05:31:18 AM »
Quote
do you have any schematic circuit, i do not want the graphical circuit, http://www.societyofrobots.com/step_by_step_robot_step3B.shtml

Ummmm no . . . but if you just draw lines between the color dots, that would be what you want . . . seriously, the circuit is so simple it doessnt require a traditional schematic . . . just plug and play.

Quote
can i connect a normal motor to this board? where should i plug in?

Nope. You will need a motor driver first. Search the forum for this, many people have asked in the past . . . The advantage of a servo is that it has a motor driver already built in, along with gears and feedback control as well.

Offline newbieTopic starter

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Stampy robot code
« Reply #27 on: July 25, 2007, 02:21:40 AM »
so, we need to use a servo motor although for the wheel?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Stampy robot code
« Reply #28 on: July 25, 2007, 04:31:16 AM »
I dont understand your question . . .

For those who dont know what they are doing, I suggest using servos for your first bot . . .

 


Get Your Ad Here