loading
 
Change cameras
Paul Dal Bianco from Canada  [42 posts]
7 years

I read through the FAQ and guides about using multiple cameras but I am not sure how you recommend interfacing with 2 cameras. Should I have 2 instances of RR running or can I switch cameras in one instance.


The API interface allows for sending a command to change cameras.
<request>
    <set_camera>DRIVER_NAME</set_camera>
</request>

Can I use the new parameter setting features in vbScript to change cameras in the pipline?

Thanks.  
Anonymous 7 years
Paul,

Switching between two cameras by activating and deactivating them is not the recommended solution. Windows takes a bit to do that switch and normally if something is going to go wrong it will happen during that period.

What we recommend instead is to keep both cameras active within the same version of RoboRealm by using the Marker module to switch from one camera to the other. The trick then is to use the image that is appropriate at the time. For example, if you want to switch from one camera to another using a single variable surround the Marker module with an If_statement module that checks for this variable. Then simply changing the variables value from the API (or other module) will quickly switch to that other camera. Note that both cameras are constantly running but you only pay attention to one's results and ignore the other. With both running the switching will be very quick and easy on the system.

Let me know if you need a robofile that better illustrates this process.

STeven.
Paul Dal Bianco from Canada  [42 posts] 7 years
I didn't know you could do that with the marker module. That's extremely helpful.

Thanks.
spacehermit from United States  [28 posts] 7 years
I've been fighting with getting multiple cameras working too.  The marker module works much better than what I had been doing.  If you're willing I would like an example .robo file of the if statements and marker module working together.  I tried creating a variable and changing its value in the VB script module but I must be missing something simple.  Thanks
Anonymous 7 years
Ok, included is a sample ... note that it is very brief as it is just the switch mechanism and not what may be used to set the variable. We just used the Set_variable module to show an example. Changing the camera_num from 2 to 1 will switch which camera is in view.

See attached robofile.

STeven.
program.robo
spacehermit from United States  [28 posts] 7 years
Thank you.  I had the same thing and figured out that instead of using the setvariable module I had to put the vbscript module below the if statements.
Thanks again it's working how I want it to now.

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