Author Topic: Line Following Using Vision Sensors  (Read 17444 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Line Following Using Vision Sensors
« on: August 30, 2008, 04:21:38 PM »
The line following course is as follows : A line that is limited to a maximum of 90 degree turns but can have turns of other angles that are lower than 90. The line can break and then the robot must travel straight over that break in the line and retake the line on the other end. Plus there are victims ( green and silver paper things) on the line and the robot must identify the victims by lighting an LED when its above the victim.

Do you guys think that a CMUcam or any other camera sensor can do all that by itself?

,Eric
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Line Following Using Vision Sensors
« Reply #1 on: August 30, 2008, 05:08:21 PM »
I don't know about the CMU camera, but the AVRcam works like this:
You can set up to 8 color blobs that the camera will find and return bounding boxes for each color you are searching for. So, for a line following, you set a black color to search and the camera will return the bounding boxes for each spot it detects it on a frame. Than you move the bot to keep the bounding boxes in the middle of the frame. You are also searching for the green color (victims) and move the bot so the bounding box will get centered in the frame and then lit your LED.
Check out the uBotino robot controller!

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #2 on: August 30, 2008, 06:46:21 PM »
Thanks for the reply Robot-X.

The CMUcam works the same way.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #3 on: September 01, 2008, 05:55:47 PM »
The original CMUcam cannot track more than a single color at a time.

You'd have to cycle through the colors to do this.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #4 on: September 01, 2008, 06:05:06 PM »
The original CMUcam cannot track more than a single color at a time.

You'd have to cycle through the colors to do this.

awww
I think I might upgrade to the CMUcam2 after I finish documenting the original CMUcam. Its more or less the same commands , right?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #5 on: September 01, 2008, 06:16:03 PM »
The commands are a bit different, but you shouldn't have to modify your code more than 5-10%.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #6 on: October 16, 2008, 09:41:18 PM »
I am having difficulty getting past one obstacle with the camera line following. The course has one 25 degree ramp that the robot must follow the black line up. My worry is that when the robot goes up the ramp at the very beginning of the ramp the camera points away from the line and screws up.

Also anybody have any strategies or tips on line following using a camera?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #7 on: October 16, 2008, 09:50:05 PM »
Quote
My worry is that when the robot goes up the ramp at the very beginning of the ramp the camera points away from the line and screws up.
The MOBOT course at CMU has that problem . . . 45 degree downward ramps, many robots speed down the ramp and lose the line when it suddenly turns at the bottom of the ramp.

Solutions:
use a wide angle lens
bring the camera higher up away from the line (for a wider view)
add a servo for the camera to rotate like on my ERP
setup the control algorithm so that its more likely to rotate the robot than move forward

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #8 on: October 16, 2008, 09:52:36 PM »
Solutions:
add a servo for the camera to rotate like on my ERP

How would the robot know when to pan the camera and how much to pan it

Btw are you going to release your ERP line following code?
« Last Edit: October 16, 2008, 09:55:35 PM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #9 on: October 16, 2008, 10:27:14 PM »
Here is how it works:

The head centers itself onto the white line

The body centers itself to the head.

So the camera is always looking at the line, and the body is always trying to equalize with the head. Its almost just like my Stampy code, but without the oscillation.

I'll be releasing my ERP code in probably two weeks or so (don't quote me on that!). It uses alpha version Axon code, so I have to update it all, test it, and make it user friendly.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #10 on: October 16, 2008, 10:39:43 PM »
Here is how it works:
The head centers itself onto the white line

Do I need one servo for panning only or do I need two servos for panning and tilting?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #11 on: October 16, 2008, 10:54:52 PM »
For the MOBOT competition I disabled the vertical servo, so just one should be fine for you.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #12 on: October 17, 2008, 08:09:39 AM »
For the MOBOT competition I disabled the vertical servo, so just one should be fine for you.

