mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 16:08:53 +08:00
merge from upstream
This commit is contained in:
@@ -51,3 +51,4 @@ xcode
|
||||
src/platforms/posix/px4_messages/
|
||||
src/platforms/posix-arm/px4_messages/
|
||||
src/platforms/qurt/px4_messages/
|
||||
ROMFS/*/*/rc.autostart
|
||||
|
||||
@@ -18,6 +18,7 @@ addons:
|
||||
- build-essential
|
||||
- ccache
|
||||
- cmake
|
||||
- clang-3.5
|
||||
- g++-4.8
|
||||
- gcc-4.8
|
||||
- genromfs
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -0,0 +1,98 @@
|
||||
[TOC]
|
||||
|
||||
# Introduction
|
||||
|
||||
The HIL architecture allows you to test the flight stack replacing the real physical vehicle and sensors with a simulator of vehicle dynamics and sensor outputs. The flight stack "is not aware" that it is not on a real vehicle. This is a powerful tool for develping and testing code rapidly in a benchtop environment.
|
||||
|
||||
The flight stack can be run anywhere that supports a network connection to the simulator (with sufficient bandwidth and latency to transport the sensor and actuator messages). This can be on a standard linux workstation, an on-target linux image, or the on-target DSP image. These modes can be selected based on the goals of the testing. Workstation is useful for rapid testing in a tool-rich environment. DSP image testing is the closest to the final implementation, so is useful for testing actual HW operation, other than the physical sensing and actuation.
|
||||
|
||||
## Px4 High-level HIL Architecture
|
||||
|
||||
A diagram of the setup described is shown here. Note that UDP port numbers are only displayed on the socket server and are left blank on the socket client.
|
||||
|
||||
(???NOTES: This diagram needs to be updated to use control inputs over UDP, either from QGC or from other)
|
||||
|
||||

