goodrobots / mavcesium Goto Github PK
View Code? Open in Web Editor NEWAn experimental web based map display for MAVProxy based on Cesium
Home Page: https://gitter.im/goodrobots/Lobby
License: GNU General Public License v3.0
An experimental web based map display for MAVProxy based on Cesium
Home Page: https://gitter.im/goodrobots/Lobby
License: GNU General Public License v3.0
refactor javascript to allow for 'vehicle' objects
each vehicle has its own 3D model, mission and fence
each vehicle has a callback to update its location, pose and other info
each vehicle will have a unique system ID that will allow the correct vehicle to be targeted for updates
.ini should be .gitignored from commits
New config parsing master code loads config (and api key) from mavproxy directory. This has two problems:
How can we get this working with PX4? Would be good to have it on both stacks and the majority of the mav messages are common. Happy to help.
#Users should be able to add and remove hud elements without editing hud.js. A optional config file could be saved to the user directory which can be edited to control the hud layout and content.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14994 mav 20 0 427996 112960 12180 R 20.1 6.6 26:34.26 python
112Mb resident memory is a lot for a small embedded computer (for example an rpi zero only has 384mb after graphics). Can this be reduced?
The cpu is presumably down to pymavlink?
When you first load the webpage it looks like camera points down, so it's very unclear what you're looking at. The 'synthetic' camera provides a familiar horizon. Also, perhaps 'synthetic' might be called 'forward' to be more intuitive?
This would make an awesome FPV HUD if the map display was replaced by streaming video feed :)
The new config parsing in master sets websocket address to the server bind address+port. The default bind address is 0.0.0.0, which is a good thing. However this then makes the browser attempt to connect to websocket over ws://0.0.0.0:5000/ws which is bogus.
WEBSOCKET = "ws://"+SERVER_INTERFACE+":"+SERVER_PORT+"/ws"
Perhaps a better method might be something like this:
var websocket = '{{ websocket }}';
if (/0.0.0.0/.test(websocket) || /localhost/.test(websocket)) {
websocket = ("ws://" + window.location.hostname + ":" + window.location.port + "/ws");
}
Or perhaps even better would be to make WEBSOCKET an optional configuration item and use it if set, otherwise by default construct the websocket address:
var websocket = '{{ websocket }}';
if (!websocket) {
websocket = ("ws://" + window.location.hostname + ":" + window.location.port + "/ws");
}
This issue is related to #4
The servers need to launch and provide some sort of helpful feedback to the user prior to receiving mavlink data. e.g. Display the cesium globe with text "waiting for mavlink data..." or similar.
Hello there, i was trying to load the cesium module but i got this error like this, there's an error say that the configparser didn't have attribute 'read_file', how can i fix this ?, this is the error line
Failed to use config file at C:\Python27\lib\site-packages\MAVProxy\modules\mavproxy_cesium\app\mavcesium_default.ini : ConfigParser instance has no attribute 'read_file'
ERROR in command ['load', 'cesium']: 'Configuration' object has no attribute 'MODULE_DEBUG'
Traceback (most recent call last):
File "mavproxy.py", line 521, in process_stdin
fn(args[1:])
File "mavproxy.py", line 343, in cmd_module
load_module(modname, **kwargs)
File "mavproxy.py", line 296, in load_module
module = m.init(mpstate, **kwargs)
File "C:\Python27\lib\site-packages\MAVProxy\modules\mavproxy_cesium\__init__.py", line 243, in init
return CesiumModule(mpstate, **kwargs)
File "C:\Python27\lib\site-packages\MAVProxy\modules\mavproxy_cesium\__init__.py", line 49, in __init__
('debug', bool, self.config.MODULE_DEBUG)])
AttributeError: 'Configuration' object has no attribute 'MODULE_DEBUG'
thx
Panning is currently supported, but long touch and zoom events are not.
Currently MAVProxy is used to generate the JSON messages which drive the display. MAVProxy is also used for communicating back to the autopilot, WP and fence management.
Ideally this application could be made stand alone to interact with the autopilot directly.
Hello
I get an error when I run the module
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/mohammad/.local/lib/python3.8/site-packages/MAVProxy-1.8.39-py3.8.egg/MAVProxy/modules/mavproxy_cesium/app/cesium_web_server.py", line 141, in main
File "/home/mohammad/.local/lib/python3.8/site-packages/MAVProxy-1.8.39-py3.8.egg/MAVProxy/modules/mavproxy_cesium/app/cesium_web_server.py", line 104, in start_app
File "/home/mohammad/.local/lib/python3.8/site-packages/tornado-6.2.dev1-py3.8-linux-x86_64.egg/tornado/tcpserver.py", line 152, in listen
self.add_sockets(sockets)
File "/home/mohammad/.local/lib/python3.8/site-packages/tornado-6.2.dev1-py3.8-linux-x86_64.egg/tornado/tcpserver.py", line 165, in add_sockets
self._handlers[sock.fileno()] = add_accept_handler(
File "/home/mohammad/.local/lib/python3.8/site-packages/tornado-6.2.dev1-py3.8-linux-x86_64.egg/tornado/netutil.py", line 246, in add_accept_handler
io_loop = IOLoop.current()
File "/home/mohammad/.local/lib/python3.8/site-packages/tornado-6.2.dev1-py3.8-linux-x86_64.egg/tornado/ioloop.py", line 264, in current
loop = asyncio.get_event_loop()
File "/usr/lib/python3.8/asyncio/events.py", line 639, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'Thread-1'.
The project is no longer using Flask or autobahn and the live demo server has been re purposed for a different project.
What needs to be done:
Currently all WP makers are shown without numbers. Need to add text values within or above WP markers.
Ideally users should be able to `pip install mavcesium'
After successfully loaded this app, I found out that after making changes to the HTML file and other JS files, it does not reflect when running the app. Is it that it is not possible to make changes or modify the HTML and JS files?
Running mavcesium behind a reverse proxy is much easier if it runs on a configurable prefix (eg. /mavcesium).
I did install as expected using git clone , and submodules.
I see no errors, but nor do I see anything at port 5000.. :(
As mentioned in #32 the internet connection is on yet the map is not loading.
I used ArduPilot SITL:
./sim_vehicle.py -v ArduPlane --console
after that:
module load cesium
Tornado server started on http://0.0.0.0:5000/mavcesium/
Am I doing something wrong? why the map is not loading?
When the files from the web application are extracted the following warning occurs:
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/uas/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
As I see it there are a few ways to handle this warning:
chmod g-wx,o-wx ~/.python-eggs
I'm not sure if this is an issue on Windows, but option 1 wont work for that use case.
Traceback (most recent call last):
File "/usr/local/bin/mavproxy.py", line 491, in process_stdin
fn(args[1:])
File "/usr/local/bin/mavproxy.py", line 319, in cmd_module
load_module(args[1])
File "/usr/local/bin/mavproxy.py", line 277, in load_module
module = m.init(mpstate)
File "build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_cesium/init.py", line 266, in init
return CesiumModule(mpstate)
File "build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_cesium/init.py", line 72, in init
self.run_web_server()
File "build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_cesium/init.py", line 97, in run_web_server
from app import cesium_web_server
File "build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_cesium/app/cesium_web_server.py", line 26, in
TypeError: init() got an unexpected keyword argument 'root_path'
Hi,
I really love the GoodRobots-projects and currently investigate regarding integrating / working on some of them. Is there any chance to get MAVCesium and vision_landing under a permissive license as well? This would make adoption easier.
Peter
If you start the mavcesium standalone server before the mavlink connection is ready (eg. mavlink proxy is not yet fully started), it does not seem to retry and reconnect when the mavlink connection does become available.
In particular I'm testing this on the Maverick 1.1.5 release for Tegra TX1. On boot the mavcesium service starts slighty before or at the same time as mavlink-router@sitl service. The mavlink proxy (mavlink-router@sitl) service does start up very shortly afterwards and is available, however you have to restart mavcesium service before it connects. It should retry connection.
Use pybind11 to make a JSON MAVLink bridge in C++ with python interfaces. Device handling and parsing will be in C++ and it will create JSON formatted strings to be passed via websocket. All message processing and sorting will happen client side in JavaScript.
Can't unload and load cesium module from mavproxy.
dule reload cesium
MANUAL> WebSocket connection closed: connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Unloaded module cesium
MAVCesium display loaded at http://192.168.1.175:6790/
Reloaded module cesium
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1193, in run
self.startRunning(installSignalHandlers=installSignalHandlers)
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1173, in startRunning
ReactorBase.startRunning(self)
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 684, in startRunning
raise error.ReactorNotRestartable()
ReactorNotRestartable
MANUAL> module unload cesium
MANUAL> Unloaded module cesium
MANUAL> module load cesium
MANUAL> ERROR in command ['load', 'cesium']: Couldn't listen on 192.168.1.175:6790: [Errno 98] Address already in use.
Hi, are is there a way to load cesium module from MAVProxy running with SITL?
STABILIZE> module load cesium
STABILIZE> Traceback (most recent call last):
File "mavproxy.py", line 276, in load_module
m = import_package(modpath)
File "mavproxy.py", line 406, in import_package
mod = import(name)
File "build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_cesium/init.py", line 15, in
ImportError: No module named twisted.websocket
Traceback (most recent call last):
File "mavproxy.py", line 276, in load_module
m = import_package(modpath)
File "mavproxy.py", line 406, in import_package
mod = import(name)
ImportError: No module named cesium
Failed to load module: No module named cesium. Use 'set moddebug 3' in the MAVProxy console to enable traceback
[1]+ Stopped python mavproxy.py --master=tcp:127.0.0.1:5760 --c
Please consider adding :
-wind speed & direction. (numerical with an arrow ?)
-xtrack and altitude error
heading, bearing , and next few waypoints
in the the mockup below heading is not very relevant, but in other views it may be.
Together, viewing turns with targets (WP right in the map) - would make it easy to evaluate turns when tuning.
This will require custom shaders and materials to be added to Cesium. Currently I am unable to build any Cesium versions greater than 1.27 (current is 1.30)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.