├── .flake8
├── .github
└── workflows
│ ├── python-cleanliness.yml
│ ├── python-publish.yml
│ └── windows_build.yml
├── .gitignore
├── .gitmodules
├── ANDROID.md
├── COPYING.txt
├── MAVProxy
├── MAVLink.xml
├── MAVProxyWinLAN.bat
├── MAVProxyWinUSB.bat
├── __init__.py
├── mavproxy.py
├── modules
│ ├── __init__.py
│ ├── lib
│ │ ├── ANUGA
│ │ │ ├── README.txt
│ │ │ ├── __init__.py
│ │ │ ├── geo_reference.py
│ │ │ ├── lat_long_UTM_conversion.py
│ │ │ └── redfearn.py
│ │ ├── LowPassFilter2p.py
│ │ ├── MacOS
│ │ │ ├── __init__.py
│ │ │ ├── backend_agg.py
│ │ │ ├── backend_wx.py
│ │ │ ├── backend_wxagg.py
│ │ │ └── wxversion.py
│ │ ├── __init__.py
│ │ ├── camera_projection.py
│ │ ├── dumpstacks.py
│ │ ├── geodesic_grid.py
│ │ ├── graph_ui.py
│ │ ├── graphdefinition.py
│ │ ├── grapher.py
│ │ ├── icon.py
│ │ ├── kmlread.py
│ │ ├── live_graph.py
│ │ ├── live_graph_ui.py
│ │ ├── magfit.py
│ │ ├── mav_fft.py
│ │ ├── mission_item_protocol.py
│ │ ├── mp_checklist.py
│ │ ├── mp_elevation.py
│ │ ├── mp_image.py
│ │ ├── mp_instructor.py
│ │ ├── mp_menu.py
│ │ ├── mp_module.py
│ │ ├── mp_settings.py
│ │ ├── mp_substitute.py
│ │ ├── mp_util.py
│ │ ├── mp_widgets.py
│ │ ├── msgstats.py
│ │ ├── multiproc.py
│ │ ├── multiproc_util.py
│ │ ├── ntrip.py
│ │ ├── opengl.py
│ │ ├── optparse_gui
│ │ │ ├── README.txt
│ │ │ └── __init__.py
│ │ ├── param_ftp.py
│ │ ├── param_help.py
│ │ ├── rline.py
│ │ ├── rtcm3.py
│ │ ├── srtm.py
│ │ ├── textconsole.py
│ │ ├── wavefront.py
│ │ ├── win_layout.py
│ │ ├── wx_addlink.py
│ │ ├── wx_loader.py
│ │ ├── wx_processguard.py
│ │ ├── wx_util.py
│ │ ├── wxconsole.py
│ │ ├── wxconsole_ui.py
│ │ ├── wxconsole_util.py
│ │ ├── wxgrapheditor.py
│ │ ├── wxhorizon.py
│ │ ├── wxhorizon_ui.py
│ │ ├── wxhorizon_util.py
│ │ ├── wxrc.py
│ │ ├── wxsaildash.py
│ │ ├── wxsaildash_ui.py
│ │ ├── wxsaildash_util.py
│ │ ├── wxsettings.py
│ │ └── wxsettings_ui.py
│ ├── mavproxy_DGPS.py
│ ├── mavproxy_GPSInject.py
│ ├── mavproxy_GPSInput.py
│ ├── mavproxy_HIL.py
│ ├── mavproxy_OpenDroneID.py
│ ├── mavproxy_SIYI
│ │ ├── __init__.py
│ │ ├── camera_view.py
│ │ ├── raw_thermal.py
│ │ └── tools
│ │ │ ├── playback.py
│ │ │ ├── temp_dir.py
│ │ │ └── temp_view.py
│ ├── mavproxy_SecureCommand.py
│ ├── mavproxy_adsb.py
│ ├── mavproxy_ais.py
│ ├── mavproxy_antenna.py
│ ├── mavproxy_anufireproject
│ │ └── __init__.py
│ ├── mavproxy_arm.py
│ ├── mavproxy_asterix.py
│ ├── mavproxy_auxopt.py
│ ├── mavproxy_battery.py
│ ├── mavproxy_calibration.py
│ ├── mavproxy_cameraview.py
│ ├── mavproxy_chat
│ │ ├── __init__.py
│ │ ├── assistant_setup
│ │ │ ├── assistant_instructions.txt
│ │ │ ├── copter_flightmodes.txt
│ │ │ ├── delete_wakeup_timers.json
│ │ │ ├── get_all_parameters.json
│ │ │ ├── get_available_mavlink_messages.json
│ │ │ ├── get_current_datetime.json
│ │ │ ├── get_location_plus_dist_at_bearing.json
│ │ │ ├── get_location_plus_offset.json
│ │ │ ├── get_mavlink_message.json
│ │ │ ├── get_mode_mapping.json
│ │ │ ├── get_parameter.json
│ │ │ ├── get_parameter_description.json
│ │ │ ├── get_vehicle_location_and_yaw.json
│ │ │ ├── get_vehicle_state.json
│ │ │ ├── get_vehicle_type.json
│ │ │ ├── get_wakeup_timers.json
│ │ │ ├── plane_flightmodes.txt
│ │ │ ├── rover_modes.txt
│ │ │ ├── send_mavlink_command_int.json
│ │ │ ├── send_mavlink_set_position_target_global_int.json
│ │ │ ├── set_parameter.json
│ │ │ ├── set_wakeup_timer.json
│ │ │ ├── setup_assistant.py
│ │ │ └── sub_modes.txt
│ │ ├── chat_openai.py
│ │ ├── chat_voice_to_text.py
│ │ └── chat_window.py
│ ├── mavproxy_checklist.py
│ ├── mavproxy_cmdlong.py
│ ├── mavproxy_console.py
│ ├── mavproxy_dataflash_logger.py
│ ├── mavproxy_devop.py
│ ├── mavproxy_emuecu.py
│ ├── mavproxy_example.py
│ ├── mavproxy_fakegps.py
│ ├── mavproxy_fence.py
│ ├── mavproxy_fenceitem_protocol.py
│ ├── mavproxy_fieldcheck
│ │ ├── __init__.py
│ │ ├── cmac-foamy-fence.txt
│ │ ├── cmac-foamy-mission-ccw.txt
│ │ ├── cmac-foamy-mission-cw.txt
│ │ ├── cmac-foamy-rally.txt
│ │ ├── springvalley-foamy-fence.txt
│ │ ├── springvalley-foamy-mission-ccw.txt
│ │ ├── springvalley-foamy-mission-cw.txt
│ │ ├── springvalley-foamy-rally.txt
│ │ ├── springvalleybottom-foamy-fence.txt
│ │ ├── springvalleybottom-foamy-mission-ccw.txt
│ │ ├── springvalleybottom-foamy-mission-cw.txt
│ │ └── springvalleybottom-foamy-rally.txt
│ ├── mavproxy_firmware.py
│ ├── mavproxy_followtest.py
│ ├── mavproxy_ftp.py
│ ├── mavproxy_gasheli.py
│ ├── mavproxy_generator.py
│ ├── mavproxy_genobstacles.py
│ ├── mavproxy_gimbal.py
│ ├── mavproxy_gopro.py
│ ├── mavproxy_graph.py
│ ├── mavproxy_heliplane.py
│ ├── mavproxy_help.py
│ ├── mavproxy_horizon.py
│ ├── mavproxy_instructor.py
│ ├── mavproxy_joystick
│ │ ├── __init__.py
│ │ ├── controls.py
│ │ ├── findjoy.py
│ │ └── joysticks
│ │ │ ├── FeiYing.yml
│ │ │ ├── Logitech_WingMan_3D.yml
│ │ │ ├── SparkFun Pro Micro.yml
│ │ │ ├── T16S.yml
│ │ │ ├── carolbox-usb.yml
│ │ │ ├── cypress-spektrum.yml
│ │ │ ├── great-planes.Interlink-X.yaml
│ │ │ ├── great-planes.yml
│ │ │ ├── jumper.yml
│ │ │ ├── logicool-f310.yml
│ │ │ ├── logitech-dual-action.yml
│ │ │ ├── saili-simulator.yml
│ │ │ ├── sony-playstation.yml
│ │ │ ├── spektrumInterLinkDX.yml
│ │ │ ├── sz-mypower-ds4.yml
│ │ │ ├── taranis.yml
│ │ │ ├── xbox-360.yml
│ │ │ └── xboxdrv-mode2.yml
│ ├── mavproxy_kmlread.py
│ ├── mavproxy_layout.py
│ ├── mavproxy_link.py
│ ├── mavproxy_log.py
│ ├── mavproxy_magical
│ │ ├── __init__.py
│ │ ├── data
│ │ │ ├── arrow.mtl
│ │ │ ├── arrow.obj
│ │ │ ├── quadcopter.mtl
│ │ │ └── quadcopter.obj
│ │ ├── glrenderer.py
│ │ ├── magical_ui.py
│ │ ├── wxgeodesicgrid.py
│ │ └── wxvehicle.py
│ ├── mavproxy_map
│ │ ├── GAreader.py
│ │ ├── __init__.py
│ │ ├── data
│ │ │ ├── barrell.png
│ │ │ ├── blueantenna.png
│ │ │ ├── blueblimp.png
│ │ │ ├── blueboat.png
│ │ │ ├── bluecopter.png
│ │ │ ├── blueheli.png
│ │ │ ├── blueplane.png
│ │ │ ├── bluerover.png
│ │ │ ├── bluesinglecopter.png
│ │ │ ├── bluesub.png
│ │ │ ├── camera-small-red.png
│ │ │ ├── cloud.png
│ │ │ ├── flag.png
│ │ │ ├── flame.png
│ │ │ ├── greenantenna.png
│ │ │ ├── greenblimp.png
│ │ │ ├── greencopter.png
│ │ │ ├── greenheli.png
│ │ │ ├── greenplane.png
│ │ │ ├── greenrover.png
│ │ │ ├── greensinglecopter.png
│ │ │ ├── greensub.png
│ │ │ ├── hawk.png
│ │ │ ├── home.png
│ │ │ ├── hoop.png
│ │ │ ├── image_vector_files
│ │ │ │ └── heli_icon.svg
│ │ │ ├── loading.jpg
│ │ │ ├── migbird.png
│ │ │ ├── orangecopter.png
│ │ │ ├── orangeheli.png
│ │ │ ├── orangeplane.png
│ │ │ ├── orangerover.png
│ │ │ ├── purpleplane.png
│ │ │ ├── rallypoint.png
│ │ │ ├── ramp.png
│ │ │ ├── redantenna.png
│ │ │ ├── redblimp.png
│ │ │ ├── redboat.png
│ │ │ ├── redcopter.png
│ │ │ ├── redheli.png
│ │ │ ├── redplane.png
│ │ │ ├── redrover.png
│ │ │ ├── redsinglecopter.png
│ │ │ ├── redsub.png
│ │ │ └── unavailable.jpg
│ │ ├── mp_elevation.py
│ │ ├── mp_slipmap.py
│ │ ├── mp_slipmap_ui.py
│ │ ├── mp_slipmap_util.py
│ │ ├── mp_tile.py
│ │ └── srtm.py
│ ├── mavproxy_message.py
│ ├── mavproxy_messagerate.py
│ ├── mavproxy_misc.py
│ ├── mavproxy_misseditor
│ │ ├── __init__.py
│ │ ├── button_renderer.py
│ │ ├── me_defines.py
│ │ ├── me_event.py
│ │ ├── missionEditorFrame.py
│ │ └── mission_editor.py
│ ├── mavproxy_mmap
│ │ ├── __init__.py
│ │ ├── mmap_app
│ │ │ ├── bing.js
│ │ │ ├── bluemarble.js
│ │ │ ├── drone-md.png
│ │ │ ├── drone-sm.png
│ │ │ ├── index.html
│ │ │ └── modestmaps.js
│ │ └── mmap_server.py
│ ├── mavproxy_mode.py
│ ├── mavproxy_movinghome.py
│ ├── mavproxy_mqtt.py
│ ├── mavproxy_msg.py
│ ├── mavproxy_nmeagps.py
│ ├── mavproxy_nmeaout.py
│ ├── mavproxy_nokov
│ │ └── __init__.py
│ ├── mavproxy_nsh.py
│ ├── mavproxy_ntrip.py
│ ├── mavproxy_oldwp.py
│ ├── mavproxy_optitrack
│ │ ├── DataDescriptions.py
│ │ ├── MoCapData.py
│ │ ├── NatNetClient.py
│ │ └── __init__.py
│ ├── mavproxy_osd.py
│ ├── mavproxy_output.py
│ ├── mavproxy_param.py
│ ├── mavproxy_paramedit
│ │ ├── __init__.py
│ │ ├── checklisteditor.py
│ │ ├── param_editor.py
│ │ ├── param_editor.wxg
│ │ ├── param_editor_frame.py
│ │ └── ph_event.py
│ ├── mavproxy_park.py
│ ├── mavproxy_ppp.py
│ ├── mavproxy_proximity.py
│ ├── mavproxy_rally.py
│ ├── mavproxy_rallypoint_protocol.py
│ ├── mavproxy_rc.py
│ ├── mavproxy_rcsetup.py
│ ├── mavproxy_relay.py
│ ├── mavproxy_restserver.py
│ ├── mavproxy_sail.py
│ ├── mavproxy_sensors.py
│ ├── mavproxy_serial.py
│ ├── mavproxy_setpos.py
│ ├── mavproxy_signing.py
│ ├── mavproxy_silvus.py
│ ├── mavproxy_smartcamera
│ │ ├── __init__.py
│ │ ├── sc_ExifWriter.py
│ │ ├── sc_SonyQX1.py
│ │ ├── sc_config.py
│ │ ├── sc_main.py
│ │ ├── sc_video.py
│ │ ├── sc_webcam.py
│ │ ├── smart_camera.cnf
│ │ └── ssdp.py
│ ├── mavproxy_soar.py
│ ├── mavproxy_speech.py
│ ├── mavproxy_swarm.py
│ ├── mavproxy_system_time.py
│ ├── mavproxy_terrain.py
│ ├── mavproxy_test.py
│ ├── mavproxy_timesync.py
│ ├── mavproxy_tracker.py
│ ├── mavproxy_tuneopt.py
│ ├── mavproxy_ublox
│ │ └── __init__.py
│ ├── mavproxy_ucenter.py
│ ├── mavproxy_useralerts.py
│ ├── mavproxy_vicon.py
│ ├── mavproxy_warning.py
│ └── mavproxy_wp.py
└── tools
│ ├── MAVExplorer.bat
│ ├── MAVExplorer.py
│ ├── graphs
│ ├── ekf3Graphs.xml
│ ├── ekfGraphs.xml
│ ├── mavgraphs.xml
│ └── mavgraphs2.xml
│ ├── mavflightview.py
│ └── mavpicviewer
│ ├── mavpicviewer.bat
│ ├── mavpicviewer.py
│ ├── mavpicviewer_image.py
│ ├── mavpicviewer_mosaic.py
│ ├── mavpicviewer_settings.py
│ └── mavpicviewer_shared.py
├── MAVProxy_Icon
├── 3.ai
├── 3.jpg
├── 3.png
├── icon.jpg
├── icon.png
├── mockup.jpg
├── source file 2.ai
├── source file.ai
├── trans-BG-2.png
├── trans-BG.png
├── white-BG-2.jpg
└── white-BG.jpg
├── README.md
├── docs
├── JOYSTICKS.md
└── MavProxy_Screenshot_Termux.jpg
├── requirements.txt
├── scripts
└── run_flake8.py
├── setup.py
├── shortcuts
├── ReadMe.md
├── mavexplorer.desktop
├── mavexplorer.png
├── mavpicviewer.desktop
├── mavpicviewer.png
├── mavproxy.desktop
└── mavproxy.png
└── windows
├── MAVExplorer.ico
├── MAVProxy.ico
├── MAVProxyWinBuild.bat
├── Startup Examples
├── MAVProxyLogput.bat
└── MAVProxyMultiOutput.bat
├── mavinit.scr
├── mavpicviewer.ico
├── mavproxy.iss
├── mavproxy.spec
└── returnVersion.py
/.flake8:
--------------------------------------------------------------------------------
1 | [flake8]
2 | ignore =
3 | # H301: one import per line
4 | H301,
5 | # H306: imports not in alphabetical order (time, os)
6 | H306,
7 | # E226: missing whitespace around arithmetic operator
8 | E226,
9 | # E261 at least two spaces before inline comment
10 | E261,
11 | # W504 line break after binary operator
12 | W504,
13 | # E203 whitespace before ':'
14 | E203,
15 | # E221 multiple spaces before operator
16 | E221
17 |
18 | max-line-length = 127
19 |
--------------------------------------------------------------------------------
/.github/workflows/python-cleanliness.yml:
--------------------------------------------------------------------------------
1 | name: test Python cleanliness
2 |
3 | on: [push, pull_request, workflow_dispatch]
4 |
5 | concurrency:
6 | group: ci-${{github.workflow}}-${{ github.ref }}
7 | cancel-in-progress: true
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-22.04
12 |
13 | steps:
14 | # git checkout the PR
15 | - uses: actions/checkout@v4
16 | with:
17 | submodules: 'recursive'
18 |
19 | - name: Install dependencies
20 | run: |
21 | python -m pip install -U flake8
22 |
23 | - name: Check Python with Flake8
24 | run: |
25 | scripts/run_flake8.py MAVProxy
26 |
--------------------------------------------------------------------------------
/.github/workflows/python-publish.yml:
--------------------------------------------------------------------------------
1 | # This workflow will upload a Python Package using Twine when a release is created
2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3 |
4 | name: Upload MAVProxy Package
5 |
6 | on:
7 | release:
8 | types: [published]
9 |
10 | jobs:
11 | deploy:
12 |
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - uses: actions/checkout@v2
17 | - name: Set up Python
18 | uses: actions/setup-python@v2
19 | with:
20 | python-version: '3.10'
21 | - name: Install dependencies
22 | run: |
23 | python -m pip install -U pip
24 | python -m pip install -U wheel
25 | python -m pip install -U pymavlink
26 | pip install build
27 | pip install -U .
28 | git submodule update --recursive --init
29 | - name: Build package
30 | run: python -m build
31 | - name: Publish package
32 | uses: pypa/gh-action-pypi-publish@release/v1
33 | with:
34 | user: __token__
35 | password: ${{ secrets.PYPI_API_TOKEN }}
36 |
--------------------------------------------------------------------------------
/.github/workflows/windows_build.yml:
--------------------------------------------------------------------------------
1 | name: Windows Build
2 |
3 | on: [push, pull_request, workflow_dispatch]
4 | concurrency:
5 | group: ci-${{github.workflow}}-${{ github.ref }}
6 | cancel-in-progress: true
7 |
8 | jobs:
9 | build:
10 | runs-on: 'windows-latest'
11 | strategy:
12 | matrix:
13 | python-version: ['3.10']
14 |
15 | steps:
16 | - uses: actions/checkout@v4
17 | with:
18 | submodules: 'recursive'
19 | - uses: actions/checkout@v4
20 | - name: Set up Python ${{ matrix.python-version }}
21 | uses: actions/setup-python@v5
22 | with:
23 | python-version: ${{ matrix.python-version }}
24 | - name: Install dependencies
25 | run: |
26 | python3 -m pip install -U wheel setuptools pip
27 | python3 -m pip install -U pywin32 lxml pymavlink numpy matplotlib pyserial opencv-python PyYAML Pygame Pillow wxpython prompt-toolkit scipy
28 | python3 -m pip install -U openai wave pyaudio
29 | python3 -m pip install -U pyinstaller==6.7.0 packaging
30 | - name: Download Inno Setup installer
31 | run: curl -L -o installer.exe http://files.jrsoftware.org/is/6/innosetup-6.3.1.exe
32 | - name: Install Inno Setup
33 | run: ./installer.exe /verysilent /allusers /dir=inst
34 | - name: Build MAVProxy
35 | run: |
36 | python3 -m pip install .[recommended] --user
37 | python3 -m pip list
38 | - name: Prepare installer
39 | run: |
40 | cd MAVProxy
41 | copy ..\\windows\\mavproxy.spec
42 | pyinstaller --clean mavproxy.spec
43 | del mavproxy.spec
44 | - name: Download parameters
45 | run: |
46 | mkdir Parameters
47 | $wc = New-Object System.Net.WebClient
48 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/Rover/apm.pdef.xml', 'Parameters\Rover.xml')
49 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/Copter/apm.pdef.xml', 'Parameters\Copter.xml')
50 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/Plane/apm.pdef.xml', 'Parameters\Plane.xml')
51 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/Sub/apm.pdef.xml', 'Parameters\Sub.xml')
52 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/AntennaTracker/apm.pdef.xml', 'Parameters\AntennaTracker.xml')
53 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/Heli/apm.pdef.xml', 'Parameters\Heli.xml')
54 | $wc.DownloadFile('https://autotest.ardupilot.org/Parameters/Blimp/apm.pdef.xml', 'Parameters\Blimp.xml')
55 | - name: Build installer
56 | run: |
57 | cd windows
58 | $env:VERSION=$(python returnVersion.py)
59 | python3 returnVersion.py > version.txt
60 | ISCC.exe /dMyAppVersion=$env:VERSION mavproxy.iss
61 | ls Output
62 | - name: Archive build
63 | uses: actions/upload-artifact@v4
64 | with:
65 | name: MAVProxyInstaller
66 | path: windows/Output
67 | retention-days: 7
68 | - name: Pre Release
69 | uses: "softprops/action-gh-release@v2"
70 | if: github.ref == 'refs/heads/master'
71 | with:
72 | prerelease: true
73 | name: "Development Build"
74 | tag_name: "latest"
75 | files: windows/Output/*.*
76 | token: "${{ secrets.GITHUB_TOKEN }}"
77 | - name: Release
78 | uses: "softprops/action-gh-release@v2"
79 | if: startsWith(github.ref, 'refs/tags/v')
80 | with:
81 | prerelease: false
82 | files: windows/Output/*.*
83 | token: "${{ secrets.GITHUB_TOKEN }}"
84 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | mavproxy
2 | *~
3 | *.o
4 | *.pyc
5 | *.log
6 | camera/
7 | build/
8 | dist/
9 | gtest/
10 | *.tlog
11 | *.raw
12 | MANIFEST
13 | *.egg-info
14 | .DS_Store
15 | *.bak
16 | *.orig
17 | windows/version.txt
18 | /.vscode
19 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "MAVProxy/modules/mavproxy_cesium"]
2 | path = MAVProxy/modules/mavproxy_cesium
3 | url = https://github.com/ArduPilot/MAVCesium.git
4 |
--------------------------------------------------------------------------------
/ANDROID.md:
--------------------------------------------------------------------------------
1 | ## install MAVProxy on Android ?
2 |
3 | Yes, it's possible to install MAVProxy on Android, totally unsupported, no guarantees, good luck, but here goes.
4 |
5 | ### install/load Termux Android app from .apk on github
6 | see https://github.com/termux/termux-app for more.
7 |
8 | eg: https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_armeabi-v7a.apk
9 |
10 | tip: do NOT install from play store, its a really old version.
11 |
12 | Once installed, in the termux console run these commands:
13 | ```
14 | pkg upgrade
15 | ```
16 | [ answer 'y' to all questions.]
17 |
18 | ```
19 | pkg install python
20 | ```
21 | [3.10.x at time of testing]
22 |
23 | ```
24 | pkg install libxml2*
25 | ```
26 | [ for -dev pkg ]
27 |
28 | ```
29 | pkg install libxslt*
30 | ```
31 | [ for -dev pkg ]
32 |
33 | ```
34 | pkg install python-*
35 | ```
36 | [ for python-dev , be sure to include the '-' here.]
37 |
38 | ```
39 | pip install --upgrade pip
40 | ```
41 | pip is needed for the next few packages
42 |
43 | ```
44 | pip install wheel
45 | pip install pymavlink
46 | ```
47 | wheel isn't installed automatically in some cases, so we install it manually first
48 |
49 | #https://superuser.com/questions/1724176/why-pip-throwing-an-error-when-installing-numpy-in-termux
50 | ```
51 | MATHLIB="m" pip3 install numpy
52 | ```
53 | numpy doesnt install without this extra prefix on android , so we do it first as well.
54 |
55 | ```
56 | pip install mavproxy
57 | ```
58 | finally we install mavproxy!
59 |
60 | ```
61 | pkg install mlocate
62 | updatedb
63 | ```
64 | optionally other things that might be helpful
65 |
66 | ```
67 | locate mavproxy.py
68 | ```
69 | where is it?
70 |
71 | ```
72 | mavproxy.py
73 |
74 | mavproxy.py --master=udp:1.2.3.4:14550
75 | ```
76 | a few different ways to run it!
77 | eg: if u have udp mavlink data being forward to your phone over wifi, then 1.2.3.4 should be your PHONE's ip address, and it will receive the data.
78 |
79 |
80 | known issues:
81 | * --console and all the GUI parts of mavproxy don't work, as the 'WX' package isn't available for android.
82 | * no idea if using a usb/serial connecton works, but UDP-over-wifi definitely does!
83 | * totally unsupported, may break at any time and stop working. please do a pull-request to edit this file if you find these instructions no longer work.
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/MAVProxy/MAVLink.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
14 |
15 |
16 | true
17 |
18 |
19 |
20 | aileron
21 | double
22 | /controls/flight/aileron
23 |
24 |
25 | elevator
26 | double
27 | /controls/flight/elevator
28 |
29 |
30 | rudder
31 | double
32 | /controls/flight/rudder
33 |
34 |
35 | throttle
36 | double
37 | /controls/engines/engine[0]/throttle
38 |
39 |
40 |
41 |
42 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/MAVProxy/MAVProxyWinLAN.bat:
--------------------------------------------------------------------------------
1 | cd ..\
2 | python.exe -m pip install --upgrade build . --user
3 | python.exe .\MAVProxy\mavproxy.py --master=0.0.0.0:14550 --console
4 | pause
5 |
--------------------------------------------------------------------------------
/MAVProxy/MAVProxyWinUSB.bat:
--------------------------------------------------------------------------------
1 | cd ..\
2 | python.exe -m pip install --upgrade build . --user
3 | python.exe .\MAVProxy\mavproxy.py --console
4 | pause
--------------------------------------------------------------------------------
/MAVProxy/__init__.py:
--------------------------------------------------------------------------------
1 | '''MAVProxy MAVLink ground station libraries'''
2 |
--------------------------------------------------------------------------------
/MAVProxy/modules/__init__.py:
--------------------------------------------------------------------------------
1 | # Allow imports
2 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/ANUGA/README.txt:
--------------------------------------------------------------------------------
1 |
2 | This module adapted from ANUGA:
3 |
4 | https://anuga.anu.edu.au/
5 |
6 | Many thanks to ANUGA for making this code available under the GPL!
7 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/ANUGA/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArduPilot/MAVProxy/224e88628ad2cf90e5059282c2ae209a94d2bce8/MAVProxy/modules/lib/ANUGA/__init__.py
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/LowPassFilter2p.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | from math import *
4 |
5 | class LowPassFilter2p:
6 | def __init__(self, sample_freq, cutoff_freq):
7 | self.cutoff_freq = cutoff_freq
8 | self.sample_freq = sample_freq
9 | self.a1 = 0.0
10 | self.a2 = 0.0
11 | self.b0 = 0.0
12 | self.b1 = 0.0
13 | self.b2 = 0.0
14 | self.delay_element_1 = None
15 | self.delay_element_2 = None
16 | self.set_cutoff_frequency(sample_freq, cutoff_freq)
17 |
18 | def set_cutoff_frequency(self, sample_freq, cutoff_freq):
19 | self.cutoff_freq = cutoff_freq
20 | if self.cutoff_freq <= 0.0:
21 | return
22 | fr = self.sample_freq/self.cutoff_freq
23 | ohm = tan(pi/fr)
24 | c = 1.0+2.0*cos(pi/4.0)*ohm + ohm*ohm
25 | self.b0 = ohm*ohm/c
26 | self.b1 = 2.0*self.b0
27 | self.b2 = self.b0
28 | self.a1 = 2.0*(ohm*ohm-1.0)/c
29 | self.a2 = (1.0-2.0*cos(pi/4.0)*ohm+ohm*ohm)/c
30 |
31 | def apply(self, sample):
32 | if self.delay_element_1 is None:
33 | self.delay_element_1 = sample
34 | self.delay_element_2 = sample
35 | delay_element_0 = sample - (self.delay_element_1 * self.a1) - (self.delay_element_2 * self.a2)
36 | output = (delay_element_0 * self.b0) + (self.delay_element_1 * self.b1) + (self.delay_element_2 * self.b2)
37 |
38 | self.delay_element_2 = self.delay_element_1
39 | self.delay_element_1 = delay_element_0
40 |
41 | return output
42 |
43 | if __name__ == "__main__":
44 | from pymavlink.rotmat import Vector3
45 | filter = LowPassFilter2p(1000.0, 98.0)
46 |
47 | v2 = filter.apply(Vector3(1,2,3))
48 | print(v2)
49 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/MacOS/__init__.py:
--------------------------------------------------------------------------------
1 | # version of matplotlib backends modified to work with MacOS
2 |
3 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/__init__.py:
--------------------------------------------------------------------------------
1 | # Allow imports.
2 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/dumpstacks.py:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import threading, sys, traceback
5 |
6 | # Import dumpstacks to install a SIGQUIT handler that shows a stack dump for all stacks
7 | # From http://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application
8 |
9 | def dumpstacks(signal, frame):
10 | id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
11 | code = []
12 | for threadId, stack in sys._current_frames().items():
13 | code.append("\n# Thread: %s(%d)" % (id2name.get(threadId, ""), threadId))
14 | for filename, lineno, name, line in traceback.extract_stack(stack):
15 | code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
16 | if line:
17 | code.append(" %s" % (line.strip()))
18 | print("\n".join(code))
19 |
20 | try:
21 | import signal
22 | signal.signal(signal.SIGQUIT, dumpstacks)
23 | except Exception as e:
24 | # Silently ignore failures installing this handler (probably won't work on Windows)
25 | pass
26 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/graph_ui.py:
--------------------------------------------------------------------------------
1 | from MAVProxy.modules.lib import grapher
2 | from MAVProxy.modules.lib import multiproc
3 |
4 | import errno
5 | import socket
6 | import copy
7 |
8 | graph_count = 1
9 |
10 | class Graph_UI(object):
11 | """docstring for ClassName"""
12 | def __init__(self, mestate):
13 | self.mestate = mestate
14 | self.xlim = None
15 | global graph_count
16 | self.count = graph_count
17 | graph_count += 1
18 | self.xlim_pipe = multiproc.Pipe()
19 |
20 | def display_graph(self, graphdef, flightmode_colourmap=None):
21 | '''display a graph'''
22 | if 'mestate' in globals():
23 | self.mestate.console.write("Expression: %s\n" % ' '.join(graphdef.expression.split()))
24 | else:
25 | self.mestate.child_pipe_send_console.send("Expression: %s\n" % ' '.join(graphdef.expression.split()))
26 | #mestate.mlog.reduce_by_flightmodes(mestate.flightmode_selections)
27 |
28 | #setup the graph, then pass to a new process and display
29 | self.mg = grapher.MavGraph(flightmode_colourmap)
30 | if self.mestate.settings.title is not None:
31 | self.mg.set_title(self.mestate.settings.title)
32 | else:
33 | self.mg.set_title(graphdef.name)
34 | if self.mestate.settings.max_rate > 0:
35 | self.mg.set_max_message_rate(self.mestate.settings.max_rate)
36 | self.mg.set_marker(self.mestate.settings.marker)
37 | self.mg.set_condition(self.mestate.settings.condition)
38 | self.mg.set_xaxis(self.mestate.settings.xaxis)
39 | self.mg.set_linestyle(self.mestate.settings.linestyle)
40 | self.mg.set_show_flightmode(self.mestate.settings.show_flightmode)
41 | self.mg.set_legend(self.mestate.settings.legend)
42 | self.mg.add_mav(copy.copy(self.mestate.mlog))
43 | for f in graphdef.expression.split():
44 | self.mg.add_field(f)
45 | self.mg.process(self.mestate.flightmode_selections, self.mestate.mlog._flightmodes)
46 | self.lenmavlist = len(self.mg.mav_list)
47 | #Important - mg.mav_list is the full logfile and can be very large in size
48 | #To avoid slowdowns in Windows (which copies the vars to the new process)
49 | #We need to empty this var when we're finished with it
50 | self.mg.mav_list = []
51 | child = multiproc.Process(target=self.mg.show, args=[self.lenmavlist,], kwargs={"xlim_pipe" : self.xlim_pipe})
52 | child.start()
53 | self.xlim_pipe[1].close()
54 | self.mestate.mlog.rewind()
55 |
56 | def check_xlim_change(self):
57 | '''check for new X bounds'''
58 | if self.xlim_pipe is None:
59 | return None
60 | xlim = None
61 | try:
62 | while self.xlim_pipe[0].poll():
63 | xlim = self.xlim_pipe[0].recv()
64 | except Exception:
65 | return None
66 | if xlim != self.xlim:
67 | return xlim
68 | return None
69 |
70 | def set_xlim(self, xlim):
71 | '''set new X bounds'''
72 | if self.xlim_pipe is not None and self.xlim != xlim:
73 | #print("send0: ", graph_count, xlim)
74 | try:
75 | self.xlim_pipe[0].send(xlim)
76 | except IOError:
77 | return False
78 | self.xlim = xlim
79 | return True
80 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/graphdefinition.py:
--------------------------------------------------------------------------------
1 | '''
2 | GraphDefinition class
3 | '''
4 |
5 | class GraphDefinition(object):
6 | '''a pre-defined graph'''
7 | def __init__(self, name, expression, description, expressions, filename):
8 | self.name = name
9 | self.expression = expression
10 | self.description = description
11 | self.expressions = expressions
12 | self.filename = filename
13 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/icon.py:
--------------------------------------------------------------------------------
1 | """
2 | MAVProxy icons generator
3 | """
4 | import numpy as np
5 | from io import BytesIO
6 | from matplotlib.figure import Figure
7 | from matplotlib.gridspec import GridSpec
8 | import matplotlib.path as mpath
9 | import matplotlib.patches as mpatches
10 | from MAVProxy.modules.lib.wx_loader import wx
11 |
12 |
13 | class SimpleIcon():
14 | """
15 | Generate icons with Matplotlib.
16 | """
17 | def __init__(self, text=None):
18 | LIGHT_BLUE_BACKGROUND = "#afceff"
19 | VIOLET_FONT = "#4800f0"
20 | t1 = np.arange(0.0, 5.0, 0.1)
21 | t2 = np.arange(0.0, 5.0, 0.02)
22 |
23 | def f(t):
24 | return np.exp(-t) * np.cos(2*np.pi*t)
25 |
26 | fig = Figure(figsize=(1.28, 1.28), facecolor=LIGHT_BLUE_BACKGROUND)
27 | spec = GridSpec(nrows=2, ncols=1, wspace=0, hspace=0.0, height_ratios=[1, 2])
28 | ax = fig.add_subplot(spec[0])
29 | ax.text(0, 0.8, 'MAV', style='italic', fontsize=20, weight='bold', color=VIOLET_FONT)
30 | if text is None:
31 | text = "GRAPH"
32 | ax.text(0, 0.1, text.upper(), style='italic', fontsize=14, weight='bold', color=VIOLET_FONT)
33 | ax.axis('off')
34 |
35 | ax = fig.add_subplot(spec[1], facecolor=LIGHT_BLUE_BACKGROUND)
36 | if text == "GRAPH" or text == "EXPLORER":
37 | ax.plot(t1, f(t1), color='tab:green', marker='o')
38 | ax.plot(t2, f(t2), color='red')
39 | ax.set_xticks(t1, minor=True)
40 | ax.grid(True, which='both', linestyle="--")
41 | if text == "CONSOLE":
42 | ax.plot([0, 2.5], [2.5, 1.25], color='red', linewidth=4)
43 | ax.plot([0, 2.5], [0, 1.25], color='red', linewidth=4)
44 | ax.plot([3, 5], [0, 0], color='red', linewidth=4)
45 | ax.axis('off')
46 | if text == "MAP":
47 | path_data = [
48 | (mpath.Path.MOVETO, [2.5, 0]),
49 | (mpath.Path.LINETO, [1.25, 2.5]),
50 | (mpath.Path.CURVE3, [2.5, 5]),
51 | (mpath.Path.CURVE3, [3.75, 2.5]),
52 | (mpath.Path.LINETO, [3.75, 2.5]),
53 | (mpath.Path.CLOSEPOLY, [2.5, 0])]
54 | codes, verts = zip(*path_data)
55 | path = mpath.Path(verts, codes)
56 |
57 | patch = mpatches.PathPatch(path, facecolor='red', lw=2)
58 | ax.add_patch(patch)
59 | circle_neg = mpatches.Circle((2.5, 2.5), 0.5, color='white')
60 | ax.add_patch(circle_neg)
61 |
62 | ax.plot([0, 5/3.0, 10/3.0, 5], [5, 4, 5, 4], color='black', linewidth=2)
63 | ax.plot([0, 5/3.0, 10/3.0, 5], [-1, -2, -1, -2], color='black', linewidth=2)
64 | ax.plot([0, 0], [-1, 5], color='black', linewidth=2)
65 | ax.plot([5/3.0, 5/3.0], [-2, 4], color='black', linewidth=2)
66 | ax.plot([10/3.0, 10/3.0], [-1, 5], color='black', linewidth=2)
67 | ax.plot([5, 5], [-2, 4], color='black', linewidth=2)
68 | ax.set_xlim(-0.5, 5.5)
69 | ax.set_ylim(-2.5, 5.5)
70 | ax.axis('off')
71 |
72 | buf = BytesIO()
73 | fig.savefig(buf, format='png')
74 | buf.seek(0)
75 | svgimg = wx.Image(buf, wx.BITMAP_TYPE_PNG)
76 | self.img = svgimg
77 |
78 | def get_ico(self):
79 | """Get the ico from the image bitmap.
80 | need to be call after the wx.app is created."""
81 | return wx.Icon(wx.Bitmap(self.img))
82 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/live_graph.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 |
5 | MAVProxy realtime graphing module, partly based on the wx graphing
6 | demo by Eli Bendersky (eliben@gmail.com)
7 |
8 | http://eli.thegreenplace.net/files/prog_code/wx_mpl_dynamic_graph.py.txt
9 | """
10 |
11 | import platform
12 | from MAVProxy.modules.lib import mp_util
13 | from MAVProxy.modules.lib import multiproc
14 |
15 | class LiveGraph():
16 | '''
17 | a live graph object using wx and matplotlib
18 | All of the GUI work is done in a child process to provide some insulation
19 | from the parent mavproxy instance and prevent instability in the GCS
20 |
21 | New data is sent to the LiveGraph instance via a pipe
22 | '''
23 | def __init__(self,
24 | fields,
25 | title='MAVProxy: LiveGraph',
26 | timespan=20.0,
27 | tickresolution=0.2,
28 | colors=[ 'red', 'green', 'blue', 'orange', 'olive', 'cyan', 'magenta', 'brown',
29 | 'violet', 'purple', 'grey', 'black'],
30 | labels=None):
31 | self.fields = fields
32 | self.labels = labels
33 | self.colors = colors
34 | self.title = title
35 | self.timespan = timespan
36 | self.tickresolution = tickresolution
37 | self.values = [None]*len(self.fields)
38 | self.parent_pipe,self.child_pipe = multiproc.Pipe()
39 | self.close_graph = multiproc.Event()
40 | self.close_graph.clear()
41 | self.child = multiproc.Process(target=self.child_task)
42 | self.child.start()
43 |
44 | def child_task(self):
45 | '''child process - this holds all the GUI elements'''
46 | mp_util.child_close_fds()
47 |
48 | import matplotlib, platform
49 | if platform.system() != "Darwin":
50 | # on MacOS we can't set WxAgg here as it conflicts with the MacOS version
51 | matplotlib.use('WXAgg')
52 |
53 | from MAVProxy.modules.lib import wx_processguard
54 | from MAVProxy.modules.lib.wx_loader import wx
55 |
56 | app = wx.App(False)
57 | from MAVProxy.modules.lib import live_graph_ui
58 | app.frame = live_graph_ui.GraphFrame(state=self)
59 | app.frame.Show()
60 | app.MainLoop()
61 |
62 | def add_values(self, values):
63 | '''add some data to the graph'''
64 | if self.child.is_alive():
65 | self.parent_pipe.send(values)
66 |
67 | def close(self):
68 | '''close the graph'''
69 | self.close_graph.set()
70 | if self.is_alive():
71 | self.child.join(2)
72 |
73 | def is_alive(self):
74 | '''check if graph is still going'''
75 | return self.child.is_alive()
76 |
77 |
78 | if __name__ == "__main__":
79 | multiproc.freeze_support()
80 | # test the graph
81 | import time, math
82 | import live_graph
83 | livegraph = live_graph.LiveGraph(['sin(t)', 'cos(t)', 'sin(t+1)',
84 | 'cos(t+1)', 'sin(t+2)', 'cos(t+2)',
85 | 'cos(t+1)', 'sin(t+2)', 'cos(t+2)', 'x'],
86 | timespan=30,
87 | title='Graph Test',
88 | labels=['a','b','c','d'])
89 | while livegraph.is_alive():
90 | t = time.time()
91 | livegraph.add_values([math.sin(t), math.cos(t),
92 | math.sin(t+1), math.cos(t+1),
93 | math.sin(t+1), math.cos(t+1),
94 | math.sin(t+1), math.cos(t+1),
95 | math.sin(t+2), math.cos(t+2)])
96 | time.sleep(0.05)
97 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/mp_widgets.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | '''
3 | some useful wx widgets
4 |
5 | Andrew Tridgell
6 | June 2012
7 | '''
8 |
9 | from MAVProxy.modules.lib.wx_loader import wx
10 | import cv2
11 | import numpy as np
12 | import warnings
13 |
14 | class ImagePanel(wx.Panel):
15 | '''a resizable panel containing an image'''
16 | def __init__(self, parent, img):
17 | wx.Panel.__init__(self, parent, -1, size=(1, 1))
18 | self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
19 | self.set_image(img)
20 | self.Bind(wx.EVT_PAINT, self.on_paint)
21 |
22 | def on_paint(self, event):
23 | '''repaint the image'''
24 | dc = wx.AutoBufferedPaintDC(self)
25 | dc.DrawBitmap(self._bmp, 0, 0)
26 |
27 | def set_image(self, img):
28 | '''set the image to be displayed'''
29 | with warnings.catch_warnings():
30 | warnings.simplefilter('ignore')
31 | if hasattr(img, 'shape'):
32 | (width, height) = (img.shape[1], img.shape[0])
33 | self._bmp = wx.BitmapFromBuffer(width, height, np.uint8(img)) # http://stackoverflow.com/a/16866833/2559632
34 | elif hasattr(img, 'GetHeight'):
35 | self._bmp = wx.BitmapFromImage(img)
36 | else:
37 | print("Unsupported image type: %s" % type(img))
38 | return
39 | self.SetMinSize((self._bmp.GetWidth(), self._bmp.GetHeight()))
40 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/multiproc.py:
--------------------------------------------------------------------------------
1 | '''
2 | multi-processing abstraction
3 | This wraps the multiprocessing module, using billiard on MacOS
4 | and multiprocessing on Linux and Windows
5 |
6 | The key problem on MacOS is that you can't fork in any process that uses
7 | threading, which is almost all of processes as so many libraries use
8 | threads. So instead billiard uses an approach that uses fork+exec and re-runs
9 | the script in the child. It is horrible, but it seems to be the only way to
10 | make things work on MacOS
11 | '''
12 |
13 | class PipeQueue(object):
14 | '''simulate a queue using a pipe. This is used to avoid a problem with
15 | pipes on MacOS, while still keeping similar syntax'''
16 | def __init__(self):
17 | (self.sender,self.receiver) = Pipe()
18 | self.alive = True
19 | self.pending = []
20 |
21 | def close(self):
22 | self.alive = False
23 | self.sender.close()
24 | self.receiver.close()
25 |
26 | def put(self, *args):
27 | if not self.alive:
28 | return
29 | try:
30 | self.sender.send(*args)
31 | except Exception:
32 | self.close()
33 |
34 | def fill(self):
35 | if not self.alive:
36 | return
37 | try:
38 | while self.receiver.poll():
39 | m = self.receiver.recv()
40 | self.pending.append(m)
41 | except Exception:
42 | self.alive = False
43 | self.close()
44 |
45 | def get(self):
46 | if not self.alive:
47 | return None
48 | self.fill()
49 | if len(self.pending) > 0:
50 | return self.pending.pop(0)
51 | return None
52 |
53 | def qsize(self):
54 | self.fill()
55 | return len(self.pending)
56 |
57 | def empty(self):
58 | return self.qsize() == 0
59 |
60 | import platform, os, sys
61 |
62 | # we use billiard (and forking disable) on MacOS, and also if USE_BILLIARD environment
63 | # is set. Using USE_BILLIARD allows for debugging of the crazy forking disable approach on
64 | # a saner platform
65 | # As of Python 3.8 the default start method for macOS is spawn and billiard is not required.
66 | if ((platform.system() == 'Darwin' or os.environ.get('USE_BILLIARD',None) is not None)
67 | and sys.version_info < (3, 8)):
68 | from billiard import Process, forking_enable, freeze_support, Pipe, Semaphore, Event, Lock
69 | forking_enable(False)
70 | Queue = PipeQueue
71 | else:
72 | from multiprocessing import Process, freeze_support, Pipe, Semaphore, Event, Lock, Queue
73 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/optparse_gui/README.txt:
--------------------------------------------------------------------------------
1 | This is optparse_gui from http://code.google.com/p/optparse-gui/
2 |
3 | Thanks to slider for a great library!
4 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/param_ftp.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | '''
3 | decode ftp parameter protocol data
4 | '''
5 |
6 | import struct
7 | import sys
8 |
9 | class ParamData(object):
10 | def __init__(self):
11 | # params as (name, value, ptype)
12 | self.params = []
13 | # defaults as (name, value, ptype)
14 | self.defaults = None
15 |
16 | def add_param(self, name, value, ptype):
17 | self.params.append((name,value,ptype))
18 |
19 | def add_default(self, name, value, ptype):
20 | if self.defaults is None:
21 | self.defaults = []
22 | self.defaults.append((name,value,ptype))
23 |
24 | def ftp_param_decode(data):
25 | '''decode parameter data, returning ParamData'''
26 | pdata = ParamData()
27 |
28 | magic = 0x671b
29 | magic_defaults = 0x671c
30 | if len(data) < 6:
31 | return None
32 | magic2,num_params,total_params = struct.unpack(" 0 and data[0] == pad_byte:
58 | # skip pad bytes
59 | data = data[1:]
60 |
61 | if len(data) == 0:
62 | break
63 |
64 | ptype, plen = struct.unpack(">4) & 0x0F
66 | has_default = with_defaults and (flags&1) != 0
67 | ptype &= 0x0F
68 |
69 | if not ptype in data_types:
70 | print("paramftp: bad type 0x%x" % ptype)
71 | return None
72 |
73 | (type_len, type_format) = data_types[ptype]
74 | default_len = type_len if has_default else 0
75 |
76 | name_len = ((plen>>4) & 0x0F) + 1
77 | common_len = (plen & 0x0F)
78 | name = last_name[0:common_len] + data[2:2+name_len]
79 | vdata = data[2+name_len:2+name_len+type_len+default_len]
80 | last_name = name
81 | data = data[2+name_len+type_len+default_len:]
82 | if with_defaults:
83 | if has_default:
84 | v1,v2, = struct.unpack("<" + type_format + type_format, vdata)
85 | pdata.add_param(name, v1, ptype)
86 | pdata.add_default(name, v2, ptype)
87 | else:
88 | v, = struct.unpack("<" + type_format, vdata)
89 | pdata.add_param(name, v, ptype)
90 | pdata.add_default(name, v, ptype)
91 | else:
92 | v, = struct.unpack("<" + type_format, vdata)
93 | pdata.add_param(name, v, ptype)
94 | count += 1
95 |
96 | if count != total_params:
97 | print("paramftp: bad count %u should be %u" % (count, total_params))
98 | return None
99 |
100 | return pdata
101 |
102 | if __name__ == "__main__":
103 | import sys
104 | fname = sys.argv[1]
105 | data = open(fname,'rb').read()
106 | print("Decoding file of length %u" % len(data))
107 | pdata = ftp_param_decode(data)
108 | if pdata is None:
109 | print("Decode failed")
110 | sys.exit(1)
111 | for (name,value,ptype) in pdata.params:
112 | print(name.decode('utf-8'), value)
113 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/textconsole.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 | MAVProxy default console
5 | """
6 | import sys
7 |
8 | class SimpleConsole():
9 | '''
10 | a message console for MAVProxy
11 | '''
12 | def __init__(self):
13 | pass
14 |
15 | def write(self, text, fg='black', bg='white'):
16 | '''write to the console'''
17 | if isinstance(text, str):
18 | sys.stdout.write(text)
19 | else:
20 | sys.stdout.write(str(text))
21 | sys.stdout.flush()
22 |
23 | def writeln(self, text, fg='black', bg='white'):
24 | '''write to the console with linefeed'''
25 | if not isinstance(text, str):
26 | text = str(text)
27 | self.write(text + '\n', fg=fg, bg=bg)
28 |
29 | def set_status(self, name, text='', row=0, fg='black', bg='white'):
30 | '''set a status value'''
31 | pass
32 |
33 | def error(self, text, fg='red', bg='white'):
34 | self.writeln(text, fg=fg, bg=bg)
35 |
36 | def close(self):
37 | pass
38 |
39 | def is_alive(self):
40 | '''check if we are alive'''
41 | return True
42 |
43 | def set_menu(self, menu, callback):
44 | pass
45 |
46 | if __name__ == "__main__":
47 | # test the console
48 | import time
49 | console = SimpleConsole()
50 | while console.is_alive():
51 | console.write('Tick', fg='red')
52 | console.write(" %s " % time.asctime())
53 | console.writeln('tock', bg='yellow')
54 | time.sleep(0.5)
55 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wx_loader.py:
--------------------------------------------------------------------------------
1 | from MAVProxy.modules.lib import wx_util
2 |
3 | if not wx_util.safe:
4 | print('Cannot access wx from main thread.')
5 | import traceback
6 | print(traceback.print_stack())
7 | raise Exception('Cannot access wx from main thread')
8 |
9 | import wx
10 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wx_processguard.py:
--------------------------------------------------------------------------------
1 | # Explicit information for the Python loader
2 | # that this subprocess can load wx, which is not process-safe.
3 |
4 | from MAVProxy.modules.lib import wx_util
5 |
6 | wx_util.safe = True
7 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wx_util.py:
--------------------------------------------------------------------------------
1 | # Maintain the guard for wx being able to be
2 | # loaded on this process. This is only needed
3 | # for Darwin, so to reduce error cases, only
4 | # implement it on Darwin.
5 |
6 | import sys
7 | safe = sys.platform != 'darwin'
8 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxconsole_util.py:
--------------------------------------------------------------------------------
1 | class Text():
2 | '''text to write to console'''
3 | def __init__(self, text, fg='black', bg='white'):
4 | self.text = text
5 | self.fg = fg
6 | self.bg = bg
7 |
8 | class Value():
9 | '''a value for the status bar'''
10 | def __init__(self, name, text, row=0, fg='black', bg='white'):
11 | self.name = name
12 | self.text = text
13 | self.row = row
14 | self.fg = fg
15 | self.bg = bg
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxgrapheditor.py:
--------------------------------------------------------------------------------
1 | '''
2 | Graphical editing of graph definition
3 | '''
4 | from MAVProxy.modules.lib.wx_loader import wx
5 | from MAVProxy.modules.lib.graphdefinition import GraphDefinition
6 |
7 | class GraphDialog(wx.Dialog):
8 | def __init__(self, title, graphdef, callback):
9 | wx.Dialog.__init__(self, None, -1, title, size=(900, 400))
10 |
11 | self.callback = callback
12 | self.graphdef = graphdef
13 |
14 | self.panel = wx.Panel(self, -1)
15 | vbox = wx.BoxSizer(wx.VERTICAL)
16 |
17 | # name entry
18 | hbox_name = wx.BoxSizer(wx.HORIZONTAL)
19 | st_name = wx.StaticText(self.panel, -1, 'Name: ')
20 | self.tc_name = wx.TextCtrl(self.panel, -1, size=(400, -1))
21 | try:
22 | self.tc_name.Value = self.graphdef.name
23 | except Exception:
24 | self.tc_name.Value = 'UNKNOWN'
25 | hbox_name.Add(st_name, 0, wx.LEFT, 10)
26 | hbox_name.Add(self.tc_name, 0, wx.LEFT, 35)
27 | vbox.Add(hbox_name, 0, wx.TOP, 10)
28 |
29 | # expression entry
30 | st = wx.StaticText(self.panel, -1, 'Expressions: ')
31 | vbox.Add(st, 0, wx.LEFT, 10)
32 |
33 | hbox_expressions = wx.BoxSizer(wx.HORIZONTAL)
34 | self.tc_expressions = wx.TextCtrl(self.panel, -1, style=wx.TE_MULTILINE|wx.HSCROLL, size=(800, 80))
35 | elist = []
36 | for e in self.graphdef.expressions:
37 | e = ' '.join(e.split())
38 | elist.append(e)
39 | self.tc_expressions.Value = '\n'.join(elist)
40 | vbox.Add(self.tc_expressions, 0, wx.LEFT, 15)
41 |
42 | # description entry
43 | st = wx.StaticText(self.panel, -1, 'Description: ')
44 | vbox.Add(st, 0, wx.LEFT, 10)
45 | self.tc_description = wx.TextCtrl(self.panel, -1, style=wx.TE_MULTILINE)
46 | vbox.Add(self.tc_description, 1, wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 15)
47 | self.tc_description.Value = self.graphdef.description
48 |
49 | # buttons
50 | button_save = wx.Button(self.panel, 1, 'Save')
51 | button_cancel = wx.Button(self.panel, 2, 'Cancel')
52 | button_test = wx.Button(self.panel, 3, 'Test')
53 | hbox_buttons = wx.BoxSizer(wx.HORIZONTAL)
54 | hbox_buttons.Add(button_save, 0, wx.LEFT, 10)
55 | hbox_buttons.Add(button_cancel, 0, wx.LEFT, 10)
56 | hbox_buttons.Add(button_test, 0, wx.LEFT, 10)
57 | vbox.Add(hbox_buttons, 0, wx.TOP, 10)
58 | self.Bind(wx.EVT_BUTTON, self.OnSave, id=1)
59 | self.Bind(wx.EVT_BUTTON, self.OnCancel, id=2)
60 | self.Bind(wx.EVT_BUTTON, self.OnTest, id=3)
61 |
62 | self.panel.SetSizer(vbox)
63 | self.Centre()
64 |
65 | def update_values(self):
66 | self.graphdef.name = self.tc_name.Value.strip()
67 | self.graphdef.expressions = self.tc_expressions.Value.split('\n')
68 | self.graphdef.description = self.tc_description.Value
69 |
70 | def OnCancel(self, event):
71 | self.Close()
72 |
73 | def OnTest(self, event):
74 | self.update_values()
75 | self.callback('test', self.graphdef)
76 |
77 | def OnSave(self, event):
78 | self.update_values()
79 | self.callback('save', self.graphdef)
80 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxhorizon.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 | MAVProxy horizon indicator.
5 | """
6 | from MAVProxy.modules.lib import multiproc
7 | import time
8 |
9 | class HorizonIndicator():
10 | '''
11 | A horizon indicator for MAVProxy.
12 | '''
13 | def __init__(self,title='MAVProxy: Horizon Indicator'):
14 | self.title = title
15 | # Create Pipe to send attitude information from module to UI
16 | self.child_pipe_recv,self.parent_pipe_send = multiproc.Pipe()
17 | self.close_event = multiproc.Event()
18 | self.close_event.clear()
19 | self.child = multiproc.Process(target=self.child_task)
20 | self.child.start()
21 | self.child_pipe_recv.close()
22 |
23 | def child_task(self):
24 | '''child process - this holds all the GUI elements'''
25 | self.parent_pipe_send.close()
26 |
27 | from MAVProxy.modules.lib import wx_processguard
28 | from MAVProxy.modules.lib.wx_loader import wx
29 | from MAVProxy.modules.lib.wxhorizon_ui import HorizonFrame
30 | # Create wx application
31 | app = wx.App(False)
32 | app.frame = HorizonFrame(state=self, title=self.title)
33 | app.frame.SetDoubleBuffered(True)
34 | app.frame.Show()
35 | app.MainLoop()
36 | self.close_event.set() # indicate that the GUI has closed
37 |
38 | def close(self):
39 | '''Close the window.'''
40 | self.close_event.set()
41 | if self.is_alive():
42 | self.child.join(2)
43 |
44 | def is_alive(self):
45 | '''check if child is still going'''
46 | return self.child.is_alive()
47 |
48 | if __name__ == "__main__":
49 | # test the console
50 | multiproc.freeze_support()
51 | horizon = HorizonIndicator()
52 | while horizon.is_alive():
53 | print('test')
54 | time.sleep(0.5)
55 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxhorizon_util.py:
--------------------------------------------------------------------------------
1 | class Attitude():
2 | '''The current Attitude Data'''
3 | def __init__(self, attitudeMsg):
4 | self.pitch = attitudeMsg.pitch
5 | self.roll = attitudeMsg.roll
6 | self.yaw = attitudeMsg.yaw
7 |
8 | class VFR_HUD():
9 | '''HUD Information.'''
10 | def __init__(self,hudMsg):
11 | self.airspeed = hudMsg.airspeed
12 | self.groundspeed = hudMsg.groundspeed
13 | self.heading = hudMsg.heading
14 | self.throttle = hudMsg.throttle
15 | self.climbRate = hudMsg.climb
16 |
17 | class Global_Position_INT():
18 | '''Altitude relative to ground (GPS).'''
19 | def __init__(self,gpsINT,curTime):
20 | self.relAlt = gpsINT.relative_alt/1000.0
21 | self.curTime = curTime
22 |
23 | class BatteryInfo():
24 | '''Voltage, current and remaning battery.'''
25 | def __init__(self,batMsg):
26 | self.voltage = batMsg.voltage_battery/1000.0 # Volts
27 | self.current = batMsg.current_battery/100.0 # Amps
28 | self.batRemain = batMsg.battery_remaining # %
29 |
30 | class FlightState():
31 | '''Mode and arm state.'''
32 | def __init__(self,mode,armState):
33 | self.mode = mode
34 | self.armState = armState
35 |
36 | class WaypointInfo():
37 | '''Current and final waypoint numbers, and the distance
38 | to the current waypoint.'''
39 | def __init__(self,current,final,currentDist,nextWPTime,wpBearing):
40 | self.current = current
41 | self.final = final
42 | self.currentDist = currentDist
43 | self.nextWPTime = nextWPTime
44 | self.wpBearing = wpBearing
45 |
46 | class FPS():
47 | '''Stores intended frame rate information.'''
48 | def __init__(self,fps):
49 | self.fps = fps # if fps is zero, then the frame rate is unrestricted
50 |
51 |
52 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxsaildash.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 | MAVProxy sailing dashboard
5 | """
6 |
7 | from MAVProxy.modules.lib import multiproc
8 | import time
9 |
10 | class SailingDashboard(object):
11 | '''
12 | A sailing dashboard for MAVProxy
13 | '''
14 |
15 | def __init__(self, title="MAVProxy: Sailing Dashboard"):
16 | self.title = title
17 |
18 | # create a pipe for communication from the module to the GUI
19 | self.child_pipe_recv, self.parent_pipe_send = multiproc.Pipe(duplex=False)
20 | self.close_event = multiproc.Event()
21 | self.close_event.clear()
22 |
23 | # create and start the child process
24 | self.child = multiproc.Process(target=self.child_task)
25 | self.child.start()
26 |
27 | # prevent the parent from using the child connection
28 | self.child_pipe_recv.close()
29 |
30 | def child_task(self):
31 | '''The child process hosts the GUI elements'''
32 |
33 | # prevent the child from using the parent connection
34 | self.parent_pipe_send.close()
35 |
36 | from MAVProxy.modules.lib import wx_processguard
37 | from MAVProxy.modules.lib.wx_loader import wx
38 | from MAVProxy.modules.lib.wxsaildash_ui import SailingDashboardFrame
39 |
40 | # create the wx application and pass self as the state
41 | app = wx.App()
42 | app.frame = SailingDashboardFrame(state=self, title=self.title, size=(800, 300))
43 | app.frame.SetDoubleBuffered(True)
44 | app.frame.Show()
45 | app.MainLoop()
46 |
47 | # trigger a close event when the main app window is closed.
48 | # the event is monitored by the MAVProxy module which will
49 | # flag the module for unloading
50 | self.close_event.set()
51 |
52 | def close(self):
53 | '''Close the GUI'''
54 |
55 | # trigger a close event which is monitored by the
56 | # child gui process - it will close allowing the
57 | # process to be joined
58 | self.close_event.set()
59 | if self.is_alive():
60 | self.child.join(timeout=2.0)
61 |
62 | def is_alive(self):
63 | '''Check if the GUI process is alive'''
64 |
65 | return self.child.is_alive()
66 |
67 | if __name__ == "__main__":
68 | '''A stand alone test for the sailing dashboard'''
69 |
70 | multiproc.freeze_support()
71 | sail_dash = SailingDashboard()
72 | while sail_dash.is_alive():
73 | print('sailing dashboard is alive')
74 | time.sleep(0.5)
75 |
76 |
77 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxsaildash_util.py:
--------------------------------------------------------------------------------
1 | '''
2 | MAVProxy sailing dashboard utility classes
3 | '''
4 |
5 | import enum
6 |
7 | class WindReference(enum.Enum):
8 | '''
9 | An enumeration for the wind reference (either RELATIVE or TRUE)
10 | '''
11 |
12 | RELATIVE = 1
13 | TRUE = 2
14 |
15 | class SpeedUnit(enum.Enum):
16 | '''
17 | An enumeration for the units of speed: kph, mph, or knots
18 | '''
19 |
20 | KPH = 1
21 | MPH = 2
22 | KNOTS = 3
23 |
24 | class WindAngleAndSpeed(object):
25 | '''
26 | Wind angle and speed attributes
27 | '''
28 |
29 | def __init__(self, reference, angle, speed, unit):
30 | self.wind_reference = reference
31 | self.wind_angle = angle
32 | self.wind_speed = speed
33 | self.wind_speed_unit = unit
34 |
35 | class WaterSpeedAndHeading(object):
36 | '''
37 | Water speed and heading attributes
38 | '''
39 |
40 | def __init__(self, water_speed, heading_true):
41 | self.water_speed = water_speed
42 | self.heading_true = heading_true
43 |
--------------------------------------------------------------------------------
/MAVProxy/modules/lib/wxsettings.py:
--------------------------------------------------------------------------------
1 | '''
2 | Graphical editing of mp_settings object
3 | '''
4 | import os, sys
5 | from MAVProxy.modules.lib import multiproc
6 | import threading
7 |
8 | class WXSettings(object):
9 | '''
10 | a graphical settings dialog for mavproxy
11 | '''
12 | def __init__(self, settings):
13 | self.settings = settings
14 | self.parent_pipe,self.child_pipe = multiproc.Pipe()
15 | self.close_event = multiproc.Event()
16 | self.close_event.clear()
17 | self.child = multiproc.Process(target=self.child_task)
18 | self.child.start()
19 | t = threading.Thread(target=self.watch_thread)
20 | t.daemon = True
21 | t.start()
22 |
23 | def child_task(self):
24 | '''child process - this holds all the GUI elements'''
25 | from MAVProxy.modules.lib import mp_util
26 | from MAVProxy.modules.lib import wx_processguard
27 | from MAVProxy.modules.lib.wx_loader import wx
28 | from MAVProxy.modules.lib.wxsettings_ui import SettingsDlg
29 |
30 | mp_util.child_close_fds()
31 | app = wx.App(False)
32 | dlg = SettingsDlg(self.settings)
33 | dlg.parent_pipe = self.parent_pipe
34 | dlg.ShowModal()
35 | dlg.Destroy()
36 |
37 | def watch_thread(self):
38 | '''watch for settings changes from child'''
39 | from MAVProxy.modules.lib.mp_settings import MPSetting
40 | while True:
41 | setting = self.child_pipe.recv()
42 | if not isinstance(setting, MPSetting):
43 | break
44 | try:
45 | self.settings.set(setting.name, setting.value)
46 | except Exception:
47 | print("Unable to set %s to %s" % (setting.name, setting.value))
48 |
49 | def is_alive(self):
50 | '''check if child is still going'''
51 | return self.child.is_alive()
52 |
53 |
54 | if __name__ == "__main__":
55 | multiproc.freeze_support()
56 |
57 | def test_callback(setting):
58 | '''callback on apply'''
59 | print("Changing %s to %s" % (setting.name, setting.value))
60 |
61 | # test the settings
62 | from MAVProxy.modules.lib import mp_settings, time
63 | from MAVProxy.modules.lib.mp_settings import MPSetting
64 | settings = mp_settings.MPSettings(
65 | [ MPSetting('link', int, 1, tab='TabOne'),
66 | MPSetting('altreadout', int, 10, range=(-30,1017), increment=1),
67 | MPSetting('pvalue', float, 0.3, range=(-3.0,1e6), increment=0.1, digits=2),
68 | MPSetting('enable', bool, True, tab='TabTwo'),
69 | MPSetting('colour', str, 'Blue', choice=['Red', 'Green', 'Blue']),
70 | MPSetting('foostr', str, 'blah', label='Foo String') ])
71 | settings.set_callback(test_callback)
72 | dlg = WXSettings(settings)
73 | while dlg.is_alive():
74 | time.sleep(0.1)
75 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_DGPS.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | '''
3 | support for a GCS attached DGPS system
4 | '''
5 |
6 | import socket, errno
7 | from pymavlink import mavutil
8 | from MAVProxy.modules.lib import mp_module
9 |
10 | class DGPSModule(mp_module.MPModule):
11 | def __init__(self, mpstate):
12 | super(DGPSModule, self).__init__(mpstate, "DGPS", "DGPS injection support for SBP/RTCP/UBC")
13 | self.portnum = 13320
14 | self.port = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
15 | self.port.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
16 | self.port.bind(("127.0.0.1", self.portnum))
17 | mavutil.set_close_on_exec(self.port.fileno())
18 | self.port.setblocking(0)
19 | self.inject_seq_nr = 0
20 | print("DGPS: Listening for RTCM packets on UDP://%s:%s" % ("127.0.0.1", self.portnum))
21 |
22 | def send_rtcm_msg(self, data):
23 | msglen = 180;
24 |
25 | if (len(data) > msglen * 4):
26 | print("DGPS: Message too large", len(data))
27 | return
28 |
29 | # How many messages will we send?
30 | msgs = 0
31 | if (len(data) % msglen == 0):
32 | msgs = len(data) // msglen
33 | else:
34 | msgs = (len(data) // msglen) + 1
35 |
36 | for a in range(0, msgs):
37 |
38 | flags = 0
39 |
40 | # Set the fragment flag if we're sending more than 1 packet.
41 | if (msgs) > 1:
42 | flags = 1
43 |
44 | # Set the ID of this fragment
45 | flags |= (a & 0x3) << 1
46 |
47 | # Set an overall sequence number
48 | flags |= (self.inject_seq_nr & 0x1f) << 3
49 |
50 |
51 | amount = min(len(data) - a * msglen, msglen)
52 | datachunk = data[a*msglen : a*msglen + amount]
53 |
54 | self.master.mav.gps_rtcm_data_send(
55 | flags,
56 | len(datachunk),
57 | bytearray(datachunk.ljust(180, b'\0')))
58 |
59 | # Send a terminal 0-length message if we sent 2 or 3 exactly-full messages.
60 | if (msgs < 4) and (len(data) % msglen == 0) and (len(data) > msglen):
61 | flags = 1 | (msgs & 0x3) << 1 | (self.inject_seq_nr & 0x1f) << 3
62 | self.master.mav.gps_rtcm_data_send(
63 | flags,
64 | 0,
65 | bytearray("".ljust(180, '\0')))
66 |
67 | self.inject_seq_nr += 1
68 |
69 |
70 |
71 | def idle_task(self):
72 | '''called in idle time'''
73 | try:
74 | data = self.port.recv(1024) # Attempt to read up to 1024 bytes.
75 | except socket.error as e:
76 | if e.errno in [ errno.EAGAIN, errno.EWOULDBLOCK ]:
77 | return
78 | raise
79 | try:
80 | self.send_rtcm_msg(data)
81 |
82 | except Exception as e:
83 | print("DGPS: GPS Inject Failed:", e)
84 |
85 | def init(mpstate):
86 | '''initialise module'''
87 | return DGPSModule(mpstate)
88 |
89 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_SIYI/tools/temp_dir.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | # save images in therm cap
4 |
5 | import sys
6 | import numpy as np
7 | import cv2
8 | import time
9 | import glob
10 | import os
11 | from MAVProxy.modules.lib.mp_image import MPImage
12 | from pymavlink import mavutil
13 |
14 | from argparse import ArgumentParser
15 | parser = ArgumentParser(description=__doc__)
16 |
17 | parser.add_argument("--min-temp", default=None, type=float, help="min temperature")
18 | parser.add_argument("--siyi-log", default=None, type=float, help="SIYI binlog")
19 | parser.add_argument("dirname", default=None, type=str, help="directory")
20 | args = parser.parse_args()
21 |
22 | DNAME=args.dirname
23 | mouse_temp=-1
24 | tmin = -1
25 | tmax = -1
26 | last_data = None
27 | C_TO_KELVIN = 273.15
28 |
29 | def update_title():
30 | global tmin, tmax, mouse_temp
31 | cv2.setWindowTitle('Thermal', "Thermal: (%.1fC to %.1fC) %.1fC" % (tmin, tmax, mouse_temp))
32 |
33 | def click_callback(event, x, y, flags, param):
34 | global last_data, mouse_temp
35 | if last_data is None:
36 | return
37 | p = last_data[y*640+x]
38 | mouse_temp = p - C_TO_KELVIN
39 | update_title()
40 |
41 | def display_file(fname):
42 | global mouse_temp, tmin, tmax, last_data
43 | print('Importing: ', fname)
44 | a = np.fromfile(fname, dtype='>u2')
45 | if len(a) != 640 * 512:
46 | print("Bad size %u" % len(a))
47 | return
48 | # get in Kelvin
49 | a = (a / 64.0)
50 |
51 | C_TO_KELVIN = 273.15
52 |
53 | maxv = a.max()
54 | minv = a.min()
55 |
56 | tmin = minv - C_TO_KELVIN
57 | tmax = maxv - C_TO_KELVIN
58 |
59 | if args.min_temp is not None and tmax < args.min_temp:
60 | return
61 |
62 | print("Max=%.3fC Min=%.3fC" % (tmax, tmin))
63 | if maxv <= minv:
64 | print("Bad range")
65 | return
66 |
67 | last_data = a
68 |
69 | # convert to 0 to 255
70 | a = (a - minv) * 65535.0 / (maxv - minv)
71 |
72 | # convert to uint8 greyscale as 640x512 image
73 | a = a.astype(np.uint16)
74 | a = a.reshape(512, 640)
75 |
76 | cv2.imshow('Thermal', a)
77 | cv2.setMouseCallback('Thermal', click_callback)
78 | cv2.setWindowTitle('Thermal', "Thermal: (%.1fC to %.1fC) %.1fC" % (tmin, tmax, mouse_temp))
79 |
80 | cv2.waitKey(0)
81 |
82 | flist = sorted(glob.glob(DNAME + "/*bin"))
83 |
84 | for f in flist:
85 | display_file(f)
86 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_SIYI/tools/temp_view.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 | import numpy as np
5 | import cv2
6 | import time
7 | from MAVProxy.modules.lib.mp_image import MPImage
8 |
9 | FNAME=sys.argv[1]
10 |
11 | # little-endian 16 bit data
12 | # Celsius temp = Raw data/64-273.15.
13 |
14 | print('Importing: ', FNAME)
15 | a = np.fromfile(FNAME, dtype='>u2')
16 | # get in Kelvin
17 | a = (a / 64.0)
18 |
19 | C_TO_KELVIN = 273.15
20 |
21 | #a = np.clip(a, C_TO_KELVIN+50, C_TO_KELVIN+200)
22 |
23 | maxv = a.max()
24 | minv = a.min()
25 | print("Max=%.3fC Min=%.3fC" % (maxv-273.15, minv-273.15))
26 | if maxv <= minv:
27 | print("Bad range")
28 | sys.exit(1)
29 |
30 | # convert to 0 to 255
31 | a = (a - minv) * 65535.0 / (maxv - minv)
32 |
33 | # convert to uint8 greyscale as 640x512 image
34 | a = a.astype(np.uint16)
35 | a = a.reshape(512, 640)
36 |
37 | #im.set_image(a)
38 | cv2.imshow('Grey16', a)
39 | while True:
40 | cv2.waitKey(1)
41 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_antenna.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | '''
3 | antenna pointing module
4 | Andrew Tridgell
5 | June 2012
6 | '''
7 |
8 | import sys, os, time
9 | from cuav.lib import cuav_util
10 | from MAVProxy.modules.lib import mp_module
11 |
12 | class AntennaModule(mp_module.MPModule):
13 | def __init__(self, mpstate):
14 | super(AntennaModule, self).__init__(mpstate, "antenna", "antenna pointing module")
15 | self.gcs_location = None
16 | self.last_bearing = 0
17 | self.last_announce = 0
18 | self.add_command('antenna', self.cmd_antenna, "antenna link control")
19 |
20 | def cmd_antenna(self, args):
21 | '''set gcs location'''
22 | if len(args) != 2:
23 | if self.gcs_location is None:
24 | print("GCS location not set")
25 | else:
26 | print("GCS location %s" % str(self.gcs_location))
27 | return
28 | self.gcs_location = (float(args[0]), float(args[1]))
29 |
30 |
31 |
32 | def mavlink_packet(self, m):
33 | '''handle an incoming mavlink packet'''
34 | if self.gcs_location is None and self.module('wp').wploader.count() > 0:
35 | home = self.module('wp').get_home()
36 | self.gcs_location = (home.x, home.y)
37 | print("Antenna home set")
38 | if self.gcs_location is None:
39 | return
40 | if m.get_type() == 'GPS_RAW' and self.gcs_location is not None:
41 | (gcs_lat, gcs_lon) = self.gcs_location
42 | bearing = cuav_util.gps_bearing(gcs_lat, gcs_lon, m.lat, m.lon)
43 | elif m.get_type() == 'GPS_RAW_INT' and self.gcs_location is not None:
44 | (gcs_lat, gcs_lon) = self.gcs_location
45 | bearing = cuav_util.gps_bearing(gcs_lat, gcs_lon, m.lat / 1.0e7, m.lon / 1.0e7)
46 | else:
47 | return
48 | self.console.set_status('Antenna', 'Antenna %.0f' % bearing, row=0)
49 | if abs(bearing - self.last_bearing) > 5 and (time.time() - self.last_announce) > 15:
50 | self.last_bearing = bearing
51 | self.last_announce = time.time()
52 | self.say("Antenna %u" % int(bearing + 0.5))
53 |
54 | def init(mpstate):
55 | '''initialise module'''
56 | return AntennaModule(mpstate)
57 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/copter_flightmodes.txt:
--------------------------------------------------------------------------------
1 | This file holds the Copter flight mode name to number mapping
2 |
3 | STABILIZE = 0, // pilot directly controls the airframe angle with roll, pitch and yaw stick inputs. Pilot directly controls throttle
4 | ACRO = 1, // pilot directly controls the body-frame angular rate. pilot directly controls throttle
5 | ALT_HOLD = 2, // pilot directly controls the vehicle roll, pitch and yaw angles. Pilot's throttle control controls climb rate
6 | AUTO = 3, // fully automatic waypoint control using mission commands
7 | GUIDED = 4, // fully automatic fly to coordinate or fly at velocity/direction using mavlink commands.
8 | LOITER = 5, // pilot controls the vehicle's 3D speed and acceleration with roll, pitch and throttle input. Heading is controlled with the yaw stick
9 | RTL = 6, // automatic return to launching point
10 | CIRCLE = 7, // automatic circular flight with automatic throttle
11 | LAND = 9, // automatic landing with horizontal position control
12 | DRIFT = 11, // semi-autonomous position, yaw and throttle control. rarely used.
13 | SPORT = 13, // manual earth-frame angular rate control with manual throttle. very rarely used
14 | FLIP = 14, // automatically flip the vehicle 360 degrees
15 | AUTOTUNE = 15, // automatically tune the vehicle's roll and pitch gains
16 | POSHOLD = 16, // automatic position hold with manual override, with automatic throttle. very similar to Loiter mode
17 | BRAKE = 17, // full-brake using inertial/GPS system, no pilot input
18 | THROW = 18, // throw to launch mode using inertial/GPS system, no pilot input
19 | AVOID_ADSB = 19, // automatic avoidance of manned vehicle. very rarely used
20 | GUIDED_NOGPS = 20, // guided mode but only accepts attitude and altitude commands
21 | SMART_RTL = 21, // SMART_RTL returns vehicle home by retracing its steps
22 | FLOWHOLD = 22, // FLOWHOLD holds position with optical flow without rangefinder. similar to Loiter. very rarely used
23 | FOLLOW = 23, // follow attempts to follow another vehicle or ground station
24 | ZIGZAG = 24, // ZIGZAG mode is able to fly in a zigzag manner with predefined point A and point B. Normally used for crop spraying vehicles.
25 | SYSTEMID = 25, // System ID mode produces automated system identification signals in the controllers. very rarely used
26 | AUTOROTATE = 26, // Autonomous autorotation. Used only for traditional helicopters
27 | AUTO_RTL = 27, // return to launch but using an Auto mission starting from the DO_LAND_START command
28 | TURTLE = 28, // Flip vehicle to recover after crash
29 |
30 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/delete_wakeup_timers.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "delete_wakeup_timers",
5 | "description": "Delete all active wakeup timers. You can optionally provide a message parameter to filter which timers will be deleted based on their message. When specifying the message parameter, you can use regular expressions (regex) to match patterns within the timer messages. This is useful when you want to delete timers with specific keywords or patterns in their message. For example, to delete all timers containing the word 'hello', you can use the regex '.*hello.*', where the dot-star (.*) pattern matches any character sequence.",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "message": {"type": "string", "description": "wakeup message of timers to be deleted. regex values are accepted."}
10 | },
11 | "required": []
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_all_parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_all_parameters",
5 | "description": "Get all available parameter names and values",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {},
9 | "required": []
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_available_mavlink_messages.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_available_mavlink_messages",
5 | "description": "Get a list of mavlink message names that can be retrieved using the get_mavlink_message function",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {},
9 | "required": []
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_current_datetime.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_current_datetime",
5 | "description": "Get the current date and time, e.g. 'Saturday, June 24, 2023 6:14:14 PM'",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {},
9 | "required": []
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_location_plus_dist_at_bearing.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_location_plus_dist_at_bearing",
5 | "description": "Calculate the latitude and longitude given an existing latitude and longitude and a distance in meters and a bearing in degrees",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "latitude": {"type": "number", "description": "latitude in degrees"},
10 | "longitude": {"type": "number", "description": "longitude in degrees"},
11 | "distance": {"type": "number", "description": "distance to move meters"},
12 | "bearing": {"type": "number", "description": "bearing in degrees. 0 is North, 90 is East, etc"}
13 | },
14 | "required": ["latitude", "longitude", "distance", "bearing"]
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_location_plus_offset.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_location_plus_offset",
5 | "description": "Calculate the latitude and longitude given an existing latitude and longitude and distances (in meters) North and East",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "latitude": {"type": "number", "description": "latitude in degrees"},
10 | "longitude": {"type": "number", "description": "longitude in degrees"},
11 | "distance_north": {"type": "number", "description": "distance to move North in meters"},
12 | "distance_east": {"type": "number", "description": "distance to move East in meters"}
13 | },
14 | "required": ["latitude", "longitude", "distance_north", "distance_east"]
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_mavlink_message.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_mavlink_message",
5 | "description": "Get a mavlink message including all fields and values sent by the vehicle. The list of available messages can be retrieved using the get_available_mavlink_messages",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "message": {"type": "string", "description": "mavlink message name (e.g. HEARTBEAT, VFR_HUD, GLOBAL_POSITION_INT, etc)"}
10 | },
11 | "required": ["message"]
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_mode_mapping.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_mode_mapping",
5 | "description": "Get a list of mode names to mode numbers available for this vehicle. If the name or number parameter is provided only that mode's name and number will be returned. If neither name nor number is provided the full list of available modes will be returned",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "name": {"type": "string", "description": "flight mode name (e.g. Guided, Loiter, RTL)"},
10 | "number": {"type": "number", "description": "flight mode number"}
11 | },
12 | "required": []
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_parameter.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_parameter",
5 | "description": "Get a vehicle parameter's value. The full list of available parameters and their values is available using the get_all_parameters function",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "name": {"type": "string", "description": "parameter name (e.g. ARMING_CHECK, LOG_BITMASK). Regex expressions are supported"},
10 | "value": {"type": "number", "description": "parameter value"}
11 | },
12 | "required": ["name"]
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_parameter_description.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_parameter_description",
5 | "description": "Get vehicle parameter descriptions including description, units, min and max",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "name": {"type": "string", "description": "parameter name (e.g. ARMING_CHECK, LOG_BITMASK). Regex expressions are supported. set to * to get all parameter descriptions"}
10 | },
11 | "required": ["name"]
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_vehicle_location_and_yaw.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_vehicle_location_and_yaw",
5 | "description": "Get the vehicle's current location including latitude, longitude, altitude above sea level and altitude above home",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "latitude": {"type": "number", "description": "latitude in degrees"},
10 | "longitude": {"type": "number", "description": "longitude in degrees"},
11 | "altitude_amsl": {"type": "number", "description": "altitude above sea level in meters (aka AMSL)"},
12 | "altitude_above_home": {"type": "number", "description": "altitude above home in meters"},
13 | "yaw": {"type": "number", "description": "vehicle yaw (aka heading) in degrees"}
14 | },
15 | "required": []
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_vehicle_state.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_vehicle_state",
5 | "description": "Get the vehicle state including armed status and (flight) mode",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "armed": {"type": "boolean", "description": "vehicle armed status. True means motors can spin and vehicle can move."},
10 | "mode": {"type": "number", "description": "flight flight mode. The number is specific to the vehicle type (e.g. Copter, Plane, Rover"}
11 | },
12 | "required": []
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_vehicle_type.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_vehicle_type",
5 | "description": "Get the vehicle type (e.g. Copter, Plane, Rover, Boat, etc)",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "vehicle_type": {"type": "string", "description": "the vehicle type. Unknown if not known"}
10 | },
11 | "required": []
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/get_wakeup_timers.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "get_wakeup_timers",
5 | "description": "Retrieves a list of all active wakeup timers. You can optionally provide a message parameter to filter timers by their associated messages. When specifying the message parameter, you can use regular expressions (regex) to match patterns within the timer messages. This is useful when you want to find timers with specific keywords or patterns in their messages. For example, to retrieve all timers containing the word 'hello', you can use the regex '.*hello.*', where the dot-star (.*) pattern matches any character sequence.",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "message": {"type": "string", "description": "wakeup message of timers to be retrieved. regex values are accepted."}
10 | },
11 | "required": []
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/plane_flightmodes.txt:
--------------------------------------------------------------------------------
1 | This file holds the Plane flight mode name to number mapping. Modes starting with Q are only for use with QuadPlanes.
2 |
3 | MANUAL = 0, // pilot has direct control over servos without stabilization
4 | CIRCLE = 1, // Circle around a GPS waypoint
5 | STABILIZE = 2, // Level flight stabilization
6 | TRAINING = 3, // Limits the roll and pitch angles to keep the aircraft stable
7 | ACRO = 4, // Full manual aerobatic control with some stabilization
8 | FLY_BY_WIRE_A = 5, // Stabilized flight with manual throttle
9 | FLY_BY_WIRE_B = 6, // More stabilization than FLY_BY_WIRE_A
10 | CRUISE = 7, // Mixed manual and automatic throttle control
11 | AUTOTUNE = 8, // Automatically tune the PID controller for optimal performance
12 | AUTO = 10, // Fully autonomous flight, following a pre-programmed mission
13 | RTL = 11, // Return to Launch point
14 | LOITER = 12, // Circle around a point while maintaining altitude
15 | TAKEOFF = 13, // Automated takeoff sequence
16 | AVOID_ADSB = 14, // Avoidance maneuver triggered by ADS-B aircraft detection
17 | GUIDED = 15, // Remotely guided commands from GCS or companion computer
18 | INITIALISING = 16, // Initialization mode at startup
19 | QSTABILIZE = 17, // QuadPlane's stabilize mode. Similar to Copter's stabilize mode
20 | QHOVER = 18, // QuadPlane's hover mode. Similar to Copter's AltHold mode
21 | QLOITER = 19, // QuadPlane's loiter mode. Similar to Copter's Loiter mode
22 | QLAND = 20, // QuadPlane's land mode. Similar to Copter's Land mode
23 | QRTL = 21, // QuadPlane's Return to Launch mode. Similar to Copter's RTL mode
24 | QAUTOTUNE = 22, // QuadPlane's autotune mode. Similar to Copter's AutoTune mode
25 | QACRO = 23, // QuadPlane's acrobatic mode. Similar to Copter's Acro mode
26 | THERMAL = 24, // Thermal detection and exploitation mode
27 | LOITER_ALT_QLAND = 25, // QuadPlane's loiter to alt then land mode
28 |
29 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/rover_modes.txt:
--------------------------------------------------------------------------------
1 | This file holds the Rover (aka car) and boat mode name to number mapping. Rover "modes" are the same as "flight modes" for other vehicles. "Rover" is synonymous with "car"
2 |
3 | MANUAL = 0, // Pilot directly controls the vehicle's steering and throttle
4 | ACRO = 1, // Pilot controls the turn rate and speed
5 | STEERING = 3, // Pilot controls the steering using lateral acceleration. throttle stick controls speed
6 | HOLD = 4, // motor and steering outputs are disabled. Rovers will stop, boats will drift in this mode
7 | LOITER = 5, // hold position at the current location
8 | FOLLOW = 6, // follow a GPS-enabled device
9 | SIMPLE = 7, // Pilot controls the vehicles by moving the combined steering and throttle stick in the direction they wish to move. The direction of movement is relative to the vehicle's heading when first powered on
10 | DOCK = 8, // Automatic docking mode
11 | CIRCLE = 9, // Circle around a location recorded when the vehicle entered this mode
12 | AUTO = 10, // Fully autonomous mode following pre-programmed waypoints
13 | RTL = 11, // Return to Launch point
14 | SMART_RTL = 12, // Creates a path back to the launch point based on the rover's traveled path
15 | GUIDED = 15, // Guided control via a ground station or companion computer
16 | INITIALISING = 16, // Initialization mode at startup
17 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/send_mavlink_command_int.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "send_mavlink_command_int",
5 | "description": "Send a mavlink COMMAND_INT message to the vehicle. Available commands including changing the flight mode, arming, disarming, takeoff and commanding the vehicle to fly to a specific location",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "target_system": {"type": "integer", "minimum":0, "maximum":255, "description": "vehicle autopilot System ID. can be omitted"},
10 | "target_component": {"type": "integer", "minimum":0, "maximum":255, "description": "vehicle autopilot Component ID. can be omitted"},
11 | "frame": {"type": "integer", "minimum":0, "maximum":21, "description": "altitude type. see MAV_FRAME. 0 for altitude above sea level, 3 for altitude above home, 10 for altitude above terrain"},
12 | "command": {"type": "integer", "minimum":0, "maximum":65535, "description": "MAVLink command id. See MAV_CMD for a full list of available commands"},
13 | "current": {"type": "integer", "description": "not used. always zero"},
14 | "autocontinue": {"type": "integer", "description": "not used. always zero"},
15 | "param1": {"type": "number", "description": "parameter 1. see MAV_CMD enum"},
16 | "param2": {"type": "number", "description": "parameter 2. see MAV_CMD enum"},
17 | "param3": {"type": "number", "description": "parameter 3. see MAV_CMD enum"},
18 | "param4": {"type": "number", "description": "parameter 4. see MAV_CMD enum"},
19 | "x": {"type": "integer", "description": "latitude in degrees * 10^7"},
20 | "y": {"type": "integer", "description": "longitude in degrees * 10^7"},
21 | "z": {"type": "number", "description": "altitude in meters (relative to sea level, home or terrain depending on frame field)."}
22 | },
23 | "required": ["frame", "command"]
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/send_mavlink_set_position_target_global_int.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "send_mavlink_set_position_target_global_int",
5 | "description": "Send a mavlink SET_POSITION_TARGET_GLOBAL_INT message to the vehicle. This message is the preferred way to command a vehicle to fly to a specified location or to fly at a specfied velocity",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "time_boot_ms": {"type": "integer", "description": "system timestamp. can be left as 0"},
10 | "target_system": {"type": "integer", "minimum":0, "maximum":255, "description": "vehicle autopilot System ID. can be omitted"},
11 | "target_component": {"type": "integer", "minimum":0, "maximum":255, "description": "vehicle autopilot Component ID. can be omitted"},
12 | "coordinate_frame": {"type": "integer", "minimum":0, "maximum":21, "description": "altitude type. see MAV_FRAME. 5 for altitude above sea level, 6 for altitude above home, 11 for altitude above terrain"},
13 | "type_mask": {"type": "integer", "minimum":0, "maximum":65535, "description": "Bitmap to indicate which dimensions should be ignored by the vehicle. see POSITION_TARGET_TYPEMASK. If only location (e.g. lat_int, lon_int and alt) is sent use 3576. If location and yaw are sent use 2552. If only velocity (e.g. vx, vy, vz) is sent use 2552. if velocity and yaw are sent use 2503. If only yaw is sent use 2559"},
14 | "latitude": {"type": "number", "description": "latitude in degrees"},
15 | "longitude": {"type": "number", "description": "longitude in degrees"},
16 | "alt": {"type": "number", "description": "altitude in meters (relative to sea level, home or terrain depending on frame field)"},
17 | "vx": {"type": "number", "description": "velocity North in m/s"},
18 | "vy": {"type": "number", "description": "velocity East in m/s"},
19 | "vz": {"type": "number", "description": "velocity Down in m/s"},
20 | "afx": {"type": "number", "description": "acceleration North in m/s/s. rarely used, normally 0"},
21 | "afy": {"type": "number", "description": "acceleration East in m/s/s. rarely used, normally 0"},
22 | "afz": {"type": "number", "description": "acceleration Down in m/s/s. rarely used, normally 0"},
23 | "yaw": {"type": "number", "minimum":-6.28318530717959, "maximum":6.28318530717959, "description": "yaw (aka heading) in radians"},
24 | "yaw_rate": {"type": "number", "description": "yaw (aka heading) rotation rate in radians/second. rarely used, normally 0"}
25 | },
26 | "required": ["coordinate_frame", "type_mask"]
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/set_parameter.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "set_parameter",
5 | "description": "Set a vehicle parameter's value. The full list of parameters is available using the get_all_parameters function",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "name": {"type": "string", "description": "parameter name (e.g. ARMING_CHECK, LOG_BITMASK)"},
10 | "value": {"type": "number", "description": "parameter value"}
11 | },
12 | "required": ["name", "value"]
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/set_wakeup_timer.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "function",
3 | "function": {
4 | "name": "set_wakeup_timer",
5 | "description": "Set a timer to wake you up in a specified number of seconds in the future. This allows taking actions in the future. The wakeup message will appear with the user role but will look something like WAKEUP:. Multiple wakeup messages are supported",
6 | "parameters": {
7 | "type": "object",
8 | "properties": {
9 | "seconds": {"type": "number", "description": "number of seconds in the future that the timer will wake you up"},
10 | "message": {"type": "string", "description": "wakeup message that will be sent to you"}
11 | },
12 | "required": ["seconds", "message"]
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/assistant_setup/sub_modes.txt:
--------------------------------------------------------------------------------
1 | This file holds the Sub (aka submarine) mode name to number mapping.
2 |
3 | STABILIZE = 0, // manual angle with manual depth/throttle
4 | ACRO = 1, // manual body-frame angular rate with manual depth/throttle
5 | ALT_HOLD = 2, // manual angle with automatic depth/throttle
6 | AUTO = 3, // fully automatic waypoint control using mission commands
7 | GUIDED = 4, // fully automatic fly to coordinate or fly at velocity/direction using GCS immediate commands
8 | CIRCLE = 7, // automatic circular flight with automatic throttle
9 | SURFACE = 9, // automatically return to surface, pilot maintains horizontal control
10 | POSHOLD = 16, // automatic position hold with manual override, with automatic throttle
11 | MANUAL = 19, // Pass-through input with no stabilization
12 | MOTOR_DETECT = 20 // Automatically detect motors orientation
13 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_chat/chat_voice_to_text.py:
--------------------------------------------------------------------------------
1 | '''
2 | AI Chat Module voice-to-text class
3 | Randy Mackay, December 2023
4 |
5 | AP_FLAKE8_CLEAN
6 | '''
7 |
8 |
9 | try:
10 | import pyaudio # install using, "sudo apt-get install python3-pyaudio"
11 | import wave # install with "pip3 install wave"
12 | from openai import OpenAI
13 | except Exception:
14 | print("chat: failed to import pyaudio, wave or openai. See https://ardupilot.org/mavproxy/docs/modules/chat.html")
15 | exit()
16 |
17 | # initializing the global list to keep and update the stop_recording state
18 | stop_recording = [False]
19 |
20 |
21 | class chat_voice_to_text():
22 | def __init__(self):
23 | # initialise variables
24 | self.client = None
25 | self.assistant = None
26 |
27 | # set the OpenAI API key
28 | def set_api_key(self, api_key_str):
29 | self.client = OpenAI(api_key=api_key_str)
30 |
31 | # check connection to OpenAI assistant and connect if necessary
32 | # returns True if connection is good, False if not
33 | def check_connection(self):
34 | # create connection object
35 | if self.client is None:
36 | try:
37 | self.client = OpenAI()
38 | except Exception:
39 | print("chat: failed to connect to OpenAI")
40 | return False
41 |
42 | # return True if connected
43 | return self.client is not None
44 |
45 | # record audio from microphone
46 | # returns filename of recording or None if failed
47 | def record_audio(self):
48 | # Initialize PyAudio
49 | p = pyaudio.PyAudio()
50 |
51 | # Open stream
52 | try:
53 | stream = p.open(format=pyaudio.paInt16, channels=1, rate=44100, input=True, frames_per_buffer=1024)
54 | except Exception:
55 | print("chat: failed to connect to microphone")
56 | return None
57 |
58 | # record until specified time
59 | frames = []
60 | while not stop_recording[0]:
61 | data = stream.read(1024)
62 | frames.append(data)
63 |
64 | # Stop and close the stream
65 | stream.stop_stream()
66 | stream.close()
67 | p.terminate()
68 |
69 | # update the recording state back to false globally
70 | stop_recording[0] = False
71 |
72 | # Save audio file
73 | wf = wave.open("recording.wav", "wb")
74 | wf.setnchannels(1)
75 | wf.setsampwidth(pyaudio.PyAudio().get_sample_size(pyaudio.paInt16))
76 | wf.setframerate(44100)
77 | wf.writeframes(b''.join(frames))
78 | wf.close()
79 | return "recording.wav"
80 |
81 | # convert audio to text
82 | # returns transcribed text on success or None if failed
83 | def convert_audio_to_text(self, audio_filename):
84 | # check connection
85 | if not self.check_connection():
86 | return None
87 |
88 | # Process with Whisper
89 | audio_file = open(audio_filename, "rb")
90 | transcript = self.client.audio.transcriptions.create(
91 | model="whisper-1",
92 | file=audio_file,
93 | response_format="text")
94 | return transcript
95 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_emuecu.py:
--------------------------------------------------------------------------------
1 | """
2 | control EMU ECU system
3 | """
4 |
5 | import time
6 |
7 | from MAVProxy.modules.lib import mp_module
8 | from MAVProxy.modules.lib import mp_settings
9 |
10 | class EMUECUModule(mp_module.MPModule):
11 |
12 | def __init__(self, mpstate):
13 | super(EMUECUModule, self).__init__(mpstate, "emuecu", "emuecu", public=False)
14 | self.emuecu_settings = mp_settings.MPSettings(
15 | [('port', int, 102)])
16 | self.add_command('emu', self.cmd_emu, 'EMUECU control',
17 | ["",
18 | "set (EMUECUSETTING)"])
19 | self.add_completion_function('(EMUECUSETTING)',
20 | self.emuecu_settings.completion)
21 |
22 | def mavlink_packet(self, msg):
23 | '''handle an incoming mavlink packet'''
24 | if msg.get_type() == 'SERIAL_CONTROL':
25 | print(msg)
26 |
27 | def cmd_emu(self, args):
28 | '''emu command handling'''
29 | if len(args) <= 0:
30 | print("Usage: emu ")
31 | return
32 | if args[0] == "send":
33 | self.cmd_send(args[1:])
34 | elif args[0] == "set":
35 | self.emuecu_settings.command(args[1:])
36 |
37 | def cmd_send(self, args):
38 | '''send command'''
39 | cmd = ' '.join(args) + '\n'
40 | buf = [ord(x) for x in cmd]
41 | buf.extend([0]*(70-len(buf)))
42 | mav = self.master.mav
43 | mav.serial_control_send(self.emuecu_settings.port,
44 | 0,
45 | 0, 0,
46 | len(cmd), buf)
47 |
48 |
49 | def init(mpstate):
50 | '''initialise module'''
51 | return EMUECUModule(mpstate)
52 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_example.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | '''
3 | Example Module
4 | Peter Barker, September 2016
5 |
6 | This module simply serves as a starting point for your own MAVProxy module.
7 |
8 | 1. copy this module sidewise (e.g. "cp mavproxy_example.py mavproxy_coolfeature.py"
9 | 2. replace all instances of "example" with whatever your module should be called
10 | (e.g. "coolfeature")
11 |
12 | 3. trim (or comment) out any functionality you do not need
13 | '''
14 |
15 | import os
16 | import os.path
17 | import sys
18 | from pymavlink import mavutil
19 | import errno
20 | import time
21 |
22 | from MAVProxy.modules.lib import mp_module
23 | from MAVProxy.modules.lib import mp_util
24 | from MAVProxy.modules.lib import mp_settings
25 |
26 |
27 | class example(mp_module.MPModule):
28 | def __init__(self, mpstate):
29 | """Initialise module"""
30 | super(example, self).__init__(mpstate, "example", "")
31 | self.status_callcount = 0
32 | self.boredom_interval = 10 # seconds
33 | self.last_bored = time.time()
34 |
35 | self.packets_mytarget = 0
36 | self.packets_othertarget = 0
37 |
38 | self.example_settings = mp_settings.MPSettings(
39 | [ ('verbose', bool, False),
40 | ])
41 | self.add_command('example', self.cmd_example, "example module", ['status','set (LOGSETTING)'])
42 |
43 | def usage(self):
44 | '''show help on command line options'''
45 | return "Usage: example "
46 |
47 | def cmd_example(self, args):
48 | '''control behaviour of the module'''
49 | if len(args) == 0:
50 | print(self.usage())
51 | elif args[0] == "status":
52 | print(self.status())
53 | elif args[0] == "set":
54 | self.example_settings.command(args[1:])
55 | else:
56 | print(self.usage())
57 |
58 | def status(self):
59 | '''returns information about module'''
60 | self.status_callcount += 1
61 | self.last_bored = time.time() # status entertains us
62 | return("status called %(status_callcount)d times. My target positions=%(packets_mytarget)u Other target positions=%(packets_mytarget)u" %
63 | {"status_callcount": self.status_callcount,
64 | "packets_mytarget": self.packets_mytarget,
65 | "packets_othertarget": self.packets_othertarget,
66 | })
67 |
68 | def boredom_message(self):
69 | if self.example_settings.verbose:
70 | return ("I'm very bored")
71 | return ("I'm bored")
72 |
73 | def idle_task(self):
74 | '''called rapidly by mavproxy'''
75 | now = time.time()
76 | if now-self.last_bored > self.boredom_interval:
77 | self.last_bored = now
78 | message = self.boredom_message()
79 | self.say("%s: %s" % (self.name,message))
80 | # See if whatever we're connected to would like to play:
81 | self.master.mav.statustext_send(mavutil.mavlink.MAV_SEVERITY_NOTICE,
82 | message)
83 |
84 | def mavlink_packet(self, m):
85 | '''handle mavlink packets'''
86 | if m.get_type() == 'GLOBAL_POSITION_INT':
87 | if self.settings.target_system == 0 or self.settings.target_system == m.get_srcSystem():
88 | self.packets_mytarget += 1
89 | else:
90 | self.packets_othertarget += 1
91 |
92 | def init(mpstate):
93 | '''initialise module'''
94 | return example(mpstate)
95 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/cmac-foamy-fence.txt:
--------------------------------------------------------------------------------
1 | -35.363720 149.163651
2 | -35.358795 149.164734
3 | -35.359211 149.160767
4 | -35.368622 149.162750
5 | -35.368279 149.166870
6 | -35.358795 149.164734
7 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/cmac-foamy-mission-ccw.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.363262 149.165237 583.429993 1
3 | 1 0 3 22 10.000000 0.000000 0.000000 0.000000 -35.361279 149.164230 30.000000 1
4 | 2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.361229 149.163025 60.000000 1
5 | 3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.364563 149.163773 60.000000 1
6 | 4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.364384 149.164795 60.000000 1
7 | 5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.361027 149.164093 60.000000 1
8 | 6 0 0 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
9 | 7 0 3 189 0.000000 0.000000 0.000000 0.000000 -35.362915 149.162613 60.000000 1
10 | 8 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.363136 149.162750 60.000000 1
11 | 9 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.365467 149.164215 55.000000 1
12 | 10 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.365620 149.165543 30.000000 1
13 | 11 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.363029 149.165192 -0.030000 1
14 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/cmac-foamy-mission-cw.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.363262 149.165237 584.039978 1
3 | 1 0 3 22 10.000000 0.000000 0.000000 0.000000 -35.364239 149.164474 30.000000 1
4 | 2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.364563 149.163773 60.000000 1
5 | 3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.361229 149.163025 60.000000 1
6 | 4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.361027 149.164093 60.000000 1
7 | 5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.364384 149.164795 60.000000 1
8 | 6 0 0 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
9 | 7 0 3 189 0.000000 0.000000 0.000000 0.000000 -35.362915 149.162613 60.000000 1
10 | 8 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.363136 149.162750 60.000000 1
11 | 9 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.360531 149.163452 55.000000 1
12 | 10 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.361004 149.164841 30.000000 1
13 | 11 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.362377 149.165115 -0.030000 1
14 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/cmac-foamy-rally.txt:
--------------------------------------------------------------------------------
1 | RALLY -35.363160 149.164101 60.000000 40.000000 0.000000 0
2 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalley-foamy-fence.txt:
--------------------------------------------------------------------------------
1 | -35.281086 149.007370
2 | -35.282536 149.005096
3 | -35.278564 149.005066
4 | -35.279636 149.009476
5 | -35.281803 149.010056
6 | -35.282536 149.005096
7 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalley-foamy-mission-ccw.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.281315 149.005325 582.039978 1
3 | 1 0 3 22 10.000000 0.000000 0.000000 0.000000 -35.281807 149.006989 24.879999 1
4 | 2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281597 149.008514 43.990002 1
5 | 3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.280743 149.008179 37.040001 1
6 | 4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281124 149.005753 54.560001 1
7 | 5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281960 149.005981 55.720001 1
8 | 6 0 0 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
9 | 7 0 3 189 0.000000 0.000000 0.000000 0.000000 -35.280418 149.007812 45.240002 1
10 | 8 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.280895 149.008682 43.169998 1
11 | 9 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281326 149.008255 37.180000 1
12 | 10 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281761 149.007767 17.639999 1
13 | 11 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.281963 149.006546 -3.030000 1
14 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalley-foamy-mission-cw.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.280651 149.005356 585.669983 1
3 | 1 0 3 22 10.000000 0.000000 0.000000 0.000000 -35.280037 149.005600 15.000000 1
4 | 2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.279388 149.005722 60.000000 1
5 | 3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.279301 149.006836 60.000000 1
6 | 4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281384 149.006958 60.000000 1
7 | 5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281494 149.005844 60.000000 1
8 | 6 0 0 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
9 | 7 0 3 189 0.000000 0.000000 0.000000 0.000000 -35.279713 149.007004 35.000000 1
10 | 8 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.280079 149.007065 20.000000 1
11 | 9 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281940 149.007339 15.000000 1
12 | 10 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.282162 149.005844 12.000000 1
13 | 11 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.280937 149.005768 0.000000 1
14 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalley-foamy-rally.txt:
--------------------------------------------------------------------------------
1 | RALLY -35.281194 149.006725 100.000000 40.000000 0.000000 0
2 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalleybottom-foamy-fence.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 5000 0.000000 0.000000 0.000000 0.000000 -35.281086 149.007370 0.000000 0
3 | 1 0 0 5001 4.000000 0.000000 0.000000 0.000000 -35.282628 149.004323 0.000000 0
4 | 2 0 0 5001 4.000000 0.000000 0.000000 0.000000 -35.278564 149.005066 0.000000 0
5 | 3 0 0 5001 4.000000 0.000000 0.000000 0.000000 -35.279636 149.009476 0.000000 0
6 | 4 0 0 5001 4.000000 0.000000 0.000000 0.000000 -35.281803 149.010056 0.000000 0
7 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalleybottom-foamy-mission-ccw.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.281315 149.005325 582.039978 1
3 | 1 0 3 22 10.000000 0.000000 0.000000 0.000000 -35.281807 149.006989 24.879999 1
4 | 2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281597 149.008514 43.990002 1
5 | 3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.280743 149.008179 37.040001 1
6 | 4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281124 149.005753 54.560001 1
7 | 5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281960 149.005981 55.720001 1
8 | 6 0 0 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
9 | 7 0 3 189 0.000000 0.000000 0.000000 0.000000 -35.280418 149.007812 45.240002 1
10 | 8 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.280895 149.008682 43.169998 1
11 | 9 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281326 149.008255 37.180000 1
12 | 10 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281761 149.007767 17.639999 1
13 | 11 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.281963 149.006546 -3.030000 1
14 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalleybottom-foamy-mission-cw.txt:
--------------------------------------------------------------------------------
1 | QGC WPL 110
2 | 0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.282402 149.005365 585.989990 1
3 | 1 0 3 22 10.000000 0.000000 0.000000 0.000000 -35.280037 149.005600 15.000000 1
4 | 2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.279388 149.005722 60.000000 1
5 | 3 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.279301 149.006836 60.000000 1
6 | 4 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281384 149.006958 60.000000 1
7 | 5 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281494 149.005844 60.000000 1
8 | 6 0 0 177 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
9 | 7 0 3 189 0.000000 0.000000 0.000000 0.000000 -35.279713 149.007004 35.000000 1
10 | 8 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.280079 149.007065 40.000000 1
11 | 9 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281671 149.007520 25.000000 1
12 | 10 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.281851 149.007122 15.000000 1
13 | 11 0 3 21 0.000000 0.000000 0.000000 1.000000 -35.282289 149.005488 0.000000 1
14 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_fieldcheck/springvalleybottom-foamy-rally.txt:
--------------------------------------------------------------------------------
1 | RALLY -35.281194 149.006725 100.000000 40.000000 0.000000 0
2 |
--------------------------------------------------------------------------------
/MAVProxy/modules/mavproxy_gopro.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | '''gopro control over mavlink for the solo-gimbal
3 |
4 | To use this module connect to a Solo with a GoPro installed on the gimbal.
5 | '''
6 |
7 | import time, os
8 |
9 | from MAVProxy.modules.lib import mp_module
10 | from pymavlink import mavutil
11 |
12 | class GoProModule(mp_module.MPModule):
13 |
14 | def __init__(self, mpstate):
15 | super(GoProModule, self).__init__(mpstate, "gopro", "gopro handling")
16 |
17 | self.add_command('gopro', self.cmd_gopro, 'gopro control', [
18 | 'status',
19 | 'shutter ',
20 | 'mode