replay_bbox_ltm.rb additional settings - stronnag/mwptools GitHub Wiki

Intro

Unmaintained Article Please check the manual for more up-to-date information.

mwp's blackbox replay tool replay_bbox_ltm.rb has a "hidden" settings file ~/.config/mwp/replay_ltm.json which allows the user to specify some settings that affect blackbox replay but are not captured in the blackbox log:

  • Declination
  • The machine type for 'auto'
  • Whether the baro should be ignored (instead use GPS altitude)
  • Extra arguments to blackbox_decode (e.g. virtual current sensor)
  • Home offset

Implementation

The settings are stored as a JSON file ~/.config/mwp/replay_ltm.json, which will be (poorly) illustrated by example:

{
    "declination":-1,
    "extra":{"Dodos*":
             "--simulate-current-meter --sim-current-meter-scale=45 --sim-current-meter-offset=10"},
    "home":{"Wing it!|FloatyBlue":{"pos":"35.759725, 140.381370","dir":270,"dist":60}}
}

In this example:

  • Use -1 (1°W) as the magnetic declination
  • Use extra arguments, in this case defining the virtual current sensor where the UAV name matches "Dodos*"
  • Use a home offset, in this case if the UAV is named "Wing it!" or "FloatyBlue", and the home position is within dist (here 60m) of pos (here 35.759725, 140.381370), then display the home 60m to the west of the actual origin.

Note in the latter example

  • I have no intention of flying off the main runway at Narita Aiport; the location is obfuscated.
  • The setting (60m, 270°) corresponds to iNav 2.4's nav_rth_home_offset_distance and nav_rth_home_offset_direction for the named UAVs; these settings are not otherwise available to the replayer.