Giter Site home page Giter Site logo

stronnag / impload Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 1.0 17.36 MB

Cross-platform command line application to upload missions in a number of formats to an iNav flight controller.

Home Page: https://stronnag.github.io/impload/

License: GNU General Public License v2.0

Go 90.65% CSS 8.12% Makefile 1.23%
inav plan-mission upload-mission mwp

impload's Introduction

impload - iNav Mission Plan uploader

Introduction

impload is a cross-platform command line application to upload missions in a number of formats to an INAV flight controller. "Alien" formats may also be converted to MW-XML. Supported formats include:

  • MW XML mission files (as used by mwp, inav configurator, ezgui, mission planner for inav)
  • apmplanner / qgroundcontrol mission files (qgc plan mission and survey at least (QPC or JSON).
  • GPX files (tracks, routes, waypoints)
  • KML, KMZ files
  • Plain, simple CSV files
  • mwp JSON mission files]
  • inav cli wp stanzas

Serial devices and TCP are supported for upload / download to / from flight controllers.

Please see the user guide for more information.

YouTube Tutorial

$ impload --help
Usage of impload [options] command [files ...]
Options:
  -a int
    	Default altitude (m) (default 20)
  -b int
    	Baud rate (default 115200)
  -d string
    	Serial Device
  -fmt string
    	Output format (xml, json, md, cli, xml-ugly) (default "xml")
  -force-land
    	Adds RTH / Land for 'external' formats
  -force-rth
    	Adds RTH for 'external' formats
  -rebase string
    	rebase 1st WP to location (as lat,lon[,wpidx,segidx])
  -s float
    	Default speed (m/s)
  -v	Shows version
  -verbose
    	Verbose
  command:
	Action required (upload|download|store|restore|convert|test|clear|erase|multi[=n])

Device Name

impload supports the mwp device naming scheme:

  • serial_device[@baudrate]
  • tcp://host:port
  • udp://remotehost:remote_port
  • udp://local_host:local_port/remote_host:remote_port
  • xx:xx:xx:xx:xx:xx (raw BT socket, Linux only)

The baud rate given as an extended device name is preferred to -b

For ESP8288 transparent serial over UDP (the recommended mode for ESP8266), the latter form is needed.

Device name examples:

/dev/ttyUSB0@57600
/dev/ttyACM0
COM17@115200
tcp://esp8266:23
udp://:14014/esp-air:14014
# both sides use port 14014, remote (FC) is esp-air, blank local name is understood as INADDR_ANY.
30:14:12:02:16:64

Use Cases

  • Plan missions in apmplanner2 (QGC WPL 110 text files), upload (& save) to INAV
  • Plan missions in qgroundcontrol (JSON plan files), upload (& save) to INAV
  • Plan missions an any GPX creating GIS tool
  • Plan mission in Google Earth, save as KML path, upload to the FC
  • Convert "alien" formats to MW-XML.
  • Move a mission to a new location

Install

Binaries in the Release area (FreeBSD, Linux, MacOS, Win32) if you don't want it build it locally.

Command summary

  • upload : upload mission to FC volatile memory
  • store : upload mission to FC volatile memory and stores in EEPROM
  • download : downloads mission from FC volatile memory
  • restore : restores mission from EEPROM to FC volatile memory and downloads the mission
  • convert : converts alien formats to MW-XML (default), or the format defined by the -fmt option.
  • test : tests communications with FC
  • clear : clear mission in volatile RAM (specifically, uploads a mission with just a single RTH WP, which is always safe).
  • erase : erases mission in EEPROM and clears mission in volatile RAM (specifically, uploads and stores a mission with just a single RTH WP, which is always safe).
  • multi, multi=n : inav 4.0+; gets / sets the nav_wp_multi_mission_index value.

Examples

# Linux, detect serial device, test communications
# Linux tries /dev/ttyACM0 and /dev/ttyUSB0 (in that order)
$ ./impload test
2018/05/24 18:08:11 Using device /dev/ttyUSB0 115200
INAV v2.0.0 SPRACINGF3 (e7ca7944) API 2.2 "vtail"
Waypoints: 0 of 60, valid 0

# Linux, detect serial device and upload a apmplanner2 mission file
$ ./impload upload samples/qpc_0.txt
2018/05/24 18:09:10 Using device /dev/ttyUSB0 115200
INAV v2.0.0 SPRACINGF3 (e7ca7944) API 2.2 "vtail"
Waypoints: 0 of 60, valid 0
upload 12, save false
Waypoints: 12 of 60, valid 1

