Browser-based map module for mavproxy

This is a video of my browser-based map module for mavproxy.

I had trouble using the map code that's currently checked in to mavproxy, so I wrote this alternative.

Views: 1418

Tags: gcs, groundcontrolstation, mav, mavlink, mavproxy, modestmaps, wanderdrone

Comment by Matthew Coleman on June 25, 2012 at 3:19pm

Very nice. Just what I was looking for to go with my netbook in a backpack groundstation.

I think that the attitude indicator is backwards on pitch and roll. I am using UDB rather than ardupilot so this might be the problem.

Comment by John Wiseman on June 25, 2012 at 6:13pm

Thanks for finding that bug, Matthew.  I've been running it in simulation only, and I started to suspect there was an issue.  If I'd just run it with my own drone I would have seen it immediately.

Fixed code is committed.

Comment by Matthew Coleman on June 26, 2012 at 3:05am

Thanks John, I was not sure if that was my mistake.  Found the problem when running HILSIM.

A question: Is the graphics rendering done on the server or the client side?  i.e. Is the communication between server and client just simple data or the map image?

There is so much potential for this setup.  There are many features I would like to have and I know that the best way to get those is to help you develop the code.  Unfortunately I have no no experience of java yet.  Here are the ideas that I am dreaming of:

A HUD and/or instruments view

An option to grow the attitude indicator across the whole screen

Optional aircraft shape/colour for visibility on your local satellite photos.

A parameter editor for tuning the aircraft through a touchscreen interface.

Comment by Matthew Coleman on June 26, 2012 at 3:28am

and not forgetting high contrast sunlight mode

Comment by John Wiseman on June 26, 2012 at 10:26am

Matthew, the rendering is done on the client side.  If you go to http://127.0.0.1/data you can see what the server is sending:

{"wp_change_time": 1340730412.534398, "groundspeed": 0.4099999964237213, "waypoints": [], "pitch": 0.006737286224961281, "lat": 34.0920523, "alt": 28.6200008392334, "yaw": 0.012437696568667889, "lon": -118.2671388, "airspeed": 0.4099999964237213, "roll": 0.005609632004052401, "heading": 0, "gps_fix_type": 3}

The code that does the rendering is in MAVProxy/modules/lib/mmp_app/index.html, and is all javascript + HTML (no Java).  It's simpler than you might think to change it.

I agree that this has a lot of potential.  The APM Mission Planner is a pioneering piece of software, but I found it difficult to use.   It was always a second class citizen on the Mac and Linux (I never could get it to run on my Mac).  Mission Planner was never going to run on an iPhone or iPad.  Like I said in the video this is just a proof of concept, but I'm not really a web developer and in one weekend I was able to get some basic features working.

I don't think there's anything preventing this from being a complete Mission Planner replacement that more people will be able to use.

I'll continue working and adding features.  The things you listed are all good--I like the idea of a high contrast mode, and the cool thing is that all I'd have to do is change the CSS!  I'd like to add a mission editor, too.

I have a few weeks before I start a new job, so I'll be spending a bunch of time working on this (and my other secret project).

Comment by John Wiseman on June 26, 2012 at 10:28am
Comment by Matthew Coleman on June 26, 2012 at 1:57pm

John,  You have done much in a short time.  I am impressed.

Great that the rendering is on the client side.  My groundstation netbook does not have such good graphics performance.  I prefer to keep it concentrated on running mavproxy.  QGC is definitely too much for it.

It might be good to get the client side talking mavlink if possible. It would save hours creating your own parsers.  The copter gcs project runs mavlink in java.  I don't know if you could borrow from that:

http://code.google.com/p/copter-gcs/wiki/MainPage


Developer
Comment by Andrew Tridgell on June 28, 2012 at 3:50am

This is really great work John!
I've pulled your git tree, and I plan to incorporate this into MAVProxy soon.
I'm really delighted to see people getting into the MAVProxy modules!

One thing I'll probably add is support for having modules in subdirectories, and move some of the project specific modules to keep them out of the generic directory. So I'll move modules/camera.py into a CUAV/ directory as its pretty specific to CUAV. I'd also like to start having directories (instead of single python files) for the more complex modules, like this external map.

Cheers, Tridge

Comment by John Wiseman on June 28, 2012 at 8:09am

Thanks, Andrew.

Funny, last night I was thinking that the existing loading code might just work with a module that was packaged as a subdirectory containing an __init__.py...


Developer
Comment by Andrew Tridgell on July 6, 2012 at 1:58am

Hi John,

I've merged your mmap changes into the MAVProxy git tree - thanks for the great contribution!

btw, is it possible to overlay other items on the map? For example, can we overlay the waypoints or images from a camera?

One of the reasons I wrote the mp_slipmap.py code was to allow for this sort of overlay, but if it can be done in a browser that would also be nice.

Cheers, Tridge

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service