loading
 
Separating Roborealm Data in Arduino
Andrew Green from United States  [4 posts]
13 year
Here is my problem. I am not that familiar with programming arduinos and I want to use the microcontroller rather than vbscript to control pan/tilt servos for an object tracking camera but I have no idea how to separate the roborealm data in arduino. I want to send the data packet from roborealm's serial module as:

<[cog_x],[cog_y],[cog_box_size]>  

Then I want allocate each variable's value as independent integers in aruduino such as:

x = cog_x
y = cog_y
box = cog_box_size

How can one take that data packet, determine the beginning, separate the three variables independently into integers, determine the end of the packet, and then to be ready to start the process all over to update them. I am yet to find a sample code for this where more than one variable needs to be isolated.

Any help would be appreciated as well as any sample code, thanks.
Anonymous 13 year
Well, it's kinda of a forced parcing technique where I adopted snippets of code from this forum: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1270827974/3 It is currently doing exactly what I need. The Camera's pan/tilt servos move smoothly without stuttering too. I'm sending the serial sequence at 50ms but it even does alright on AFAP. Also, depending on your servo configurations you might have to swap the pan/tiltAngle++ to pan/tiltAngle--. Anyway, hope this will help some of you.
PanTilt.zip
Andrew Green from United States  [4 posts] 13 year
Oh forgot, here is the Robo file I made for my program. It uses fiducials. I found they are more stable than color tracking.


program.robo
Oscar Galvez from United States  [2 posts] 13 year
I'm not very skillful when it comes to programming but I get my experience from reading online references. I am currently having an issue with my robot. I'm using roborealm to locate an object. The camera is mounted on the base and the wheels are programmed to rotate and find the object's center mass. Once this is complete, I would like the robot to move forward or backwards to a designated distance. I have my code, everything works great except for moving forward or backwards.  I know I'm doing something wrong but not sure what it is. I would appreciate any feedback, thank you.
Oscar Galvez from United States  [2 posts] 13 year
I'm not very skillful when it comes to programming but I get my experience from reading online references. I am currently having an issue with my robot. I'm using roborealm and arduino mega to locate an object. The camera is mounted on the base and the wheels are programmed to rotate and find the object's center mass. Once this is complete, I would like the robot to move forward or backwards to a designated distance. I have my code, everything works great except for moving forward or backwards.  I know I'm doing something wrong but not sure what it is. I would appreciate any feedback, thank you.
Arduinocode.zip
program.robo
Andrew Green from United States  [4 posts] 13 year
Hi, I actually have an updated code I used for my senior design robot in college. It worked as i wanted and I graduated on it. The thing had a fast tracking pan/tilt camera and would effectively move forward/backwards and turn at the same time. I'm sure the algorithms controlling all that could be improved but if you are interested you can contact me at my email electronica95@gmail.com and I can give you the updated code and walk you through it if necessary. Also, I may have to take out some extra stuff in it such as sonar implementation for object avoidance in order to simplify it.
Oscar Galvez from United States  [2 posts] 13 year
I would greatly appreciate any help you can spare. I'm inches away from completing my hobby robot, just need it to go forward or backwards =).

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