But my robot has to go up a ramp , not down one. Does that change anything or do I just need a horizontal servo)
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #13 on: October 17, 2008, 09:52:24 AM »
No idea, never made a line follower go up a ramp :P
(well actually I tried, but it didn't have the torque . . .)

I say run some experiments! ;D


But my intuition says it shouldn't be a problem . . .

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #14 on: October 17, 2008, 10:14:04 AM »
I'll make a 1:1 scale CAD and post it up here in about an hour or two.

I'm only unsure about how high to place the camera and at what angle the camera should be pointing down.

Heres the CAD


It has two motorized wheels on each side of the robot. Axon microcontroller and I'll add on a battery soon. One servo connected to CMUcam on top.
« Last Edit: October 17, 2008, 02:42:13 PM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #15 on: October 18, 2008, 07:25:28 PM »
This is what I mean


you see how it starts to go up the ramp the camera is "looking" at the line which is way to far away. How do I figure out the optimum angle for the camera to be pointing downward at the line?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Line Following Using Vision Sensors
« Reply #16 on: October 18, 2008, 07:31:06 PM »
You can use a tilt sensor (some weight attached to a potentiometer) that can cause the tilt servo to adjust the camera for a proper angle.
Check out the uBotino robot controller!

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #17 on: October 18, 2008, 07:59:51 PM »
You can use a tilt sensor (some weight attached to a potentiometer) that can cause the tilt servo to adjust the camera for a proper angle.
yea I guess but then thats extra cost - another servo and another tilt sensor

I was wondering if there is someway to calculate a "magic angle" that will see the line on flat surface and on a ramp.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #18 on: October 18, 2008, 11:10:34 PM »
hmmmm, but when its up on the ramp, its as if its on level terrain . . . the only prob you'd have is right before it gets on the ramp, and the line is too close.

you have to decide not just the optimal angle, but also the optimal height from the ground . . . hook up your cam to your PC to view what it sees and make a subjective comparison.

then you need to account for speed . . . faster your robot goes, or slower it processes data, the further ahead it needs to look to make up for the lag time.

look at my ERP for a good example, it worked fine for me at the angle/height/speed i chose.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #19 on: October 19, 2008, 09:53:58 AM »
Heres a quick look at the final CAD of the robot:


The line following robot with vision uses a CMUcam , four 150:1 Micro Metal Gearmotor HP motors , Axon microcontroller, 6V NiMH battery pack, and one panning servo for the camera. Chassis is HDPE (Spray painted blue) and is two decker - deck supported by four hex spacers.

I haven't decided yet  if I am going to make a step-by-step tutorial or just documentation. Also I'll be making a tutorial on interfacing the CMUcam to the Axon.

More updates to follow.
« Last Edit: October 19, 2008, 09:55:12 AM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #20 on: January 10, 2009, 11:25:46 PM »
Sorry guys - seems as if I will not be able to make the SoR Robot Contest this time around. I've been way busy with other projects of mine and scheduled this robot build for February/March time .
I'll still be writing a tutorial on it though.

Oh well I guess I'll just have to let someone else get an Axon . :P
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #21 on: January 23, 2009, 04:26:12 AM »
The more robots you try to build at the same time, the fewer robots you actually build at the same time :P

Anyway, where is my CMUcam + Axon tutorial that I bribed you to do? :P

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #22 on: January 23, 2009, 07:46:14 AM »
The more robots you try to build at the same time, the fewer robots you actually build at the same time :P

Anyway, where is my CMUcam + Axon tutorial that I bribed you to do? :P
working on it , working on it.  :P
The competition for the line follower with vision is in May and I've been busy finishing up some other projects. You will for sure have it by May and most likely have it by February/March.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #23 on: February 21, 2009, 09:21:13 PM »
UPDATES!!!

I got the CMUcam to work with the axon. I even built the chassis but I havent mounted on the Axon yet. Notice the LED spotlight on the CMUcam. I also mounted a rangefinder on the robot.

Enjoy the video:
[youtube]QBCuAPl8qug[/youtube]
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Line Following Using Vision Sensors
« Reply #24 on: February 26, 2009, 09:20:35 PM »
I'm curious about the spotlight. Do you find it helps?

Got an ETA on code release? (no rush, just curious)

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #25 on: February 26, 2009, 10:03:16 PM »
I'm curious about the spotlight. Do you find it helps?

Got an ETA on code release? (no rush, just curious)
Yep it definitely helps

I'll probably release the code next week. I just got my motor drivers, so I'm trying to finish up on the robot.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #26 on: March 02, 2009, 12:47:16 PM »
Update:
Vision Camera Robot Following a Red Line

I did red because black is just too easy :P

I'll be releasing the code to do tracking sometime tonight.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Line Following Using Vision Sensors
« Reply #27 on: March 02, 2009, 12:51:30 PM »
which cam is it and why do u do the rotating motion for the cam...i think it is not required
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #28 on: March 02, 2009, 01:04:40 PM »
which cam is it and why do u do the rotating motion for the cam...i think it is not required
CMUcam

Yea I need work on my algorithm , but I need rotating motion for sharp turns
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Line Following Using Vision Sensors
« Reply #29 on: March 15, 2009, 06:51:03 PM »
New video
Line Follower with Improved Algorithm

Source code will be released tomorrow evening-  right now I'm just editing my comments so they make sense
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

 


Get Your Ad Here

data_list