loading
 
Roborealm and NXT
Michael from Canada  [9 posts]
17 year
Hello:

I have been playing around with Roborealm and the NXT. I have managed to get the Roborealm software to detect the red ball. I think I have also managed to get the NXT and Roborealm connected together using the Bluetooth. What I need is a working sample of the Roborealm *.robo file, and the corresponding NXT-G file. My programming skills are not very good so if there is a VBscript file it needs to be shortened so that it shows only the left and right motor adjustments for tracking one of the balls. Can someone please help me out? I have also asked for some help on the nxtasy forum.

Mike,
My Solution
Anonymous
17 year
I have experimented with the same kind of project, and I have included my .robo file with this post.  As far as I know, you don't need an NXT-G file if you're using the Lego_NXT control in RoboRealm.  My sample program follows a red ball, moving the left or right motor depending on the X value of the Center of Gravity of the red shape.  

To get a feel for how to use RoboRealm  with your NXT, check out the VBScript Program module of the .robo file, most importantly the lines:

SetVariable "Left_Speed",  CLng( (GetVariable("COG_X") / GetVariable("IMAGE_WIDTH") * 100))
SetVariable "Right_Speed",  CLng( (1-((GetVariable("COG_X") / GetVariable("IMAGE_WIDTH")))) * 100)

Thost lines set two variables ("Left_Speed" and "Right_Speed) depending on the X value of the Center of Gravity module.

Next take a look at the Lego_NXT control module.  You should see two variables in motor ports A and B respectively, the "Left_Speed" and "Right_Speed" we just set in the VBScript module.

Finally, in the lower right hand corner of that same module you should see a box marked "Options" and in that a drop down list of which connection to use.  Choose the appropriate COM port from your bluetooth connection, and you should be up and running!

If you have any questions, don't hesitate to ask!

~Kevin
program.robo
NXT-G and roborealm
Michael from Canada  [9 posts]
17 year
Hello Kevin:

Thank you for your help. I will try out your sample later tonight. Have you tried using Roborealm to control the robot along with a NXT-G program? That is my ultimate goal, to have the camera assist the robot as it navigates its way through the house.

Mike,
Anonymous 17 year
Unfortunately, no I have not used the NXT-G program at all.  I work as a computer science research assistant at a university, and the NXT-G is not programming-intensive enough for our uses.  We use Microsoft Robotics Studio for all of our robotics programming.  MSRS does include a Visual Programming Language, so it might be worth checking out, even if you aren't very experienced with programming.

As a side note, many of my goals with RoboRealm are similar to yours: to use RoboRealm as a supplement to my programs that require machine vision.  So hopefully we'll be able to help each other out!

~Kevin
Anonymous 17 year
Michael,

Did you not find the example NXT-G and robofile downloads on

http://www.roborealm.com/help/Lego_NXT.php

to be sufficient? Or did they not work?

STeven.
using roborealm and NXT
Michael from Canada  [9 posts]
17 year
Hello STeven:

I have had a bit more success with the software. One thing that I did notice is that as played with the software/scripts that the program started to bog down and get very sluggish. At first I noticed the list of variables that I can watch kept getting longer and longer. Than I decided to delete all the modules and start over. Guess what? The sluggishness went away. I have not had a lot of time to play but now that things are working better I should be able to do get my robot up and running.

Thank you for all you help.
Mike,

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