NXT-G Return to Starting position
Brian from United States  [1 posts]
2 years
Hi all,

I have an algorithm written in NXT-G for a robot competition at my school. The competition is basically  two robots in an 8x8 square arena(solid green mat surface) and there are blue and yellow canisters randomly scattered around the arena. 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. Both 'drop zones' are are a different color surface than the rest of the arena.

Is there a way to have the robot know where the center of the arena is after picking up a yellow canister? Is this possible using Roborealm and NXT-G? Right now my algorithm has won the preliminary competition for my section, but I really am willing to put in the work to win the whole thing. I really want to write a program for my robot to be able to use dead reckoning from any position that it picks up a yellow canister and accurately move the either the center of the arena or directly to the yellow drop zone. Any help would be greatly appreciated.

Edit: the only sensors allowed are the ultrasonic, magnetic, color, touch, light and sound. No camera unfortunately.
Steven Gentner from United States  [1370 posts] 2 years

It is certainly possible to use the encoders to get a rough idea on where you are in the arena. If you have a look at


that is a good intro to using encoders. You can skip down to the software section since the NXT has these built in already.

I would also look for some sort of absolute correction (like the floor color transition) to help correct the eventual drift that you will experience. You'll have to try with just encoders and then decide if it is sufficient or not. Any event that you can detect can be used to help reduce this drift over time but with additional complexity. The algorithm described above should be able to run on the NXT itself so no need for RR here.

Anonymous 2 years
Thank you for your response Steve.

I gave the article a read. I am not too familiar with NXC and I do not think I will have time to accurately apply the code to my existing algorithm(written in NXT-G). I have dug deep through the internet and I have not found a way to apply odometry with NXT-G. Do you know if this is possible? Or if it is possible to integrate RR into NXT-G to accomplish this task?

I am sorry if i sound lazy or uneducated on the subject. I really am willing to put the work in, as long it is something that i can practically learn. Thank you already for your help.

Steven Gentner from United States  [1370 posts] 2 years
It would be possible to integrate a RR module to do location estimation using the encoder values from the NXT. Do you know if you are allowed to use an external computer communicating to the NXT via bluetooth? Most of these competitions do NOT allow for external computation to be used which is needed in order to run RR ... unless you have a small Windows computing environment that you can put on the NXT.

Let me know if you can and we can work up a module that should do the trick. Let me know your competition schedule in case something comes up that requires our undivided attention which would delay the release of this module.

Anonymous 2 years

I am so sorry for the late response, I did not get a notification that anyone had replied to my message. The competition is exactly 1 week from now. There's nothing in the rules saying that I can't use my computer to run RR during the competition. If you can help, Please email me at btromero@hotmail.com Thank you so much, if this is possible. I can explain more about how my algorithm works.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index