View unanswered posts | View active topics It is currently Sun May 29, 2016 5:36 am

 Page 1 of 1 [ 7 posts ]
 Print view Previous topic | Next topic
Create a map
Author Message
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Create a map
Dear,
i want to create an algorithm for path planning, first i want to create the map of environment,
how to put in my program a standard environment?

Fri May 17, 2013 3:23 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Create a map
i created a 2D array
and a loop for sonar sensor

#pragma config(Sensor, S4, sonarSensor, sensorSONAR)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

// create 2D array 5 X 5
int square[][] =
{
{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},
};

{

// Move forward until 7 cm from the wall.
while (SensorValue(sonarSensor) > 7)
{
motor[motorA] = 10;
motor[motorC] = 10;
}

// go backward
motor[motorA] = -6;
motor[motorC] = -6;
wait1Msec(5000); // stop in 5 seconds
}

Fri May 17, 2013 4:24 am
Professor

Joined: Sat May 18, 2013 1:24 pm
Posts: 271
Location: Olympia, WA
Re: Create a map
Could you explain your code a little more? For example, what does your array represent?

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

Sat May 18, 2013 2:31 pm
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Create a map
the black area it is the obstacle,
i defined with -1
the other numbers
Starting from an array value of 1, add 1 to
every adjacent square that is a 0.
Starting from an array value of 2, add 1 to
every adjacent square that is a 0.
Starting from the goal turn left, right or
continue straight to ensure the robot
always goes to a lower numbered cell
Or a same numbered cell if no lower one
exists

something like this picture,
but i don't know how to create a map or how to move the lego in one area

 Attachments: plan.png [ 15.27 KiB | Viewed 3739 times ]
Sat May 18, 2013 5:20 pm
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Create a map
i want to move the robot based on array, how to connect the robot with array?

Sun May 19, 2013 5:26 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Create a map
i believe the code for this example image is the follow
int square[][] =
{
{7, -1, 5, 6},
{6, 5, 4, -1},
{7, -1, 3, 2},
{8, -1, 3, 2},
};

how to put the robot motion with array?

Sun May 19, 2013 5:35 am
Novice

Joined: Wed Feb 20, 2013 2:46 am
Posts: 64
Re: Create a map
how to create a static map? the obstacles not moves, i want to know before start the program where are the obstacles
if i will create a map may have the project

Tue May 21, 2013 4:03 am
Display posts from previous:  Sort by
 Page 1 of 1 [ 7 posts ]

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