Display Distance wheels encoder

hello, i have installed a wheel encoder for distance measurement on my rover with orange cube. it works because I have the feedback in Mavlink which gives me good info and can see ground speed in mission planner and QGC.
Unfortunately, I don’t know how to display the wheel,distance measurement in Mission Planner, I want to display the distance ground in on my radio control with QGC or SOLEX from HERELINK. i want to see the distance travelled in live. is this possible and if so how ? help please I am stuck on this last step. thank you very much.

Hello,

This could be implemented with a LUA script reading wheel encoders and outputting on GCS console using gcs:send_text

ah ok ! i will try that. I’ll have to find someone to write this, I unfortunately don’t know how to do it. if it can interest someone on this forum …?! Thank you for your answer. Have a good day !

Maybe @count74 or @Yuri_Rage might be interested to help

1 Like

I can take a look at the methods for accessing WENC data in Lua and at least point the topic in a good direction, if not write the script. It sounds reasonably straightforward. I’ll try and update this post later today or tomorrow with some more info unless someone else beats me to it. I have a small, indoor wheel encoder Rover running on a Cube Orange, so I can test it.

1 Like

that would be really great, because I’m blocking more than that to complete my project.
This function will be of crucial use for the future development of the project, thank you in advance. you are doing a great job on this forum …!

1 Like

At a glance, I don’t see an existing Lua binding for wheel encoder data. I’m sure I could figure out how to write one, but that would mean you’d be stuck with my fork/branch of ArduPilot (at least until that binding is merged with the master branch).

@iampete, is there a better/existing way to access wheel encoder data via Lua?

Can we read through MAvlink message ?

Technically you can read a serial/telemetry port within Lua, but I don’t know of a way to parse the data effectively to capture a specific message without writing a MAVLink library in Lua, which seems like the hard way to do things here.

I’m happy to be proven wrong!

it s unlucky that the developers of Ardurover are not provided for this display because we can display the speed but not the distance traveled (odometry) while this can be read by the Mavlink, to be sent back to the Arupilot developers for the next update day maybe?

sorry for my english, i m french using google translate… :slightly_smiling_face:

I debugged a balance bot with two DC motors with encoders (now unusable with 4.1.x) with a lap to a circuit, looking at WENC,Dist’s on MP on the log:

Since I had that lap as mission waypoints, adding the individual distances between waypoints (haversine’s), when the sum was coincident with WENC.Dist’s, and appeared as above, everything was right.

Note above that inner wheel shows a smaller distance.

To be fair, the value is provided via MAVLink, and it can be displayed in the Inspector that Mission Planner provides.

Your request was to display it on two other platforms not developed or maintained by ArduPilot, so the Lua solution seemed most advantageous. However, there is no binding (at present) for WENC data in Lua.

yes indeed I had mentioned two platforms which are QGC and SOLEX in case someone has a solution with these 2 there.
if I understood correctly we can “visualize” but not display the distance in MP as we can do with the speed then? that’s it ?

thanks Webillo
for what : the Rover must move without GPS and I must be able to see how far from the start I stopped to inspect detect objects at the same time.

You only need the rover to move between known GPS points, so you can compare with haversines the WENC.Dist’s on the log. But, for example if you move between two points with distance measured with a metric tape you would not need GPS at all (compare WENC.Dist’s to a known measure).

I think I explained myself badly:
I want to be able to display the distance from my starting point while I am driving the rover.
the goal being to inspect caves and identify objects.
I pilot manually and not automatically, I watch the video from the camera in streaming and at the same time the odometry is displayed on my radio screen.

Distance from home is available in the MP Quick tab, as is total distance driven.

If you want a periodic MAVLink GCS message with those values, I can help with that.

I thought you specifically wanted each encoder’s discrete output.

yes i saw that in Quick Tab and i can display in Hud but only speed is ok the others (distance driven and distance from home) are always on 0.00, nothing move

and i ve only 1 encodeur Aux 6 et 5