go_away

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

0 Members and 1 Guest are viewing this topic.

#### Cubebot

• Jr. Member
• Posts: 7
##### 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.

#### Rebelgium

• Supreme Robot
• Posts: 638
• 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

#### mbateman

• Full Member
• Posts: 82
##### 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.

#### szhang

• Robot Overlord
• Posts: 140
##### 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.

#### Cubebot

• Jr. Member
• Posts: 7
##### 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.

• Supreme Robot
• Posts: 11,658