View unanswered posts | View active topics It is currently Sun Aug 28, 2016 6:29 am

 Page 1 of 2 [ 27 posts ] Go to page 1, 2  Next
 Print view Previous topic | Next topic
Lego Two-Dimensional Array
Author Message
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
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 map

how to create this program?

thanks in advance
best regards

Tue Apr 09, 2013 7:49 am
Site Admin

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Tue Apr 09, 2013 9:23 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Lego Two-Dimensional Array
thanks bro, i will start the project with this

Tue Apr 09, 2013 12:06 pm
Site Admin

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Tue Apr 09, 2013 12:23 pm
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
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 7789 times ]
Fri May 10, 2013 7:56 am
Site Admin

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Fri May 10, 2013 8:37 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Lego Two-Dimensional Array
thanks a lot bro

Fri May 10, 2013 9:07 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Lego Two-Dimensional Array
another one question bro, how to define the start point and end point?

Fri May 10, 2013 5:06 pm
Site Admin

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Sat May 11, 2013 1:03 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
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 sensor
but i don't know how to define start and end point

Sat May 11, 2013 3:17 am
Site Admin

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
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.htm
http://www.me.iitb.ac.in/~adeshmukh/floodfill.php

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Sat May 11, 2013 3:29 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Lego Two-Dimensional Array
Dear,
i want only to move from one point to other point,
is it easy?

thanks in advance
best regards

Mon Jun 03, 2013 5:51 pm
Expert

Joined: Fri Nov 02, 2012 12:07 am
Posts: 163
Location: California, USA
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!!!!

_________________
string Robored = "Awesome"
~~Neil Balch~~

Mon Jun 03, 2013 7:43 pm
Professor

Joined: Sat May 18, 2013 1:24 pm
Posts: 271
Location: Olympia, WA
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

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!

Mon Jun 03, 2013 9:34 pm
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
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 }

Tue Jun 04, 2013 7:11 am
Display posts from previous:  Sort by
 Page 1 of 2 [ 27 posts ] Go to page 1, 2  Next

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.