ROBOTC.net forumshttp://www.robotc.net/forums/ Lego Two-Dimensional Arrayhttp://www.robotc.net/forums/viewtopic.php?f=1&t=5683 Page 1 of 2

 Author: MariosRobot [ Tue Apr 09, 2013 7:49 am ] Post subject: Lego Two-Dimensional Array Dear,i want to make a Two-Dimensional Array for Lego,i want to make a path planning to avoid the obstacles and find the shorter path in a maphow to create this program?thanks in advancebest regards

Author:  mightor [ Tue Apr 09, 2013 9:23 am ]
Post subject:  Re: Lego Two-Dimensional Array

I can help you with the array but you're on your own with the other thing. Good luck though!

 Code:int array[10][10];

= Xander

 Author: MariosRobot [ Tue Apr 09, 2013 12:06 pm ] Post subject: Re: Lego Two-Dimensional Array thanks bro, i will start the project with this

 Author: mightor [ Tue Apr 09, 2013 12:23 pm ] Post subject: Re: Lego Two-Dimensional Array Good start but I think you're likely to need a bit more code to get the whole thing working = Xander

Author:  MariosRobot [ Fri May 10, 2013 7:56 am ]
Post subject:  Re: Lego Two-Dimensional Array

i have one square 5X5,
any square 25cm
so the big square is 125X125 cm
how to define this in a two dimensional array?

 Attachments: PathPlanning.png [ 25.96 KiB | Viewed 11457 times ]

Author:  mightor [ Fri May 10, 2013 8:37 am ]
Post subject:  Re: Lego Two-Dimensional Array

You could make obstacles to be -1
 Code:int maze[][] = {{10, 9, 8, 7, 8},{11, 10, -1, 6, 7},{-1, -1, -1, 5, 6},{1, 2, -1, 4, 5}{0, 1, 2, 3, 4}};

= Xander

 Author: MariosRobot [ Fri May 10, 2013 9:07 am ] Post subject: Re: Lego Two-Dimensional Array thanks a lot bro

 Author: MariosRobot [ Fri May 10, 2013 5:06 pm ] Post subject: Re: Lego Two-Dimensional Array another one question bro, how to define the start point and end point?

 Author: mightor [ Sat May 11, 2013 1:03 am ] Post subject: Re: Lego Two-Dimensional Array Well, that depends, do you know before you start the robot where the start and finish are? How does your robot distinguish the tiles? Or do you already know "I start here and I finish there"?= Xander

 Author: MariosRobot [ Sat May 11, 2013 3:17 am ] Post subject: Re: Lego Two-Dimensional Array i want to give the start point and the end point and found the shorter path and avoid obstacles for found the obstacles i will use the sonar sensorbut i don't know how to define start and end point

 Author: mightor [ Sat May 11, 2013 3:29 am ] Post subject: Re: Lego Two-Dimensional Array You should have a look to see how others have implemented this in C. Also take a look here: http://www.mcs.alma.edu/LMICSE/LabMater ... lgCoL4.htmhttp://www.me.iitb.ac.in/~adeshmukh/floodfill.php= Xander

 Author: MariosRobot [ Mon Jun 03, 2013 5:51 pm ] Post subject: Re: Lego Two-Dimensional Array Dear,i want only to move from one point to other point,is it easy?thanks in advancebest regards

Author:  roboRed [ Mon Jun 03, 2013 7:43 pm ]
Post subject:  Re: Lego Two-Dimensional Array

mightor wrote:
I can help you with the array but you're on your own with the other thing. Good luck though!

 Code:int array[10][10];

= Xander

I didn't know that that was possible!!!!

 Author: Ernest3.14 [ Mon Jun 03, 2013 9:34 pm ] Post subject: Re: Lego Two-Dimensional Array Just a quick interjection:I've read of the wavefront method multiple times; is it the only method? It's always mentioned as the most primitive, so surely there must be better ones

Author:  MariosRobot [ Tue Jun 04, 2013 7:11 am ]
Post subject:  Re: Lego Two-Dimensional Array

can you help me with robotC code?

my instructor give me some code's parts and i implemented an algorithm but not working

 Code:#pragma config(Sensor, S4,     sonarSensor,    sensorSONAR)//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//int  M[25][25];int  V[25][25];int maxx = 24;int maxy = 24;int Gx, Gy, x, y;int goal, Sx, Sy;//Assign sequencial values in the value arrayvoid assignvalues(){  bool check = false;  while (check == false){       for (y=Gy; y>=0; y--){          for (x=Gx; x<=maxx; x++){               if (((y-1)>=0) && (M[x][y-1]!=1) && ((V[x][y]+1)=0) && (M[x-1][y]!=1) && ((V[x][y]+1)=0; x--){            if (((y-1)>=0) && (M[x][y-1]!=1) && ((V[x][y]+1)=0) && (M[x-1][y]!=1) && ((V[x][y]+1)=0) && (M[x][y-1]!=1) && ((V[x][y]+1)=0) && (M[x-1][y]!=1) && ((V[x][y]+1)=0; x--){            if (((y-1)>=0) && (M[x][y-1]!=1) && ((V[x][y]+1)=0) && (M[x-1][y]!=1) && ((V[x][y]+1) 7)    {        motor[motorA] = 10;        motor[motorC] = 10;    }   // go backward    motor[motorA] = -6;    motor[motorC] = -6;    wait1Msec(5000); // stop in 5 seconds }

 Page 1 of 2 All times are UTC - 5 hours [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Grouphttp://www.phpbb.com/