I'm attaching three files of C++. These put wrappers around variables to be read from RR using the RR_API. These classes only do reads, so far, since that is all I've needed to date. I'll add writing at some point in the future but though some might find limited routines these useful before I get write opeartions.
The first class is RoboRealmVar which wraps individual variables. Its a template class. I've created specific instanctiations for int, float and string. It should be easy to add more if necessary. The only thing you might have to write is a simple conversion from ascii to data type routine. See the string instatiation for how it was done there.
To declare a var is done by:
Instatiate it with
where mRoboRealm is the instance of RR from RR_API.
All the examples are for the COG module and are using class members, hence the 'm' prefix.
You can retrieve the values with:
int cogX = mCogX();
which uses an overload of operator();
If you want to retrieve mutliple variables with one call use the class RoboRealmVars. You may have noticed the class RoboRealmVarBase which is a base class for RoboRealmVars. It is used to provide an interface to individual vars when working with multiple vars.
Do this for multiple variables:
which is another operator() overload for reading multiple vars. All the individual vars then have values that can be accessed as shown above in the individual var example.
Hope someone finds these useful. I know reading multiple vars took a lot of detail chasing that this new class how hides.