#
# Upload / store a GPX file
$ ./impload store samples/qpc_1_trk.gpx
2018/05/24 18:34:49 Using device /dev/ttyUSB0 115200
INAV v2.0.0 SPRACINGF3 (e7ca7944) API 2.2 "vtail"
Waypoints: 11 of 60, valid 1
upload 11, save true
Saved mission
Waypoints: 11 of 60, valid 1

# TCP ...
#
$ impload  -d tcp://localhost:4321 upload samples/qpc_1.mission
2018/09/18 18:57:08 Using device localhost 4321
INAV v2.1.0 SPRACINGF3 (a29bfbd1) API 2.2
Waypoints: 0 of 60, valid 0
upload 12, save false
Waypoints: 12 of 60, valid 1

$ impload  -d tcp://localhost:4321 download /tmp/m.mission
2018/09/18 19:08:30 Using device localhost 4321
INAV v2.1.0 SPRACINGF3 (a29bfbd1) API 2.2
Waypoints: 12 of 60, valid 1

# UDP ....
#
$ impload -d udp://:14014/esp-air:14014 test
2018/09/19 21:11:34 Using device udp://:14014/esp-air:14014
INAV v2.1.0 SPRACINGF3 (a29bfbd1) API 2.2
Waypoints: 12 of 60, valid 1

$ impload -d udp://:14014/esp-air:14014 download /tmp/m.mission
2018/09/19 21:11:46 Using device udp://:14014/esp-air:14014
INAV v2.1.0 SPRACINGF3 (a29bfbd1) API 2.2
Waypoints: 12 of 60, valid 1

> REM  Windows, needs a named device to be given
> impload -d COM17 upload samples/google-earth-mission.kml

# Conversion
$ impload convert g-earth.kmz example.mission
# Convert and relocate
impload -rebase  35.761000,140.378945 convert WP_test.mission  /tmp/wp-test-jp.mission

Build Instructions

Go infrastructure, unmodified source

go get github.com/stronnag/impload, binaries endup in go/bin, source in go/src/github.com/stronnag/impload. Requires go and git.

Local compilation (e.g for local modification)

git clone https://github.com/stronnag/impload

Files sources where ever you wish.

  • Simplest: make (or make install)
  • Windows (native): make nocgo (probably). You can also use the nocgo target on POSIX to generate a dynamically linked executable (vice the default static executable).

Note that you can cross-compile for any OS / architecture supported by Go using the GOOS and GOARCH environment variables, e.g for Win32 on Linux riscvs64:

$ uname -a
Linux jagular 5.15.2-cwt13 #2 SMP PREEMPT Thu Jun 1 14:42:43 +07 2023 riscv64 GNU/Linux
GOOS=windows GOARCH=386 make clean nocgo
rm -f impload
CGO_ENABLED=0  go build -trimpath -ldflags "-s -w -X \"main.GitCommit=0fa31fb / 2023-06-11\" -X \"main.GitTag=v5.161.652\""
$ file impload.exe
impload.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows, 6 sections

Postscript

The author knows how to spell "implode".

impload's People

Contributors

stronnag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

victor-brito

impload's Issues

How to compile impload in Windows?

My first time with go. knock down nijia in cmd command, cmd prompted me the following error, how can I do it?

D:\8_data\0_general\github\qgc\impload>ninja.exe
[1/1] CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -extldflags -static" -o impload
FAILED: impload
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -extldflags -static" -o impload
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.

impload fails on older firmware versions

On old iNav firmware (e.g. 1.7.2), impload fails:

2018/11/16 08:04:08 Using device com4
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.MSPInit(0x1, 0x12440088, 0x4, 0x1c200, 0x0, 0x0, 0x0, 0x0)
         /home/jrh/Projects/impload/msp.go:267 +0xc4e
main.do_test()
         /home/jrh/Projects/impload/impload.go:45 +0x35
main.main()
         /home/jrh/Projects/impload/impload.go:191 +0x305

This is due to the older API, that impload fails to handle correctly.

Cant run on windows

Hi,
I'm new on github and inav. I'm trying to load some waypoints onto my fc. I downloaded the .exe file for impload but i cant seem to get it to run on windows. please help

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.