loading
 
Two COG_X variables from different markers in Python API
Loren John Presley from United States  [17 posts]
15 year
Hello everyone! My project NINA is starting to come into fuition, thanks to your help.

I do have one question concerning the python API and how to write a bit of code. I'm fairly savvy in python, I've just never used it to inferface with roborealm before, so bear with me...

I have two markers, side by side cameras for stereo vision. In my python API code, I want to get the variables of the COG_X from two Center of Gravities (one for each marker). Except I can't figure out how to write it. I've looked at the example API's and the documentation, but I still can't make heads or tails out of getting the variables from two separate COGs.

Any pointers? Thanks in advance!

Loren
Anonymous 15 year
Loren,

I assume that you know how to get variables from RoboRealm in python? So all you need to do in RR is to rename the first COG_X variable to another variable (like FIRST_COG_X) which you can use the Set_Variable module to do. You'd just place this module after the first COG and set the new variable to be the value of the COG. You'd also do this for the second COG to ensure that the values stay stable. Then from your python program you'd query FIRST_COG_X and SECOND_COG_X instead of COG.

Keep in mind that you need the second rename as your python program might attempt to read the variable when the first COG is updating it. Renaming it to another variable will ensure that the two COG's are kept separate.

STeven.
Loren John Presley from United States  [17 posts] 15 year
Oh...I didn't know you could do that. Thanks, Steven! I'll try it out.

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