How does the async nature of RVR notifications work?

There are several places where there are “notify” events: e.g., motor fault notifications or color detection notifications. I assume these events are asynchronous…but how do they actually work? Do they just pop data in the output stream when they happen?

I’ve been building a C library for the RVR interface on a Raspberry Pi. For sensors, I spawn a separate thread to handle the sensor stream. But that works because the RVR will stream data until it’s told to stop. If the notify events push out data between other data outputs, it will require a different way to do it.

Thanks.

1 Like

Yes, the RVR sends notifications and streaming data intermixed with responses from requests.

I’ve diagrammed my best guess at how this works. I"m doing a C++ reverse engineering of the protocol and documenting it in a Wiki.

3 Likes

I’m going at it a little different. I have created a C# program with a form that has most of the functions broken out on it.
You can use the program to single step through the code and see how things are assembled and sent out to the RVR. I have also broken down the incoming stream data into the many parts.
Streaming seems a little confusing to me as there is not enough data coming back to identify what stream it is. So if you enable all the sensor streams it would be impossible to determine what sensor data you are getting back.
Any way I have a working C# program up on GitHub C# Form Project

Mike

1 Like

Sensor streaming works by enabling a sensor and then telling it how often you want it to report back the data when you start it. The sensor data then comes back as a binary value that has to be scaled back to the actual sensor values.

Mike

1 Like

Reported sensor data has a token specified in the configuration. See my Wiki Streaming page. Just finished it last night. May sill have some rough spots.

2 Likes

The documentation only show 3 different values for token so that is not very useful if you want to stream Accelerometer and IMU with Gyro unless the token can be any value from 1 to 255 which is not clear from the documentation.

Mike

1 Like

My testing shows the token values can be more than what is shown. Code base is under reorg so can’t check this in detail. But I used a token of 2 and a token of 7 for ambient light and the raw values were the same. Part of the reorg is how I calculate final value.

1 Like

I was basing the token on the code in the control program. Just tried assigning tokens to each sensor and it works just fine. So multiple tokens can be used to identify different streams coming back from RVR.

Mike

1 Like