Sphero RVR Blocks - Pitch Orientation Vs Rate

Trying to do something I consider fairly simple. I was a bit surprised that it didn’t work the first try.

I want the main LED to be red if RVR is flat on the ground, and green if his pitch is above 45 degrees.

This didn’t work, but with some tinkering I think I have found that the block Sensor > Pitch Orientation, it is sensing the Pitch RATE rather than the Pitch Orientation.

Also, pitch up seems to be in the negative direction.

Am I doing something wrong? Is this by design?


Also which chip are you guys using? It doesn’t look like the BNO055’s I’ve seen. (for the IMU)

1 Like

@Kinvert I took the Sphero asyncio single_sensor_stream.py and made a few changes to make RVR do what you have described above with a small twist. When front of the RVR is <45 degrees the headlights are green. When the front of the RVR is lifted above 45 degrees the headlights turn red. Hope this helps.

RVR as a tilt sensor

1 Like

I got it to work in Python also. However the blocks being named orientation instead of rate could be confusing.

What direction resulted in positive pitching angle for you?

Lifting the back of the RVR up gave me a positive pitch angle. Lifting the front is a negative angle. You can see that in the code. I agree that seems odd, but we can wait for one of the Sphero staff to let us know why they designed it that way. :slight_smile:

Yep your positive pitch seems backwards like mine. At least backwards from what I think is normal convention. Maybe it was designed this way.

1 Like

That is wrong by the conventions. See https://en.wikipedia.org/wiki/Aircraft_principal_axes.

Do roll and yaw conform to the direction in the article?

Roll - left up, right down.
Pitch - nose up
Yaw - positive to right

1 Like

@Kinvert We are using an ST chip as our processor that handles RVR’s IMU :slight_smile:

The behavior that you and @Missionctrl are seeing is unexpected. We confirmed using the EDU application, the Python SDK and the Node SDK that IMU reads positive pitch for nose up and negative pitch when the back of the RVR is lifted. Can you confirm that you are on the latest firmware version (you connected to the EDU application before using)?

We will continue to troubleshoot on our end and see if we can reproduce the behavior you are seeing!



Yes I used the EDU app before using.

You guys can send me some Python code and I can try it probably later today if that works. Who knows maybe I wrote it wrong.


@Missionctrl In the code you shared, I noticed the usage RvrStreamingServices.accelerometer. If it’s the pitch angle that’s of interest, have you tried using RvrStreamingServices.imu?

@Kinvert On line 34 of single_sensor_stream.py found under the getting_started/asyncio/sensor_steraming directory, you can replace RvrStreamingServices.accelerometer with RvrStreamingServices.imu to stream data pertaining to pitch, roll, and yaw (in euler angles).


@angel.of.desk Thank you for the reply and sorry I did not come back and update my post. You are correct. I used the accelerometer Y axis in my code so when the nose of RVR is lifted up i triggered the lights at -0.45. I should have used the IMU pitch as you indicated which I can confirm does give me a positive value when the front of RVR is lifted.