ElEscalador
Posts: 674
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

How to display large 2D array (robot map)?

Fri Jan 15, 2016 11:18 pm

In my smart roomba project, I'm at the point where the robot needs to start building a map of it's physical environment...because it's not that cool for me to have to navigate this thing by hand. The basic idea is for it to keep track of it's location on a grid of 10cm squares(like chessboard). This is my 2d array. During it's initial "map the environment" function it will drive around all clumsy like a roomba does and for every square it passes freely - it will write a char ' ' (that's a space) and for every square that it encounters an obstacle - it will write an 'X'. It's location represented by an 'O'. I originally thought I'd just cout or printf to display, but I now realize that would limit the map size to 70x45 or so squares (which would translate to a 22x14 feet ish environment) - which is way too small. I'm doing this project party to learn C++ and have made much progress so far, but have always gotten by with gpio pins and text interfaces and simply have no idea what to even google to start with a graphical display.

Maybe theres an altogether better way - I'm open to suggestions for that too.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: How to display large 2D array (robot map)?

Sat Jan 16, 2016 12:55 am

try libpng.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

rotwang
Posts: 243
Joined: Sat Dec 07, 2013 1:12 pm

Re: How to display large 2D array (robot map)?

Sun Jan 24, 2016 11:09 am

Hint :- Why not just print a section of the map centred around the roomba's location.
Roger
ElEscalador wrote:In my smart roomba project, I'm at the point where the robot needs to start building a map of it's physical environment...because it's not that cool for me to have to navigate this thing by hand. The basic idea is for it to keep track of it's location on a grid of 10cm squares(like chessboard). This is my 2d array. During it's initial "map the environment" function it will drive around all clumsy like a roomba does and for every square it passes freely - it will write a char ' ' (that's a space) and for every square that it encounters an obstacle - it will write an 'X'. It's location represented by an 'O'. I originally thought I'd just cout or printf to display, but I now realize that would limit the map size to 70x45 or so squares (which would translate to a 22x14 feet ish environment) - which is way too small. I'm doing this project party to learn C++ and have made much progress so far, but have always gotten by with gpio pins and text interfaces and simply have no idea what to even google to start with a graphical display.

Maybe theres an altogether better way - I'm open to suggestions for that too.

Return to “General programming discussion”