Display Distance wheels encoder

Try right clicking on the map in Mission Planner and using the “set home here” feature. It doesn’t really matter where you set the home position if you aren’t using GPS, but having it defined may help display the values you’re after.

See this video:

an accelerated capture of an above mentioned balance bot long tlog.

DistToHome (DH) and DistTraveled (DT) show reasonable values (BTW, I dont know if they are got from encoders).

Are you sure you have everything OK?

ok for me, but i have to set EKF origin in MP not home (right click on map and “Set here EKF origin”) it s the best thing because when i desarm vehicule Zero is setting distance ground.

however, can i set EKF or Home origin witout MP ?? with QGC for exemple, cause can t have my PC always

I am getting back with scripting… again :slight_smile:
I see there is an example already available:

1 Like

Yes Ok thanks… i’ ll try this tomorrow and tell you what happened…

hello, test it but not working…it seems an error ins script ?
message from MP :SyntaxError: Non-ASCII character ‘\xe0’ in file D:\SCANLINE\SCANLINE\sauvegarde trx\ahrs_set_origin.lua on line 1, but no encoding declared; see PEP 263 -- Defining Python Source Code Encodings | Python.org for details

Are you sure you have read the wiki and loaded script on FC as explained ?
https://ardupilot.org/copter/docs/common-lua-scripts.html

yes i do exactly what is in wiki.
enable scr 1
script LUA in script APM
SRTL_point 0
Note find terrain_enable`

I dont have a FC handy, I might try later this week… maybe @Yuri_Rage could give it a try?

ok thank you, i try again but error :slightly_smiling_face: image

ok thank you for your help

Do not try to run the script from the Mission Planner Script tab. That is for Python scripts on the GCS computer. Again, follow the wiki linked above.

ok sorry, i try again. :+1:

OK done. scripts are in FC.
how can i see if it’s working ? open MP ? QGC ?

See if you receive a GCS message in Mission Planner stating that the origin is set.

here ?image

nothing in HUD yet

when i set EKF origin manually, the distance displayed in HUD is divided by 2 compared to the distance displayed distance in MavlinkInspector…?? an idea ? i test up to 10 turns off wheel and exactly divided by 2 for each turn

First, you say that you are running a Cube Orange, yet your GCS messages indicate a Cube Purple. They are very different hardware, so be sure you have installed the correct firmware for your autopilot.

The script referenced above is only valid for Rover 4.2-dev. ahrs:initialised() and ahrs:set_origin() are not exposed in the 4.1 branch, so you cannot use the script to set the origin. You will need to set the origin manually unless you want to update your firmware to an unstable development branch (not recommended - 4.2 is changing rapidly right now, and there are some very strange behaviors for Rover that may further complicate your problems).