GithubHelp home page GithubHelp logo

clydemcqueen / ardusub_log_tools Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 1.95 MB

A collection of log analysis tools for working with ArduSub vehicles

License: MIT License

Python 99.85% Shell 0.15%

ardusub_log_tools's People

Contributors

clydemcqueen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ptrmu

ardusub_log_tools's Issues

Report on GPS time in BIN files

Some BIN files from Nereo are named with time/date, but some are not. (Why?)

BIN_info.py: scan a BIN file for GPS records and report on the time/date information.

Remove os.environ['MAVLINK20'] = '1' from all tools

Summary: the line os.environ['MAVLINK20'] = '1' isn't doing anything, and it should be removed.

Longer story:

To set the MAVLink wire protocol to 2.0 you need to set os.environ['MAVLINK20'] = '1' before importing pymavlink. Setting the wire protocol only matters when writing (packing) new messages; when reading (unpacking) the wire protocol is determined by the magic byte (0xFE vs 0xFD) in the message. None of the tools write new messages, so we don't need this line, and probably don't need the import os as well.

MAVLink version reference

Log additional info from WL UGPS API

As we prepare to use the WL UGPS external bridge to send NMEA messages to the WL G2 box, it will be helpful to add a few more endpoints to the wl_ugps_logger:

  • Global position of G2 box: /api/v1/position/master
  • Global position of U1 locator: /api/v1/position/global

tlog_param: support MAVProxy

Write parameter files that MAVProxy will read:

  • output file name should be *.parm
  • line should be , where value is float or int

Add CI

Add a few tests and automagically run them on each push or PR

Multi-file dive analysis

A dive may generate multiple telemetry (tlog) and dataflash (BIN) logs. These can be organized in a directory structure, with all of the log files for a dive sitting in a directory.

Create a dive.py tool that:

  • opens all of the tlog and BIN files in a directory
  • uses time information in the files (e.g., SYSTEM_TIME MAVLink messages) to build a single timeline that spans all of the telemetry and dataflash logs. The names of the files may also contain some useful information, though it may be less trustworthy than the data contained in the files.
  • report any errors, such as missing log files
  • print interesting information about the dive

The timeline generator should be in a separate Python file so that it can be used by other tools. E.g., merge.py may replace tlog_merge.py and BIN_merge.py and merge data from multiple files and log types.

Publish on PyPi

  • re-arrange as a module
  • add setup.py and other files
  • publish on PyPi

New tool: tlog_explode.py

Add a new tlog_explode.py ... tool (wrapper) that implements tlog_merge.py --no-merge --explode ....

New tool: segment.py

Add a new segment.py tool that will do the following:

  • Open one or more tlog files from the same dive and logically stitch them together in time order.
  • Segment the messages by time, where segments alternate between discard and keep.
  • Write the keep segments to new, smaller tlog files.

The target use case is a survey that spans several hours, where a single tlog file spans several transects. We want to easily pull out the transects for further processing.

Proposed parameters:

  • [--timestamps xxx,yyy,zzz] A comma-separated (no spaces) list of timestamps . If no timestamps are provided, the tool will stitch tlog files together, but won't segment them.
  • [--keep-first] By default, the messages before the 1st timestamp in --timestamps are considered a discard segment. Use this option if the first segment is a keep segment instead.
  • [--types aaa,bbb,ccc] A comma-separated (no spaces) list of message types to write. If none are provided, all types are included.
  • path ... One or more tlog files. If there is more than 1 tlog file they will be stitched together in the order provided.

For example, this command will break foo.tlog into 5 segments at 100-second boundaries. The segments between 100-200s and 300-400s will be written as new tlog files:

segment.py --timestamps 100,200,300,400 foo.tlog

Same as above, but only the DISTANCE_SENSOR messages are written in the new tlog files:

segment.py --timestamps 100,200,300,400 --types DISTANCE_SENSOR foo.tlog

Timestamps can be specified in 2 ways:

  • Seconds since the start of the earliest tlog file in the list, e.g., 100.
  • Unix time (seconds since January 1st, 1970 UTC), e.g., 1694633807. Any timestamp > 10000000 is treated as Unix timestamp.

Limitations:

  • The user must provide the timestamps by examining the files.
  • This only works on tlog files, not BIN (Dataflash) files.

See #22 for a more general tool that re-constructs a dive using both BIN and tlog files. This is more complicated because BIN files use a different clock.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.