go_away

Author Topic: Code for stereoscopic IR vision and response.  (Read 1898 times)

0 Members and 1 Guest are viewing this topic.

Offline CubebotTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Code for stereoscopic IR vision and response.
« on: November 26, 2008, 08:31:09 AM »
I am new to C, and before my Axon and other parts arrive, I need a code written for me.
I plan to put two IR sensors on each side of the robot, so that it has stereoscopic vision and can therefore make smart decisions about which way to turn, not just to turn. I need a script that does the following:
Start going straight relatively fast
If left or right IR measures less than 6cm in distance, then
See if Left IR value>Right IR Value, if yes turn left (Right servo 50 revolutions, Left servo 25 revolutions, then keep going straight), if no turn right (Left servo 50 revolutions, Right servo 25 revolutions, then keep going straight). I just need the robot to make a slight right or left turn, so you may tweak the number of revolutions to get it right for a very small (3x3x3) robot. Assume that the left IR goes on ADC 1 and the right on ADC 2, and that the left servo goes on E2 and E3 on the I/O.

Offline Rebelgium

  • Supreme Robot
  • *****
  • Posts: 638
  • Helpful? 0
  • It's called the future ... We like it here
Re: Code for stereoscopic IR vision and response.
« Reply #1 on: November 26, 2008, 04:20:52 PM »
I need a code written for me.

Are you serious?
Write it yourself... Learn it.
To relax after some hard work on robotics: A very fun free online text based MMORPG
orgcrime.net

Offline mbateman

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
Re: Code for stereoscopic IR vision and response.
« Reply #2 on: November 26, 2008, 05:49:18 PM »
The last post was a little harsh, but the point is valid. If you want a canned robot, then just go buy one. The whole point of this forum is to assist people who want to learn how to do it themselves. The code you are asking for is pretty simple and much of it is covered in the $50 robot tutorial. You might want to start there and then modify it to do what you want.

This the perfect chance to learn C, so dive in, and most of all, have fun.

Offline szhang

  • Robot Overlord
  • ****
  • Posts: 140
  • Helpful? 1
Re: Code for stereoscopic IR vision and response.
« Reply #3 on: November 26, 2008, 06:14:11 PM »
Stereoscopic vision with distance sensors?  That doesn't make sense at all.  Stereoscopic vision only applies to vision sensors like cameras, and use the difference in the two images to compute distance.

Also, we are here to provide (free) knowledge.  If you have question on how to do something, that we can answer, if you want code written FOR you, hire a programmer.

Offline CubebotTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Code for stereoscopic IR vision and response.
« Reply #4 on: November 27, 2008, 07:28:45 AM »
Okay, and by stereoscopic I mean it could see which way it was facing relative to an obstacle and make the shortest turn to get back on its way.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Code for stereoscopic IR vision and response.
« Reply #5 on: November 30, 2008, 12:30:34 AM »
All the code is done for you with the Axon, you just need to copy/paste the commands you want to use into control.c:
http://www.societyofrobots.com/axon/axon_function_list.shtml

In fact, it also has default photovore code which is 90% of what you want already :P

 


Get Your Ad Here