RVR Distance Control

I’ve been having a good amount of success with RVRs “Drive forward for _ seconds” block in the EDU app, but it has been quite time consuming finding out how far it will go each time, leading to a lot guess and checking. As the RVR is very precise, would it be possible to command it to move # feet (or meters) in a direction? It would make everything way easier since I could just measure how far i want it to go and plug that into the app. Or if not, is there a way to convert its 0-255 speed into m/s? That would make the math a lot easier.

Also, because it has so many sensors, I was wondering if one of them would be able to retrace its path. For example pushing it a certain distance, taking it back to the start, and then having it automatically retrace its steps. I know this might be far fetched, but since it can stabilize, it must have some sort of orientation and movement tracker that could record the data to use in a future run. It’s just an idea, and might not be possible, but since asking won’t hurt, I might as well do so.

2 Likes

That would be a fun thing to implement :smiley:

One of the challenges with us giving you a speed in m/s or having you be able to ask RVR to go a certain distance is that different terrains/terrain grades can affect RVR’s travel (though we are still working on these capabilities). With that said, have you looked at the velocity and acceleration graphs that are produced after your program is run? Those can also be found in the three dot menu in the program editing screen, under “Sensor Data”. Using the information there may help you with your calculations :blush:

We are also working on a retracing steps example program for RVR! Because, as I mentioned in my other response to you, MakeCode hasn’t approved our extension, this program doesn’t yet have the RVR components, but it can give you an idea of the general format you could use (putting movements in an array and reversing that array) to accomplish your goal!

Hope you have tons of fun!

Kelsey

1 Like

Ok, yeah, that makes sense. Although you could still make an option for m/s or feet for when it’s used on a smooth, flat surface. (like on a wooden or stone floor.)

1 Like

If I read correctly the parameter called “Distance” is only available when the program has completed. Why could it not be the real time distance ran so far ?

We do need an real time distance value to perform exact move, turn etc. The time value is only good for fixed speed and a bit of trial an error.

I understand that all of our suggestions represents more work, changes and testing.

Thanks for your support

1 Like

@caribe, when working with the serial communications API the location is updated in real time. Not sure if you can capture that data using Javascrip in the Edu app.

1 Like

I wrote a few line with Scratch to try it out but the parameter value is ignored.

I just tried using “Location” using Y axis with similar results. Maybe something will be in the next firmware update.

Eventually I will put my Pi on but in the meantime I just wanted to learn what could be done as is.

Thanks for the input.

2 Likes

@caribe Have you had any luck with this? Also looking for a way to get real-time location/distance data.

1 Like

From what I know the RVR does not have a built in GPS. (I may be wrong, but I was told it can’t tell me the speed in mph or m/s, so I’m going to assume that means no gps as well) I’m sure it would not be too hard to make it work using RasPi, but not everyone has one of those.

Hi,

No did not go further with that issue. I will wait and see in the Q1 firmware update. I m planning to put a Raspberry Pi on the RVR
in the coming months.

Thanks

Benoît Carignan

2 Likes

I will try it out and update if I make some headway.

1 Like

maybe the RVR motors have some sort of feedback? maybe hall sensors? in that case we could get a reading of how many revolutions we are looking at, then with that we could estimate a distance traveled per revolution, and estimate distance traveled in unit of time with that?

Actually they have already announced that in an upcoming update you will be able to get RVRs speed in m/s