|
||||
|
||||
## Requirements
|
||||
The simulator that is currently supported is jMAVSim. The setup described here requires PX4 and jMAVSim installed and running. qGroundControl (QGC) is also required because it is the supported method of providing manual control commands.
|
||||
|
||||
## Assumptions
|
||||
|
||||
# Compiling Code
|
||||
|
||||
## JMAVSim
|
||||
|
||||
### Platform Requirements
|
||||
Linux with java-1.7.x or greater
|
||||
|
||||
### Build Instructions
|
||||
In a clean directory
|
||||
```
|
||||
> git clone https://github.com/PX4/jMAVSim.git
|
||||
> cd jMAVSim
|
||||
> git submodule init
|
||||
> git submodule update
|
||||
> ant
|
||||
```
|
||||
|
||||
## qGroundControl
|
||||
|
||||
### Platform Requirements
|
||||
Windows 7
|
||||
Logitech Gamepad F310 joystick controller
|
||||
|
||||
### Download/Install Instructions
|
||||
Download QGC from http://qgroundcontrol.org/downloads and install using the windows executable.
|
||||
|
||||
|
||||
## PX4
|
||||
|
||||
### Platfrom Requirements
|
||||
Linux or Eagle with a working IP interface (?? does this need further instructions?)
|
||||
|
||||
### Build Host Requirements
|
||||
(???Notes: Windows?)
|
||||
|
||||
### Download & Build Instructions
|
||||
|
||||
### Installing binaries on the Qualcomm Target
|
||||
|
||||
# Running PX4 in HIL Mode
|
||||
|
||||
## Starting PX4 on Qualcomm Eagle
|
||||
|
||||
```
|
||||
> adb shell
|
||||
# bash
|
||||
root@linaro-developer:/# cd ???
|
||||
root@linaro-developer:/# ./mainapp
|
||||
App name: mainapp
|
||||
Enter a command and its args:
|
||||
uorb start
|
||||
muorb start
|
||||
mavlink start -u 14556
|
||||
simulator start -p
|
||||
```
|
||||
|
||||
## Starting jMAVSim
|
||||
In the directory where jMAVSim is installed
|
||||
```
|
||||
java -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -udp <IPADDR>:14560 -n 100
|
||||
```
|
||||
replacing <IPADDR> with the IP address of the machine running PX4 (Eagle). This can be found by running "ifconfig" on that machine.
|
||||
|
||||
## Starting qGroundControl
|
||||
Launch the qGroundControl application
|
||||
1. Set up the communication to the flight stack. In the menu File:Settings:CommLinks, select Add. Enter a Link Name of your choice. Select Link Type: UDP. Set the listening port to an unused port (example: 14561). Select Add. Enter the IP address and port of the PX4 Mavlink app, which is <IPADDR>:14556 with <IPADDR> being the IP address of the Eagle board. Select OK.
|
||||
1. Set up the joystick. Plug in the joystick to your Windows machine. In the menu File:Settings:CommLinks, check Enable Controllers. Select "Gamepad F310". Select "Manual". Set the axes/channel mapping to 0:Yaw, 1:Throttle, 2:unset, 3:Pitch, 4:Roll. Seletct "Inverted" for the throttle axis. Click "Calibrate range". Move the right joystick through its full range of motion. Move the left joystick full left then full right. Move the left joystick full forward (but not full backward). Click "end calibration."
|
||||
1. Connect to the flight stack. Click Analyze. Click the "Connect" button in the upper right, and select the connection that you created in the first step.
|
||||
|
||||
You should now be connected to the flight stack. You can see incoming Mavlink packets using the MAVLink Instpector (from Advanced:Tool Widgets)
|
||||
|
||||
|
||||
## Controlling PX4 flight in HIL Mode
|
||||
The joystick can now be used to fly the simulated vehicle. The jMAVSim world visualization gives a FPV view, and QGC can be used to display instruments such as artificial horizon and maps (if GPS simulation is enabled).
|
||||
|
||||
|
||||
# Debugging/FAQ
|
||||
File diff suppressed because it is too large
Load Diff
@@ -169,6 +169,7 @@ TOPICS_DIR = $(PX4_BASE)src/modules/uORB/topics
|
||||
MULTIPLATFORM_HEADER_DIR = $(PX4_BASE)src/platforms/$(PX4_TARGET_OS)/px4_messages
|
||||
MULTIPLATFORM_PREFIX = px4_
|
||||
TOPICHEADER_TEMP_DIR = $(BUILD_DIR)topics_temporary
|
||||
MULTI_TOPICHEADER_TEMP_DIR = $(BUILD_DIR)multi_topics_temporary
|
||||
GENMSG_PYTHONPATH = $(PX4_BASE)Tools/genmsg/src
|
||||
GENCPP_PYTHONPATH = $(PX4_BASE)Tools/gencpp/src
|
||||
|
||||
@@ -181,9 +182,7 @@ generateuorbtopicheaders: checksubmodules
|
||||
@$(ECHO) "Generating multiplatform uORB topic wrapper headers"
|
||||
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
|
||||
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
|
||||
-d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
|
||||
# clean up temporary files
|
||||
$(Q) (rm -r $(TOPICHEADER_TEMP_DIR))
|
||||
-d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(MULTI_TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
|
||||
|
||||
#
|
||||
# Testing targets
|
||||
@@ -194,16 +193,20 @@ testbuild:
|
||||
|
||||
nuttx posix posix-arm qurt:
|
||||
ifeq ($(GOALS),)
|
||||
make PX4_TARGET_OS=$@ $(GOALS)
|
||||
$(MAKE) PX4_TARGET_OS=$@ $(GOALS)
|
||||
else
|
||||
export PX4_TARGET_OS=$@
|
||||
endif
|
||||
|
||||
sitlrun:
|
||||
Tools/sitl_run.sh
|
||||
sitl_quad:
|
||||
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rcS
|
||||
sitl_quad_gazebo:
|
||||
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rc_iris_ros
|
||||
sitl_plane:
|
||||
$(Q) Tools/sitl_run.sh posix-configs/SITL/init/rc.fixed_wing
|
||||
|
||||
qurtrun:
|
||||
make PX4_TARGET_OS=qurt sim
|
||||
$(MAKE) PX4_TARGET_OS=qurt sim
|
||||
|
||||
#
|
||||
# Unittest targets. Builds and runs the host-level
|
||||
@@ -227,6 +230,8 @@ clean:
|
||||
$(Q) $(RMDIR) $(BUILD_DIR)*.build
|
||||
$(Q) $(RMDIR) $(PX4_VERSIONING_DIR)
|
||||
$(Q) $(REMOVE) $(IMAGE_DIR)*.px4
|
||||
$(Q) $(RMDIR) $(TOPICHEADER_TEMP_DIR)
|
||||
$(Q) $(RMDIR) $(MULTI_TOPICHEADER_TEMP_DIR)
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
#!nsh
|
||||
#
|
||||
# HILStar
|
||||
# <lorenz@px4.io>
|
||||
# @name HILStar (XPlane)
|
||||
#
|
||||
# @type Simulation
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN3 rudder
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Team Blacksheep Discovery Quadcopter
|
||||
# @name Team Blacksheep Discovery
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>, Simon Wilks <simon@px4.io>
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>, Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# 3DR Iris Quadcopter
|
||||
# @name 3DR Iris Quadrotor
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
#!nsh
|
||||
#
|
||||
# Steadidrone QU4D
|
||||
# @name Steadidrone QU4D
|
||||
#
|
||||
# Thomas Gubler <thomas@px4.io>
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# TODO tune roll/pitch separately
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.13
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.13
|
||||
param set MC_PITCHRATE_P 0.19
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAW_P 4.0
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Team Blacksheep Discovery Long Range Quadcopter
|
||||
#
|
||||
# Setup: 15 x 5" Props, 6S 4000mAh TBS LiPo, TBS 30A ESCs, TBS 400kV Motors
|
||||
# @name Team Blacksheep Discovery Endurance
|
||||
#
|
||||
# Simon Wilks <simon@px4.io>
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# HobbyKing SK450 DeadCat modification
|
||||
# @name HobbyKing SK450 DeadCat modification
|
||||
#
|
||||
# Anton Matosov <anton.matosov@gmail.com>
|
||||
# @type Quadrotor Wide
|
||||
#
|
||||
# @maintainer Anton Matosov <anton.matosov@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
@@ -10,13 +12,13 @@ sh /etc/init.d/rc.mc_defaults
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.0
|
||||
param set MC_ROLLRATE_P 0.04
|
||||
param set MC_ROLLRATE_I 0.1
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
param set MC_ROLLRATE_I 0.03
|
||||
param set MC_ROLLRATE_D 0.0015
|
||||
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.08
|
||||
param set MC_PITCHRATE_I 0.2
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.03
|
||||
param set MC_PITCHRATE_D 0.0015
|
||||
|
||||
param set MC_YAW_P 2.8
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# HIL Quadcopter X
|
||||
# @name HIL Quadcopter X
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name 3DR DIY Quad
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 6.5
|
||||
param set MC_ROLLRATE_P 0.08
|
||||
param set MC_ROLLRATE_I 0.1
|
||||
param set MC_ROLLRATE_D 0.004
|
||||
param set MC_PITCH_P 6.0
|
||||
param set MC_PITCHRATE_P 0.16
|
||||
param set MC_PITCHRATE_I 0.09
|
||||
param set MC_PITCHRATE_D 0.004
|
||||
param set MC_YAW_P 4
|
||||
fi
|
||||
|
||||
set MIXER quad_x
|
||||
|
||||
set PWM_OUT 1234
|
||||
|
||||
set PWM_MIN 1100
|
||||
set PWM_MAX 1950
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# HIL Quadcopter +
|
||||
# @name HIL Quadcopter +
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# HIL Rascal 110 (Flightgear)
|
||||
# @name HIL Rascal 110 (Flightgear)
|
||||
#
|
||||
# Thomas Gubler <thomas@px4.io>
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# HIL Malolo 1 (Flightgear)
|
||||
# @name HIL Malolo 1 (Flightgear)
|
||||
#
|
||||
# Thomas Gubler <thomas@px4.io>
|
||||
# @type Simulation
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Hexa coaxial geometry
|
||||
# @name Generic Hexa coaxial geometry
|
||||
#
|
||||
# Lorenz Meier <lorenz@px4.io>
|
||||
# @type Hexarotor Coaxial
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Octo coaxial geometry
|
||||
# @name Generic 10" Octo coaxial geometry
|
||||
#
|
||||
# Lorenz Meier <lorenz@px4.io>
|
||||
# @type Octorotor Coaxial
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic configuration file for caipirinha VTOL version
|
||||
# @name Duorotor Tailsitter
|
||||
#
|
||||
# Roman Bapst <bapstr@ethz.ch>
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
@@ -13,3 +16,4 @@ set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
param set VT_MOT_COUNT 2
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic configuration file for BirdsEyeView Aerobotics FireFly6
|
||||
# @name BirdsEyeView Aerobotics FireFly6
|
||||
#
|
||||
# Roman Bapst <romanbapst@yahoo.de>
|
||||
# @type VTOL Tiltrotor
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
@@ -41,3 +43,4 @@ set MAV_TYPE 21
|
||||
|
||||
param set VT_MOT_COUNT 6
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Quadrotor X Tailsitter
|
||||
#
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
set MIXER quad_x_vtol
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
set MAV_TYPE 20
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set VT_ELEV_MC_LOCK 1
|
||||
@@ -0,0 +1,21 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Quadrotor + Tailsitter
|
||||
#
|
||||
# @type VTOL Tailsitter
|
||||
#
|
||||
# @maintainer Roman Bapst <roman@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
set MIXER quad_+_vtol
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
set MAV_TYPE 20
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
param set VT_ELEV_MC_LOCK 1
|
||||
@@ -1,9 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic Tricopter Y Geometry
|
||||
# Yaw Servo +Output ==> +Yaw Vehicle Rotation
|
||||
# @name Generic Tricopter Y+ Geometry
|
||||
#
|
||||
# Trent Lukaczyk <aerialhedgehog@gmail.com>
|
||||
# @type Tricopter Y+
|
||||
#
|
||||
# @maintainer Trent Lukaczyk <aerialhedgehog@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic Tricopter Y Geometry
|
||||
# Yaw Servo +Output ==> -Yaw Vehicle Rotation
|
||||
# @name Generic Tricopter Y- Geometry
|
||||
#
|
||||
# Trent Lukaczyk <aerialhedgehog@gmail.com>
|
||||
# @type Tricopter Y-
|
||||
#
|
||||
# @maintainer Trent Lukaczyk <aerialhedgehog@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# MPX EasyStar Plane
|
||||
# @name Multiplex Easystar
|
||||
#
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Standard AERT Plane
|
||||
#
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN4 rudder
|
||||
# @output MAIN3 throttle
|
||||
# @output MAIN5 flaps
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set MIXER AERT
|
||||
@@ -1,5 +0,0 @@
|
||||
#!nsh
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set MIXER AERT
|
||||
@@ -1,4 +1,21 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Skywalker (3DR Aero)
|
||||
#
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN4 rudder
|
||||
# @output MAIN3 throttle
|
||||
# @output MAIN5 flaps
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Skyhunter 1800
|
||||
#
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name Standard AETR Plane
|
||||
#
|
||||
# @type Standard Plane
|
||||
#
|
||||
# @output MAIN1 aileron
|
||||
# @output MAIN2 elevator
|
||||
# @output MAIN3 throttle
|
||||
# @output MAIN4 rudder
|
||||
# @output MAIN5 flaps
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
set MIXER AETR
|
||||
@@ -1,7 +1,46 @@
|
||||
#!nsh
|
||||
#
|
||||
# @name IO Camflyer
|
||||
#
|
||||
# @url https://pixhawk.org/platforms/planes/bormatec_camflyer_q
|
||||
#
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @output MAIN1 left aileron
|
||||
# @output MAIN2 right aileron
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set FW_AIRSPD_MAX 15
|
||||
param set FW_AIRSPD_MIN 10
|
||||
param set FW_AIRSPD_TRIM 13
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
param set FW_LND_FLALT 5
|
||||
param set FW_LND_HHDIST 15
|
||||
param set FW_LND_HVIRT 13
|
||||
param set FW_LND_TLALT 5
|
||||
param set FW_THR_LND_MAX 0
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_PR_IMAX 0.4
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.04
|
||||
fi
|
||||
|
||||
set MIXER Q
|
||||
# Provide ESC a constant 1000 us pulse while disarmed
|
||||
set PWM_OUT 4
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
#!nsh
|
||||
#
|
||||
# Phantom FPV Flying Wing
|
||||
# @name Phantom FPV Flying Wing
|
||||
#
|
||||
# Simon Wilks <simon@px4.io>
|
||||
# @url https://pixhawk.org/platforms/planes/z-84_wing_wing
|
||||
#
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @output MAIN1 left aileron
|
||||
# @output MAIN2 right aileron
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
@@ -16,14 +28,12 @@ then
|
||||
param set FW_L1_DAMPING 0.75
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_PR_FF 0.2
|
||||
param set FW_PR_I 0.005
|
||||
param set FW_PR_IMAX 0.2
|
||||
param set FW_PR_P 0.03
|
||||
param set FW_P_LIM_MAX 50
|
||||
param set FW_P_LIM_MIN -50
|
||||
param set FW_P_ROLLFF 1
|
||||
param set FW_RR_FF 0.5
|
||||
param set FW_RR_I 0.02
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.08
|
||||
param set FW_R_LIM 50
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
#!nsh
|
||||
#
|
||||
# Skywalker X5 Flying Wing
|
||||
# @name Skywalker X5 Flying Wing
|
||||
#
|
||||
# Thomas Gubler <thomas@px4.io>, Julian Oes <julian@px4.io>
|
||||
# @url https://pixhawk.org/platforms/planes/skywalker_x5
|
||||
#
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @output MAIN1 left aileron
|
||||
# @output MAIN2 right aileron
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>, Julian Oes <julian@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
@@ -14,18 +26,16 @@ then
|
||||
param set FW_AIRSPD_MAX 40
|
||||
param set FW_ATT_TC 0.3
|
||||
param set FW_L1_DAMPING 0.74
|
||||
param set FW_L1_PERIOD 15
|
||||
param set FW_PR_FF 0.3
|
||||
param set FW_PR_I 0
|
||||
param set FW_PR_IMAX 0.2
|
||||
param set FW_PR_P 0.03
|
||||
param set FW_P_ROLLFF 1
|
||||
param set FW_RR_FF 0.3
|
||||
param set FW_RR_I 0
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.03
|
||||
param set FW_R_LIM 60
|
||||
param set FW_R_RMAX 0
|
||||
param set FW_L1_PERIOD 16
|
||||
param set FW_LND_ANG 15
|
||||
param set FW_LND_FLALT 5
|
||||
param set FW_LND_HHDIST 15
|
||||
param set FW_LND_HVIRT 13
|
||||
param set FW_LND_TLALT 5
|
||||
param set FW_THR_LND_MAX 0
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_P 0.04
|
||||
fi
|
||||
|
||||
set MIXER X5
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
#!nsh
|
||||
#
|
||||
# Wing Wing (aka Z-84) Flying Wing
|
||||
# @name Wing Wing (aka Z-84) Flying Wing
|
||||
#
|
||||
# Simon Wilks <simon@px4.io>
|
||||
# @url https://pixhawk.org/platforms/planes/z-84_wing_wing
|
||||
#
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @output MAIN1 left aileron
|
||||
# @output MAIN2 right aileron
|
||||
# @output MAIN4 throttle
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
@@ -23,23 +35,8 @@ then
|
||||
param set FW_LND_TLALT 5
|
||||
param set FW_THR_LND_MAX 0
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_PR_I 0.005
|
||||
param set FW_PR_IMAX 0.4
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_I 0.005
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.04
|
||||
param set MT_TKF_PIT_MAX 30.0
|
||||
param set MT_ACC_D 0.2
|
||||
param set MT_ACC_P 0.6
|
||||
param set MT_A_LP 0.5
|
||||
param set MT_PIT_OFF 0.1
|
||||
param set MT_PIT_I 0.1
|
||||
param set MT_THR_OFF 0.65
|
||||
param set MT_THR_I 0.35
|
||||
param set MT_THR_P 0.2
|
||||
param set MT_THR_FF 1.5
|
||||
fi
|
||||
|
||||
set MIXER wingwing
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# FX-79 Buffalo Flying Wing
|
||||
# @name FX-79 Buffalo Flying Wing
|
||||
#
|
||||
# Simon Wilks <simon@px4.io>
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#
|
||||
#!nsh
|
||||
#
|
||||
# Viper
|
||||
# @name Viper
|
||||
#
|
||||
# Simon Wilks <simon@px4.io>
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @maintainer Simon Wilks <simon@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# TBS Caipirinha
|
||||
# @name TBS Caipirinha
|
||||
#
|
||||
# Lorenz Meier <lorenz@px4.io>
|
||||
# @type Flying Wing
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.fw_defaults
|
||||
@@ -22,19 +24,22 @@ then
|
||||
param set FW_LND_TLALT 5
|
||||
param set FW_THR_LND_MAX 0
|
||||
param set FW_PR_FF 0.35
|
||||
param set FW_PR_I 0.01
|
||||
param set FW_PR_IMAX 0.4
|
||||
param set FW_PR_P 0.08
|
||||
param set FW_RR_FF 0.6
|
||||
param set FW_RR_I 0.01
|
||||
param set FW_RR_IMAX 0.2
|
||||
param set FW_RR_P 0.04
|
||||
param set SYS_COMPANION 157600
|
||||
param set PWM_MAIN_REV0 1
|
||||
param set PWM_MAIN_REV1 1
|
||||
param set PWM_DISARMED 0
|
||||
param set PWM_MIN 900
|
||||
param set PWM_MAX 2100
|
||||
fi
|
||||
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
set MIXER caipi
|
||||
# Provide ESC a constant 1000 us pulse
|
||||
set PWM_OUT 4
|
||||
set PWM_DISARMED 1000
|
||||
set PWM_OUT 1234
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Quad X geometry
|
||||
# @name Generic Quadrotor X config
|
||||
#
|
||||
# Lorenz Meier <lorenz@px4.io>
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# ARDrone
|
||||
# @name AR.Drone Frame
|
||||
#
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# DJI Flame Wheel F330
|
||||
# @name DJI Flame Wheel F330
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
@@ -10,18 +16,23 @@ sh /etc/init.d/4001_quad_x
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.1
|
||||
param set MC_ROLLRATE_P 0.13
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_P 0.13
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
# DJI ESCs do not support calibration and need a higher min
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
set PWM_MIN 1200
|
||||
set PWM_MAX 1950
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1075
|
||||
then
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# DJI Flame Wheel F450
|
||||
# @name DJI Flame Wheel F450
|
||||
#
|
||||
# Lorenz Meier <lorenz@px4.io>
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
@@ -11,18 +17,23 @@ if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# TODO REVIEW
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.1
|
||||
param set MC_ROLLRATE_P 0.16
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_D 0.01
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_P 0.16
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_D 0.01
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_P 0.3
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
# DJI ESCs do not support calibration and need a higher min
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
set PWM_MIN 1230
|
||||
set PWM_MAX 1950
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1075
|
||||
then
|
||||
param set PWM_MIN 1230
|
||||
fi
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
#!nsh
|
||||
#
|
||||
# F450-sized quadrotor with CAN
|
||||
# @name F450-sized quadrotor with CAN
|
||||
#
|
||||
# Pavel Kirienko <pavel@px4.io>
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Pavel Kirienko <pavel@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
# TODO REVIEW
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.1
|
||||
param set MC_ROLLRATE_P 0.16
|
||||
param set MC_ROLLRATE_I 0.05
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_ROLLRATE_D 0.01
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_P 0.16
|
||||
param set MC_PITCHRATE_I 0.05
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_PITCHRATE_D 0.01
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.0
|
||||
param set MC_YAWRATE_P 0.3
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!nsh
|
||||
#
|
||||
# Hobbyking Micro Integrated PCB Quadcopter
|
||||
# with SimonK ESC firmware and Mystery A1510 motors
|
||||
# @name Hobbyking Micro PCB
|
||||
#
|
||||
# Thomas Gubler <thomas@px4.io>
|
||||
# @type Quadrotor x
|
||||
#
|
||||
# @maintainer Thomas Gubler <thomas@px4.io>
|
||||
#
|
||||
echo "HK Micro PCB Quad"
|
||||
|
||||
sh /etc/init.d/4001_quad_x
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# loading default values for the axialracing ax10
|
||||
# @name Axial Racing AX10
|
||||
#
|
||||
# @type Rover
|
||||
#
|
||||
|
||||
#load some defaults e.g. PWM values
|
||||
sh /etc/init.d/rc.axialracing_ax10_defaults
|
||||
|
||||
#choose a mixer, for rover control we need a plain passthrough to the servos
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Quad + geometry
|
||||
# @name Generic 10" Quad + geometry
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Quadrotor +
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Hexa X geometry
|
||||
# @name Generic Hexarotor x geometry
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Hexarotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Hexa + geometry
|
||||
# @name Generic Hexarotor + geometry
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Hexarotor +
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Octo X geometry
|
||||
# @name Generic Octocopter X geometry
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Octorotor x
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!nsh
|
||||
#
|
||||
# Generic 10" Octo + geometry
|
||||
# @name Generic Octocopter + geometry
|
||||
#
|
||||
# Anton Babushkin <anton@px4.io>
|
||||
# @type Octorotor +
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
#
|
||||
# @maintainer Anton Babushkin <anton@px4.io>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
@@ -1,296 +0,0 @@
|
||||
#
|
||||
# SYS_AUTOSTART = 0 means no autostart (default)
|
||||
#
|
||||
# AUTOSTART PARTITION:
|
||||
# 0 .. 999 Reserved (historical)
|
||||
# 1000 .. 1999 Simulation setups
|
||||
# 2000 .. 2999 Standard planes
|
||||
# 3000 .. 3999 Flying wing
|
||||
# 4000 .. 4999 Quad X
|
||||
# 5000 .. 5999 Quad +
|
||||
# 6000 .. 6999 Hexa X
|
||||
# 7000 .. 7999 Hexa +
|
||||
# 8000 .. 8999 Octo X
|
||||
# 9000 .. 9999 Octo +
|
||||
# 10000 .. 10999 Wide arm / H frame
|
||||
# 11000 .. 11999 Hexa Cox
|
||||
# 12000 .. 12999 Octo Cox
|
||||
# 13000 .. 13999 VTOL
|
||||
# 14000 .. 14999 Tri Y
|
||||
|
||||
#
|
||||
# Simulation
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 901
|
||||
then
|
||||
sh /etc/init.d/901_bottle_drop_test.hil
|
||||
set MODE custom
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 1000
|
||||
then
|
||||
sh /etc/init.d/1000_rc_fw_easystar.hil
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 1001
|
||||
then
|
||||
sh /etc/init.d/1001_rc_quad_x.hil
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 1003
|
||||
then
|
||||
sh /etc/init.d/1003_rc_quad_+.hil
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 1004
|
||||
then
|
||||
sh /etc/init.d/1004_rc_fw_Rascal110.hil
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 1005
|
||||
then
|
||||
sh /etc/init.d/1005_rc_fw_Malolo1.hil
|
||||
fi
|
||||
|
||||
#
|
||||
# Plane
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 2100 100
|
||||
then
|
||||
sh /etc/init.d/2100_mpx_easystar
|
||||
set MODE custom
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 2101 101
|
||||
then
|
||||
sh /etc/init.d/2101_hk_bixler
|
||||
set MODE custom
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 2102 102
|
||||
then
|
||||
sh /etc/init.d/2102_3dr_skywalker
|
||||
set MODE custom
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 2103 103
|
||||
then
|
||||
sh /etc/init.d/2103_skyhunter_1800
|
||||
set MODE custom
|
||||
fi
|
||||
|
||||
#
|
||||
# Flying wing
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 3030 30
|
||||
then
|
||||
sh /etc/init.d/3030_io_camflyer
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 3031 31
|
||||
then
|
||||
sh /etc/init.d/3031_phantom
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 3032 32
|
||||
then
|
||||
sh /etc/init.d/3032_skywalker_x5
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 3033 33
|
||||
then
|
||||
sh /etc/init.d/3033_wingwing
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 3034 34
|
||||
then
|
||||
sh /etc/init.d/3034_fx79
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 3035 35
|
||||
then
|
||||
sh /etc/init.d/3035_viper
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 3100
|
||||
then
|
||||
sh /etc/init.d/3100_tbs_caipirinha
|
||||
fi
|
||||
|
||||
#
|
||||
# Quad X
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 4001
|
||||
then
|
||||
sh /etc/init.d/4001_quad_x
|
||||
fi
|
||||
|
||||
#
|
||||
# ARDrone
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 4008 8
|
||||
then
|
||||
sh /etc/init.d/4008_ardrone
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 4010 10
|
||||
then
|
||||
sh /etc/init.d/4010_dji_f330
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 4011 11
|
||||
then
|
||||
sh /etc/init.d/4011_dji_f450
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 4012
|
||||
then
|
||||
sh /etc/init.d/4012_quad_x_can
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 4020
|
||||
then
|
||||
sh /etc/init.d/4020_hk_micro_pcb
|
||||
fi
|
||||
|
||||
#
|
||||
# Quad +
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 5001
|
||||
then
|
||||
sh /etc/init.d/5001_quad_+
|
||||
fi
|
||||
|
||||
#
|
||||
# Hexa X
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 6001
|
||||
then
|
||||
sh /etc/init.d/6001_hexa_x
|
||||
fi
|
||||
|
||||
#
|
||||
# Hexa +
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 7001
|
||||
then
|
||||
sh /etc/init.d/7001_hexa_+
|
||||
fi
|
||||
|
||||
#
|
||||
# Octo X
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 8001
|
||||
then
|
||||
sh /etc/init.d/8001_octo_x
|
||||
fi
|
||||
|
||||
#
|
||||
# Octo +
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 9001
|
||||
then
|
||||
sh /etc/init.d/9001_octo_+
|
||||
fi
|
||||
|
||||
#
|
||||
# Wide arm / H frame
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 10015 15
|
||||
then
|
||||
sh /etc/init.d/10015_tbs_discovery
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 10016 16
|
||||
then
|
||||
sh /etc/init.d/10016_3dr_iris
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 10017
|
||||
then
|
||||
sh /etc/init.d/10017_steadidrone_qu4d
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 10018 18
|
||||
then
|
||||
sh /etc/init.d/10018_tbs_endurance
|
||||
fi
|
||||
|
||||
if param compare SYS_AUTOSTART 10019
|
||||
then
|
||||
sh /etc/init.d/10019_sk450_deadcat
|
||||
fi
|
||||
|
||||
#
|
||||
# Hexa Coaxial
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 11001
|
||||
then
|
||||
sh /etc/init.d/11001_hexa_cox
|
||||
fi
|
||||
|
||||
#
|
||||
# Octo Coaxial
|
||||
#
|
||||
|
||||
if param compare SYS_AUTOSTART 12001
|
||||
then
|
||||
sh /etc/init.d/12001_octo_cox
|
||||
fi
|
||||
|
||||
# 13000 is historically reserved for the quadshot
|
||||
|
||||
#
|
||||
# VTOL Caipririnha (Tailsitter)
|
||||
#
|
||||
if param compare SYS_AUTOSTART 13001
|
||||
then
|
||||
sh /etc/init.d/13001_caipirinha_vtol
|
||||
fi
|
||||
|
||||
#
|
||||
# VTOL BirdsEyeView FireFly x6 (Tilt-Rotor)
|
||||
#
|
||||
if param compare SYS_AUTOSTART 13002
|
||||
then
|
||||
sh /etc/init.d/13002_firefly6
|
||||
fi
|
||||
|
||||
#
|
||||
# TriCopter Y Yaw+
|
||||
#
|
||||
if param compare SYS_AUTOSTART 14001
|
||||
then
|
||||
sh /etc/init.d/14001_tri_y_yaw+
|
||||
fi
|
||||
|
||||
#
|
||||
# TriCopter Y Yaw-
|
||||
#
|
||||
if param compare SYS_AUTOSTART 14002
|
||||
then
|
||||
sh /etc/init.d/14002_tri_y_yaw-
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Ground Rover AxialRacing AX10
|
||||
#
|
||||
if param compare SYS_AUTOSTART 50001
|
||||
then
|
||||
sh /etc/init.d/50001_axialracing_ax10
|
||||
fi
|
||||
|
||||
@@ -17,9 +17,17 @@ then
|
||||
param set FW_T_TIME_CONST 5
|
||||
|
||||
param set PE_VELNE_NOISE 0.3
|
||||
param set PE_VELD_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.35
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.0
|
||||
param set PE_GBIAS_PNOISE 0.000001
|
||||
param set PE_ABIAS_PNOISE 0.0002
|
||||
fi
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
@@ -4,51 +4,46 @@ set VEHICLE_TYPE mc
|
||||
|
||||
if [ $AUTOCNF == yes ]
|
||||
then
|
||||
param set MC_ROLL_P 7.0
|
||||
param set MC_ROLLRATE_P 0.1
|
||||
param set MC_ROLLRATE_I 0.0
|
||||
param set MC_ROLLRATE_D 0.003
|
||||
param set MC_PITCH_P 7.0
|
||||
param set MC_PITCHRATE_P 0.1
|
||||
param set MC_PITCHRATE_I 0.0
|
||||
param set MC_PITCHRATE_D 0.003
|
||||
param set MC_YAW_P 2.8
|
||||
param set MC_YAWRATE_P 0.2
|
||||
param set MC_YAWRATE_I 0.1
|
||||
param set MC_YAWRATE_D 0.0
|
||||
param set MC_YAW_FF 0.5
|
||||
|
||||
param set MPC_THR_MAX 1.0
|
||||
param set MPC_THR_MIN 0.1
|
||||
param set MPC_XY_P 1.0
|
||||
param set MPC_XY_VEL_P 0.1
|
||||
param set MPC_XY_VEL_I 0.02
|
||||
param set MPC_XY_VEL_D 0.01
|
||||
param set MPC_XY_VEL_MAX 5
|
||||
param set MPC_XY_FF 0.5
|
||||
param set MPC_Z_P 1.0
|
||||
param set MPC_Z_VEL_P 0.1
|
||||
param set MPC_Z_VEL_I 0.02
|
||||
param set MPC_Z_VEL_D 0.0
|
||||
param set MPC_Z_VEL_MAX 3
|
||||
param set MPC_Z_FF 0.5
|
||||
param set MPC_TILTMAX_AIR 45.0
|
||||
param set MPC_TILTMAX_LND 15.0
|
||||
param set MPC_LAND_SPEED 1.0
|
||||
|
||||
param set PE_VELNE_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.7
|
||||
param set PE_VELD_NOISE 0.35
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.0
|
||||
param set PE_POSD_NOISE 1.25
|
||||
param set PE_GBIAS_PNOISE 0.000001
|
||||
param set PE_ABIAS_PNOISE 0.0001
|
||||
|
||||
param set NAV_ACC_RAD 2.0
|
||||
param set RTL_RETURN_ALT 30.0
|
||||
param set RTL_DESCEND_ALT 10.0
|
||||
param set PWM_DISARMED 900
|
||||
param set PWM_MIN 1075
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
|
||||
# Transitional support: ensure suitable PWM min/max param values
|
||||
if param compare PWM_MIN 1000
|
||||
then
|
||||
param set PWM_MIN 1075
|
||||
fi
|
||||
if param compare PWM_MAX 2000
|
||||
then
|
||||
param set PWM_MAX 1950
|
||||
fi
|
||||
if param compare PWM_DISARMED 0
|
||||
then
|
||||
param set PWM_DISARMED 900
|
||||
fi
|
||||
|
||||
# set environment variables (!= parameters)
|
||||
set PWM_RATE 400
|
||||
set PWM_DISARMED 900
|
||||
set PWM_MIN 1075
|
||||
set PWM_MAX 2000
|
||||
# tell the mixer to use parameters for these instead
|
||||
set PWM_DISARMED p:PWM_DISARMED
|
||||
set PWM_MIN p:PWM_MIN
|
||||
set PWM_MAX p:PWM_MAX
|
||||
|
||||
# This is the gimbal pass mixer
|
||||
set MIXER_AUX pass
|
||||
set PWM_AUX_RATE 50
|
||||
set PWM_AUX_OUT 1234
|
||||
set PWM_AUX_DISARMED 1500
|
||||
set PWM_AUX_MIN 1000
|
||||
set PWM_AUX_MAX 2000
|
||||
|
||||
@@ -111,21 +111,10 @@ else
|
||||
fi
|
||||
|
||||
# Check for flow sensor
|
||||
if px4flow start
|
||||
if px4flow start &
|
||||
then
|
||||
fi
|
||||
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
if pwm_input start
|
||||
then
|
||||
fi
|
||||
|
||||
if ll40ls start pwm
|
||||
then
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Start sensors
|
||||
#
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# att & pos estimator, att & pos control.
|
||||
#
|
||||
|
||||
attitude_estimator_ekf start
|
||||
attitude_estimator_q start
|
||||
#ekf_att_pos_estimator start
|
||||
position_estimator_inav start
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ then
|
||||
param set FW_RR_P 0.02
|
||||
|
||||
param set PE_VELNE_NOISE 0.5
|
||||
param set PE_VELD_NOISE 0.7
|
||||
param set PE_VELD_NOISE 0.3
|
||||
param set PE_POSNE_NOISE 0.5
|
||||
param set PE_POSD_NOISE 1.0
|
||||
param set PE_POSD_NOISE 1.25
|
||||
param set PE_GBIAS_PNOISE 0.000001
|
||||
param set PE_ABIAS_PNOISE 0.0001
|
||||
fi
|
||||
|
||||
@@ -451,19 +451,30 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start sensors depending on the interface being up
|
||||
if param compare SENS_EN_LL40LS 1
|
||||
then
|
||||
if pwm_input start
|
||||
then
|
||||
if ll40ls start pwm
|
||||
then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $MAVLINK_F == default ]
|
||||
then
|
||||
# Normal mode, use baudrate 57600 (default) and data rate 1000 bytes/s
|
||||
if [ $TTYS1_BUSY == yes ]
|
||||
then
|
||||
# Start MAVLink on ttyS0, because FMU ttyS1 pins configured as something else
|
||||
set MAVLINK_F "-r 1000 -d /dev/ttyS0"
|
||||
set MAVLINK_F "-r 1200 -d /dev/ttyS0"
|
||||
|
||||
# Exit from nsh to free port for mavlink
|
||||
set EXIT_ON_END yes
|
||||
else
|
||||
# Start MAVLink on default port: ttyS1
|
||||
set MAVLINK_F "-r 1000"
|
||||
set MAVLINK_F "-r 1200"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -479,11 +490,11 @@ then
|
||||
# but this works for now
|
||||
if param compare SYS_COMPANION 921600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 20000
|
||||
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 80000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 57600
|
||||
then
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m onboard -r 1000
|
||||
mavlink start -d /dev/ttyS2 -b 57600 -m onboard -r 5000 -x
|
||||
fi
|
||||
if param compare SYS_COMPANION 157600
|
||||
then
|
||||
@@ -564,7 +575,7 @@ then
|
||||
fi
|
||||
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ]
|
||||
then
|
||||
set MAV_TYPE 2
|
||||
set MAV_TYPE 15
|
||||
fi
|
||||
if [ $MIXER == hexa_x -o $MIXER == hexa_+ ]
|
||||
then
|
||||
@@ -588,6 +599,7 @@ then
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 2
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
fi
|
||||
@@ -631,6 +643,7 @@ then
|
||||
if [ $MAV_TYPE == none ]
|
||||
then
|
||||
echo "Unknown MAV_TYPE"
|
||||
param set MAV_TYPE 19
|
||||
else
|
||||
param set MAV_TYPE $MAV_TYPE
|
||||
fi
|
||||
@@ -661,6 +674,8 @@ then
|
||||
then
|
||||
sh /etc/init.d/rc.axialracing_ax10_apps
|
||||
fi
|
||||
|
||||
param set MAV_TYPE 10
|
||||
fi
|
||||
|
||||
unset MIXER
|
||||
@@ -697,7 +712,7 @@ then
|
||||
fi
|
||||
unset EXIT_ON_END
|
||||
|
||||
# Run no SD alarm last
|
||||
# Run no SD alarm
|
||||
if [ $LOG_FILE == /dev/null ]
|
||||
then
|
||||
echo "[i] No microSD card found"
|
||||
@@ -705,6 +720,9 @@ then
|
||||
tone_alarm error
|
||||
fi
|
||||
|
||||
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
|
||||
mavlink boot_complete
|
||||
|
||||
# End of autostart
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
Aileron/Elevator/Throttle/Rudder mixer for PX4FMU
|
||||
==================================================
|
||||
|
||||
This file defines mixers suitable for controlling a fixed wing aircraft with
|
||||
aileron, rudder, elevator and throttle controls using PX4FMU. The configuration
|
||||
assumes the aileron servo(s) are connected to PX4FMU servo output 0, the
|
||||
elevator to output 1, the throttle to output 2 and the rudder to output 3.
|
||||
|
||||
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
|
||||
(roll), 1 (pitch) and 3 (thrust).
|
||||
|
||||
Aileron mixer
|
||||
-------------
|
||||
Two scalers total (output, roll).
|
||||
|
||||
This mixer assumes that the aileron servos are set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
As there is only one output, if using two servos adjustments to compensate for
|
||||
differences between the servos must be made mechanically. To obtain the correct
|
||||
motion using a Y cable, the servos can be positioned reversed from one another.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
|
||||
Elevator mixer
|
||||
------------
|
||||
Two scalers total (output, roll).
|
||||
|
||||
This mixer assumes that the elevator servo is set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 1 -10000 -10000 0 -10000 10000
|
||||
|
||||
Motor speed mixer
|
||||
-----------------
|
||||
Two scalers total (output, thrust).
|
||||
|
||||
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
|
||||
range. Inputs below zero are treated as zero.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 0 20000 -10000 -10000 10000
|
||||
|
||||
Rudder mixer
|
||||
------------
|
||||
Two scalers total (output, yaw).
|
||||
|
||||
This mixer assumes that the rudder servo is set up correctly mechanically;
|
||||
depending on the actual configuration it may be necessary to reverse the scaling
|
||||
factors (to reverse the servo movement) and adjust the offset, scaling and
|
||||
endpoints to suit.
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
|
||||
Gimbal / flaps / payload mixer for last four channels,
|
||||
using the payload control group
|
||||
-----------------------------------------------------
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 0 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 2 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 2 3 10000 10000 0 -10000 10000
|
||||
@@ -11,12 +11,12 @@ Elevon mixers
|
||||
-------------
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 7500 7500 0 -10000 10000
|
||||
S: 1 0 -7500 -7500 0 -10000 10000
|
||||
S: 1 1 8000 8000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 7500 7500 0 -10000 10000
|
||||
S: 1 0 -7500 -7500 0 -10000 10000
|
||||
S: 1 1 -8000 -8000 0 -10000 10000
|
||||
|
||||
Landing gear mixer
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
Mixer for Tailsitter with + motor configuration and elevons
|
||||
===========================================================
|
||||
|
||||
This file defines a single mixer for tailsitter with motors in X configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4+ 10000 10000 10000 0
|
||||
|
||||
# mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
S: 1 1 -10000 -10000 0 -10000 10000
|
||||
|
||||
# mixer for canard surface
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 1 -10000 -10000 0 -10000 10000
|
||||
|
||||
# mixer for rudder
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 2 -10000 -10000 0 -10000 10000
|
||||
@@ -0,0 +1,18 @@
|
||||
Mixer for Tailsitter with x motor configuration and elevons
|
||||
===========================================================
|
||||
|
||||
This file defines a single mixer for tailsitter with motors in X configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4x 10000 10000 10000 0
|
||||
|
||||
#mixer for the elevons
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
|
||||
M: 2
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
S: 1 1 -10000 -10000 0 -10000 10000
|
||||
@@ -0,0 +1,24 @@
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 0 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 1 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 2 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 3 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 4 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 5 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 6 10000 10000 0 -10000 10000
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 0 7 10000 10000 0 -10000 10000
|
||||
@@ -0,0 +1,174 @@
|
||||
% Copyright (c) 2009, Yury Petrov
|
||||
% All rights reserved.
|
||||
%
|
||||
% Redistribution and use in source and binary forms, with or without
|
||||
% modification, are permitted provided that the following conditions are
|
||||
% met:
|
||||
%
|
||||
% * Redistributions of source code must retain the above copyright
|
||||
% notice, this list of conditions and the following disclaimer.
|
||||
% * Redistributions in binary form must reproduce the above copyright
|
||||
% notice, this list of conditions and the following disclaimer in
|
||||
% the documentation and/or other materials provided with the distribution
|
||||
%
|
||||
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
% POSSIBILITY OF SUCH DAMAGE.
|
||||
%
|
||||
|
||||
function [ center, radii, evecs, v ] = ellipsoid_fit( X, flag, equals )
|
||||
%
|
||||
% Fit an ellispoid/sphere to a set of xyz data points:
|
||||
%
|
||||
% [center, radii, evecs, pars ] = ellipsoid_fit( X )
|
||||
% [center, radii, evecs, pars ] = ellipsoid_fit( [x y z] );
|
||||
% [center, radii, evecs, pars ] = ellipsoid_fit( X, 1 );
|
||||
% [center, radii, evecs, pars ] = ellipsoid_fit( X, 2, 'xz' );
|
||||
% [center, radii, evecs, pars ] = ellipsoid_fit( X, 3 );
|
||||
%
|
||||
% Parameters:
|
||||
% * X, [x y z] - Cartesian data, n x 3 matrix or three n x 1 vectors
|
||||
% * flag - 0 fits an arbitrary ellipsoid (default),
|
||||
% - 1 fits an ellipsoid with its axes along [x y z] axes
|
||||
% - 2 followed by, say, 'xy' fits as 1 but also x_rad = y_rad
|
||||
% - 3 fits a sphere
|
||||
%
|
||||
% Output:
|
||||
% * center - ellispoid center coordinates [xc; yc; zc]
|
||||
% * ax - ellipsoid radii [a; b; c]
|
||||
% * evecs - ellipsoid radii directions as columns of the 3x3 matrix
|
||||
% * v - the 9 parameters describing the ellipsoid algebraically:
|
||||
% Ax^2 + By^2 + Cz^2 + 2Dxy + 2Exz + 2Fyz + 2Gx + 2Hy + 2Iz = 1
|
||||
%
|
||||
% Author:
|
||||
% Yury Petrov, Northeastern University, Boston, MA
|
||||
%
|
||||
|
||||
error( nargchk( 1, 3, nargin ) ); % check input arguments
|
||||
if nargin == 1
|
||||
flag = 0; % default to a free ellipsoid
|
||||
end
|
||||
if flag == 2 && nargin == 2
|
||||
equals = 'xy';
|
||||
end
|
||||
|
||||
if size( X, 2 ) ~= 3
|
||||
error( 'Input data must have three columns!' );
|
||||
else
|
||||
x = X( :, 1 );
|
||||
y = X( :, 2 );
|
||||
z = X( :, 3 );
|
||||
end
|
||||
|
||||
% need nine or more data points
|
||||
if length( x ) < 9 && flag == 0
|
||||
error( 'Must have at least 9 points to fit a unique ellipsoid' );
|
||||
end
|
||||
if length( x ) < 6 && flag == 1
|
||||
error( 'Must have at least 6 points to fit a unique oriented ellipsoid' );
|
||||
end
|
||||
if length( x ) < 5 && flag == 2
|
||||
error( 'Must have at least 5 points to fit a unique oriented ellipsoid with two axes equal' );
|
||||
end
|
||||
if length( x ) < 3 && flag == 3
|
||||
error( 'Must have at least 4 points to fit a unique sphere' );
|
||||
end
|
||||
|
||||
if flag == 0
|
||||
% fit ellipsoid in the form Ax^2 + By^2 + Cz^2 + 2Dxy + 2Exz + 2Fyz + 2Gx + 2Hy + 2Iz = 1
|
||||
D = [ x .* x, ...
|
||||
y .* y, ...
|
||||
z .* z, ...
|
||||
2 * x .* y, ...
|
||||
2 * x .* z, ...
|
||||
2 * y .* z, ...
|
||||
2 * x, ...
|
||||
2 * y, ...
|
||||
2 * z ]; % ndatapoints x 9 ellipsoid parameters
|
||||
elseif flag == 1
|
||||
% fit ellipsoid in the form Ax^2 + By^2 + Cz^2 + 2Gx + 2Hy + 2Iz = 1
|
||||
D = [ x .* x, ...
|
||||
y .* y, ...
|
||||
z .* z, ...
|
||||
2 * x, ...
|
||||
2 * y, ...
|
||||
2 * z ]; % ndatapoints x 6 ellipsoid parameters
|
||||
elseif flag == 2
|
||||
% fit ellipsoid in the form Ax^2 + By^2 + Cz^2 + 2Gx + 2Hy + 2Iz = 1,
|
||||
% where A = B or B = C or A = C
|
||||
if strcmp( equals, 'yz' ) || strcmp( equals, 'zy' )
|
||||
D = [ y .* y + z .* z, ...
|
||||
x .* x, ...
|
||||
2 * x, ...
|
||||
2 * y, ...
|
||||
2 * z ];
|
||||
elseif strcmp( equals, 'xz' ) || strcmp( equals, 'zx' )
|
||||
D = [ x .* x + z .* z, ...
|
||||
y .* y, ...
|
||||
2 * x, ...
|
||||
2 * y, ...
|
||||
2 * z ];
|
||||
else
|
||||
D = [ x .* x + y .* y, ...
|
||||
z .* z, ...
|
||||
2 * x, ...
|
||||
2 * y, ...
|
||||
2 * z ];
|
||||
end
|
||||
else
|
||||
% fit sphere in the form A(x^2 + y^2 + z^2) + 2Gx + 2Hy + 2Iz = 1
|
||||
D = [ x .* x + y .* y + z .* z, ...
|
||||
2 * x, ...
|
||||
2 * y, ...
|
||||
2 * z ]; % ndatapoints x 4 sphere parameters
|
||||
end
|
||||
|
||||
% solve the normal system of equations
|
||||
v = ( D' * D ) \ ( D' * ones( size( x, 1 ), 1 ) );
|
||||
|
||||
% find the ellipsoid parameters
|
||||
if flag == 0
|
||||
% form the algebraic form of the ellipsoid
|
||||
A = [ v(1) v(4) v(5) v(7); ...
|
||||
v(4) v(2) v(6) v(8); ...
|
||||
v(5) v(6) v(3) v(9); ...
|
||||
v(7) v(8) v(9) -1 ];
|
||||
% find the center of the ellipsoid
|
||||
center = -A( 1:3, 1:3 ) \ [ v(7); v(8); v(9) ];
|
||||
% form the corresponding translation matrix
|
||||
T = eye( 4 );
|
||||
T( 4, 1:3 ) = center';
|
||||
% translate to the center
|
||||
R = T * A * T';
|
||||
% solve the eigenproblem
|
||||
[ evecs evals ] = eig( R( 1:3, 1:3 ) / -R( 4, 4 ) );
|
||||
radii = sqrt( 1 ./ diag( evals ) );
|
||||
else
|
||||
if flag == 1
|
||||
v = [ v(1) v(2) v(3) 0 0 0 v(4) v(5) v(6) ];
|
||||
elseif flag == 2
|
||||
if strcmp( equals, 'xz' ) || strcmp( equals, 'zx' )
|
||||
v = [ v(1) v(2) v(1) 0 0 0 v(3) v(4) v(5) ];
|
||||
elseif strcmp( equals, 'yz' ) || strcmp( equals, 'zy' )
|
||||
v = [ v(2) v(1) v(1) 0 0 0 v(3) v(4) v(5) ];
|
||||
else % xy
|
||||
v = [ v(1) v(1) v(2) 0 0 0 v(3) v(4) v(5) ];
|
||||
end
|
||||
else
|
||||
v = [ v(1) v(1) v(1) 0 0 0 v(2) v(3) v(4) ];
|
||||
end
|
||||
center = ( -v( 7:9 ) ./ v( 1:3 ) )';
|
||||
gam = 1 + ( v(7)^2 / v(1) + v(8)^2 / v(2) + v(9)^2 / v(3) );
|
||||
radii = ( sqrt( gam ./ v( 1:3 ) ) )';
|
||||
evecs = eye( 3 );
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
%
|
||||
% Tool for plotting mag data
|
||||
%
|
||||
% Reference values:
|
||||
% telem> [cal] mag #0 off: x:0.15 y:0.07 z:0.14 Ga
|
||||
% MATLAB: x:0.1581 y: 0.0701 z: 0.1439 Ga
|
||||
% telem> [cal] mag #0 scale: x:1.10 y:0.97 z:1.02
|
||||
% MATLAB: 0.5499, 0.5190, 0.4907
|
||||
%
|
||||
% telem> [cal] mag #1 off: x:-0.18 y:0.11 z:-0.09 Ga
|
||||
% MATLAB: x:-0.1827 y:0.1147 z:-0.0848 Ga
|
||||
% telem> [cal] mag #1 scale: x:1.00 y:1.00 z:1.00
|
||||
% MATLAB: 0.5122, 0.5065, 0.4915
|
||||
%
|
||||
%
|
||||
% User-guided values:
|
||||
%
|
||||
% telem> [cal] mag #0 off: x:0.12 y:0.09 z:0.14 Ga
|
||||
% telem> [cal] mag #0 scale: x:0.88 y:0.99 z:0.95
|
||||
% telem> [cal] mag #1 off: x:-0.18 y:0.11 z:-0.09 Ga
|
||||
% telem> [cal] mag #1 scale: x:1.00 y:1.00 z:1.00
|
||||
|
||||
close all;
|
||||
clear all;
|
||||
|
||||
plot_scale = 0.8;
|
||||
|
||||
xmax = plot_scale;
|
||||
xmin = -xmax;
|
||||
ymax = plot_scale;
|
||||
ymin = -ymax;
|
||||
zmax = plot_scale;
|
||||
zmin = -zmax;
|
||||
|
||||
mag0_raw = load('../../mag0_raw3.csv');
|
||||
mag1_raw = load('../../mag1_raw3.csv');
|
||||
|
||||
mag0_cal = load('../../mag0_cal3.csv');
|
||||
mag1_cal = load('../../mag1_cal3.csv');
|
||||
|
||||
fm0r = figure();
|
||||
|
||||
mag0_x_scale = 0.88;
|
||||
mag0_y_scale = 0.99;
|
||||
mag0_z_scale = 0.95;
|
||||
|
||||
plot3(mag0_raw(:,1), mag0_raw(:,2), mag0_raw(:,3), '*r');
|
||||
[mag0_raw_center, mag0_raw_radii, evecs, pars ] = ellipsoid_fit( [mag0_raw(:,1) mag0_raw(:,2) mag0_raw(:,3)] );
|
||||
mag0_raw_center
|
||||
mag0_raw_radii
|
||||
axis([xmin xmax ymin ymax zmin zmax])
|
||||
viscircles([mag0_raw_center(1), mag0_raw_center(2)], [mag0_raw_radii(1)]);
|
||||
|
||||
fm1r = figure();
|
||||
plot3(mag1_raw(:,1), mag1_raw(:,2), mag1_raw(:,3), '*r');
|
||||
[center, radii, evecs, pars ] = ellipsoid_fit( [mag1_raw(:,1) mag1_raw(:,2) mag1_raw(:,3)] );
|
||||
center
|
||||
radii
|
||||
axis([xmin xmax ymin ymax zmin zmax])
|
||||
|
||||
fm0c = figure();
|
||||
plot3(mag0_cal(:,1) .* mag0_x_scale, mag0_cal(:,2) .* mag0_y_scale, mag0_cal(:,3) .* mag0_z_scale, '*b');
|
||||
[mag0_cal_center, mag0_cal_radii, evecs, pars ] = ellipsoid_fit( [mag1_raw(:,1) .* mag0_x_scale mag1_raw(:,2) .* mag0_y_scale mag1_raw(:,3) .* mag0_z_scale] );
|
||||
mag0_cal_center
|
||||
mag0_cal_radii
|
||||
axis([xmin xmax ymin ymax zmin zmax])
|
||||
viscircles([0, 0], [mag0_cal_radii(3)]);
|
||||
|
||||
fm1c = figure();
|
||||
plot3(mag1_cal(:,1), mag1_cal(:,2), mag1_cal(:,3), '*b');
|
||||
axis([xmin xmax ymin ymax zmin zmax])
|
||||
[center, radii, evecs, pars ] = ellipsoid_fit( [mag1_raw(:,1) mag1_raw(:,2) mag1_raw(:,3)] );
|
||||
viscircles([0, 0], [radii(3)]);
|
||||
|
||||
mag0_x_scale_matlab = 1 / (mag0_cal_radii(1) / mag0_raw_radii(1))
|
||||
mag0_y_scale_matlab = 1 / (mag0_cal_radii(2) / mag0_raw_radii(2))
|
||||
mag0_z_scale_matlab = 1 / (mag0_cal_radii(3) / mag0_raw_radii(3))
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<airframes>
|
||||
<version>1</version>
|
||||
<airframe_group name="StandardPlane" image="AirframeStandardPlane.png">
|
||||
<airframe name="Multiplex Easystar 1/2" id="2100"/>
|
||||
<airframe name="Generic AERT" id="2101"/>
|
||||
</airframe_group>
|
||||
<airframe_group name="QuadRotorX" image="AirframeQuadRotorX.png">
|
||||
<airframe name="Generic 10 inch Quad" id="4001"/>
|
||||
<airframe name="DJI F330 8 inch Quad" id="4010"/>
|
||||
<airframe name="DJI F450 10 inch Quad" id="4011"/>
|
||||
</airframe_group>
|
||||
</airframes>
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<vehicle_configs>
|
||||
<vehicle class="multirotor" rotors="4" geometry="x" propeller_diameter="8" weight="1.0" id="4010">
|
||||
<title>Standard 8" Prop Quadrotor (x)</title>
|
||||
<short_desc>Standard quadrotor configuration in x configuration for 8-" propellers</short_desc>
|
||||
<mixer>/etc/mixers/quad_x.main.mix</mixer>
|
||||
</vehicle>
|
||||
<vehicle class="multirotor" rotors="4" geometry="+" propeller_diameter="8" weight="1.0" id="5001">
|
||||
<title>Standard 8" Prop Quadrotor (+)</title>
|
||||
<short_desc>Standard quadrotor configuration in + configuration for 8-" propellers</short_desc>
|
||||
<mixer>/etc/mixers/quad_+.main.mix</mixer>
|
||||
</vehicle>
|
||||
<vehicle class="multirotor" rotors="4" geometry="x" propeller_diameter="10" weight="1.5" id="4011">
|
||||
<title>Standard 8" Prop Quadrotor (x)</title>
|
||||
<short_desc>Standard quadrotor configuration in x configuration for 8-" propellers</short_desc>
|
||||
<mixer>/etc/mixers/quad_x.main.mix</mixer>
|
||||
</vehicle>
|
||||
<vehicle class="fixed_wing" wingspan="0.85" elevons="yes" ailerons="no" rudder="no" weight="1.5" id="3033">
|
||||
<title>Zeta Science Wing Wing Z-84</title>
|
||||
<short_desc>Configuration for a small flying wing.</short_desc>
|
||||
<mixer>/etc/mixers/wingwing.main.mix</mixer>
|
||||
</vehicle>
|
||||
</vehicle_configs>
|
||||
@@ -0,0 +1,2 @@
|
||||
handle SIGCONT nostop
|
||||
run
|
||||
@@ -0,0 +1 @@
|
||||
This folder contains a python library used by px_process_params.py
|
||||
@@ -0,0 +1 @@
|
||||
__all__ = ["srcscanner", "srcparser", "xmlout", "rcout"]
|
||||
@@ -0,0 +1,54 @@
|
||||
from xml.sax.saxutils import escape
|
||||
import codecs
|
||||
|
||||
class RCOutput():
|
||||
def __init__(self, groups, board):
|
||||
result = ( "#\n"
|
||||
"#\n"
|
||||
"# THIS FILE IS AUTO-GENERATED. DO NOT EDIT!\n"
|
||||
"#\n"
|
||||
"#\n"
|
||||
"# SYS_AUTOSTART = 0 means no autostart (default)\n"
|
||||
"#\n"
|
||||
"# AUTOSTART PARTITION:\n"
|
||||
"# 0 .. 999 Reserved (historical)\n"
|
||||
"# 1000 .. 1999 Simulation setups\n"
|
||||
"# 2000 .. 2999 Standard planes\n"
|
||||
"# 3000 .. 3999 Flying wing\n"
|
||||
"# 4000 .. 4999 Quadrotor x\n"
|
||||
"# 5000 .. 5999 Quadrotor +\n"
|
||||
"# 6000 .. 6999 Hexarotor x\n"
|
||||
"# 7000 .. 7999 Hexarotor +\n"
|
||||
"# 8000 .. 8999 Octorotor x\n"
|
||||
"# 9000 .. 9999 Octorotor +\n"
|
||||
"# 10000 .. 10999 Quadrotor Wide arm / H frame\n"
|
||||
"# 11000 .. 11999 Hexa Cox\n"
|
||||
"# 12000 .. 12999 Octo Cox\n"
|
||||
"# 13000 .. 13999 VTOL\n"
|
||||
"# 14000 .. 14999 Tri Y\n"
|
||||
"\n")
|
||||
for group in groups:
|
||||
result += "# GROUP: %s\n\n" % group.GetName()
|
||||
for param in group.GetParams():
|
||||
path = param.GetPath().rsplit('/', 1)[1]
|
||||
id_val = param.GetId()
|
||||
name = param.GetFieldValue("short_desc")
|
||||
long_desc = param.GetFieldValue("long_desc")
|
||||
|
||||
result += "#\n"
|
||||
result += "# %s\n" % param.GetName()
|
||||
result += "if param compare SYS_AUTOSTART %s\n" % id_val
|
||||
result += "then\n"
|
||||
result += "\tsh /etc/init.d/%s\n" % path
|
||||
result += "fi\n"
|
||||
|
||||
#if long_desc is not None:
|
||||
# result += "# %s\n" % long_desc
|
||||
result += "\n"
|
||||
|
||||
result += "\n"
|
||||
self.output = result;
|
||||
|
||||
def Save(self, filename):
|
||||
with codecs.open(filename, 'w', 'utf-8') as f:
|
||||
f.write(self.output)
|
||||
@@ -0,0 +1,346 @@
|
||||
import sys
|
||||
import re
|
||||
|
||||
class ParameterGroup(object):
|
||||
"""
|
||||
Single parameter group
|
||||
"""
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
self.params = []
|
||||
|
||||
def AddParameter(self, param):
|
||||
"""
|
||||
Add parameter to the group
|
||||
"""
|
||||
self.params.append(param)
|
||||
|
||||
def GetName(self):
|
||||
"""
|
||||
Get parameter group name
|
||||
"""
|
||||
return self.name
|
||||
|
||||
def GetParams(self):
|
||||
"""
|
||||
Returns the parsed list of parameters. Every parameter is a Parameter
|
||||
object. Note that returned object is not a copy. Modifications affect
|
||||
state of the parser.
|
||||
"""
|
||||
return sorted(self.params,
|
||||
key=lambda x: x.GetFieldValue("code"))
|
||||
|
||||
class Parameter(object):
|
||||
"""
|
||||
Single parameter
|
||||
"""
|
||||
|
||||
# Define sorting order of the fields
|
||||
priority = {
|
||||
"board": 9,
|
||||
"short_desc": 8,
|
||||
"long_desc": 7,
|
||||
"min": 5,
|
||||
"max": 4,
|
||||
"unit": 3,
|
||||
# all others == 0 (sorted alphabetically)
|
||||
}
|
||||
|
||||
def __init__(self, path, name, airframe_type, airframe_id, maintainer):
|
||||
self.fields = {}
|
||||
self.outputs = {}
|
||||
self.path = path
|
||||
self.name = name
|
||||
self.type = airframe_type
|
||||
self.id = airframe_id
|
||||
self.maintainer = maintainer
|
||||
|
||||
def GetPath(self):
|
||||
return self.path
|
||||
|
||||
def GetName(self):
|
||||
return self.name
|
||||
|
||||
def GetType(self):
|
||||
return self.type
|
||||
|
||||
def GetId(self):
|
||||
return self.id
|
||||
|
||||
def GetMaintainer(self):
|
||||
return self.maintainer
|
||||
|
||||
def SetField(self, code, value):
|
||||
"""
|
||||
Set named field value
|
||||
"""
|
||||
self.fields[code] = value
|
||||
|
||||
def SetOutput(self, code, value):
|
||||
"""
|
||||
Set named output value
|
||||
"""
|
||||
self.outputs[code] = value
|
||||
|
||||
def GetFieldCodes(self):
|
||||
"""
|
||||
Return list of existing field codes in convenient order
|
||||
"""
|
||||
keys = self.fields.keys()
|
||||
keys = sorted(keys)
|
||||
keys = sorted(keys, key=lambda x: self.priority.get(x, 0), reverse=True)
|
||||
return keys
|
||||
|
||||
def GetFieldValue(self, code):
|
||||
"""
|
||||
Return value of the given field code or None if not found.
|
||||
"""
|
||||
fv = self.fields.get(code)
|
||||
if not fv:
|
||||
# required because python 3 sorted does not accept None
|
||||
return ""
|
||||
return self.fields.get(code)
|
||||
|
||||
def GetOutputCodes(self):
|
||||
"""
|
||||
Return list of existing output codes in convenient order
|
||||
"""
|
||||
keys = self.outputs.keys()
|
||||
keys = sorted(keys)
|
||||
keys = sorted(keys, key=lambda x: self.priority.get(x, 0), reverse=True)
|
||||
return keys
|
||||
|
||||
def GetOutputValue(self, code):
|
||||
"""
|
||||
Return value of the given output code or None if not found.
|
||||
"""
|
||||
fv = self.outputs.get(code)
|
||||
if not fv:
|
||||
# required because python 3 sorted does not accept None
|
||||
return ""
|
||||
return self.outputs.get(code)
|
||||
|
||||
class SourceParser(object):
|
||||
"""
|
||||
Parses provided data and stores all found parameters internally.
|
||||
"""
|
||||
|
||||
re_split_lines = re.compile(r'[\r\n]+')
|
||||
re_comment_start = re.compile(r'^\#\s')
|
||||
re_comment_content = re.compile(r'^\#\s*(.*)')
|
||||
re_comment_tag = re.compile(r'@([a-zA-Z][a-zA-Z0-9_]*)\s*(.*)')
|
||||
re_comment_end = re.compile(r'(.*?)\s*\#\n/')
|
||||
re_cut_type_specifier = re.compile(r'[a-z]+$')
|
||||
re_is_a_number = re.compile(r'^-?[0-9\.]')
|
||||
re_remove_dots = re.compile(r'\.+$')
|
||||
re_remove_carriage_return = re.compile('\n+')
|
||||
|
||||
valid_tags = set(["url", "maintainer", "output", "name", "type"])
|
||||
|
||||
# Order of parameter groups
|
||||
priority = {
|
||||
# All other groups = 0 (sort alphabetically)
|
||||
"Miscellaneous": -10
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.param_groups = {}
|
||||
|
||||
def GetSupportedExtensions(self):
|
||||
"""
|
||||
Returns list of supported file extensions that can be parsed by this
|
||||
parser. The parser uses any extension.
|
||||
"""
|
||||
return [""]
|
||||
|
||||
def Parse(self, path, contents):
|
||||
"""
|
||||
Incrementally parse program contents and append all found airframes
|
||||
to the list.
|
||||
"""
|
||||
|
||||
airframe_id = None
|
||||
airframe_id = path.rsplit('/',1)[1].split('_',1)[0]
|
||||
|
||||
# Skip if not numeric
|
||||
if (not self.IsNumber(airframe_id)):
|
||||
return True
|
||||
|
||||
# This code is essentially a comment-parsing grammar. "state"
|
||||
# represents parser state. It contains human-readable state
|
||||
# names.
|
||||
state = None
|
||||
tags = {}
|
||||
outputs = {}
|
||||
for line in self.re_split_lines.split(contents):
|
||||
line = line.strip()
|
||||
# Ignore empty lines
|
||||
if line == "":
|
||||
continue
|
||||
if state is None and self.re_comment_start.match(line):
|
||||
state = "wait-short"
|
||||
short_desc = None
|
||||
long_desc = None
|
||||
if state is not None and state != "comment-processed":
|
||||
m = self.re_comment_end.search(line)
|
||||
if m:
|
||||
line = m.group(1)
|
||||
last_comment_line = True
|
||||
else:
|
||||
last_comment_line = False
|
||||
m = self.re_comment_content.match(line)
|
||||
if m:
|
||||
comment_content = m.group(1)
|
||||
if comment_content == "":
|
||||
# When short comment ends with empty comment line,
|
||||
# start waiting for the next part - long comment.
|
||||
if state == "wait-short-end":
|
||||
state = "wait-long"
|
||||
else:
|
||||
m = self.re_comment_tag.match(comment_content)
|
||||
if m:
|
||||
tag, desc = m.group(1, 2)
|
||||
if (tag == "output"):
|
||||
key, text = desc.split(' ', 1)
|
||||
outputs[key] = text;
|
||||
else:
|
||||
tags[tag] = desc
|
||||
current_tag = tag
|
||||
state = "wait-tag-end"
|
||||
elif state == "wait-short":
|
||||
# Store first line of the short description
|
||||
short_desc = comment_content
|
||||
state = "wait-short-end"
|
||||
elif state == "wait-short-end":
|
||||
# Append comment line to the short description
|
||||
short_desc += "\n" + comment_content
|
||||
elif state == "wait-long":
|
||||
# Store first line of the long description
|
||||
long_desc = comment_content
|
||||
state = "wait-long-end"
|
||||
elif state == "wait-long-end":
|
||||
# Append comment line to the long description
|
||||
long_desc += "\n" + comment_content
|
||||
elif state == "wait-tag-end":
|
||||
# Append comment line to the tag text
|
||||
tags[current_tag] += "\n" + comment_content
|
||||
else:
|
||||
raise AssertionError(
|
||||
"Invalid parser state: %s" % state)
|
||||
elif not last_comment_line:
|
||||
# Invalid comment line (inside comment, but not starting with
|
||||
# "*" or "*/". Reset parsed content.
|
||||
state = None
|
||||
if last_comment_line:
|
||||
state = "comment-processed"
|
||||
else:
|
||||
state = None
|
||||
|
||||
# Process parsed content
|
||||
airframe_type = None
|
||||
maintainer = "John Doe <john@example.com>"
|
||||
airframe_name = None
|
||||
|
||||
# Done with file, store
|
||||
for tag in tags:
|
||||
if tag == "maintainer":
|
||||
maintainer = tags[tag]
|
||||
elif tag == "type":
|
||||
airframe_type = tags[tag]
|
||||
elif tag == "name":
|
||||
airframe_name = tags[tag]
|
||||
elif tag not in self.valid_tags:
|
||||
sys.stderr.write("Aborting due to invalid documentation tag: '%s'\n" % tag)
|
||||
return False
|
||||
|
||||
# Sanity check
|
||||
if airframe_type == None:
|
||||
sys.stderr.write("Aborting due to missing @type tag in file: '%s'\n" % path)
|
||||
return False
|
||||
|
||||
if airframe_name == None:
|
||||
sys.stderr.write("Aborting due to missing @name tag in file: '%s'\n" % path)
|
||||
return False
|
||||
|
||||
# We already know this is an airframe config, so add it
|
||||
param = Parameter(path, airframe_name, airframe_type, airframe_id, maintainer)
|
||||
|
||||
# Done with file, store
|
||||
for tag in tags:
|
||||
if tag == "maintainer":
|
||||
maintainer = tags[tag]
|
||||
if tag == "type":
|
||||
airframe_type = tags[tag]
|
||||
if tag == "name":
|
||||
airframe_name = tags[tag]
|
||||
else:
|
||||
param.SetField(tag, tags[tag])
|
||||
|
||||
# Store outputs
|
||||
for output in outputs:
|
||||
param.SetOutput(output, outputs[output])
|
||||
|
||||
# Store the parameter
|
||||
if airframe_type not in self.param_groups:
|
||||
self.param_groups[airframe_type] = ParameterGroup(airframe_type)
|
||||
self.param_groups[airframe_type].AddParameter(param)
|
||||
|
||||
return True
|
||||
|
||||
def IsNumber(self, numberString):
|
||||
try:
|
||||
float(numberString)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def Validate(self):
|
||||
"""
|
||||
Validates the airframe meta data.
|
||||
"""
|
||||
seenParamNames = []
|
||||
for group in self.GetParamGroups():
|
||||
for param in group.GetParams():
|
||||
name = param.GetName()
|
||||
board = param.GetFieldValue("board")
|
||||
# Check for duplicates
|
||||
name_plus_board = name + "+" + board
|
||||
for seenParamName in seenParamNames:
|
||||
if seenParamName == name_plus_board:
|
||||
sys.stderr.write("Duplicate parameter definition: {0}\n".format(name_plus_board))
|
||||
return False
|
||||
seenParamNames.append(name_plus_board)
|
||||
# Validate values
|
||||
default = param.GetDefault()
|
||||
min = param.GetFieldValue("min")
|
||||
max = param.GetFieldValue("max")
|
||||
#sys.stderr.write("{0} default:{1} min:{2} max:{3}\n".format(name, default, min, max))
|
||||
if default != "" and not self.IsNumber(default):
|
||||
sys.stderr.write("Default value not number: {0} {1}\n".format(name, default))
|
||||
return False
|
||||
if min != "":
|
||||
if not self.IsNumber(min):
|
||||
sys.stderr.write("Min value not number: {0} {1}\n".format(name, min))
|
||||
return False
|
||||
if default != "" and float(default) < float(min):
|
||||
sys.stderr.write("Default value is smaller than min: {0} default:{1} min:{2}\n".format(name, default, min))
|
||||
return False
|
||||
if max != "":
|
||||
if not self.IsNumber(max):
|
||||
sys.stderr.write("Max value not number: {0} {1}\n".format(name, max))
|
||||
return False
|
||||
if default != "" and float(default) > float(max):
|
||||
sys.stderr.write("Default value is larger than max: {0} default:{1} max:{2}\n".format(name, default, max))
|
||||
return False
|
||||
return True
|
||||
|
||||
def GetParamGroups(self):
|
||||
"""
|
||||
Returns the parsed list of parameters. Every parameter is a Parameter
|
||||
object. Note that returned object is not a copy. Modifications affect
|
||||
state of the parser.
|
||||
"""
|
||||
groups = self.param_groups.values()
|
||||
groups = sorted(groups, key=lambda x: x.GetName())
|
||||
groups = sorted(groups, key=lambda x: self.priority.get(x.GetName(), 0), reverse=True)
|
||||
return groups
|
||||
@@ -0,0 +1,37 @@
|
||||
import os
|
||||
import re
|
||||
import codecs
|
||||
|
||||
class SourceScanner(object):
|
||||
"""
|
||||
Traverses directory tree, reads all source files, and passes their contents
|
||||
to the Parser.
|
||||
"""
|
||||
|
||||
def ScanDir(self, srcdir, parser):
|
||||
"""
|
||||
Scans provided path and passes all found contents to the parser using
|
||||
parser.Parse method.
|
||||
"""
|
||||
extensions = tuple(parser.GetSupportedExtensions())
|
||||
for dirname, dirnames, filenames in os.walk(srcdir):
|
||||
for filename in filenames:
|
||||
if filename.endswith(extensions):
|
||||
path = os.path.join(dirname, filename)
|
||||
if not self.ScanFile(path, parser):
|
||||
return False
|
||||
return True
|
||||
|
||||
def ScanFile(self, path, parser):
|
||||
"""
|
||||
Scans provided file and passes its contents to the parser using
|
||||
parser.Parse method.
|
||||
"""
|
||||
with codecs.open(path, 'r', 'utf-8') as f:
|
||||
try:
|
||||
contents = f.read()
|
||||
except:
|
||||
contents = ''
|
||||
print('Failed reading file: %s, skipping content.' % path)
|
||||
pass
|
||||
return parser.Parse(path, contents)
|
||||
@@ -0,0 +1,84 @@
|
||||
import xml.etree.ElementTree as ET
|
||||
import codecs
|
||||
|
||||
def indent(elem, level=0):
|
||||
i = "\n" + level*" "
|
||||
if len(elem):
|
||||
if not elem.text or not elem.text.strip():
|
||||
elem.text = i + " "
|
||||
if not elem.tail or not elem.tail.strip():
|
||||
elem.tail = i
|
||||
for elem in elem:
|
||||
indent(elem, level+1)
|
||||
if not elem.tail or not elem.tail.strip():
|
||||
elem.tail = i
|
||||
else:
|
||||
if level and (not elem.tail or not elem.tail.strip()):
|
||||
elem.tail = i
|
||||
|
||||
class XMLOutput():
|
||||
|
||||
def __init__(self, groups, board):
|
||||
xml_parameters = ET.Element("airframes")
|
||||
xml_version = ET.SubElement(xml_parameters, "version")
|
||||
xml_version.text = "1"
|
||||
last_param_name = ""
|
||||
board_specific_param_set = False
|
||||
for group in groups:
|
||||
xml_group = ET.SubElement(xml_parameters, "airframe_group")
|
||||
xml_group.attrib["name"] = group.GetName()
|
||||
if (group.GetName() == "Standard Plane"):
|
||||
xml_group.attrib["image"] = "AirframeStandardPlane.png"
|
||||
elif (group.GetName() == "Flying Wing"):
|
||||
xml_group.attrib["image"] = "AirframeFlyingWing.png"
|
||||
elif (group.GetName() == "Quadrotor x"):
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorX.png"
|
||||
elif (group.GetName() == "Quadrotor +"):
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorPlus.png"
|
||||
elif (group.GetName() == "Hexarotor x"):
|
||||
xml_group.attrib["image"] = "AirframeHexaRotorX.png"
|
||||
elif (group.GetName() == "Hexarotor +"):
|
||||
xml_group.attrib["image"] = "AirframeHexaRotorPlus.png"
|
||||
elif (group.GetName() == "Octorotor +"):
|
||||
xml_group.attrib["image"] = "AirframeOctoRotorPlus.png"
|
||||
elif (group.GetName() == "Octorotor x"):
|
||||
xml_group.attrib["image"] = "AirframeOctoRotorX.png"
|
||||
elif (group.GetName() == "Quadrotor Wide"):
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorH.png"
|
||||
elif (group.GetName() == "Quadrotor H"):
|
||||
xml_group.attrib["image"] = "AirframeQuadRotorH.png"
|
||||
elif (group.GetName() == "Simulation"):
|
||||
xml_group.attrib["image"] = "AirframeSimulation.png"
|
||||
else:
|
||||
xml_group.attrib["image"] = ""
|
||||
for param in group.GetParams():
|
||||
if (last_param_name == param.GetName() and not board_specific_param_set) or last_param_name != param.GetName():
|
||||
xml_param = ET.SubElement(xml_group, "airframe")
|
||||
xml_param.attrib["name"] = param.GetName()
|
||||
xml_param.attrib["id"] = param.GetId()
|
||||
xml_param.attrib["maintainer"] = param.GetMaintainer()
|
||||
last_param_name = param.GetName()
|
||||
for code in param.GetFieldCodes():
|
||||
value = param.GetFieldValue(code)
|
||||
if code == "board":
|
||||
if value == board:
|
||||
board_specific_param_set = True
|
||||
xml_field = ET.SubElement(xml_param, code)
|
||||
xml_field.text = value
|
||||
else:
|
||||
xml_group.remove(xml_param)
|
||||
else:
|
||||
xml_field = ET.SubElement(xml_param, code)
|
||||
xml_field.text = value
|
||||
for code in param.GetOutputCodes():
|
||||
value = param.GetOutputValue(code)
|
||||
xml_field = ET.SubElement(xml_param, "output")
|
||||
xml_field.attrib["name"] = code
|
||||
xml_field.text = value
|
||||
if last_param_name != param.GetName():
|
||||
board_specific_param_set = False
|
||||
indent(xml_parameters)
|
||||
self.xml_document = ET.ElementTree(xml_parameters)
|
||||
|
||||
def Save(self, filename):
|
||||
self.xml_document.write(filename, encoding="UTF-8")
|
||||
@@ -101,6 +101,7 @@ class SourceParser(object):
|
||||
re_cut_type_specifier = re.compile(r'[a-z]+$')
|
||||
re_is_a_number = re.compile(r'^-?[0-9\.]')
|
||||
re_remove_dots = re.compile(r'\.+$')
|
||||
re_remove_carriage_return = re.compile('\n+')
|
||||
|
||||
valid_tags = set(["group", "board", "min", "max", "unit"])
|
||||
|
||||
@@ -188,12 +189,20 @@ class SourceParser(object):
|
||||
if last_comment_line:
|
||||
state = "comment-processed"
|
||||
else:
|
||||
tp = None
|
||||
name = None
|
||||
defval = ""
|
||||
# Non-empty line outside the comment
|
||||
m = self.re_parameter_definition.match(line)
|
||||
if m:
|
||||
tp, name, defval = m.group(1, 2, 3)
|
||||
else:
|
||||
m = self.re_px4_parameter_definition.match(line)
|
||||
if m:
|
||||
tp, name = m.group(1, 2)
|
||||
if tp is not None:
|
||||
# Remove trailing type specifier from numbers: 0.1f => 0.1
|
||||
if self.re_is_a_number.match(defval):
|
||||
if defval != "" and self.re_is_a_number.match(defval):
|
||||
defval = self.re_cut_type_specifier.sub('', defval)
|
||||
param = Parameter(name, tp, defval)
|
||||
param.SetField("short_desc", name)
|
||||
@@ -202,52 +211,71 @@ class SourceParser(object):
|
||||
group = "Miscellaneous"
|
||||
if state == "comment-processed":
|
||||
if short_desc is not None:
|
||||
param.SetField("short_desc",
|
||||
self.re_remove_dots.sub('', short_desc))
|
||||
param.SetField("short_desc", self.re_remove_dots.sub('', short_desc))
|
||||
if long_desc is not None:
|
||||
long_desc = self.re_remove_carriage_return.sub(' ', long_desc)
|
||||
param.SetField("long_desc", long_desc)
|
||||
for tag in tags:
|
||||
if tag == "group":
|
||||
group = tags[tag]
|
||||
elif tag not in self.valid_tags:
|
||||
sys.stderr.write("Skipping invalid "
|
||||
"documentation tag: '%s'\n" % tag)
|
||||
sys.stderr.write("Skipping invalid documentation tag: '%s'\n" % tag)
|
||||
return False
|
||||
else:
|
||||
param.SetField(tag, tags[tag])
|
||||
# Store the parameter
|
||||
if group not in self.param_groups:
|
||||
self.param_groups[group] = ParameterGroup(group)
|
||||
self.param_groups[group].AddParameter(param)
|
||||
else:
|
||||
# Nasty code dup, but this will all go away soon, so quick and dirty (DonLakeFlyer)
|
||||
m = self.re_px4_parameter_definition.match(line)
|
||||
if m:
|
||||
tp, name = m.group(1, 2)
|
||||
param = Parameter(name, tp)
|
||||
param.SetField("short_desc", name)
|
||||
# If comment was found before the parameter declaration,
|
||||
# inject its data into the newly created parameter.
|
||||
group = "Miscellaneous"
|
||||
if state == "comment-processed":
|
||||
if short_desc is not None:
|
||||
param.SetField("short_desc",
|
||||
self.re_remove_dots.sub('', short_desc))
|
||||
if long_desc is not None:
|
||||
param.SetField("long_desc", long_desc)
|
||||
for tag in tags:
|
||||
if tag == "group":
|
||||
group = tags[tag]
|
||||
elif tag not in self.valid_tags:
|
||||
sys.stderr.write("Skipping invalid "
|
||||
"documentation tag: '%s'\n" % tag)
|
||||
else:
|
||||
param.SetField(tag, tags[tag])
|
||||
# Store the parameter
|
||||
if group not in self.param_groups:
|
||||
self.param_groups[group] = ParameterGroup(group)
|
||||
self.param_groups[group].AddParameter(param)
|
||||
# Reset parsed comment.
|
||||
state = None
|
||||
state = None
|
||||
return True
|
||||
|
||||
def IsNumber(self, numberString):
|
||||
try:
|
||||
float(numberString)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def Validate(self):
|
||||
"""
|
||||
Validates the parameter meta data.
|
||||
"""
|
||||
seenParamNames = []
|
||||
for group in self.GetParamGroups():
|
||||
for param in group.GetParams():
|
||||
name = param.GetName()
|
||||
board = param.GetFieldValue("board")
|
||||
# Check for duplicates
|
||||
name_plus_board = name + "+" + board
|
||||
for seenParamName in seenParamNames:
|
||||
if seenParamName == name_plus_board:
|
||||
sys.stderr.write("Duplicate parameter definition: {0}\n".format(name_plus_board))
|
||||
return False
|
||||
seenParamNames.append(name_plus_board)
|
||||
# Validate values
|
||||
default = param.GetDefault()
|
||||
min = param.GetFieldValue("min")
|
||||
max = param.GetFieldValue("max")
|
||||
#sys.stderr.write("{0} default:{1} min:{2} max:{3}\n".format(name, default, min, max))
|
||||
if default != "" and not self.IsNumber(default):
|
||||
sys.stderr.write("Default value not number: {0} {1}\n".format(name, default))
|
||||
return False
|
||||
if min != "":
|
||||
if not self.IsNumber(min):
|
||||
sys.stderr.write("Min value not number: {0} {1}\n".format(name, min))
|
||||
return False
|
||||
if default != "" and float(default) < float(min):
|
||||
sys.stderr.write("Default value is smaller than min: {0} default:{1} min:{2}\n".format(name, default, min))
|
||||
return False
|
||||
if max != "":
|
||||
if not self.IsNumber(max):
|
||||
sys.stderr.write("Max value not number: {0} {1}\n".format(name, max))
|
||||
return False
|
||||
if default != "" and float(default) > float(max):
|
||||
sys.stderr.write("Default value is larger than max: {0} default:{1} max:{2}\n".format(name, default, max))
|
||||
return False
|
||||
return True
|
||||
|
||||
def GetParamGroups(self):
|
||||
"""
|
||||
|
||||
@@ -17,8 +17,10 @@ class SourceScanner(object):
|
||||
for dirname, dirnames, filenames in os.walk(srcdir):
|
||||
for filename in filenames:
|
||||
if filename.endswith(extensions):
|
||||
path = os.path.join(dirname, filename)
|
||||
self.ScanFile(path, parser)
|
||||
path = os.path.join(dirname, filename)
|
||||
if not self.ScanFile(path, parser):
|
||||
return False
|
||||
return True
|
||||
|
||||
def ScanFile(self, path, parser):
|
||||
"""
|
||||
@@ -32,4 +34,4 @@ class SourceScanner(object):
|
||||
contents = ''
|
||||
print('Failed reading file: %s, skipping content.' % path)
|
||||
pass
|
||||
parser.Parse(contents)
|
||||
return parser.Parse(contents)
|
||||
|
||||
@@ -93,6 +93,30 @@ def convert_dir(inputdir, outputdir, templatedir):
|
||||
"""
|
||||
Converts all .msg files in inputdir to uORB header files
|
||||
"""
|
||||
|
||||
# Find the most recent modification time in input dir
|
||||
maxinputtime = 0
|
||||
for f in os.listdir(inputdir):
|
||||
fni = os.path.join(inputdir, f)
|
||||
if os.path.isfile(fni):
|
||||
it = os.path.getmtime(fni)
|
||||
if it > maxinputtime:
|
||||
maxinputtime = it;
|
||||
|
||||
# Find the most recent modification time in output dir
|
||||
maxouttime = 0
|
||||
if os.path.isdir(outputdir):
|
||||
for f in os.listdir(outputdir):
|
||||
fni = os.path.join(outputdir, f)
|
||||
if os.path.isfile(fni):
|
||||
it = os.path.getmtime(fni)
|
||||
if it > maxouttime:
|
||||
maxouttime = it;
|
||||
|
||||
# Do not generate if nothing changed on the input
|
||||
if (maxinputtime != 0 and maxouttime != 0 and maxinputtime < maxouttime):
|
||||
return False
|
||||
|
||||
includepath = incl_default + [':'.join([package, inputdir])]
|
||||
for f in os.listdir(inputdir):
|
||||
# Ignore hidden files
|
||||
@@ -109,6 +133,8 @@ def convert_dir(inputdir, outputdir, templatedir):
|
||||
templatedir,
|
||||
includepath)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def copy_changed(inputdir, outputdir, prefix=''):
|
||||
"""
|
||||
@@ -129,14 +155,16 @@ def copy_changed(inputdir, outputdir, prefix=''):
|
||||
shutil.copy(fni, fno)
|
||||
print("{0}: new header file".format(f))
|
||||
continue
|
||||
# The file exists in inputdir and outputdir
|
||||
# only copy if contents do not match
|
||||
if not filecmp.cmp(fni, fno):
|
||||
shutil.copy(fni, fno)
|
||||
print("{0}: updated".format(f))
|
||||
continue
|
||||
|
||||
print("{0}: unchanged".format(f))
|
||||
if os.path.getmtime(fni) > os.path.getmtime(fno):
|
||||
# The file exists in inputdir and outputdir
|
||||
# only copy if contents do not match
|
||||
if not filecmp.cmp(fni, fno):
|
||||
shutil.copy(fni, fno)
|
||||
print("{0}: updated".format(f))
|
||||
continue
|
||||
|
||||
#print("{0}: unchanged".format(f))
|
||||
|
||||
|
||||
def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
|
||||
@@ -146,7 +174,6 @@ def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
|
||||
"""
|
||||
# Create new headers in temporary output directory
|
||||
convert_dir(inputdir, temporarydir, templatedir)
|
||||
|
||||
# Copy changed headers from temporary dir to output dir
|
||||
copy_changed(temporarydir, outputdir, prefix)
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ parser.add_argument("--summary", action="store", help="set a brief description")
|
||||
parser.add_argument("--description", action="store", help="set a longer description")
|
||||
parser.add_argument("--git_identity", action="store", help="the working directory to check for git identity")
|
||||
parser.add_argument("--parameter_xml", action="store", help="the parameters.xml file")
|
||||
parser.add_argument("--airframe_xml", action="store", help="the airframes.xml file")
|
||||
parser.add_argument("--image", action="store", help="the firmware image")
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -107,6 +108,11 @@ if args.parameter_xml != None:
|
||||
bytes = f.read()
|
||||
desc['parameter_xml_size'] = len(bytes)
|
||||
desc['parameter_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8')
|
||||
if args.airframe_xml != None:
|
||||
f = open(args.airframe_xml, "rb")
|
||||
bytes = f.read()
|
||||
desc['airframe_xml_size'] = len(bytes)
|
||||
desc['airframe_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8')
|
||||
if args.image != None:
|
||||
f = open(args.image, "rb")
|
||||
bytes = f.read()
|
||||
|
||||
Executable
+110
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2013-2015 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
#
|
||||
# PX4 airframe config processor (main executable file)
|
||||
#
|
||||
# This tool scans the PX4 source code for declarations of airframes
|
||||
#
|
||||
# Currently supported formats are:
|
||||
# * XML for the parametric UI generator
|
||||
#
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
from px4airframes import srcscanner, srcparser, xmlout, rcout
|
||||
|
||||
def main():
|
||||
# Parse command line arguments
|
||||
parser = argparse.ArgumentParser(description="Process airframe documentation.")
|
||||
parser.add_argument("-a", "--airframes-path",
|
||||
default="../ROMFS/px4fmu_common",
|
||||
metavar="PATH",
|
||||
help="path to source files to scan for parameters")
|
||||
parser.add_argument("-x", "--xml",
|
||||
nargs='?',
|
||||
const="airframes.xml",
|
||||
metavar="FILENAME",
|
||||
help="Create XML file"
|
||||
" (default FILENAME: airframes.xml)")
|
||||
parser.add_argument("-s", "--start-script",
|
||||
nargs='?',
|
||||
const="rc.autostart",
|
||||
metavar="FILENAME",
|
||||
help="Create start script file")
|
||||
parser.add_argument("-b", "--board",
|
||||
nargs='?',
|
||||
const="",
|
||||
metavar="BOARD",
|
||||
help="Board to create airframes xml for")
|
||||
args = parser.parse_args()
|
||||
|
||||
# Check for valid command
|
||||
if not (args.xml) and not (args.start_script):
|
||||
print("Error: You need to specify at least one output method!\n")
|
||||
parser.print_usage()
|
||||
sys.exit(1)
|
||||
|
||||
# Initialize source scanner and parser
|
||||
scanner = srcscanner.SourceScanner()
|
||||
parser = srcparser.SourceParser()
|
||||
|
||||
# Scan directories, and parse the files
|
||||
print("Scanning source path " + args.airframes_path)
|
||||
if not scanner.ScanDir(args.airframes_path, parser):
|
||||
sys.exit(1)
|
||||
# We can't validate yet
|
||||
# if not parser.Validate():
|
||||
# sys.exit(1)
|
||||
param_groups = parser.GetParamGroups()
|
||||
|
||||
# Output to XML file
|
||||
if args.xml:
|
||||
print("Creating XML file " + args.xml)
|
||||
out = xmlout.XMLOutput(param_groups, args.board)
|
||||
out.Save(args.xml)
|
||||
|
||||
if args.start_script:
|
||||
print("Creating start script " + args.start_script)
|
||||
out = rcout.RCOutput(param_groups, args.board)
|
||||
out.Save(args.start_script)
|
||||
|
||||
print("All done!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -115,7 +115,10 @@ def main():
|
||||
|
||||
# Scan directories, and parse the files
|
||||
print("Scanning source path " + args.src_path)
|
||||
scanner.ScanDir(args.src_path, parser)
|
||||
if not scanner.ScanDir(args.src_path, parser):
|
||||
sys.exit(1)
|
||||
if not parser.Validate():
|
||||
sys.exit(1)
|
||||
param_groups = parser.GetParamGroups()
|
||||
|
||||
# Output to XML file
|
||||
|
||||
@@ -48,6 +48,8 @@ print """
|
||||
|
||||
#include <px4_tasks.h>
|
||||
#include <px4_posix.h>
|
||||
#include <px4_log.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -64,6 +66,7 @@ static int list_tasks_main(int argc, char *argv[]);
|
||||
static int list_files_main(int argc, char *argv[]);
|
||||
static int list_devices_main(int argc, char *argv[]);
|
||||
static int list_topics_main(int argc, char *argv[]);
|
||||
static int sleep_main(int argc, char *argv[]);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +81,7 @@ print '\tapps["list_tasks"] = list_tasks_main;'
|
||||
print '\tapps["list_files"] = list_files_main;'
|
||||
print '\tapps["list_devices"] = list_devices_main;'
|
||||
print '\tapps["list_topics"] = list_topics_main;'
|
||||
print '\tapps["sleep"] = sleep_main;'
|
||||
|
||||
print """
|
||||
}
|
||||
@@ -117,5 +121,17 @@ static int list_files_main(int argc, char *argv[])
|
||||
px4_show_files();
|
||||
return 0;
|
||||
}
|
||||
static int sleep_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
PX4_WARN( "Usage: sleep <seconds>" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned long usecs = ( (unsigned long) atol( argv[1] ) ) * 1000 * 1000;
|
||||
PX4_WARN("Sleeping for %s, %ld",argv[1],usecs);
|
||||
usleep( usecs );
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
|
||||
mkdir -p Build/posix_sitl.build/rootfs/fs/microsd
|
||||
mkdir -p Build/posix_sitl.build/rootfs/eeprom
|
||||
cd Build/posix_sitl.build && ./mainapp ../../posix-configs/SITL/init/rcS
|
||||
cd Build/posix_sitl.build && ./mainapp ../../$1
|
||||
|
||||
Vendored
+102
@@ -0,0 +1,102 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure(2) do |config|
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://atlas.hashicorp.com/search.
|
||||
config.vm.box = "ubuntu/trusty64"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||
# MAVLink telemetry via UDP in SITL mode
|
||||
config.vm.network "forwarded_port", guest: 14556, host: 14556, protocol: "udp"
|
||||
# SITL simulation data
|
||||
config.vm.network "forwarded_port", guest: 14560, host: 14560, protocol: "udp"
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
# using a specific IP.
|
||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||
|
||||
# Create a public network, which generally matched to bridged network.
|
||||
# Bridged networks make the machine appear as another physical device on
|
||||
# your network.
|
||||
# config.vm.network "public_network"
|
||||
|
||||
# Share an additional folder to the guest VM. The first argument is
|
||||
# the path on the host to the actual folder. The second argument is
|
||||
# the path on the guest to mount the folder. And the optional third
|
||||
# argument is a set of non-required options.
|
||||
config.vm.synced_folder ".", "/Firmware"
|
||||
|
||||
# Provider-specific configuration so you can fine-tune various
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
# Example for VirtualBox:
|
||||
#
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
# Display the VirtualBox GUI when booting the machine
|
||||
vb.gui = false
|
||||
vb.customize ["modifyvm", :id, "--ioapic", "on"]
|
||||
vb.customize ["modifyvm", :id, "--cpus", "2"]
|
||||
|
||||
# Since make and other tools freak out if they see timestamps
|
||||
# from the future and we share directories, tightly lock the host and guest clocks together (clock sync if more than 2 seconds off)
|
||||
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 2000]
|
||||
# Do this on start and restore
|
||||
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-start"]
|
||||
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-on-restore", "1"]
|
||||
|
||||
# Customize the amount of memory on the VM:
|
||||
vb.memory = "2048"
|
||||
end
|
||||
#
|
||||
# View the documentation for the provider you are using for more
|
||||
# information on available options.
|
||||
|
||||
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||
# such as FTP and Heroku are also available. See the documentation at
|
||||
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||
# config.push.define "atlas" do |push|
|
||||
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||
# end
|
||||
|
||||
# Enable provisioning with a shell script. Additional provisioners such as
|
||||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||
# documentation for more information about their specific syntax and use.
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
# Ensure we start in the Firmware folder
|
||||
echo "cd /Firmware" >> ~/.bashrc
|
||||
# Install software
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential ccache cmake clang-3.5 lldb-3.5 g++-4.8 gcc-4.8 genromfs libc6-i386 libncurses5-dev python-argparse python-empy python-serial s3cmd texinfo zlib1g-dev git-core
|
||||
pushd .
|
||||
cd ~
|
||||
wget -q https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
|
||||
tar -jxf gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2
|
||||
exportline="export PATH=$HOME/gcc-arm-none-eabi-4_8-2014q3/bin:\$PATH"
|
||||
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
|
||||
. ~/.profile
|
||||
popd
|
||||
# setup ccache
|
||||
mkdir -p ~/bin
|
||||
ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++
|
||||
ln -s /usr/bin/ccache ~/bin/arm-none-eabi-gcc
|
||||
ln -s /usr/bin/ccache ~/bin/g++-4.8
|
||||
ln -s /usr/bin/ccache ~/bin/gcc-4.8
|
||||
export PATH=~/bin:$PATH
|
||||
|
||||
# Configure hardware related bits
|
||||
sudo apt-get -y remove modemmanager
|
||||
sudo usermod -a -G dialout $USER
|
||||
SHELL
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
<launch>
|
||||
|
||||
<arg name="headless" default="false"/>
|
||||
<arg name="gui" default="true"/>
|
||||
<arg name="enable_logging" default="false"/>
|
||||
<arg name="enable_ground_truth" default="true"/>
|
||||
<arg name="ns" default="iris"/>
|
||||
<arg name="log_file" default="$(arg ns)"/>
|
||||
<arg name="mavlink_bridge_url" default="udp://localhost:14553@localhost:14560" />
|
||||
|
||||
<include file="$(find rotors_gazebo)/launch/iris_empty_world.launch">
|
||||
<arg name="headless" value="$(arg headless)"/>
|
||||
<arg name="gui" value="$(arg gui)"/>
|
||||
<arg name="enable_logging" value="$(arg enable_logging)" />
|
||||
<arg name="enable_ground_truth" value="$(arg enable_ground_truth)" />
|
||||
<arg name="log_file" value="$(arg log_file)"/>
|
||||
</include>
|
||||
<include file="$(find mavros)/launch/mavlink_bridge.launch">
|
||||
<arg name="mavlink_bridge_url" value="$(arg mavlink_bridge_url)" />
|
||||
<arg name="ns" value="$(arg ns)"/>
|
||||
</include>
|
||||
|
||||
</launch>
|
||||
@@ -48,11 +48,12 @@ MODULES += modules/navigator
|
||||
MODULES += modules/mavlink
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
# Estimation modules (EKF / other filters)
|
||||
#
|
||||
MODULES += modules/attitude_estimator_ekf
|
||||
MODULES += modules/attitude_estimator_so3
|
||||
# Too high RAM usage due to static allocations
|
||||
#MODULES += modules/attitude_estimator_ekf
|
||||
MODULES += modules/ekf_att_pos_estimator
|
||||
MODULES += modules/attitude_estimator_q
|
||||
MODULES += modules/position_estimator_inav
|
||||
|
||||
#
|
||||
|
||||
@@ -37,6 +37,7 @@ MODULES += drivers/ets_airspeed
|
||||
MODULES += drivers/meas_airspeed
|
||||
MODULES += drivers/frsky_telemetry
|
||||
MODULES += modules/sensors
|
||||
MODULES += drivers/px4flow
|
||||
|
||||
#
|
||||
# System commands
|
||||
|
||||
@@ -73,11 +73,13 @@ MODULES += modules/mavlink
|
||||
MODULES += modules/gpio_led
|
||||
MODULES += modules/uavcan
|
||||
MODULES += modules/land_detector
|
||||
MODULES += modules/camera_trigger
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
MODULES += modules/attitude_estimator_ekf
|
||||
# Too high RAM usage due to static allocations
|
||||
#MODULES += modules/attitude_estimator_ekf
|
||||
MODULES += modules/attitude_estimator_q
|
||||
MODULES += modules/ekf_att_pos_estimator
|
||||
MODULES += modules/position_estimator_inav
|
||||
|
||||
@@ -88,7 +88,6 @@ MODULES += examples/px4_simple_app
|
||||
#
|
||||
# Drivers / modules to test build, but not useful for test environment
|
||||
#
|
||||
MODULES += modules/attitude_estimator_so3
|
||||
MODULES += drivers/pca8574
|
||||
|
||||
#
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
PRODUCT_BUNDLE = $(WORK_DIR)firmware.px4
|
||||
PRODUCT_BIN = $(WORK_DIR)firmware.bin
|
||||
PRODUCT_ELF = $(WORK_DIR)firmware.elf
|
||||
PRODUCT_PARAMXML = $(WORK_DIR)/parameters.xml
|
||||
PRODUCT_PARAMXML = $(WORK_DIR)/parameters.xml
|
||||
PRODUCT_AIRFRAMEXML = $(WORK_DIR)/airframes.xml
|
||||
|
||||
.PHONY: firmware
|
||||
firmware: $(PRODUCT_BUNDLE)
|
||||
@@ -48,9 +49,11 @@ $(PRODUCT_BUNDLE): $(PRODUCT_BIN)
|
||||
@$(ECHO) %% Generating $@
|
||||
ifdef GEN_PARAM_XML
|
||||
$(Q) $(PYTHON) $(PX4_BASE)/Tools/px_process_params.py --src-path $(PX4_BASE)/src --board CONFIG_ARCH_BOARD_$(CONFIG_BOARD) --xml
|
||||
$(Q) $(PYTHON) $(PX4_BASE)/Tools/px_process_airframes.py -a $(PX4_BASE)/ROMFS/px4fmu_common/init.d --board CONFIG_ARCH_BOARD_$(CONFIG_BOARD) --xml
|
||||
$(Q) $(MKFW) --prototype $(IMAGE_DIR)/$(BOARD).prototype \
|
||||
--git_identity $(PX4_BASE) \
|
||||
--parameter_xml $(PRODUCT_PARAMXML) \
|
||||
--airframe_xml $(PRODUCT_AIRFRAMEXML) \
|
||||
--image $< > $@
|
||||
else
|
||||
$(Q) $(MKFW) --prototype $(IMAGE_DIR)/$(BOARD).prototype \
|
||||
|
||||
@@ -68,6 +68,9 @@ ROMFS_OBJ = $(ROMFS_CSRC:.c=.o)
|
||||
LIBS += $(ROMFS_OBJ)
|
||||
LINK_DEPS += $(ROMFS_OBJ)
|
||||
|
||||
# Add autostart script
|
||||
ROMFS_AUTOSTART = $(PX4_BASE)/Tools/px_process_airframes.py
|
||||
|
||||
# Remove all comments from startup and mixer files
|
||||
ROMFS_PRUNER = $(PX4_BASE)/Tools/px_romfs_pruner.py
|
||||
|
||||
@@ -90,6 +93,10 @@ ifneq ($(ROMFS_EXTRA_FILES),)
|
||||
$(Q) $(MKDIR) -p $(ROMFS_SCRATCH)/extras
|
||||
$(Q) $(COPY) $(ROMFS_EXTRA_FILES) $(ROMFS_SCRATCH)/extras
|
||||
endif
|
||||
$(Q) $(PYTHON) -u $(ROMFS_AUTOSTART) -a $(ROMFS_ROOT)/init.d -s $(ROMFS_SCRATCH)/init.d/rc.autostart
|
||||
# Execute in standard dir as well
|
||||
# so developers notice the generated file
|
||||
$(Q) $(PYTHON) -u $(ROMFS_AUTOSTART) -a $(ROMFS_ROOT)/init.d -s $(ROMFS_ROOT)/init.d/rc.autostart
|
||||
$(Q) $(PYTHON) -u $(ROMFS_PRUNER) --folder $(ROMFS_SCRATCH)
|
||||
|
||||
EXTRA_CLEANS += $(ROMGS_OBJ) $(ROMFS_IMG)
|
||||
|
||||
@@ -15,7 +15,7 @@ ifeq ($(SYSTYPE),Darwin)
|
||||
SERIAL_PORTS ?= "/dev/tty.usbmodemPX*,/dev/tty.usbmodem*"
|
||||
endif
|
||||
ifeq ($(SYSTYPE),Linux)
|
||||
SERIAL_PORTS ?= "/dev/serial/by-id/usb-3D_Robotics*"
|
||||
SERIAL_PORTS ?= "/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/pci-3D_Robotics*"
|
||||
endif
|
||||
ifeq ($(SERIAL_PORTS),)
|
||||
SERIAL_PORTS = "COM32,COM31,COM30,COM29,COM28,COM27,COM26,COM25,COM24,COM23,COM22,COM21,COM20,COM19,COM18,COM17,COM16,COM15,COM14,COM13,COM12,COM11,COM10,COM9,COM8,COM7,COM6,COM5,COM4,COM3,COM2,COM1,COM0"
|
||||
|
||||
@@ -18,7 +18,8 @@ MODULES += modules/sensors
|
||||
#
|
||||
MODULES += systemcmds/param
|
||||
MODULES += systemcmds/mixer
|
||||
MODULES += systemcmds/topic_listener
|
||||
MODULES += systemcmds/ver
|
||||
#MODULES += systemcmds/topic_listener
|
||||
|
||||
#
|
||||
# General system control
|
||||
@@ -34,7 +35,7 @@ MODULES += modules/ekf_att_pos_estimator
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
MODULES += modules/navigator
|
||||
#MODULES += modules/navigator
|
||||
MODULES += modules/mc_pos_control
|
||||
MODULES += modules/mc_att_control
|
||||
|
||||
@@ -48,7 +49,7 @@ MODULES += modules/dataman
|
||||
MODULES += modules/sdlog2
|
||||
MODULES += modules/simulator
|
||||
MODULES += modules/commander
|
||||
MODULES += modules/controllib
|
||||
#MODULES += modules/controllib
|
||||
|
||||
#
|
||||
# Libraries
|
||||
@@ -58,18 +59,10 @@ MODULES += lib/mathlib/math/filter
|
||||
MODULES += lib/geo
|
||||
MODULES += lib/geo_lookup
|
||||
MODULES += lib/conversion
|
||||
|
||||
#
|
||||
# Linux port
|
||||
#
|
||||
MODULES += platforms/posix/px4_layer
|
||||
MODULES += platforms/posix/drivers/accelsim
|
||||
MODULES += platforms/posix/drivers/gyrosim
|
||||
MODULES += platforms/posix/drivers/adcsim
|
||||
MODULES += platforms/posix/drivers/barosim
|
||||
MODULES += platforms/posix/drivers/tonealrmsim
|
||||
MODULES += platforms/posix/drivers/airspeedsim
|
||||
MODULES += platforms/posix/drivers/gpssim
|
||||
|
||||
#
|
||||
# Unit tests
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# Makefile for the POSIXTEST *default* configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
MODULES += drivers/device
|
||||
#MODULES += drivers/blinkm
|
||||
#MODULES += drivers/hil
|
||||
#MODULES += drivers/rgbled
|
||||
MODULES += drivers/led
|
||||
#MODULES += modules/sensors
|
||||
#MODULES += drivers/ms5611
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
MODULES += systemcmds/param
|
||||
#MODULES += systemcmds/mixer
|
||||
#MODULES += systemcmds/topic_listener
|
||||
MODULES += systemcmds/ver
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
MODULES += modules/mavlink
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
#MODULES += modules/attitude_estimator_ekf
|
||||
#MODULES += modules/ekf_att_pos_estimator
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
#MODULES += modules/navigator
|
||||
#MODULES += modules/mc_pos_control
|
||||
#MODULES += modules/mc_att_control
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
MODULES += modules/systemlib
|
||||
#MODULES += modules/systemlib/mixer
|
||||
MODULES += modules/uORB
|
||||
MODULES += modules/dataman
|
||||
MODULES += modules/sdlog2
|
||||
MODULES += modules/simulator
|
||||
MODULES += modules/commander
|
||||
#MODULES += modules/controllib
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
MODULES += lib/mathlib
|
||||
MODULES += lib/mathlib/math/filter
|
||||
MODULES += lib/geo
|
||||
MODULES += lib/geo_lookup
|
||||
MODULES += lib/conversion
|
||||
|
||||
#
|
||||
# Linux port
|
||||
#
|
||||
MODULES += platforms/posix/px4_layer
|
||||
#MODULES += platforms/posix/drivers/accelsim
|
||||
#MODULES += platforms/posix/drivers/gyrosim
|
||||
#MODULES += platforms/posix/drivers/adcsim
|
||||
#MODULES += platforms/posix/drivers/barosim
|
||||
#MODULES += platforms/posix/drivers/tonealrmsim
|
||||
#MODULES += platforms/posix/drivers/airspeedsim
|
||||
#MODULES += platforms/posix/drivers/gpssim
|
||||
|
||||
#
|
||||
# Unit tests
|
||||
#
|
||||
#MODULES += platforms/posix/tests/hello
|
||||
#MODULES += platforms/posix/tests/vcdev_test
|
||||
#MODULES += platforms/posix/tests/hrt_test
|
||||
#MODULES += platforms/posix/tests/wqueue
|
||||
|
||||
#
|
||||
# muorb fastrpc changes.
|
||||
#
|
||||
MODULES += modules/muorb/krait
|
||||
@@ -0,0 +1,89 @@
|
||||
#
|
||||
# Makefile for the POSIXTEST *default* configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
MODULES += drivers/device
|
||||
#MODULES += drivers/blinkm
|
||||
#MODULES += drivers/hil
|
||||
#MODULES += drivers/rgbled
|
||||
#MODULES += drivers/led
|
||||
#MODULES += modules/sensors
|
||||
#MODULES += drivers/ms5611
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
#MODULES += systemcmds/param
|
||||
#MODULES += systemcmds/mixer
|
||||
#MODULES += systemcmds/topic_listener
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
#MODULES += modules/mavlink
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
#MODULES += modules/attitude_estimator_ekf
|
||||
#MODULES += modules/ekf_att_pos_estimator
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
#MODULES += modules/navigator
|
||||
#MODULES += modules/mc_pos_control
|
||||
#MODULES += modules/mc_att_control
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
#MODULES += modules/systemlib
|
||||
#MODULES += modules/systemlib/mixer
|
||||
MODULES += modules/uORB
|
||||
#MODULES += modules/dataman
|
||||
#MODULES += modules/sdlog2
|
||||
#MODULES += modules/simulator
|
||||
#MODULES += modules/commander
|
||||
#MODULES += modules/controllib
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
#MODULES += lib/mathlib
|
||||
#MODULES += lib/mathlib/math/filter
|
||||
#MODULES += lib/geo
|
||||
#MODULES += lib/geo_lookup
|
||||
#MODULES += lib/conversion
|
||||
|
||||
#
|
||||
# Linux port
|
||||
#
|
||||
MODULES += platforms/posix/px4_layer
|
||||
#MODULES += platforms/posix/drivers/accelsim
|
||||
#MODULES += platforms/posix/drivers/gyrosim
|
||||
#MODULES += platforms/posix/drivers/adcsim
|
||||
#MODULES += platforms/posix/drivers/barosim
|
||||
#MODULES += platforms/posix/drivers/tonealrmsim
|
||||
#MODULES += platforms/posix/drivers/airspeedsim
|
||||
#MODULES += platforms/posix/drivers/gpssim
|
||||
|
||||
#
|
||||
# muorb fastrpc changes.
|
||||
#
|
||||
MODULES += modules/muorb/krait
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
# Unit tests
|
||||
#
|
||||
#MODULES += platforms/posix/tests/hello
|
||||
#MODULES += platforms/posix/tests/vcdev_test
|
||||
#MODULES += platforms/posix/tests/hrt_test
|
||||
#MODULES += platforms/posix/tests/wqueue
|
||||
MODULES += platforms/posix/tests/muorb
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/****************************************************************************
|
||||
* ld.script
|
||||
*
|
||||
* Copyright (C) 2015 Mark Charlebois. All rights reserved.
|
||||
* Author: Mark Charlebois <charlebm@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,13 +33,14 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _work_lock_h_
|
||||
#define _work_lock_h_
|
||||
|
||||
|
||||
//#pragma once
|
||||
|
||||
void work_lock(int id);
|
||||
void work_unlock(int id);
|
||||
|
||||
#endif // _work_lock_h_
|
||||
SECTIONS
|
||||
{
|
||||
/*
|
||||
* Construction data for parameters.
|
||||
*/
|
||||
__param : ALIGN(8) {
|
||||
__param_start = .;
|
||||
KEEP(*(__param*))
|
||||
__param_end = .;
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,7 @@ ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED)))
|
||||
$(error Unsupported version of $(CC), found: $(CROSSDEV_VER_FOUND) instead of one in: $(CROSSDEV_VER_SUPPORTED))
|
||||
endif
|
||||
|
||||
EXT_MUORB_LIB_ROOT = /opt/muorb_libs
|
||||
|
||||
# XXX this is pulled pretty directly from the fmu Make.defs - needs cleanup
|
||||
|
||||
@@ -156,12 +157,11 @@ ARCHWARNINGS = -Wall \
|
||||
-Werror=reorder \
|
||||
-Werror=uninitialized \
|
||||
-Werror=init-self \
|
||||
-Wno-error=logical-op \
|
||||
-Wdouble-promotion \
|
||||
-Wno-error=logical-op \
|
||||
-Wlogical-op \
|
||||
-Wformat=1 \
|
||||
-Werror=unused-but-set-variable \
|
||||
-Werror=double-promotion \
|
||||
-Wno-error=double-promotion \
|
||||
-fno-strength-reduce \
|
||||
-Wno-error=unused-value
|
||||
|
||||
@@ -188,9 +188,11 @@ ARCHWARNINGSXX = $(ARCHWARNINGS) \
|
||||
# pull in *just* libm from the toolchain ... this is grody
|
||||
LIBM := $(shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a)
|
||||
#EXTRA_LIBS += $(LIBM)
|
||||
#EXTRA_LIBS += ${PX4_BASE}../muorb_krait/lib/libmuorb.so
|
||||
EXTRA_LIBS += -lpx4muorb -ladsprpc
|
||||
EXTRA_LIBS += -pthread -lm -lrt
|
||||
|
||||
LIB_DIRS += $(EXT_MUORB_LIB_ROOT)/krait/libs
|
||||
|
||||
# Flags we pass to the C compiler
|
||||
#
|
||||
CFLAGS = $(ARCHCFLAGS) \
|
||||
@@ -226,7 +228,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \
|
||||
$(EXTRADEFINES) \
|
||||
$(EXTRAAFLAGS)
|
||||
|
||||
LDSCRIPT = $(PX4_BASE)/posix-configs/posixtest/scripts/ld.script
|
||||
LDSCRIPT = $(PX4_BASE)/makefiles/posix-arm/ld.script
|
||||
# Flags we pass to the linker
|
||||
#
|
||||
LDFLAGS += $(EXTRALDFLAGS) \
|
||||
@@ -323,6 +325,7 @@ endef
|
||||
define LINK
|
||||
@$(ECHO) "LINK: $1"
|
||||
@$(MKDIR) -p $(dir $1)
|
||||
echo "$(Q) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $1 $2 $(LIBS) $(EXTRA_LIBS) $(LIBGCC)"
|
||||
$(Q) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $1 $2 $(LIBS) $(EXTRA_LIBS) $(LIBGCC)
|
||||
|
||||
endef
|
||||
|
||||
@@ -11,15 +11,20 @@ MODULES += drivers/hil
|
||||
MODULES += drivers/rgbled
|
||||
MODULES += drivers/led
|
||||
MODULES += modules/sensors
|
||||
#MODULES += drivers/ms5611
|
||||
#MODULES += drivers/ms5611
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
MODULES += systemcmds/param
|
||||
MODULES += systemcmds/mixer
|
||||
MODULES += systemcmds/topic_listener
|
||||
MODULES += systemcmds/ver
|
||||
MODULES += systemcmds/param
|
||||
MODULES += systemcmds/mixer
|
||||
#MODULES += systemcmds/esc_calib
|
||||
MODULES += systemcmds/tests
|
||||
#MODULES += systemcmds/reboot
|
||||
MODULES += systemcmds/topic_listener
|
||||
MODULES += systemcmds/ver
|
||||
MODULES += systemcmds/esc_calib
|
||||
MODULES += systemcmds/reboot
|
||||
|
||||
#
|
||||
# General system control
|
||||
@@ -30,7 +35,10 @@ MODULES += modules/mavlink
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
MODULES += modules/attitude_estimator_ekf
|
||||
MODULES += modules/attitude_estimator_q
|
||||
MODULES += modules/ekf_att_pos_estimator
|
||||
MODULES += modules/attitude_estimator_q
|
||||
MODULES += modules/position_estimator_inav
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
@@ -38,6 +46,9 @@ MODULES += modules/ekf_att_pos_estimator
|
||||
MODULES += modules/navigator
|
||||
MODULES += modules/mc_pos_control
|
||||
MODULES += modules/mc_att_control
|
||||
MODULES += modules/mc_pos_control_multiplatform
|
||||
MODULES += modules/mc_att_control_multiplatform
|
||||
MODULES += modules/land_detector
|
||||
|
||||
#
|
||||
# Library modules
|
||||
@@ -61,9 +72,10 @@ MODULES += lib/geo_lookup
|
||||
MODULES += lib/conversion
|
||||
|
||||
#
|
||||
# Linux port
|
||||
# POSIX port
|
||||
#
|
||||
MODULES += platforms/posix/px4_layer
|
||||
MODULES += platforms/posix/work_queue
|
||||
MODULES += platforms/posix/drivers/accelsim
|
||||
MODULES += platforms/posix/drivers/gyrosim
|
||||
MODULES += platforms/posix/drivers/adcsim
|
||||
@@ -75,12 +87,12 @@ MODULES += platforms/posix/drivers/gpssim
|
||||
#
|
||||
# Unit tests
|
||||
#
|
||||
#MODULES += platforms/posix/tests/hello
|
||||
#MODULES += platforms/posix/tests/vcdev_test
|
||||
#MODULES += platforms/posix/tests/hrt_test
|
||||
#MODULES += platforms/posix/tests/wqueue
|
||||
#MODULES += platforms/posix/tests/hello
|
||||
#MODULES += platforms/posix/tests/vcdev_test
|
||||
#MODULES += platforms/posix/tests/hrt_test
|
||||
#MODULES += platforms/posix/tests/wqueue
|
||||
|
||||
#
|
||||
# muorb fastrpc changes.
|
||||
#
|
||||
#MODULES += $(PX4_BASE)../muorb_krait
|
||||
#MODULES += $(PX4_BASE)../muorb_krait
|
||||
|
||||
@@ -56,9 +56,11 @@ $(PRODUCT_SHARED_PRELINK): $(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS) $(GLOBAL_DEPS)
|
||||
$(PRODUCT_SHARED_LIB): $(PRODUCT_SHARED_PRELINK)
|
||||
$(call LINK_A,$@,$(PRODUCT_SHARED_PRELINK))
|
||||
|
||||
$(WORK_DIR)apps.h: $(WORK_DIR)builtin_commands
|
||||
$(PX4_BASE)/Tools/posix_apps.py > $(WORK_DIR)apps.h
|
||||
|
||||
MAIN = $(PX4_BASE)/src/platforms/posix/main.cpp
|
||||
$(WORK_DIR)mainapp: $(PRODUCT_SHARED_LIB)
|
||||
$(PX4_BASE)/Tools/posix_apps.py > apps.h
|
||||
$(WORK_DIR)mainapp: $(PRODUCT_SHARED_LIB) $(WORK_DIR)apps.h
|
||||
$(call LINK,$@, -I. $(MAIN) $(PRODUCT_SHARED_LIB))
|
||||
|
||||
#
|
||||
|
||||
@@ -44,12 +44,18 @@
|
||||
# Set to 1 for GCC-4.8.2 and to 0 for Clang-3.5 (Ubuntu 14.04)
|
||||
USE_GCC?=0
|
||||
|
||||
ifeq ($(PX4_DEBUG_LEVEL),)
|
||||
VERBOSITY_LEVEL=
|
||||
else
|
||||
VERBOSITY_LEVEL=-D$(PX4_DEBUG_LEVEL)
|
||||
endif
|
||||
|
||||
ifneq ($(USE_GCC),1)
|
||||
|
||||
HAVE_CLANG35:=$(shell clang-3.5 -dumpversion 2>/dev/null)
|
||||
|
||||
# Clang will report 4.2.1 as GCC version
|
||||
HAVE_CLANG:=$(shell clang -dumpversion)
|
||||
HAVE_CLANG:=$(shell clang -dumpversion 2> /dev/null)
|
||||
|
||||
#If using ubuntu 14.04 and packaged clang 3.5
|
||||
ifeq ($(HAVE_CLANG35),4.2.1)
|
||||
@@ -120,7 +126,8 @@ ifeq ($(CONFIG_BOARD),)
|
||||
$(error Board config does not define CONFIG_BOARD)
|
||||
endif
|
||||
ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) \
|
||||
-Dnoreturn_function= \
|
||||
-Dnoreturn_function=__attribute__\(\(noreturn\)\) \
|
||||
$(VERBOSITY_LEVEL)\
|
||||
-I$(PX4_BASE)/src/modules/systemlib \
|
||||
-I$(PX4_BASE)/src/lib/eigen \
|
||||
-I$(PX4_BASE)/src/platforms/posix/include \
|
||||
@@ -296,7 +303,7 @@ endef
|
||||
define COMPILEXX
|
||||
@$(ECHO) "CXX: $1"
|
||||
@$(MKDIR) -p $(dir $2)
|
||||
@echo $(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2
|
||||
@$(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2
|
||||
$(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2
|
||||
endef
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user