View unanswered posts | View active topics It is currently Fri Jan 17, 2020 9:20 am

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
Rookie

Joined: Thu Feb 19, 2015 10:24 am
Posts: 3
Right now I am still new to RobotC, but It does not seem too different from NXT-G and I am patient enough to learn. I have an algorithm written in NXT-G for a robot competition at my school. Basically it is two robots in an 8x8 square arena and there are blue and yellow canisters. A corner with a light source is where to blue canisters go(which is easy), but the opposite corner is where the yellow canisters go. Is there a way to have the robot know where the center of the arena is after picking up a yellow canister? Any help would be greatly appreciated.

Edit: the only sensors allowed are the ultrasonic, magnetic, color, touch, light and sound.

Thu Feb 19, 2015 10:30 am

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Re: Return to starting position(is this possible?)
How is the field laid out, is it a grid pattern (8x8 squares?), and if so how are the squares separated? If the different squares have a distinct separation between each 'tile', you could use the light sensor to count how many lines have been crossed.

Alternatively, you could use the encoders in the motors to keep track of how far the robot has traveled in a given direction, the ultrasonic to see how far away from an object (or wall) the robot is, etc. There are many, many different ways to solve this particular problem; I suggest breaking down the full challenge into step-by-step sections (what the robot is doing first, what it is doing second, what it is doing third, etc) and then breaking each section down into individual behaviors (moving forward, turning, closing the gripper, etc).

This is called behavior based programming, and you can find more information on how to implement it under the 'Thinking About Programming' section found here.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.

Thu Feb 19, 2015 1:07 pm
Rookie

Joined: Thu Feb 19, 2015 10:24 am
Posts: 3
Re: Return to starting position(is this possible?)
Thank you for the response John,

Unfortunately the arena is an 8'x8' square with a solid green mat as the surface. The algorithm i have written in NXG allows for collision avoidance and can bring blue canisters to the light corner 100% of the time. My robot actually won the preliminary competition for the school. I have done research on dead reckoning by using the encoders in the servo motor, but I can't seem to find out how to work that into the algorithm. If there is a resource anyone could possibly guide me towards, it would be very much appreciated.

ps. right now the ultrasonic sensor is used to avoid the other robot in the arena, and the walls. Also it is used to let the robot know when to release the blue canister(when it is in the "light" corner). The robot moves in a random motion until the color sensor picks up blue or yellow and the claw closes. The Yellow canisters are magnetic, so the magnetic sensor is used to tell the difference between the two.

Thu Feb 19, 2015 2:16 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

 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.