User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 565
Joined: Sat Nov 02, 2013 2:06 pm

Robot Navigation - Mapping or Map Reading

Tue Apr 10, 2018 3:15 pm

Whilst prepping for PiWars 2018 I have started to look at OpenCV for robot vision. I am currently working on the Maze challenge and am looking at a couple of approaches.

One option is to navigate the maze by locating the boundaries of the maze (the walls) and driving along a centre line in between the walls. This would involve using Hough Line Transform or Canny Edge Detection.

The other that I would like help with involves mapping the maze either by building up a mental map of the maze when obstacles are detected. Or navigating the maze using a pre-loaded 2D image of the maze with symbols to confirm location.

Or better still a combination of maze mapping and OpenCV vision.

Obviously navigating in this manner and moving in a direction for a specified amount of time (based on knowing how far the robot will travel each m/s) is fraught with issues such as wheel spin etc but having the added advantage of using OpenCV for line / shape detection for identifying symbols and obstacles will help to build a relative picture of the robots world.

What I would like help with initially is a steer regarding how to get the robot to read a pee-loaded image and or make a map based on what it sees?

Thanks in advance.
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: Robot Navigation - Mapping or Map Reading

Tue Apr 10, 2018 8:40 pm

If you are designing the maze then an easy way to make this challenge is to make the maze by with a black line down the center of the pathways of the maze, strictly speaking then you don't even need the walls as your following the black line in the center not the walls. This will also make it easy for beginner to attempt this challenge as line following and detecting a side branch in the line is much easier to code.

You won't be able to move the robot a reliable distance without have a encoder on the wheels to measure wheel rotation. It might be a better approach to maybe drive till you find the side branch rather than drive a certain distance. You could possibility have some error checking like the side branch should be in this distaince with + or - 15% for error and if you have gone more than 15% past the expected distance without finding side road then your code can realize it may have missed it's turn

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 565
Joined: Sat Nov 02, 2013 2:06 pm

Re: Robot Navigation - Mapping or Map Reading

Wed Apr 11, 2018 9:57 am

Thanks for the reply but line following is not an option (I can already do that with OpenCV). I am trying to find a more complex method of vision. I know that sound silly but eventually I want a robot that can map an unknown area.
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
B.Goode
Posts: 8059
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Robot Navigation - Mapping or Map Reading

Wed Apr 11, 2018 10:09 am

It sounds as though you are teetering on the brink of the knowledge domain referred to as Machine Learning?

A great topic to investigate. But I doubt you are going to get working results in the next 10 days...
What I would like help with initially is a steer regarding how to get the robot to read a pee-loaded image and or make a map based on what it sees
Do the PiWars organiser reveal the maze in advance? Or do you plan to sneek in and grab a picture for yourself?

IF (and it's a big if) there is enough visual contrast between the upper edge of the dividers and the floor of the maze you might be able to do some image processing with something like GIMP?

User avatar
recantha2
Posts: 277
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Robot Navigation - Mapping or Map Reading

Wed Apr 11, 2018 4:42 pm

Hi.
I'm one of the Pi Wars organisers. We do indeed reveal the design of the maze in advance. There's several ways of completing it:
1/ Ultrasonics on multiple sides of the robot to detect the walls.
2/ Pre-encoding the robot with a route with distances and angles.
3/ Add up to 6 'targets' such as QR codes for your robot to lock onto.
4/ Use the colours of the maze walls to know where you are.

All the details and renders can be found here:
https://piwars.org/2018-competition/cha ... imal-maze/

However, maybe for next year, we may not show you the design of the maze, should the maze be a challenge we choose... :-)
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 565
Joined: Sat Nov 02, 2013 2:06 pm

Re: Robot Navigation - Mapping or Map Reading

Wed Apr 11, 2018 7:35 pm

Mike,

It's Bill Harvey, we have been conversing by email and on Discord. Nice to see you lurking here as well. I use the user name JonnyAlpha for several forums, a hang up from my childhood love of 2000AD. 😂

Yes I think I will really get into OpenCV and Machine Learning after PiWars.
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

Return to “Automation, sensing and robotics”