loading
 
first try: interfacing with parallax servo controler
grindel  [5 posts]
17 year
Hi all,
I have read through the tutorial on the web controlled camera.  I want to do something similar but using the parallax controller.  Can I somehow use the parrallax controller extension to make programming easier?  I am not skilled in programming (yet) so any help would be appreciated


Thanks,
Anonymous 17 year
grindel,

That should be possible with not much programming. If you replace the Orbit module with the Control->Parallax Module you will see a control interface to the Parallax. The interface allows better control over movement than the Orbit module as you can specify variables that range from 0 to 255 to control the absolute position of the servo as apposed to 'move a bit up' or 'move a bit down' in the Orbit control module.

You could emulate the current mode by using the VBScript module to accumulate a position count that is received from the web. Replace the current VBScript for the tutorial with something like:

panServo = GetVariable("pan")
tiltServo = GetVariable("tilt")

move = GetVariable("move")
' so you don't process it more than once
SetVariable "move", 0

select case move
  case 1:
    tiltServo = tiltServo+10
  case 2:
    tiltServo = tiltServo - 10
  case 4:
    panServo = panServo + 10
  case 8:
    panServo = panServo - 10
  case 16:
    panServo=128
    tiltServo = 128
end select

SetVariable "pan", panServo
SetVariable "tilt", tiltServo

and then use panServo and tiltServo variables in the Parallax interface with the appropriate servo. Note that this is just one way of doing this ... you can also change the web interface buttons to specify values directly.

STeven.
grindel  [5 posts] 17 year
"use panServo and tiltServo variables in the Parallax interface"  
This is what I am having trouble with, when I load the Parallax control extension, all it enables me to do is select a com port, mess with some servos with the sliders.  How would I get the web page to interface with that, especially since I don't seem to be able to modify the extension (is this correct with roborealm?).  Maybe it doesn't need the extension at all, and everything has to be done on the web page.  sorry to be so ignorant, I have looked around and found some examples of Java outputting information to a com port, but I have not gone down that road since I found roborealm and figured that it might be easier.

My original code was written over a year ago and was a hacked up mess that ran on apache tomkat, I figured out how to link actions to a button, it called a .bat file that would redirect an echo out to a com port (using a program I download), but it was very slow to react to the button push.

Thanks
Anonymous 17 year
Grindel,

No problem. It is a little tricky to understand how information moves from the web into RoboRealm so I'll try to outline it here.

On the webpage you have a bunch of buttons and each of those buttons has a name and a value. You can also have other elements like text boxes, etc. but from our point of view they are also just containers for a name and a value.

Once you submit that page (or use Javascript to refresh it) those name and value pairs are submitted back to the webserver. In this case the webserver is RoboRealm. RoboRealm will read and parse all those name, value pairs and create RoboRealm variables based on those name value pairs. Thus any module that needs variables can now read the information that had been submitted from the webpage in order to change their action.

For example, the control->parallax module will have the sliders for you to manually test the movement but more importantly they each have a dropdown next to them that will list all the currently know variables in the system. If you had submitted a webpage already the variables will be seen in that dropdown ... if not just type in the name (it is a combo box) that you intend to contain the servo position value.

Thus, you can use a url/webpage to create or update a variable value within RoboRealm. That variable would need to be specified in the Parallax module "binded" to one of the servo's. Then when you type in a number in the webpage, submit the page back to RoboRealm the servo will move based on that value. This assume the value ranges from 0 to 255.

Try this the included robo-file below. When you run it it will just configure the parallax module to turn the first servo based on a my_servo variable value. Then be sure to have the webserver turned on and execute this url in your browser:

http://localhost:8080/set_variables?my_servo=200

which should cause the servo to move to position 200 ... like wise

http://localhost:8080/set_variables?my_servo=100

will cause it to move to position 100. The urls above simulate pressing a button whose value is then directly fed to the parallax extension.

Note the included index.html file includes code in Javascript to show you how to send this information back to the web server without needing to refresh the entire page ... this technique is known as AJAX.

Hopefully this helps a little.

STeven.



program.robo
grindel  [5 posts] 17 year
This makes much more sense, I should been able to figure that out.  Thanks for your time, I will try it tonight.  

cheers!
Anonymous 17 year
woohoo, this works on my win2000 machine, not my Vista laptop.  See other post about "VBScripts under Vista"
Anonymous 17 year
feel free to mess with it as long as this IP lasts

http://75.23.97.214:8080/

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