loading
 
OSC controll questions
Brian Banta from United States  [7 posts]
16 year
Hi,
I've looked at the other posts about using OSC but I'm still unclear about it. I'm designing a robot that will follow a colored object around. I'm using the Make Controller which can be directly controlled via OSC from a computer. Since it has an ethernet jack on it, and an IP address and I can send the commands directly from RoboRealm. But I can't seem to put in the variables that I need. I need to be able to send out /servo/*/position *   but I can't seem to be able to do so, under "available variables" the only one that I can using a module is servo_position. But it's not the correct one. Is there a way I can set my own variables. Also, is there a good VB script tutorial out there, I've been looking around and I can't find a good one. Thanks a allot, Rob
Anonymous 16 year
Rob,

Yes, there are several ways to create new variables. You can use the set_variable module

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

which is good for setting variables to other variables or to static values (i.e. a number). You can also use the VBScript module

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

which is nice when you need to calculate a variables value from another as in

x = GetVariable("servo_position")
x = x * 10
SetVariable "position", x

Or you can also use the API from any other language and call the SetVariable function in that respective language which will send the set_variable xml stream to RoboRealm and cause it to create a new variable.

Think of variables as the content of RoboRealm and the modules as interfacing that content to other systems in the case of OSC.

Note that many modules also create their own variables.

Also note that in your case the Address prefix would be

/servo/*/

and the actual value would be based on selecting the 'position' variable from the dropdown (assuming it has been created by one of the above). Note that since you probably want to set different servos (like left and right) you will have to use 2 OSC modules with

/servo/0/
/servo/1/

as their address prefixes and reassign the position variable after using the first OSC module. Its not an elegant solution but should work. We will also look at creating a module specifically for the Make Controller which will make all this communication easier.

STeven.






Anonymous 16 year
Ah, ok, so I would need to make a VBscript program that would get the variable I'm looking for and then send it out to another program that would interface with it and send out the osc message i'm looking for?

Rob
Anonymous 16 year
Creating a module for the Make Controller would be great, there are allot of people who would be extremely enthusiastic about having roborealm interface with it.
Rob
Anonymous 16 year
Rob,

Not exactly. Lets make a simpler example. Suppose you want to change the position of servo 0. You would then configure the OSC module using

/servo/0/

as the address prefix and select

position

as the one variable to send. See the robofile below for this example. You will have to config the port to the one you are using on the make controller.

So this should work for one servo. For more than one you will need to repeat the exact procedure and use the same module type but with as another instance (i.e. you would have 2 OSC modules in the pipeline). The reason for having two modules is because you need to change the address prefix to

/servo/1/

in the second module ... since you can only set this to static text you need two modules to specify a different prefix.

Does that make more sense?

STeven.
program.robo
Anonymous 16 year
Also, would you be willing to beta test a Make controller interface if we create one?

STeven.
Anonymous 16 year
I would love to beta test it if you did!
Anonymous 16 year
^That actually is me, Rob, forgot to put my name sorry, but yes, I would be glad to beta test it for you.

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