Compare commits

..

1605 Commits

Author SHA1 Message Date
Michael Schaeuble b0ee5256d5 Disable LPE in px4fmu-v2_default
With GCC 4.9 the binary is to large for the flash memory.
This is why we disabled LPE on that platform.
2016-12-09 18:59:42 +01:00
Michael Schaeuble bdb76d013e Fix incorrect MPU9250 device ID
We propagate the bus parameters from the bus interface to the sensor
devices. Thus, the device ID of the sensor driver is set to the correct
bus id and address. Otherwise it would be zero, which is an issue if several MPU9250s
are running at the same time.
2016-12-09 18:59:42 +01:00
Paul Riseborough 1fbc688757 Commander: Fix pre-flight EKF check errors 2016-12-09 17:58:23 +01:00
Beat Küng 9442c89691 Tools/upload_log.py: add script to upload ulog file to logs.px4.io 2016-12-09 17:57:29 +01:00
Julian Oes 1424994bc0 navigator: don't takeoff in loiter on ground
This fixes the following corner case:
1. Upload a mission.
2. Set mission mode.
3. Set loiter mode.
4. Arm.
At this point it will shoot up and go to the takeoff waypoint even
though we're not in mission but in loiter mode.

The fix makes sure that the triplet is reset to invalid (and idle) in
loiter mode if we're landed and disarmed.
It will lead to the vehcle sit in idle on the ground until you issue a
start mission (or takeoff) command.
2016-12-08 15:07:14 +01:00
Dennis Mannhart dd1ca0daa2 correctin from user input to roll and pitch 2016-12-08 15:06:00 +01:00
Dennis Mannhart 6906d966ce manual input mapping to roll and pitch 2016-12-08 15:06:00 +01:00
Roman 0c49abbef8 standard vtol: correctly modify attitude for pusher assist
- fix a bug where the wrong rotation order was used to compute the attitude
setpoint when using the pusher assist feature

Signed-off-by: Roman <bapstroman@gmail.com>
2016-12-08 15:05:43 +01:00
Samay Siga 6b08ba6272 Update 13010_claire
updated VT_FW_MOT_OFFID
2016-12-07 20:54:49 +01:00
Samay Siga e3ef206846 Update claire.aux.mix
Replaced individual elevator and aileron into "elevons"
2016-12-07 20:17:43 +01:00
Daniel Agar 1941dfca87 add tests code coverage
-closes #5862
2016-12-07 20:17:00 +01:00
Dennis Mannhart c2b6381759 adjust to astyle format 2016-12-07 17:32:09 +01:00
Dennis Mannhart 5ed35e9731 added comment why reseting at this point; created variable for horizontal velocity magnitude 2016-12-07 17:32:09 +01:00
Dennis Mannhart 6865a70dea reset position setpoints once altitude condition is reached 2016-12-07 17:32:09 +01:00
Julian Oes fc9f2143d2 sitl_gazebo: update submodule 2016-12-07 16:23:21 +01:00
Beat Küng 78f1d9d017 hmc5883: fix MAGIOCGEXTERNAL ioctl for non fmuv1 boards
This makes the onboard check consistent with hmc5883_bus_option
initialization. If the current bus is the onboard bus, return !external.

It fixes the onboard mag (HMC5883) for AeroFC. Its priority is now 100,
previously it was 255, so that if an external mag is attached, it will be
preferred.
2016-12-07 11:06:28 +01:00
James Goppert 13df03c78a Fix bug with imu rotation for tyhpoon in sitl gazebo. (#5988) 2016-12-06 12:55:05 -05:00
James Goppert fa834497bf Setup sf0x driver to handle all lightware lidars. (#5957) 2016-12-06 12:19:13 -05:00
Lucas De Marchi 7b81374fda aerofc: add comment to make intention clear 2016-12-06 08:34:18 +01:00
Lucas De Marchi 162c0a7418 Revert "Aerofc: px4fmu_common: Only set AUTOSTART to 4070 if nothing was set"
This reverts commit 126172d70c.

This commit is going in the wrong direction: it's actually the same as
it was before, but allows changing the autostart configuration to
something other than 4070, which means people could wrongly assume it
would work in other configurations.
2016-12-06 08:34:18 +01:00
Beat Küng 176c6e0df2 aerofc config: update default parameters for attitude & position controllers 2016-12-05 18:08:44 +01:00
Beat Küng e4e5a77f71 aerofc: use logger when autoconfig 2016-12-05 18:08:44 +01:00
Beat Küng e3537ca6c2 px4fmu rcS: increase mavlink rate to 100000 for SYS_COMPANION 1500000
Needed for log streaming
2016-12-05 18:08:44 +01:00
Roman aabf753ecb mc_pos_control: do not do tilt compensation when hor velocity is controlled
- fixed a bug where tilt compensation was done also when the horizontal
velocity was controlled. This is not needed because in this case
the controller outputs a 3D thrust vector.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-12-05 16:07:19 +01:00
Lorenz Meier f15d1ce5e7 Sort and sync FMUv3 config 2016-12-05 15:27:11 +01:00
Daniel Agar 77298e42db fix pixhawk 2 (solo) sensor start 2016-12-05 15:27:11 +01:00
Daniel Agar 69cc4d7e7f rc.sensors fix indentation 2016-12-05 15:27:11 +01:00
Daniel Agar 9d494e625f travis-ci upload px4fmu-v3 for qgc 2016-12-05 15:27:11 +01:00
Daniel Agar a8747a01fe pixhawk 2.1 add 2nd ms5611 2016-12-05 15:27:11 +01:00
Daniel Agar 2c23c16b4f airframe metadata for vtol standard delta and AAERT 2016-12-05 10:26:17 +01:00
Mark Whitehorn 3294d839d6 add airframe metadata 2016-12-05 10:25:54 +01:00
Daniel Agar 2f962a986b PX4IO add IMU heater to status 2016-12-05 10:23:46 +01:00
Daniel Agar 1a1b8f69ac PX4IO add page setup case for thermal 2016-12-05 10:23:46 +01:00
Lorenz Meier 1b19b78c2b ROMFS: Enable thermal control (set to off) for Pixhawk 2 2016-12-05 10:23:46 +01:00
Lorenz Meier b229dd891f Senssors app: Introduce thermal setting 2016-12-05 10:23:46 +01:00
Lorenz Meier 3166aeb8a4 PX4IO driver: Enable thermal control 2016-12-05 10:23:46 +01:00
Lorenz Meier 9f14ace0fa IO: Allow control of the blue led state as function of a Pixhawk 2.1 heater 2016-12-05 10:23:46 +01:00
James Goppert 4b6a11161e Fixes for sitl gazebo ground truth. (#5932)
* Fixes for sitl gazebo ground truth.

* Switch ekf2 to new logging module for sitl.
2016-12-03 11:40:53 -05:00
Dennis Shtatnov d71645b321 CF2 Update to EKF2 2016-12-03 17:02:16 +01:00
Andreas Antener 64657900de SITL CI: use tagged docker image instead of latest 2016-12-03 09:42:54 +01:00
Lorenz Meier 899fb8d3c5 Aero: Add integrator gains for attitude control 2016-12-02 23:39:30 +01:00
Andreas Antener ef495d26b8 Airspeed calibration: wait on filter before preflight check 2016-12-02 22:56:48 +01:00
Andreas Antener e9737d6f7a Preflight checks: made sure pre-flight check results are always reported first thing on the console and always on new or re-established telemetry links AFTER waiting for the hotplug timeout
(leads to double publishing on the console when a new link is established, but this is the best compromise between fixing and completely restructuring)
2016-12-02 22:56:48 +01:00
Andreas Antener c069264752 Preflight check: initialize VTOL flag before it is used 2016-12-02 22:56:48 +01:00
Andreas Antener b531e65f6a Airspeed check: updated message and explained test parameters 2016-12-02 22:56:48 +01:00
Andreas Antener f772fc2d02 Airspeed: preflight check for bad offset, fixed calls to preflight checks (vtol & airspeed) 2016-12-02 22:56:48 +01:00
Julian Oes f092b31f54 Update cmake_hexagon and DriverFramework
This update is needed after changes in
https://github.com/ATLFlight/cross_toolchain/pull/10.
2016-12-02 21:18:18 +01:00
Lorenz Meier c53d828e09 Set EKF2 as default estimator 2016-12-02 21:13:34 +01:00
Lorenz Meier 654c7d2d16 Remove unused system command for FMUv2 config and re-enable MPU9250 driver 2016-12-02 20:58:38 +01:00
bharathr fee75c61a1 Added PX4 sanity test script for Snapdragon Flight 2016-12-02 18:49:30 +01:00
Julian Oes e416a8cb83 mc_pos_control: fix takeoff bug
This resolves a bug where a takeoff would go sideways instead of
straight up. What happened was that the position setpoint got shifted
around even though there was actually no real setpoint set but only a
setpoint of type IDLE. This then lead to a position setpoint far away
from the takeoff point and therefore scary takeoffs.

This fix prevents the part of the position controller which
moves/integrates the position setpoint from running in the case of an
idle setpoint.

This bug could be reproduced by switching the vehicle to mission mode
without a valid mission, then switch to hold mode, and then send the arm
and takeoff command.
2016-12-02 17:34:00 +01:00
Michael Schaeuble b982dca45a Add comments to clarify the BMI160 related changes 2016-12-02 12:40:12 +01:00
Michael Schaeuble 10867131fa Bring up BMI160 for px4fmu-v4 targets 2016-12-02 12:40:12 +01:00
José Roberto de Souza 126172d70c Aerofc: px4fmu_common: Only set AUTOSTART to 4070 if nothing was set
This way user can set aftwards any other AUTOSTART value and it will
not be overwritten.
Also move the block up and set SYS_AUTOCONFIG, this way if air frame
configuration was reset in ground station it will wipe the parameters
before load new ones.
2016-12-01 07:52:23 +01:00
José Roberto de Souza 9bb77adbec Aerofc: Fix and add more information about flash sectors 2016-12-01 07:52:23 +01:00
Beat Küng b020be13f6 flashparams: fix memory leak when saving parameters
A large buffer on the heap was not deallocated when parameters were saved,
but there were no changes to the parameters. In that case
parameter_flashfs_write() was not called, which was previously responsible
for freeing the buffer.

This patch moves the responsibility of freeing the buffer to the calling
side, which already explicitly allocates the buffer.
2016-11-29 10:38:11 +01:00
Mark Whitehorn a0796c6847 add tests to auavx21 config 2016-11-29 08:03:23 +01:00
Daniel Agar e0a9793347 mavlink doesn't have already published message
- if the land detector started before the mavlink module it won't have
   a valid message vehicle_land_detected message until published again
2016-11-29 00:49:57 -05:00
David Sidrane abc79faf3b Chip Slect fixes for the ICM_20608_G
The mapping of PX4_SPIDEV_ACCEL_MAG to PX4_SPIDEV_ICM is not
   a clean approach and the PX4_SPIDEV_MPU is already used by the
   mpu9250 leaving the only (and the correct) option to the use
   PX4_SPIDEV_ICM and make it map to the reused ACCEL_MAG_CS PC15
   as 206080D_CS
2016-11-28 21:02:23 +01:00
Julian Oes 0109f6f549 update mavlink to master, rename MOUNT_STATUS
The mavlink message MOUNT_STATUS has been renamed to MOUNT_ORIENTATION.

This changes the Firmware code accordingly.
2016-11-28 21:01:22 +01:00
Lucas De Marchi 780e903d5b aerofc: load autostart on first boot 2016-11-28 09:21:12 +01:00
Lucas De Marchi 2fb09b7978 Add AUTOCNF to Intel Aero RTF
Thanks to Beat Küng for improved tuning.
2016-11-28 09:21:12 +01:00
Lucas De Marchi f51595ab16 Fix setting output mode in the wrong place
Make it common with other boards
2016-11-28 09:21:12 +01:00
Lucas De Marchi 8fe765c3aa Change drone name
This is the file to set things related to the Intel Aero RTF.
2016-11-28 09:21:12 +01:00
José Roberto de Souza 9befff1e79 aerofc: Add information about the flash usage 2016-11-28 09:21:12 +01:00
José Roberto de Souza 621a0fe492 aerofc: Enable IST8310 2016-11-28 09:21:12 +01:00
José Roberto de Souza 8fb15f1de8 aerofc: Enable I2C1 for external compass
For now it is only checking if there is a external HMC5883, if
necessary more compass should be added and probe.
2016-11-28 09:21:12 +01:00
José Roberto de Souza c49c3f469e aerofc: add upload command
AeroFC is updated by Aero board using the UART between AeroFC
and Aero board.

This script will copy firmware and px_uploader.py to Aero board and run
px_uploader.py with the correct paremeters. User only needs to have a
network connection (Ethernet over USB or WiFi) with Aero board to update
AeroFC firmware. The IP/hostname can be given by AERO_HOSTNAME
environment variable.
2016-11-28 09:21:12 +01:00
Lucas De Marchi 6af31a109f aerofc: start mavlink on ttyS4 2016-11-28 09:21:12 +01:00
Lucas De Marchi 4989f8d40a aerofc: start mavlink to communicate with Aero Compute Board 2016-11-28 09:21:12 +01:00
José Roberto de Souza 508c782bab mavlink: Add support for high speed baudrates 2016-11-28 09:21:12 +01:00
Lucas De Marchi 1360c26c62 romfs: allow to use another uart for companion
Right now it's only possible to use ttyS2 as the UART for connecting a
companion computer. Add a variable that can be set so other boards may
be better supported.
2016-11-28 09:21:12 +01:00
José Roberto de Souza 4943437327 aerofc: Set sensors rotation 2016-11-28 09:21:12 +01:00
José Roberto de Souza 873901c7cd aerofc: Sleep for some time to wait tap_esc startup
Or mixer load will fail
2016-11-28 09:21:12 +01:00
José Roberto de Souza 8f0322b8aa aerofc: Dirty hack to start mixer with the correctly output device 2016-11-28 09:21:12 +01:00
Lucas De Marchi 66628a4cf1 aerofc: forbid gpio changes
We export an "empty" table, but there's no protection when doing
ioctl().
2016-11-28 09:21:12 +01:00
Lucas De Marchi fdb5a92873 aerofc: make sure we don't have IO enabled 2016-11-28 09:21:12 +01:00
Lucas De Marchi f5c65cf206 aerofc: disable mixer aux 2016-11-28 09:21:12 +01:00
Lucas De Marchi 99bb7be10f aerofc: leave OUTPUT_MODE as rcin
So it just does rcin and does not try to do the other initializations.
2016-11-28 09:21:12 +01:00
Lucas De Marchi 3b3d4f385c aerofc: fix UART port assignments 2016-11-28 09:21:12 +01:00
Lucas De Marchi 1eadee19c3 aerofc: Fix for ms5611 init 2016-11-28 09:21:12 +01:00
James Goppert 893714dc6a aerofc: Fixes for init 2016-11-28 09:21:12 +01:00
José Roberto de Souza 15c75ebb40 aerofc: Add autostart script
As ASC use a non-standard UART for mavlink it is necessary check for
the board name and set SYS_AUTOSTART to initialize mavlink on the
right interface otherwise there is no way to change the SYS_AUTOSTART.
2016-11-28 09:21:12 +01:00
José Roberto de Souza effdb37a2b aerofc: Fix UARTs configuration
Correct set pin mux and removed unused interfaces.
2016-11-28 09:21:12 +01:00
Lucas De Marchi ce8a7f6bdc aerofc: fix comment regarding hrt 2016-11-28 09:21:12 +01:00
Lucas De Marchi 1aea9457a9 aerofc: remove usb sensing 2016-11-28 09:21:12 +01:00
José Roberto de Souza 51f85858f2 aerofc: Power on sensors
MPU6500, MS5611 and HMC5883 only power on when GPIO_SENSORS_POWER is
set.
2016-11-28 09:21:12 +01:00
José Roberto de Souza 7ced5a1b6f aerofc: Remove unused GPIO configuration 2016-11-28 09:21:12 +01:00
José Roberto de Souza 0f9ad1c393 aerofc: Remove remaining code and macros of RGBLed 2016-11-28 09:21:12 +01:00
José Roberto de Souza 8788e2e81e aerofc: Remove ADC configuration
Battery voltage and current will be read in another way in future.
2016-11-28 09:21:12 +01:00
Lucas De Marchi 007731df46 aerofc: use center LED for activity
Like in bootloader, use the centered LED to show activity.
2016-11-28 09:21:12 +01:00
José Roberto de Souza e690af14d8 aerofc: fix I2C bus of MS5611 and HMC5883 2016-11-28 09:21:12 +01:00
José Roberto de Souza ef7c3b2174 aerofc: Fix SPI configuration
SPI bus 1 is the bus connected to MPU6500, so remove SPI bus 3 and 4.
Also remove everything else related to SPI that this board doesn't have.
2016-11-28 09:21:12 +01:00
José Roberto de Souza a1eec553dc aerofc: Remove unused modules 2016-11-28 09:21:12 +01:00
Lucas De Marchi cf07fa3a1c aerofc: streamline nuttx configuration
Remove what's not used like SPI and UART ports, ADC, etc. Add UART5 and
I2C1 that are going to be used.

This also received contribution from
José Roberto de Souza <jose.souza@intel.com>.
2016-11-28 09:21:12 +01:00
Lucas De Marchi 0cd7984b7f Rename asc board to aerofc 2016-11-28 09:21:12 +01:00
David Sidrane 4b90daf605 WIP:Using _PX4_ wildcard match - needs testing 2016-11-28 09:18:45 +01:00
David Sidrane 100f977b0c Added listener removed unconfigured drivers 2016-11-28 09:18:45 +01:00
David Sidrane c042f49fde System Changes for AUAV X2.1 2016-11-28 09:18:45 +01:00
David Sidrane 5b5076ae01 Added AUAV X2.1 sensor startup script 2016-11-28 09:18:45 +01:00
David Sidrane fb3e2665f3 Inital Commit AUAV X2.1 2016-11-28 09:18:45 +01:00
Lorenz Meier 70e597bd9a Update ECL to include fw controller limit improvements and side slip filter improvements 2016-11-27 16:08:53 +01:00
Julian Oes cf9945ecdc sitl_run.sh: env variable NO_PXH for deamon mode
This allows to set the environment variable NO_PXH to start SITL without
the interactive pxh> shell. For this, px4 is called with the -d arg
which sets it to deamon mode.

This feature is handy to script sitl_run.sh.
2016-11-25 17:51:50 +01:00
Beat Küng 707666488e RPi px4_fw.config: use AERT mixer file & fix fw_pos_control_l1 start 2016-11-24 14:57:52 +01:00
Beat Küng fdc489358a RPi startup scripts: start logger 2016-11-24 14:43:45 +01:00
Beat Küng 0a0f268407 RPi: improve upload script, upload mixer files & all startup scripts 2016-11-24 14:43:45 +01:00
Beat Küng 6680af0d96 navio_sysfs_pwm_out: use quad_x.main.mix as default mixer file
Most people will use a quad, not FW.
2016-11-24 14:43:45 +01:00
Beat Küng 9230f419e5 DriverFramework: update submodule 2016-11-24 14:43:22 +01:00
lhc610github f559b6ca88 df_lsm9ds1_wrapper: apply calibration after rotation 2016-11-24 14:39:23 +01:00
Julian Oes afd6fd3896 px4fmu-v2_default: save more flash
This disables the following modules to save flash:
- mpu9250 driver because the MPU9250 is rarely used on Pixhawks
- Snapdragon RC PWM passthrough which is rarely used and definitely a
  special/custom configuration. Also, it will soon be obsolete with the
  upcoming PWM support on Snapdragon.
2016-11-23 12:49:15 +01:00
Julian Oes 109558cf1f cmake: fix git binary hash
The generated binary hash was off by one.
2016-11-23 12:42:06 +01:00
Julian Oes 43caf2b683 Revert "mavlink: copy chars of git hash instead of binary"
Pushed by accident.
This reverts commit 87f0ec19e4.
2016-11-23 10:57:05 +01:00
Julian Oes 87f0ec19e4 mavlink: copy chars of git hash instead of binary
I could not figure out how to make sense out of the binary git data.
Therefore, I replaced the px4_git_version_binary with the first 8 bytes
of px4_git_version (char[]) and this is easily readable when it arrives
on the other side.
2016-11-23 10:48:17 +01:00
Roman f8f12ee265 vtol_att_control: removed unnecessary pointers to derived classes
- we interface over the base class pointer so we don't need any pointers
to the derived classes of VtolType

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-22 10:05:53 +01:00
Roman d77547e7e1 vtol_attitude_control: hotfix, do not update parameters on every iteration
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-22 10:05:53 +01:00
Roman 92a5db92a2 vtol_att_control: initialise pointers and free memory
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-22 10:05:53 +01:00
Julian Oes 7a698952fb cmake: use default Python version
If the Python versions are specified, this breaks the build on Ubuntu systems
where Python3 is also installed but the extensions such as python-empy
are not installed. One could, of course, install python3-empy to fix
this but that's not in the instructions or error messages and therefore
not straightforward.

It is therefore probably better to just use the system default which
ends up being 2.7 on Ubuntu.
2016-11-21 15:02:17 +01:00
devbharat 4ea72f35ed Disable resetting alt/pos setpoint flags if switching to position control from auto when very close to takeoff setpoint 2016-11-21 09:05:22 +01:00
devbharat dd1821b02e Reset alt/position when entring position control from auto 2016-11-21 09:05:22 +01:00
devbharat 59c1dd7183 Always check reset flags in auto. Only set reset flags to true when required. Do not limit hor/vert setpoint acceleration when setpoints are reset. 2016-11-21 09:05:22 +01:00
Julian Oes d720cbe189 cmake: Use Python3 if available
This brings support for Distros that use Python3 by default such as
Arch Linux.
2016-11-21 08:34:12 +01:00
Felix Hu fe9ffb824c Update README.md 2016-11-21 08:33:42 +01:00
Roman 912ed98a28 updated ecl 2016-11-21 07:29:21 +01:00
Roman a61b1e089c make sure to update the reset counters every time the topic updates
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman 9f57ee8564 updated ecl for updated gps reset logic
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman 76f862de33 fw_pos_control_l1: when doing a position reset just reset position controller
- do not try to shift the target waypoints when a reset occurs in position
control mode. Just make it lock into the current heading.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman 7ba49aeb80 fw_pos_control_l1: make TECS handle height ekf height resets properly
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman ae7f61b0bf tecs: added method to handle ekf height resets
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman 1e1bf7e4bb ekf2 reset: fix sign of delta altitude for global position topic
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman 8155044b40 fw_pos_control_l1: put comments for lat/lon wrapping
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman f80b4f8732 fw_pos_ctrl_l1: added wrapping of lat lon coordinate after addition of
delta reset

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman b3f9114b1c fw_pos_control_l1: added missing alitude reset counter update
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman d4c87d62f1 fixed code style
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
tumbili 0e481a5d00 ekf2: publish state reset information 2016-11-21 07:29:21 +01:00
tumbili b2410460a5 made position controllers handle estimator state resets 2016-11-21 07:29:21 +01:00
tumbili 937c5adfc0 added estimator reset data to global position topic 2016-11-21 07:29:21 +01:00
tumbili 0d7189c894 added position and velocity reset data to local position topic
Conflicts:
	msg/vehicle_local_position.msg
2016-11-21 07:29:21 +01:00
tumbili 89f81cb626 added attitude reset data to control state topic 2016-11-21 07:29:21 +01:00
Daniel Agar c17c8884d1 implement MAV_CMD_DO_LAND_START 2016-11-19 15:48:10 +01:00
Daniel Agar 6cdd188158 geofence max horz/vertical better messages 2016-11-19 15:16:00 +01:00
Daniel Agar c701085ed4 geofence fix code style 2016-11-19 15:16:00 +01:00
Daniel Agar 6f10f8de9a navigator begin fixing code style 2016-11-19 15:16:00 +01:00
Daniel Agar 9e589cef48 airspeed calibration fail with any errors 2016-11-19 15:15:36 +01:00
Daniel Agar 46a697787f log all raw diff pres and airspeed 2016-11-19 15:15:36 +01:00
Daniel Agar 0fa79eab5c add differential_pressure to airspeed logging 2016-11-19 15:15:36 +01:00
Anton Matosov 90c049d8ec Fix formatting 2016-11-19 15:14:46 +01:00
Anton Matosov cd40512505 Add mag2, acc2 and gyro2 sensors params to make sure backup/restore is reliable 2016-11-19 15:14:46 +01:00
Anton Matosov 96fc66ff7d Add force param_find for missing sensor parameters to fix load/save loss of calibration data 2016-11-19 15:14:46 +01:00
Anton Matosov e284a28e25 Fixed formatting 2016-11-19 15:14:18 +01:00
Anton Matosov 4edd12c44a Make PWM_RATE configurable via QGroundControl 2016-11-19 15:14:18 +01:00
Paul Riseborough 81dc20ea86 logger: add preflight sensor check messages 2016-11-19 15:12:08 +01:00
Beat Küng 9301e9cc50 logger params: add SDLOG_MODE to select when to start & stop logging 2016-11-19 15:12:08 +01:00
Paul Riseborough 983cfb8fdd commander: Add preflight checking for EKF health and IMU sensor consistency 2016-11-19 15:12:08 +01:00
Paul Riseborough 55bf6b4974 sensors: Calculate and publish pre-flight IMU sensor consistency metric
If a single sensor is fitted, the calculation is not performed and zero values are published.
If dual IMU's are fitted, the vector length difference between the primary IMU and the second sensor is output for the angular rates and accelerations. The vector difference is low pass filtered before the length is taken.
If three IMU's are fitted, the vector length is calculated for both alternative sensors and and the maximum values output.
Fourth and subsequent IMU's are ignored.
2016-11-19 15:12:08 +01:00
Paul Riseborough c07f7b5659 msg: Add topic for pre-flight sensor checks 2016-11-19 15:12:08 +01:00
Paul Riseborough 06aca33085 ekf2_replay: Add missing log messages 2016-11-19 15:11:45 +01:00
Dennis Shtatnov 2799c0fae2 Change MC_BAT_SCALE_EN to boolean 2016-11-19 14:55:52 +01:00
Dennis Shtatnov 37641042cc Explicit internal battery resistance params 2016-11-19 14:55:52 +01:00
Dennis Shtatnov a634c14582 Scale throttle outputs by battery level. Fixes #4751 2016-11-19 14:55:52 +01:00
Andreas Antener a94c8d7812 Log download: try to use file modification date for log list if it makes sense 2016-11-19 14:51:30 +01:00
Andreas Antener dd8d178168 MAVLink Streams: added collision stream 2016-11-19 14:46:20 +01:00
lovettchris 8a2399eee1 Fix multithreading bug in mavlink over serial port. 2016-11-19 00:24:15 +01:00
Andreas Antener 0eadf26d34 Log download: fix memory leak in generating the list 2016-11-18 16:27:47 +01:00
Lorenz Meier 1f0e630958 Update use of time stamp field 2016-11-17 09:38:56 +01:00
Lorenz Meier 616c5012da Update MAVLink submodules to latest 2016-11-17 09:38:56 +01:00
Lorenz Meier 8ebc846ae7 Simulator: Do not open hardware UART in SITL 2016-11-17 09:11:58 +01:00
Lorenz Meier b83363a518 UAVCAN: Always enable dynamic node ID allocation 2016-11-16 10:56:08 +01:00
Paul Riseborough 9ff1feb92f ekf2: fix formatting 2016-11-15 23:58:05 +01:00
Paul Riseborough 056ac3c9c6 EKF: Update default value for sideslip fusion noise
Use value obtained from tuning on replay logs
2016-11-15 23:58:05 +01:00
Paul Riseborough 680a8f0b44 ekf2: fix rebase compile errors 2016-11-15 23:58:05 +01:00
CarlOlsson 72ad6627e1 updated beta noise
Conflicts:
	src/modules/ekf2/ekf2_params.c
2016-11-15 23:58:05 +01:00
CarlOlsson 5435b99f86 added beta innovations to ekf_innovations 2016-11-15 23:58:05 +01:00
CarlOlsson e4f5710ec3 added logic for beta fusion 2016-11-15 23:58:05 +01:00
CarlOlsson f00f6e6eff added parameter for when to fuse sideslip 2016-11-15 23:58:05 +01:00
CarlOlsson 1223e4ba6b added beta to replay 2016-11-15 23:58:05 +01:00
CarlOlsson 106c882cea modified logging 2016-11-15 23:58:05 +01:00
CarlOlsson d550290e63 modified ekf2_main.cpp 2016-11-15 23:58:05 +01:00
Anton Matosov 0734db1740 Ignore all CLion related files as they are all generated from cmake 2016-11-15 11:10:22 +01:00
Anton Matosov 3414fc1c7c Setup default CLion ignores 2016-11-15 11:10:22 +01:00
Julian Oes 25d1daa7a5 px4fmu-v1: Raise INTERRUPTSTACK again
This fixes #5855.
2016-11-15 08:10:40 +01:00
Julian Oes 53c23e7bff Revert "Revert "FMUv1: Save resources in config""
This reverts commit 0ca397ab20.
2016-11-15 08:10:40 +01:00
Lorenz Meier 0ca397ab20 Revert "FMUv1: Save resources in config"
This reverts commit c24046ca5b.
2016-11-14 22:37:01 +01:00
Beat Küng 2f19aebac0 mavlink_ulog_streaming: always send an ack (#5853)
Fixes the case where an ack got lost and the FMU resends the data, but
the client does not resend the ack.
2016-11-14 17:06:21 +01:00
Roman 896118281c TECS: remove logic which shifts or limits integrator during large transients
- during large transients in pitch demand the pitch integrator value
was shifted such that the final demanded pitch did not violate given
limits. Since this strategy can cause large knock-backs of the pitch
integrator we remove this logic completely. We already have logic in place
which reduces the integrator at the pitch time constant in case the
pitch limits are exceeded so we don't need to limit it further. This
has the advantage that spikes in the specific energy balance error
signal does not lead to integrator knock-back.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Paul Riseborough 9221c74e46 tecs: improvements to pitch integration limiting
Constrain the specific energy balance integrator input to prevent increasing saturation of pitch demand.
Decay the specific energy balance integrator state if the pitch demand is saturated to reduce saturation to zero and do so at the same tome constant as the control loop
Relax the clipping threshold on the specific energy balance integrator to allow the input constraint and decay functions to do more of the work
Improve variable naming and commenting
2016-11-14 22:43:33 +11:00
Roman 7106881cbc tecs: fix limiting of pitch integrator input, better comments and structure
- when limiting the pitch integrator input the value was related to
a quantity with different units (specific energy error rate vs delta pitch)
- once the unconstrained pitch demand is larger / smaller than the max/min
allowed pitch angle the integrator input should only be allowed to drag
the integrator into the direction leading to less pitch demand violation

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Roman 12ddf9d25e TECS: better handling of the constraint for the pitch integrator
- if the specific energy balance correction term produced a demanded
pitch value which exceeded the aircraft pitch limits then the pitch
integrator was shifted such that the pitch demand violation was prevented.
However, this meant that the exceeding pitch was just unloaded into the
integrator and caused unexpected behavior of the pitch loop.
In an underspeed condition e.g. this has lead to the plane pulling up it's
nose very quickly shorty after the underspeed condition kicked in.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Roman eec55a0918 TECS: run underspeed detection method before calculating speed demand
- the method in TECS for detecting an underspeed condition was run after
the method which calculated the airspeed demand. As a result the specific
engergy balance error signal showed a spike when TECS detected an underspeed
condition.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Beat Küng dc6ca7c372 VDev & CDev: dynamically allocate & resize _pollset array
In most cases, really only 1 element is needed. The dynamic allocation
handles cases where more are necessary. This is all done within a locked
state, so no races can occur.

Frees roughly 2.3KB RAM.
2016-11-14 10:27:57 +01:00
Beat Küng 14fd1b8693 ulog_stream_ack.msg: lower timeout & increase max retries
We expect a short round-trip time, so lowering the retry timeout will
increase throughput on links with high drop rate.
2016-11-14 10:27:57 +01:00
Beat Küng d54e22614f fix mavlink ulog: return if initial ack not yet received
Avoid sending data before we have an ack from the logger.
2016-11-14 10:27:57 +01:00
Carlo Wood a96ee50442 Stop people from using broken awk. 2016-11-13 19:36:27 +01:00
Carlo Wood 0fbf26e955 Add Tools/fix_headers.sh
Running this script will parse the top of all source files
that are not submodules, examples or test cases, to find
all #include's and then do basically two things:

1) Reorder and group the headers so that px4_* headers are
   included first, then local headers (headers of the project
   that aren't submodules) then C++ headers if any, then C
   headers if any, then system headers (which includes submodules)
   and finally any #includes that are inside #if*...#endif
   constructs.
2) Fix the use of "" or <> in a consistent manner.

Afterwards few fixes might be necessary for compile errors that
pop up. Most of those are already fixed in my previous commits.
However, I was not able to test a compilation for ros
(with __PX4_ROS defined) -- so some more fixes might be necessary
because of the header reordering.

The script comes with a progress counter and an error summary
(if any) at the end (so no scrolling back is necessary).
It is highly recommended to only run this script in a clean
project with no outstanding changes that need to be committed.
In fact, the script enforces this (unless you pass --force).
Reverting a run of the script is then easy with 'git checkout .'.

It is also possible to run the script on a single file
by passing that on the command line. In that case it
might make sense to pass --debug too, though that was really
meant for just me, while developing the script. This will write
debug output into the file that is passed, so you don't
want to commit that! ;)
2016-11-13 19:36:27 +01:00
Carlo Wood de85fbe1dc Remaining fixes needed before running Tools/fix_headers.sh
<systemlib/err.h> --> "systemlib/err.h" that fix_headers.sh
would miss because it comes after code it doesn't understand.

Effectively remove the '__EXPORT extern perf_counter_t perf_alloc('
line, because currently perf_alloc is defined to be NULL, and
after running fix_headers.sh that happens *before* this header
is included (the order of headers will be changed).

Do not define NULL to be (void*)0: that only works for C.
In fact, the conversions needed for NULL are so full of exceptions
that standard C++ introduced a new *keyword*: nullptr.
That's what we really should be using for C++ code.
In this case I just include the correct header to define NULL
the correct way.

Not really related to the header line:
Removed an #include <time.h> because I noted that px4_time.h
was already included... and moved a #include <sys/time.h>
to the top of the file (not really a fan of including headers
in the middle unless absolutely necessary).
Removed a include of queue.h because I noted it wasn't used.
2016-11-13 19:36:27 +01:00
Carlo Wood ebeb187522 Move #pragma once outside #ifdef's.
In this particular case it does no harm,
but since in other cases it can lead to
problems I didn't want to add an exception
for this case to fix_headers.sh, that currently
chokes on this because it doesn't know better
than that it's a bad thing.

Note on how #pragma once works: when encountered
(aka the #ifdef that it is inside has to
be true), the compiler marks the whole
file as "seen" (this is implementation
defined, but most implementations store
the inode of the file). Subsequent #include's
of that file/inode are then completely skipped.
Hence it doesn't matter if the #pragma is at
the beginning, at the end or in the middle,
but it should be encountered every #include,
usually, and thus not be inside an #if... #endif
construct.
2016-11-13 19:36:27 +01:00
Carlo Wood 04aa2bb3a4 Add missing header files.
These headers files were missing from the header files that
I added them to; the fact that they were missing didn't
lead to compile errors because by coincidence the missing
headers are included in the source files before including
these headers. But, after the reordering of header inclusions
by Tools/fix_headers.sh, these cases will give rise to compiler
errors.
2016-11-13 19:36:27 +01:00
Lorenz Meier 86c581b2ef Enable usage of UAVCAN node ID for params 2016-11-13 18:43:15 +01:00
Lorenz Meier 9866ff8959 Allow sending a param with a different component ID 2016-11-13 18:43:15 +01:00
Benoit3 83e9e1c382 The goal of this patch is to allow compatibility with GR12/GR16/GR24 graupner receiver by :
- allowing decoding of SUMD frame with failsafe bit set
- updating stack failsafe state with the sumd failsafe info

Refer to #5817 issue
2016-11-12 14:28:57 +01:00
Michael Schäuble 697d401b73 Fix boot process on Pixhawk 2 (#5844)
* Pixhawk2: Check for mpu9250 during boot

* Fix indentation style
2016-11-12 12:57:33 +01:00
Mark Whitehorn 77a23a043f use include statement instead of symbolic link 2016-11-11 09:50:42 +01:00
Mark Whitehorn 92ae763535 change board_config to symbolic link 2016-11-11 09:50:42 +01:00
Mark Whitehorn 40f2c4a8e4 add new board config for fmu-v3 2016-11-11 09:50:42 +01:00
Paul Riseborough bdec646736 ekf2_replay: Display RMS innovation values to assist with tuning
Displaying the RMS innovation values at the end of each replay assets with rapid iteration for time delay parameter tuning without having to plot or post process using another tool.
2016-11-11 08:51:12 +01:00
Julian Oes ab76a37910 DriverFramework: update of cmake_hexagon 2016-11-10 07:56:28 +01:00
Mark Charlebois 47c14395d3 Updated cmake_hexagon for Semaphore CI fix
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-11-10 07:56:28 +01:00
Julian Oes 6bdca1053c Next cmake_hexagon in Firmware and DriverFramework 2016-11-10 07:56:28 +01:00
Julian Oes 88e81aa58e cmake_hexagon: rpcmem and linking fix
This updates cmake_hexagon and cmake_hexagon inside DriverFramework
which fixes somethine about rpcmem.a and the double linking issue.
2016-11-10 07:56:28 +01:00
James Goppert 068ef591ab Added fake landing xy velocity measurement to lpe. (#5820)
Flight tested and is working.
2016-11-09 19:40:25 -05:00
James Goppert 4d6d0b2850 Fix px4io bind failed message to say safet is off instead of armed. (#5834)
Minor message clarity fix.
2016-11-09 19:39:39 -05:00
James Goppert 3511f8abfb Add position ground truth. (#5819)
Have confirmed this works with gazebo sitl.
2016-11-09 19:38:38 -05:00
Julian Oes d1d47c4c27 mavlink: send MOUNT_STATUS msg if subscribed
This adds the message MOUNT_STATUS to report about the attitude of a
gimbal.
2016-11-09 10:23:34 +01:00
Julian Oes 18d69698a0 vmount: publish mount_status
We need feedback in mavlink about the attitude of the gimbal. Therefore
the gimbal output angles are published in vmount.
2016-11-09 10:23:34 +01:00
Julian Oes 7e312f3961 msg: Added message for mount status 2016-11-09 10:23:34 +01:00
Julian Oes 8ddda0a8fa mavlink: move the msg id from uint8_t to uint16_t
With mavlink2 new messages are added with msg IDs greated than 255.
Therefore the msg ID types needed to be raised everywhere.
2016-11-09 10:23:34 +01:00
Julian Oes 278d63eef6 mavlink: update both submodule to lastest master 2016-11-09 10:23:34 +01:00
Julian Oes 7df11b900d mavlink: use queueing for acks 2016-11-09 08:50:13 +01:00
Julian Oes d0b1983784 mavlink: send NACK if msg ID does not exist 2016-11-09 08:50:13 +01:00
Julian Oes 1e617f362d mavlink: send ACK for CMD_SET_MESSAGE_INTERVAL
There was no feedback if a CMD_SET_MESSAGE_INTERVAL went through or not.
2016-11-09 08:50:13 +01:00
Beat Küng 643ccd66b6 MavlinkParametersManager: output deprecation warning if INAV is selected 2016-11-08 11:17:07 +01:00
Beat Küng d32d250a50 px4fmu-v2_test.cmake: remove inav 2016-11-08 11:17:07 +01:00
Beat Küng 66ffc834d3 startup scripts: remove INAV, start LPE if INAV selected 2016-11-08 11:17:07 +01:00
Paul Riseborough 246dc5421b ekf2: remove unnecessary variables found during review 2016-11-08 11:17:07 +01:00
Paul Riseborough d19a62a8f6 px4fmu-v1: Remove INAV to free required flash space 2016-11-08 11:17:07 +01:00
Paul Riseborough d75600b8a4 px4fmu-v2: Remove INAV to free required flash space 2016-11-08 11:17:07 +01:00
Paul Riseborough 0ee75dbc6b ekf2: Allow adjustment of min arrival time delta parameter 2016-11-08 11:17:07 +01:00
Paul Riseborough 08a380ae2d ecl: update library reference
Enables optimum setting of sensor data buffer lengths using specified data delays and min arrival interval.
2016-11-08 11:17:07 +01:00
Paul Riseborough 5ac73f3440 ekf2: code style fixes 2016-11-08 11:17:07 +01:00
Paul Riseborough 699edd2535 ekf2: Prevent loss of baro data due to buffer time arrival checks
Baro data arriving too soon after the last measurement due to a high sampling rate or timing jitter is rejected inside the ecl EKF to prevent the data buffer overflowing.
This patch checks the timestamp difference from the last measurement, and if to small, the data is accumulated and the average sent to the EKF when the time delta
is acceptable.
2016-11-08 11:17:07 +01:00
Paul Riseborough ef7ed97cbd ekf2: Don't send un-usable mag and baro data to the EKF
Fixes:

1) Invalid data with a zero time stamp could be the EKF ends up in the data buffers and result in loss of 'good' data from the buffers

2) Magnetometer data was arriving at a rate faster than the data buffers could handle resulting in loss of data.
2016-11-08 11:17:07 +01:00
Paul Riseborough 7d0d29f62d ekf2_replay: fix time stamping bug
If the replay data for the baro or mag data has a zero time stamp, then the corresponding relative timestamp published over the combined sensor topic must be se to RELATIVE_TIMESTAMP_INVALID so that the ekf2 module does not try to use this data.
2016-11-08 11:17:07 +01:00
Lorenz Meier 7be71459f5 Offboard control (#5816)
* Fix jmavsim HITL simulation of MAV_CMD_DO_REPOSITION in the case where you have no radio attached to the PX4 and so you have disabled RC link loss for that reason (set NAV_RCL_ACT = 0) but you still want the jmavsimulation to work.  The line of code changed here causes failsafe RTL to kick in without this fix.

* Add altitude hold option using Z position control, while doing velocity control on vx and vy.

* Fix style and rebase issues
2016-11-07 12:09:41 +01:00
Michal Stasiak 9180268a17 Geofence: Param update fix (#5812) 2016-11-06 14:31:59 -05:00
Daniel Agar 8ac4dd04ae implement MAV_CMD_MISSION_START 2016-11-06 15:24:34 +01:00
Beat Küng 223595e978 ecl: update submodule to master 2016-11-06 14:48:20 +01:00
Beat Küng d1a3261e81 ekf2_main: reduce stack (according to the reductions in the commit before) 2016-11-06 14:48:20 +01:00
Beat Küng 5bcfa3c7e6 ekf2_main: add {} to limit variable scope and save stack
Reformatting makes it look worse than it is, but it really only adds {}
2016-11-06 14:48:20 +01:00
Beat Küng f7e3e46a92 config command: fix device commands like 'config /dev/accel0 block' 2016-11-06 14:48:20 +01:00
Beat Küng cc27d2a1e0 ekf2_main: move subscriptions into main thread & call orb_unsubscribe at the end 2016-11-06 14:48:20 +01:00
Beat Küng 53cf27eb84 ekf2_main: some cleanup of redundant fields 2016-11-06 14:48:20 +01:00
Beat Küng 85cee9460f sensors: use only as many voters as there are sensors
This saves ~1.1KB of RAM for systems with only 1 sensor of each type.

If there are more sensors, they will be dynamically added, such that
failover still works.
2016-11-06 14:48:20 +01:00
Beat Küng 0f2b31b41e uorb: inline orb_advertise (directly calls orb_advertise_multi)
reduces the stack depth
2016-11-06 14:48:20 +01:00
Henry Zhang 309c256e9e fix param interface (#5797)
* param: fix bug when param value is changed to 'zero' for the first time, it won't be saved.

* param: revert incorrectly removed code.
2016-11-06 14:45:17 +01:00
Julian Oes 53e0bc5f12 POSIX: use up to 20 command line arguments
This fixes the case where more than 10 args were needed for instance
when starting mavlink with all its options.
2016-11-05 14:20:17 +01:00
Lorenz Meier bae8adc1a8 Update README.md
Add GitHub links to maintenance team list.
2016-11-05 11:43:09 +01:00
Lorenz Meier f44ab6f05d Update README.md
Listing existing maintainers explicitly.
2016-11-05 11:34:38 +01:00
Michal Stasiak 2bfac7ff4f Mission feasibility: Geofence check fix
Current implementation checks against geofence only if it is in polygon form.
When it's created via params, it accepts all the waypoints as the number of vertices = 0.
Thus, changed the function to the one that is used to check whether geofence is breached in flight.
2016-11-05 11:07:23 +01:00
Dennis Shtatnov bf9a1c5a18 Removing alternative io timer rate for CF2 2016-11-05 11:06:43 +01:00
David Sidrane 2d451991af PX4 System change to Remove #ifdefs from the IO timers
Update the comment, to explain how to achive a different perescale
   value.

   Added PX4_IO_TIMER_ALTERNATE_RATE one board agnostic ifdef
   PX4_IO_TIMER_ALTERNATE_RATE that is non board specific.

   N.B.  I would like to eliminate PX4_IO_TIMER_ALTERNATE_RATE
   as well, but I need crazyflie HW to validate that the startup
   script can just set the rate on the PWM to 3921 fast enough to
   not effect the motors.
2016-11-05 11:06:43 +01:00
David Sidrane b2b9a0be9f PX4 System change to allow way to override the PWM_.*_{MIN|MAX} values
Add PX4_PWM_ALTERNATE_RANGES in suport of a board agnostic way
 to override the PWM_.*_{MIN|MAX} values
2016-11-05 11:06:43 +01:00
David Sidrane d77e107e31 Crazyflie uses the board common interface to provide board name
Removed #ifdef in version.h
2016-11-05 11:06:43 +01:00
David Sidrane ab43baa02d Clean up Crazyflie
1) Remove uneeded spi and reset code
   2) Use the Board commin for providing the BOARD_NAME
   3) Add PX4_PWM_ALTERNATE_RANGES in suport of a board agnostic
      way to override the PWM_.*_{MIN|MAX} values
   4) Remove #ifdefs from the IO timers*. Drive the config deltas
      from the crazyflie_timer_config.c and one board agnostic
      ifdef PX4_IO_TIMER_ALTERNATE_RATE that is non board specific

      *I would like to eliminate PX4_IO_TIMER_ALTERNATE_RATE
      as well, but I need HW to validate that the startup
      script can just set the rate on the PWM to 3921 fast
      enough to not effect the motors.
2016-11-05 11:06:43 +01:00
David Sidrane c4d91ef644 Removed CONFIG_STM32_I2CTIMEOTICKS defined in the PX4 I2C driver
CONFIG_STM32_I2CTIMEOTICKS is hard defined on PX4 master
 and defconfig defined on upstream Nuttx (nuttx_v3) it will be fixed
 there.
2016-11-05 11:06:43 +01:00
David Sidrane fd797ae3b4 Using build system warnings.
Aligned Make.Defs to use the build system's defined warnigns.
2016-11-05 11:06:43 +01:00
Mark Whitehorn 9603794b9d set verbose flag for Dcm.renormalize test 2016-11-05 11:05:25 +01:00
Mark Whitehorn 03beeb2e55 update matrix submodule 2016-11-05 11:05:25 +01:00
Mark Whitehorn fc73ab5e40 add unit test for Dcm.renormalize() 2016-11-05 11:05:25 +01:00
Daniel Agar a8369c6ac8 FW use loiter to achieve waypoint altitude
- fixes #5061
2016-11-05 10:30:36 +01:00
Sander Smeets 39cc75b4a0 Rebase of vtol_land_weathervane patch 2016-11-04 20:29:45 +01:00
Beat Küng 4bcf2cdb52 uavcan: fix initialization of std::array
in C++11, double braces are needed for std::array aggregate initialization,
or assignment with =.
see: http://en.cppreference.com/w/cpp/container/array
2016-11-04 16:41:13 +01:00
Carlo Wood 09d36a63ef Revert to using __builtin_isfinite for QuRT.
See discussion in https://github.com/PX4/Firmware/issues/5756
2016-11-04 16:40:45 +01:00
Beat Küng ab4d7dfc59 mavlink: stop ulog streaming when mavlink thread exits
'mavlink stop-all' during a log streaming session previously led to a
resource leak, and log streaming could only be re-started by rebooting the
system.
2016-11-04 11:08:06 +01:00
Beat Küng 587c5161a3 mavlink_{shell,ulog_streaming}.py: show full error output when pymavlink import fails 2016-11-04 11:08:06 +01:00
Beat Küng fa461d018d mavlink_{shell,ulog_streaming}.py: send heartbeat
This is helpful, so that a connected partner can switch from broadcasting
to a 'connected' state.
2016-11-04 11:08:06 +01:00
Mark Whitehorn 25be7aa7cf incorporate Bill Premerlani's fast rotation handling from MatrixPilot 2016-11-03 23:03:03 +01:00
Lorenz Meier 76082da674 Add IST8310 driver 2016-11-03 15:38:28 +01:00
Lucas De Marchi c5100b6273 tap_esc: fix output order for quadrotor 2016-11-03 15:38:09 +01:00
mantelt 8b237d7cf3 navio_sysfs_pwm_out: Adressing comments of @bkueng
(https://github.com/PX4/Firmware/pull/5704#pullrequestreview-6977559)
2016-11-03 12:37:41 +01:00
mantelt 10491884ca navio_sysfs_pwm_out: command line argument for mixerfile 2016-11-03 09:38:38 +01:00
mantelt 32403ddb90 navio_sysfs_pwm_out: removing default mixer 2016-11-03 08:59:58 +01:00
mantelt 6cbd398974 RPi/Navio: add rpi baseline config for fw 2016-11-02 17:45:31 +01:00
mantelt 4b8fc2365e navio_sysfs_pwm_out: Use mixer file
use all actuator groups for mixing.
2016-11-02 17:45:30 +01:00
mantelt 4c0c526898 Loading mixer from (hardcoded) file
use actuator_controls_3 for the time being
2016-11-02 17:45:30 +01:00
Daniel Agar cdd317ba38 commander arm check throttle include rattitude 2016-11-01 22:51:51 +01:00
CarlOlsson 93fb02bfa3 fw_att_ctrl: Code cleanup
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2016-10-31 15:17:14 +01:00
Beat Küng 00cd2902c7 fix logger: avoid leaking file descriptor in get_log_time()
orb_subscribe can succeed, but if there is no publisher, orb_copy will fail.
We still need to unsubscribe in that case.
2016-10-31 12:41:04 +01:00
Daniel Agar 2908f1c16d commander allow disarm command with throttle 2016-10-31 09:15:06 +01:00
Daniel Agar 27a50275b6 commander NAV_RETURN_TO_LAUNCH change mode to RTL 2016-10-30 21:41:43 +01:00
Carlo Wood 0bff3593d3 Do not use std::cout for qurt's sake.
Using cout drags in std::localeconv which isn't defined
on QURT. While this file is also used for POSIX, it doesn't
seem to harm much to use printf there as well.
2016-10-29 10:57:34 +02:00
Carlo Wood 52b8e75aea Export symbols init_app_map and list_builtins
See discussion at https://github.com/PX4/Firmware/issues/5756
2016-10-29 10:57:34 +02:00
Henry Zhang 278124bfb8 MindPX: Code clean up. 2016-10-29 10:56:32 +02:00
Henry Zhang b280e28623 MindPX: Remove hardcode for sensors rotation. 2016-10-29 10:56:32 +02:00
Henry Zhang f17dc2f2a6 MindPX: Code style and clean up. 2016-10-29 10:56:32 +02:00
Henry Zhang d6ed416d29 MindPX: Update spi bus and sensors io config. 2016-10-29 10:56:32 +02:00
Henry Zhang cabcc39816 MindPX: Expand to maximum 8 PWM outputs. 2016-10-29 10:56:32 +02:00
Henry Zhang 53b4996379 MindPX: Use TIM14 CH1 for tone alarm output. 2016-10-29 10:56:32 +02:00
Henry Zhang b76c8cd80c MindPX: Use i2c rgbled. 2016-10-29 10:56:32 +02:00
Henry Zhang 016aa47dfc MindPX: Enable FrkSky telemetry on usart8/ttys6. 2016-10-29 10:56:32 +02:00
Henry Zhang 2b23835d56 MindPX: Support RSSI. 2016-10-29 10:56:32 +02:00
Henry Zhang d8ac044414 MindPX: Support serial RC input. 2016-10-29 10:56:32 +02:00
Henry Zhang 5076ba0049 MindPX: Disable second CAN bus. 2016-10-29 10:56:32 +02:00
Henry Zhang 99ad8f464e MindPX: Update modules config. 2016-10-29 10:56:32 +02:00
Henry Zhang 93343487e7 MindPX: Harmonize with FMUv4. 2016-10-29 10:56:32 +02:00
Julian Oes c9f0d1e645 rcS: move check for PWM input up
pwm_input was not working correctly (only after a pwm_input reset) on
Pixracer because fmu was started on all PWM output channels.

This moves the check if PWM input is needed up before the fmu start.
2016-10-29 10:52:44 +02:00
Lorenz Meier b9cf679118 Update sitl_gazebo 2016-10-29 00:01:39 +02:00
Lorenz Meier b3e948d28c Update simulators 2016-10-29 00:00:33 +02:00
Julian Oes 62603bee45 simulation: SITL outputs from 0..1
Instead of sending actuator controls from -1..1 for SITL, we should send
0..1 like we already do for HIL. This will enable negative thrust in the
future, e.g. for pusher props that spin backwards, or for vehicles with
variable pitch propellers.
2016-10-28 23:56:46 +02:00
Julian Oes 0a043365ec rename gazebo_tailsitter to tailsitter
This is currently broken anyway but the new name makes more sense.
2016-10-28 23:56:46 +02:00
Carlo Wood 90f3e3b5d3 Do not include headers inside __BEGIN_DECLS ... __END_DECLS blocks.
We don't have C++ unsafe headers (anymore).

I added a test to fix_headers.sh that checks if certain "unsafe"
headers are ONLY included inside a __BEGIN_DECLS ... __END_DECLS
(because after all, they are unsafe), as well as checking that
no other header files are included inside such a block. The rationale
of the latter is that if a file is a C header and it declares
function prototypes (otherwise it doesn't matter) and is sometimes
included outside a __BEGIN_DECLS ... __END_DECLS block (from a C++
source file) then it has to be C++ safe and doesn't ever to be
included from inside such a block; while if a file is a C++ header
then obviously it should never be included from such a block.

fix_headers.sh subsequently found several safe headers to be
included from inside such a block, and those that were (apparently
in the past) unsafe were included only sometimes inside such a
block and often outside it. I had a look at those files and saw
that at least an attempt has been made to make them C++ safe,
but especially because they already are included OFTEN outside
a __BEGIN_DECLS ... __END_DECLS (from C++ source files) the
best decision seems to treat them as safe.

This is not risky: .c files that define such functions still
generate C-linkage for their functions. If a C++ unsafe C header
is included outside a __BEGIN_DECLS ... __END_DECLS block then
the only possible result would be an undefined reference to
a function with C++-linkage that will not exist. Aka, when
something links after this commit, then the commit was correct.
I did build all targets and they all linked.
2016-10-28 11:57:08 +02:00
Carlo Wood baf89f4398 Clean up of px4_defines.h (remove math.h)
This patch reorders px4_defines.h to make it more readable (I think)
but more importantly, cleans up the #include <math.h>/<cmath>
and [std::]isfinite stuff.

My main goal was to completely get rid of including math.h/cmath,
because that doesn't really belong in a header that is supposed to
define macro's and is included in almost every source file (if not
all).

I'm not sure what it did before ;) (pun intended), but now it does
the following:

PX4_ISFINITE is only used in C++ code (that was already the case,
but hereby is official; for C code just use 'isfinite()') and is
defined to be std::isfinite, except on __PX4_QURT because that uses
the HEXAGON toolset which (erroneously) defines isfinite as macro.

I would have liked to remove PX4_ISFINITE completely from the code
and just use std::isfinite whereever that is needed, but that would
have required changing the libecl submodule, and at the moment I'm
getting tired of changing submodules... so maybe something for the
future.

Also, all includes of <math.h> or <cmath> have been removed except
for __PX4_NUTTX. Like the HEXAGON toolset NuttX currently defines
isfinite as macro for C++. So, we could have solved this in the
same was as __P4_QURT; but since we can fix NuttX ourselves I chose
to add a kludge to px4_defines.h instead that fixes this problem,
until the time that NuttX can be fixed (again postponing changing
a submodule). The kludge still demands including <cmath>, thus.

After removal of the math header file, it needed to be included
in source files that actually need it, of course.

Finally, I had a look at the math macro's (like M_PI, M_PI_F,
M_DEG_TO_RAD etc). These are sometimes (erroneously) defined in
certain math.h header files (like both, hexagon and nuttx).
This is incorrect: neither the C nor the C++ standard defines
math constants (neither as macro nor otherwise). The "problem"
here was that px4_defines.h defined some of the M_*_F float
constants in terms of the M_* double constant, which are
sometimes not defined either thus. So, I cleaned this up by
defining the M_*_F math constants as float literals in px4_defines.h,
except when they are defined in math.h for that platform.
This means that math.h has to be always included when using those
constants, but well; not much difference there as those files
usually also need/use the macro NAN (which *is* a standard macro
defined by math.h).

Finally finally, DEFAULT_PARAM_FILE was removed as it isn't
used anymore.

All in all I think the resulting px4_defines.h is nice, giving me
much less the feeling of a nearly unmaintainable and over time
slowly growing collection of kludges and hacks.
2016-10-28 08:41:30 +02:00
Carlo Wood e29b9b5d39 Remove fake config targets.
The "targets" posix_rpi_common, qurt_sdflight_default and
posix_sdflight_default are not real targets; they are
just files in cmake/configs that are included by other
targets.
2016-10-28 08:40:23 +02:00
Erik Jähne ae2aeab5e4 HIL_STATE: publish control_state_msg when receive mavlink_hil_state_quaternion message 2016-10-28 08:38:18 +02:00
Carlo Wood 5b52cd0fe6 Compile fixes for old/unused targets.
These are some changes that I needed to compile
most of the unsupported targets.

After this all (make list_config_targets) compile
for me except: posix_eagle_muorb, posix_sdflight_default
and qurt_eagle_legacy_driver_default.
2016-10-26 14:00:52 +02:00
Andreas Antener 1999ed2601 Testing: use return value to check if controllib tests failed 2016-10-26 08:41:21 +02:00
Beat Küng a2c493efc7 fix vmount: initialize manual control for mavlink inputs 2016-10-26 08:40:23 +02:00
Paul Riseborough d37a927cdb ROMFS: enable use of px4flow sensor with pixracer 2016-10-25 20:31:46 +11:00
David Sidrane 7ae749090b Update NuttX submodule to use backport of ctype.h & cctype
This is the equivalent to Greg's upstream solution for ctype.h &
 cctype with the necessary shadow waning fix.
 It also deletes the Hack in pa4_defines.h
2016-10-25 08:39:09 +02:00
Mark Whitehorn 4cc97aa705 fix another bug in fmu mode 2016-10-24 18:22:18 +02:00
Beat Küng 95f5ba9635 fix mavlink_shell.py: python3 compat for octal numbers 2016-10-24 12:51:50 +02:00
Beat Küng cbbee30e48 log_writer_file: add include px4_posix.h (needed for stack size macro)
Failed with GCC 6.0.1, don't know why it worked before...
2016-10-24 10:22:48 +02:00
Beat Küng c8a79d2443 mc_pos_control_main: remove <functional> include
Avoid including <functional> which can cause problems on NuttX
2016-10-24 10:22:48 +02:00
Beat Küng 3029555016 uORBUtils: remove #include <string>
Avoid including <string> which can cause problems on NuttX
2016-10-24 10:22:48 +02:00
Beat Küng d0dace7c23 uavcan: use math::min instead of std::min
Avoid including <memory> which can cause problems on NuttX
2016-10-24 10:22:48 +02:00
Lorenz Meier f466913a32 Update MAVLink headers and adapter header to current master 2016-10-23 22:14:19 +02:00
Lorenz Meier f9abe39c3a DSM parser: Keep local copy of channel data 2016-10-23 19:58:52 +02:00
Lorenz Meier 3bed398a1e FMU: scan longer 2016-10-23 19:58:52 +02:00
Lorenz Meier 8d51e4ade1 MAVLink shell: Fix OS X default path 2016-10-23 17:46:22 +02:00
Lorenz Meier 05bc9acfb7 navigator: Wrap get time inside into function call and set time inside to zero
This ensures that the dual-use of the pitch_min / time_inside field is handled
properly between takeoff and non-takeoff items. Flight tested in SITL.
2016-10-23 16:26:03 +02:00
Lorenz Meier 5ddd69c872 Dataman: Make versioning define more explicit 2016-10-23 16:26:03 +02:00
Lorenz Meier c7cdef2a4b Clarify version flag for dataman 2016-10-23 16:26:03 +02:00
Lorenz Meier 0a4fedd778 Dataman: Use single method to infer file compatibility 2016-10-23 16:26:03 +02:00
Lorenz Meier 9e7d5f088e dataman: Ensure compat field is set and read correctly 2016-10-23 16:26:03 +02:00
Lorenz Meier ff0d7613b1 Add manual seed to dataman hash to allow later incrementing the seed number for incompatible changes 2016-10-23 16:26:03 +02:00
Lorenz Meier db774798fa Dataman: Store sizes of all containers and reset file if any of them changes. 2016-10-23 16:26:03 +02:00
Lorenz Meier c340974991 Ensure pitch min param is correctly handled 2016-10-23 16:26:03 +02:00
Lorenz Meier eaae1abdaf Simplify use of pitch_min 2016-10-23 16:26:03 +02:00
Lorenz Meier 9821499113 navigator / mission item: Compress fields into bitfield 2016-10-23 16:26:03 +02:00
Lorenz Meier 5899ce715d Navigator: Leverage overlapping fields in logic to save RAM by makeing them overlap in memory as well 2016-10-23 16:26:03 +02:00
Julian Oes 4160b65edb navigator: change default min takeoff alt to 2.5m
Fixedwing aircraft will override this with fw.defaults anyway.
2016-10-23 16:25:15 +02:00
Julian Oes 82f27884df navigator: fix wrong altitude after takeoff
This change fixes a wrong behaviour when a takeoff command is sent.

An example:
- MIS_TAKEOFF_ALT set to 10 meters
- Takeoff command with alt setpoint of 2 meters

Old behaviour:
1. Climb to 10 meters -> takeoff WP reached
2. Go to setpoint at 2 meters

New behaviour:
1. Climb to 10 meters and stay there but notify that altitude was
   overridden.
2016-10-23 16:25:15 +02:00
Julian Oes 032f4df3de mc_pos_control: revert gain change 2016-10-23 16:25:15 +02:00
Julian Oes dcd0df7d02 navigator: fix typo 2016-10-23 16:25:15 +02:00
Julian Oes 4f5fa50efb navigator: fix takeoff jump edge case
In the normal sitl `commander takeoff` case, the takeoff jump was never
actually carried out because the default altitude radius is set to 3m
and the takeoff altitude to ~2m which means that the takeoff waypoint is
"reached" immediately.

This works around this edge case by using the altitude between the home
altitude and takeoff altitude divided by 2 as a acceptance radius.
2016-10-23 16:25:15 +02:00
Julian Oes 72e46e7ed0 mc_pos_control: jump quicker
In SITL, it still takes a while until a vehicle lifts off, so it seems
sensible to raise this jump gain a bit.
2016-10-23 16:25:15 +02:00
Julian Oes ff415a4f1d mc_pos_control: correctly initialize landed state
Since orb_copy is guarded with a orb_check, we ended up not having the
corrent landed state in the beginning which could lead to some
unexpected behaviour on takeoff.
2016-10-23 16:25:15 +02:00
Pavel Kirienko 3a332bb11a Printing all online nodes within UAVCAN status output. This feature increased memory footprint by about 150 bytes. 2016-10-23 15:26:10 +02:00
Pavel Kirienko 9b0ab83f9b Fixed misuse of the preprocessor 2016-10-23 15:26:10 +02:00
Pavel Kirienko eff6a7b5d0 get_next_active_node_id() - starting from 0 2016-10-23 15:26:10 +02:00
Beat Küng 9448e0d673 vdev: remove wrong comment 2016-10-23 15:25:20 +02:00
Beat Küng f7d8612bc9 logger: enable all backends by default
This requires ~270B more RAM
2016-10-23 15:25:20 +02:00
Beat Küng 7c6d99d30f BlockParam: remove _extern_address and create a new class BlockParamExt for this
In most cases, _extern_address was unused, thus wasting cycles & RAM. This
adds a separate class BlockParamExt with the field and uses it in ekf2_main

Frees roughly 0.5KB of RAM on Pixracer
2016-10-23 15:25:20 +02:00
Beat Küng 09d8e4fd8c logger: reduce stack size, which got freed in 05a771152520
commit msg: 'logger: avoid uORB::Subscription, directly use orb_subscribe() instead'
2016-10-23 15:25:20 +02:00
Beat Küng 1bdad65849 uorb: reduce RAM usage by avoiding string copies
The lifetime of the string is guaranteed because we never delete
DeviceNode objects and the strings in question are already on the heap.

This frees roughly 2.2KB of RAM on Pixracer
2016-10-23 15:25:20 +02:00
Beat Küng 4da2ae2302 MavlinkOrbSubscription: optimize fields for size
reorder & reduce instance to uint8_t (which is more than enough).
Reduces sizeof(MavlinkOrbSubscription) from 40 to 24.

On Pixracer this frees almost 2KB of RAM
2016-10-23 15:25:20 +02:00
Beat Küng c50e4a6e21 uORB::DeviceNode: reduce the size of some members
The limits the maximum queue size to 255, which I think is ok for the
forseable future.

sizeof(uORB::DeviceNode) is reduces from 128 to 112 on NuttX, and with
~80 instances, this saves over 1KB of RAM.
2016-10-23 15:25:20 +02:00
Beat Küng 03c12c4c78 Device: use uint16_t for _open_count instead of int (save space) 2016-10-23 15:25:20 +02:00
Beat Küng a5e6f3213f Device: remove _irq_attached flag, test with _irq == 0 instead 2016-10-23 15:25:20 +02:00
Beat Küng 64df463a85 logger: avoid setting the interval for topics where not needed
Saves some RAM, although not much in that case. But all subscriptions
combined need ~1.5KB only for the interval data within uORB.
2016-10-23 15:25:20 +02:00
Beat Küng 7140914d38 logger: remove LoggerSubscription::time_tried_subscribe
Instead use a single timestamp for subscription checks. This frees up
~800B of RAM.

Also make sure the subscription checks are distributed over time. On each
update, at most 1 topic subscription is checked. Reduces the load of the
logger from 7.3% to 5.8% (Pixracer)
2016-10-23 15:25:20 +02:00
Beat Küng f244a78368 logger: avoid uORB::Subscription, directly use orb_subscribe() instead
This frees up ~160B stack size
2016-10-23 15:25:20 +02:00
Beat Küng 4120cd93df logger: make sure structs are properly aligned
ulog_message_info_header_s *msg = reinterpret_cast<ulog_message_info_header_s *>(buffer);
members of msg could end up unaligned, because of the uint8_t buffer.
2016-10-23 15:25:20 +02:00
Lorenz Meier 296b07f9d8 Update Gazebo plugin to fix plane model 2016-10-23 14:21:50 +02:00
Julian Oes 3aa9a72562 mavlink_shell.py: default to 57600 baudrate 2016-10-23 14:00:29 +02:00
Paul Riseborough 06ad477847 ekf2: publish vibration metrics 2016-10-22 12:03:05 +02:00
Paul Riseborough 79ec263b1e msg: Change definition for un-used vibration monitoring variable
Makes the message more useful in comparing the types of vibration likely to cause numerical errors and matches the update ecl library interface.
2016-10-22 12:03:05 +02:00
Paul Riseborough 6a3b147477 ecl: update library reference
Adds reporting of IMU coning and high frequency vibration levels
2016-10-22 12:03:05 +02:00
David Sidrane a2ad92b2d7 Bugfix: Hard Fault hmc5883 with not params
Fault results from if (!strcmp(verb, "start")) {``` with null verb
2016-10-22 11:54:38 +02:00
David Sidrane bdfb2bbb8d Fixed hardfault on fast proc
_baro_topic can be null in init sequence
   init call collect before the topic is inited.

I think this pattern is repeated in other drivers. I would suggest
allowing null in orb_publish to just return.
2016-10-22 11:43:22 +02:00
Siddharth Bharat Purohit b75ff417ea fmu: fix typo introduced in 78b0d1a which adds PWM1 mode 2016-10-22 08:37:13 +02:00
Carlo Wood 6fc30c76a6 Clean up of app.h
app.h, generated from app.h_in, has unnecessary code duplication
and isn't a header file (it defines globals, static functions
and doesn't have a header guard, moreover, it has a 'using namespace
std;'). Because of this, a real headerfile that declares the stuff
defined in apps.h was missing leading to even more code duplication:
scattered forward declarations in .cpp files and an often repeated
type of std::map<std::string, px4_main_t>.

This patch moves cmake/qurt/apps.h_in to src/platforms/apps.cpp.in
(with some changes) and removes cmake/posix/apps.h_in.
Then src/platforms/apps.cpp.in is split into src/platforms/apps.cpp.in
and src/platforms/apps.h.in, splitting declarations from definitions.

A typedef is defined for the map (apps_map_type).

The main difference between cmake/posix/apps.h_in and
cmake/qurt/apps.h_in was that the first defined a global 'apps',
while qurt stores the apps in QShell. I opted to get rid of
the global variable (which are in general evil for various reasons)
and used the API of cmake/qurt/apps.h_in where a provided 'apps'
map is initialized with a call to init_app_map. Thus removing
the existing code duplication.
2016-10-22 08:31:14 +02:00
Daniel Agar c200ef88ed travis-ci, circleci update to GCC 4.9 and 5.4 2016-10-20 22:01:53 -04:00
Julian Oes d57e9f13d7 px_uploader.py: catch exception in except block
This could lead to an exception if serial is not available.
2016-10-20 23:18:56 +02:00
Julian Oes d1822699a9 px_uploader.py: remove unused variable 2016-10-20 23:18:56 +02:00
Julian Oes a14c565ab1 px_uploader.py: trailing whitespace 2016-10-20 23:18:56 +02:00
Julian Oes 78b0d1a01f tap: add landing gear capability
This configures the PWM output for the landing gear.
2016-10-20 23:17:05 +02:00
Julian Oes 2fff2ab9ac Add switch for landing gear, pass it to actuators 2016-10-20 23:17:05 +02:00
Beat Küng 10c4ec2e1a update gps submodule 2016-10-20 21:12:11 +02:00
Beat Küng 0002e86b6f jmavsim_run.sh: add additional arguments for HITL 2016-10-20 18:54:47 +02:00
Beat Küng 7ed81e5edb simulator_mavlink: send MAV_CMD_SET_MESSAGE_INTERVAL to enable ground truth 2016-10-20 18:54:47 +02:00
Beat Küng 7415d94e12 mavlink: don't publish HIL_CONTROLS in HIL mode
it generates unnecessary load. If really needed, it can still be enabled
manually.
2016-10-20 18:54:47 +02:00
Daniel Agar 3fda48517d travis-ci git clone depth 1000 2016-10-19 20:31:56 -04:00
Lorenz Meier 7b2898eaee Fix merge collision 2016-10-19 18:29:34 +02:00
Lorenz Meier 3f5f74399e Increased SBUS buffer size for more reliable SBUS and DSM parsing 2016-10-19 15:32:30 +02:00
Lorenz Meier f7f406c45d Expand RC test to 2nd receiver with 12 channels 2016-10-19 15:31:54 +02:00
Lorenz Meier 6f7a5cdf9b Add additional DSM test data 2016-10-19 15:31:54 +02:00
Beat Küng 210b5704a9 px4fmu_common rcS: fix MAVLINK_F test
fixes a 'test: syntax error' message on startup. There were two problems:
- the expansion of $MAVLINK_F lead to multiple arguments in the test
  when the variable contained spaces. Fixed with ""
- the x prevents interpretation as a unary expression, if $MAVLINK_F starts
  with a - character (in that case the expansion would be:
  if [ -r 1200 ... and nsh interprets - as unary expression)
2016-10-19 15:27:09 +02:00
Beat Küng 3bb479f72e ulog mavlink: use the px4_sem calls (needed for OSX) 2016-10-19 13:13:47 +02:00
Beat Küng 7c40c8dfd9 update mavlink submodules 2016-10-19 13:13:47 +02:00
Beat Küng 9272aa592a logwriter: fix shadowing compiler warnings 2016-10-19 13:13:47 +02:00
Beat Küng b2d45732c2 system_params: add missing crazyflie to the param description 2016-10-19 13:13:47 +02:00
Beat Küng 318c970477 mavlink ulog streaming: add rate limiting
This limits the maximum bandwidth of ulog streaming to 70% of the specified
mavlink datarate. If less is used, the leftover is assigned to the mavlink
streams, if more is used, it starts to drop.

mavlink status outputs the currently used rate, to check if a link is
saturated.
2016-10-19 13:13:47 +02:00
Beat Küng 8f5656f033 mavlink ulog: add target sys & component ids (update to changed mavlink message) 2016-10-19 13:13:47 +02:00
Beat Küng 326800e5a8 logger: increase stack size
evaluated with: logger start -e -t -m all
and then make sure to get an error printf in the mavlink writer backend,
eg. for an ack timeout.
2016-10-19 13:13:47 +02:00
Beat Küng 8e0d548f51 logger: increase default queue size for mavlink logging to 14
tested on Pixracer: 14 still produces some dropouts once in a while, but I
think it's a fair tradefoff between RAM usage & dropouts. The queue needs
about 3.5KB of RAM.

When topic sizes/logging rates change, this will have to be reevaluated.
2016-10-19 13:13:47 +02:00
Beat Küng 6999bb3e9a Tools: add mavlink_ulog_streaming.py script to stream ULog via MAVLink to a file 2016-10-19 13:13:47 +02:00
Beat Küng 7d72f31a29 mavlink: integrate MavlinkULog into the main Mavlink task & receiver 2016-10-19 13:13:47 +02:00
Beat Küng 57d85de4d1 mavlink: add MavlinkULog class to receive ulog data from the logger 2016-10-19 13:13:47 +02:00
Beat Küng f29a50df31 logger: add support for mavlink backend in Logger class, handle start/stop 2016-10-19 13:13:47 +02:00
Beat Küng 2dc59efbb6 logger: add mavlink write backend 2016-10-19 13:13:47 +02:00
Beat Küng b7d07d77d6 msg files: add ulog_stream & ulog_stream_ack 2016-10-19 13:13:47 +02:00
Beat Küng b233753e23 logger: don't exit if directory creation failed & mavlink mode enabled 2016-10-19 13:13:47 +02:00
Beat Küng 8ea38bc278 logger: better status output with configured backend mode 2016-10-19 13:13:47 +02:00
Beat Küng 7a60c1296e logger: re-use subscribed topic id's, only set them once on first use
Will be necessary when using multiple backends in parallel.
2016-10-19 13:13:47 +02:00
Beat Küng 12ded377d1 refactor logger: add need_reliable_transfer flag, remove write_wait 2016-10-19 13:13:47 +02:00
Beat Küng de20f1778e logger: add -m <mode> and -q <queue_size> parameters, prepare for mavlink backend 2016-10-19 13:13:47 +02:00
Beat Küng 1ddddccb81 logger: move thread start/stop logic into LogWriterFile 2016-10-19 13:13:47 +02:00
Beat Küng 78f19fccce replay: remove unneeded include <logger/logger.h> 2016-10-19 13:13:47 +02:00
Beat Küng ccdaabc7fb refactor logger: prepare for multiple write backends 2016-10-19 13:13:47 +02:00
Beat Küng 4e1a4440ca logger: remove _enabled attribute and add LogWriter::is_started() instead 2016-10-19 13:13:47 +02:00
Beat Küng c26e29d11c logger: move writer_thread variable into function (never accessed outside) 2016-10-19 13:13:47 +02:00
Lorenz Meier 14b0511c6c MC pos control multiplatform style fix. 2016-10-19 10:17:41 +02:00
Lorenz Meier 21bc78dedc Update ROS att estimator and remove unused rotation matrix 2016-10-19 10:17:41 +02:00
Lorenz Meier 3696e7722a Code style adjustments 2016-10-19 10:17:41 +02:00
Lorenz Meier a12780c88f Remove attitude setpoint matrix from attitude setpoint topic 2016-10-19 10:17:41 +02:00
Lorenz Meier 5317d29ffd Disable blinkm for FMUv2 2016-10-19 09:25:55 +02:00
Julian Oes af5d2c488c st24: fix RC lost detection based on error count
The packet_count was actually an error_count, therefore we should
process RC input only when the error_count since the last packet is 0.

Also, this commit fixes the RSSI scaling for st24.
2016-10-19 09:22:57 +02:00
Michael Schaeuble ffaed18e67 Reduce the binary size Bebop
The firmware binary is to large to fit into the onboard memory of the Parrot
Bebop. It could be uploaded to the emmc, but for ease of use it would be nice
to have it in /usr/bin. To strip the binary seems to be the best option right now.
2016-10-18 23:56:56 +02:00
Lorenz Meier ffe4c77dc9 vmount: Params do not need to be built 2016-10-18 20:50:09 +02:00
Michael Schaeuble 062df05865 Add __PX4_POSIX_BEBOP define to PreflightCheck.cpp 2016-10-18 20:48:17 +02:00
Carlo Wood 2c23aa4348 Avoid compile error for posix_rpi_common/native.
Fixes,
error: ignoring return value of ‘ssize_t write(int, const void*,
size_t)’, declared with attribute warn_unused_result
[-Werror=unused-result]
2016-10-18 20:47:59 +02:00
Michael Schaeuble 9bb230fa3d Remove obsolete linker flag for Bebop build
The pthread linker flags were changed in c6a2641 and it was questioned in #5504 if the
exception for the Bebop is necessary. It is not, so remove those lines from the cmake
file.
2016-10-18 20:47:19 +02:00
Lorenz Meier 43d8e5710c Remove unused q_e flag 2016-10-18 20:46:08 +02:00
Roman 7a7bf2205d ekf2_replay: compute euler angles for logging
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman 17a4b64434 old ekf: fix computation of rotation matrix
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman 7c2ebd96a0 lpe: remove usage of euler angles from attitude topic
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman 06931e12cf mc_pos_control_mulitplatform: cleanup of matrix usage
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman d086a348aa rover steering example: fixed compile error
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman 7cb06c01eb attitude_estimator_ekf: fixed quaternion computation from dcm
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman 51941b0af8 rover_steering_control: fixed comment
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman a978d61d9a attitude message cleanup: more cleanup
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Roman 3faaeb06d1 attitude setpoint topic: cleanup of matrix class usage
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Lorenz Meier ee314d2f50 Remove unused gx, gy, gz fields from attitude 2016-10-18 20:46:08 +02:00
Lorenz Meier f1e5fe9b39 Fix isfinite compilation for fixed wing example 2016-10-18 20:46:08 +02:00
Lorenz Meier 57f193174c Fix mc att control multiplatform 2016-10-18 20:46:08 +02:00
Lorenz Meier b035b6a112 Remove non-quaternion handling for ROS attitude 2016-10-18 20:46:08 +02:00
Lorenz Meier 5d9c91dece Convert fixed wing example to quaternions 2016-10-18 20:46:08 +02:00
Lorenz Meier 526fb8f515 Remove q_valid flag from attitude topic 2016-10-18 20:46:08 +02:00
Beat Küng d349bd570f ekf examples: remove unused variable 2016-10-18 20:46:08 +02:00
Lorenz Meier 0bd42402fb Sim: Remove euler angles 2016-10-18 20:46:08 +02:00
Lorenz Meier 13833e5fd6 LPE: Use euler angles derived from quaternion 2016-10-18 20:46:08 +02:00
Lorenz Meier ac936a28dd Update examples 2016-10-18 20:46:08 +02:00
Lorenz Meier 873ed17b14 VMount: Do not rely on euler angles 2016-10-18 20:46:08 +02:00
Lorenz Meier affefcc75e Attitude: Remove redundant timestamp 2016-10-18 20:46:08 +02:00
tumbili 56b2fd0257 fixed rover example 2016-10-18 20:46:08 +02:00
tumbili 38b949a5aa calculate euler angles for logging 2016-10-18 20:46:08 +02:00
tumbili 0d0fa133e6 remove comments 2016-10-18 20:46:08 +02:00
Roman eb18622d85 added old ekf attitude estimator back to config and made changes so it compiles 2016-10-18 20:46:08 +02:00
Roman b8a219d351 removed comments and fixed some euler bugs 2016-10-18 20:46:08 +02:00
tumbili 5e0e522903 adapted to new vehicle attitude message 2016-10-18 20:46:08 +02:00
tumbili 215bfaa377 clean up vehicle attitude message 2016-10-18 20:46:08 +02:00
Lorenz Meier 78c52be08c Minoor nitpick in README 2016-10-18 08:07:14 +02:00
Julian Oes e2c308c4e6 cmake: fixes for cmake_hexagon changes 2016-10-18 08:07:14 +02:00
Julian Oes 340b9002e2 sdflight_default: define QC_SOC_TARGET if not set 2016-10-18 08:07:14 +02:00
Julian Oes b5b077ae04 DriverFramework: update submodule once again 2016-10-18 08:07:14 +02:00
Julian Oes 75657dc2eb cmake: add __DF_ defines with comments 2016-10-18 08:07:14 +02:00
Julian Oes 0a4ca7c77f cmake/DriverFramework: update submodules again 2016-10-18 08:07:14 +02:00
Julian Oes f8a1631077 DriverFramework/cmake_hexagon: use defines with DF
This changes the following defines:

__QURT -> __DF_QURT
__RPI -> __DF_RPI
__EDISON -> __DF_EDISON
__BEBOP -> __DF_BEBOP
__LINUX -> __DF_LINUX
2016-10-18 08:07:14 +02:00
Lorenz Meier e4398c7088 Update ECL to include a fix for height reset 2016-10-18 08:00:13 +02:00
Lorenz Meier c2285c84a9 Dataman: Do nnot pack structs to avoid reading back wrong values on existing systems 2016-10-18 00:26:40 +02:00
David Sidrane ecbe8c2179 Packed union to save more space 2016-10-18 00:23:58 +02:00
David Sidrane 86ec703620 Left test_dataman out by default - as it was prior 2016-10-18 00:23:58 +02:00
David Sidrane bb71aa5b64 Revive test_dataman.c 2016-10-18 00:23:58 +02:00
David Sidrane b2bf9e15eb Use union of datatypes supported by dataman to reduce wasted space 2016-10-18 00:23:58 +02:00
David Sidrane b1e94b98b3 Define tap as a Memory Constrained system 2016-10-18 00:23:58 +02:00
David Sidrane 44b5b52bcb Add suport for Memory Constrained systems 2016-10-18 00:23:58 +02:00
David Sidrane 979381fcfa Support passing defines from top level config makefile 2016-10-18 00:23:58 +02:00
David Sidrane 24e20b2cec Changed public interface comments to Doxyagen style 2016-10-18 00:23:58 +02:00
David Sidrane 1152b68a28 Use RAM storage in dataman 2016-10-18 00:23:58 +02:00
David Sidrane dce2262243 Add in RAM storage to dataman 2016-10-18 00:23:58 +02:00
Lorenz Meier 0544a6ee32 Upgrade NuttX submodule 2016-10-17 22:55:31 +02:00
James Goppert e73218c112 Increase min agl for flow from 5 to 30 cm to prevent drift on ground. 2016-10-16 12:12:19 -04:00
Julian Oes cd937321c8 px_mkfw.py: fix indent (fix for Python 3) 2016-10-15 22:01:22 +02:00
Julian Oes 7eabf1ccb3 px_mkfw.py: remove unused import 2016-10-15 22:01:22 +02:00
Julian Oes 8450178849 mavlink: move MAV_CMDs according to value 2016-10-15 12:37:06 +02:00
Julian Oes 9842e49dc6 navigator/mavlink: photos and videos at waypoints
This adds the capability to forward the commands
- MAV_CMD_VIDEO_START_CAPTURE
- MAV_CMD_VIDEO_STOP_CAPTURE
- MAV_CMD_IMAGE_START_CAPTURE
- MAV_CMD_IMAGE_STOP_CAPTURE
at waypoints which will then be sent over mavlink to component id
100 aka MAV_COMP_ID_CAMERA.
2016-10-15 12:37:06 +02:00
Paul Riseborough eb51184bbd msg: Update estimator_status documentation 2016-10-15 12:00:49 +02:00
Julian Oes 2d039af7a4 sitl_gazebo: update submodule yet again
This fixes the build for Gazebo >= 7.4.
2016-10-14 20:38:29 +02:00
mantelt 8bbc1b8472 navio_sysfs_rc_in: Fixing logical expression
navio_sysfs_rc_in stop works now.
2016-10-14 15:38:36 +02:00
Julian Oes 36b2e4be09 sitl_gazebo: update submodule 2016-10-14 14:47:53 +02:00
James Goppert 9c82293bc4 Fix comment. 2016-10-14 07:00:13 -05:00
James Goppert 3ffff212e1 Added landed agl correction for lpe. 2016-10-14 07:00:13 -05:00
Paul Riseborough 35bf165190 ekf2_replay: fix code style 2016-10-13 09:06:41 +02:00
Paul Riseborough 02c3ea0a5b ekf2_replay: log output predictor tracking errors 2016-10-13 09:06:41 +02:00
Paul Riseborough 865b6404ec ekf2: reduce default output predictor time constant 2016-10-13 09:06:41 +02:00
Paul Riseborough ed0cc2af43 sdlog2: log ekf output predictor tracking errors 2016-10-13 09:06:41 +02:00
Paul Riseborough 7a9e3002ff ekf2: publish output predictor tracking errors 2016-10-13 09:06:41 +02:00
Paul Riseborough 23a379a6bf msg: add output predictor tracking errors to innovation message 2016-10-13 09:06:41 +02:00
James Goppert dbd94907c4 Only send failsafe info messages on state change. 2016-10-13 01:57:00 -04:00
James Goppert 43b665ae01 Fix gps circuit breaker logic in state machine. 2016-10-12 23:07:26 -05:00
James Goppert cf658638f4 LPE flow improvements. 2016-10-12 23:05:53 -05:00
David Sidrane db44129ec0 Prevents the posibility of buffer overflow in mixer parsing.
The fix limits scanf from overwritting the geomname buffer local
variable. Thus preventing stack corruption as noted by chungkim.
2016-10-12 22:58:55 +02:00
James Goppert f30dd2b819 Removed lidarlite driver, not widely available. 2016-10-12 11:59:46 -05:00
James Goppert 027badc340 Remove bottle/rover apps from v1 to reduce flash space. 2016-10-12 11:59:46 -05:00
Lorenz Meier 1cb180728e Disable vectorcontrol ESC firmware as they still are not really available on the market 2016-10-12 09:27:02 +02:00
Lorenz Meier c6015e65d0 Update ECL to include a reset fix 2016-10-12 08:55:36 +02:00
Lorenz Meier b4e85d1273 Update ECL to include a status reporting fix 2016-10-12 08:53:00 +02:00
Lorenz Meier 569cceb059 Fix task load measurement in NuttX. Reported by @chungkim. Fixes #5645. 2016-10-12 08:43:45 +02:00
Daniel Agar e9bce5dd71 eclipse project file updates
-properly index ECL and generated uORB
2016-10-11 21:25:58 -04:00
Lorenz Meier 69551141b7 Updated SITL 2016-10-12 00:32:59 +02:00
Beat Küng c87933d556 navigator: cleanup output messages (don't use warnx) 2016-10-11 13:10:43 +02:00
Julian Oes 7cdf9c31bf navigator: usual usleep after poll fail
We don't want to busy loop after the poll fail if that ever happened.
2016-10-11 13:05:37 +02:00
Julian Oes f6ad9b8283 navigator: only poll for position
We don't need to poll for vehicle commands, we will get them anyway by
doing orb_check. Also, the polling for them wasn't implemented correctly
anyway.
2016-10-11 13:05:37 +02:00
Paul Riseborough d80a233bcb ekf2: fix code style 2016-10-11 08:52:35 +02:00
Paul Riseborough bef4850ae3 mavlink: Publish estimator solution status flags 2016-10-11 08:52:35 +02:00
Paul Riseborough 6eabf80f2a ekf2: Publish estimator solution status flags 2016-10-11 08:52:35 +02:00
Paul Riseborough fa47569aa5 msg: Add EKF solution status flags to estimator status message 2016-10-11 08:52:35 +02:00
Paul Riseborough b6d69ca3aa mavlink: Add ESTIMATOR_STATUS accuracy data 2016-10-11 08:52:35 +02:00
Paul Riseborough c0fe08a203 ekf2: publish estimator status position accuracy 2016-10-11 08:52:35 +02:00
Paul Riseborough bc530ea992 mavlink: add missing data to ESTIMATOR_STATUS message 2016-10-11 08:52:35 +02:00
Paul Riseborough 66e887e581 sdlog2: log estimator innovation test pass/fail data 2016-10-11 08:52:35 +02:00
Paul Riseborough 5a69f4560a ekf2: Publish innovation test status data 2016-10-11 08:52:35 +02:00
Paul Riseborough 2bda15d72b msg: Add innovation test data to estimator status 2016-10-11 08:52:35 +02:00
Paul Riseborough ad65e56f47 ecl: update submodule reference 2016-10-11 08:52:35 +02:00
Daniel Agar e9e15ba3d1 Makefile error preventing px4fmu-v4_default build
-fixes #5625
2016-10-10 22:47:28 -04:00
Andreas Antener f3b5c243e5 UT: added method to test float values
MC pos control tests: added tests to all configs that include them
2016-10-10 23:05:44 +02:00
Andreas Antener 9a219da9c2 Refactored cross sphere line tracking and added a unittest to verify correct operation 2016-10-10 23:05:44 +02:00
Andreas Antener c2e0246650 MC pos control: realize when we are on the trajectory but passed the target waypoint 2016-10-10 23:05:44 +02:00
Lorenz Meier 710a8e8f56 Commander: ensure hysteresis init 2016-10-10 22:47:07 +02:00
Julian Oes 0f763768b1 commander: don't auto-disarm as fast if not flown
It was found inconvenient that auto-disarm triggers too quickly right
after arming when the vehicle has not actually taken off yet.

Therefore, the auto-disarm takes now by a factor of 5 longer if the
vehicle has not taken off yet.
2016-10-10 22:47:07 +02:00
Gregory ddea179e95 Adding support for 19200 and 38400 baud TELEM2 2016-10-10 22:24:17 +02:00
Daniel Agar 2771b92dc0 px4fmu trivial style fix 2016-10-09 23:47:09 -04:00
Daniel Agar cdc1c5c7a4 travis-ci and circleci update docker tag 2016-10-09 23:47:09 -04:00
Lorenz Meier ed62957474 Increase RC buffer size 2016-10-08 17:18:06 +02:00
Lorenz Meier 4cfd84b56a FMU driver: Ensure correct binding pulses for Spektrum, time out any receiver which has more than one second no signal. 2016-10-08 16:56:04 +02:00
Lorenz Meier 9d2b5b1c28 Always start MAVLink, never default UART to serial 2016-10-08 16:53:31 +02:00
Mark Whitehorn a56d50599d subscribe to vehicle_command topic and implement RX_PAIR command
add spektrum satellite bind command to fmu

open fmu file descriptor to issue ioctl
2016-10-08 16:19:45 +02:00
Lorenz Meier 605cffc230 Fix sensor rail reset on Pixracer. Increase the reset duration to 50 ms to ensure the sensor power has bled off. 2016-10-08 16:18:48 +02:00
Beat Küng e73cd08a30 syslink_bridge: return state instead of 0 2016-10-07 13:26:58 +02:00
Beat Küng 55bff206be mission: add NAV_CMD_DO_SET_ROI & NAV_CMD_ROI 2016-10-07 10:57:26 +02:00
David Sidrane 248cd45503 Added missig can_devinit prototype
The Nuttx CAN driver is not used with UAVCAN. However to
facilitate compilation to allow the Nuttx CAN Example to be
compiled and linked, the missing proto type was needed.

Futhermore to include the NuttX CAN eaxample the following changes
are needed:

1 ) In cmake/configs/<target>.cmake
Add can to config_extra_builtin_cmds as:

set(config_extra_builtin_cmds
        serdis
        sercon
        can
        )

Add:
add_custom_target(can)
set_target_properties(can PROPERTIES
       PRIORITY "SCHED_PRIORITY_DEFAULT"
       MAIN "can" STACK_MAIN "2048"
       COMPILE_FLAGS "-Os")

2) Update the nuttx-configs/<target>/nsh/defconfig

Run make oldconfig and make menuconfig and set the follwoing:
CONFIG_CAN=y
CONFIG_STM32_CAN1=y or CONFIG_STM32_CAN2=y
CONFIG_CAN_EXTID=y
CONFIG_CAN1_BAUD=250000
CONFIG_CAN_FIFOSIZE=8
CONFIG_CAN_NPENDINGRTR=4
CONFIG_EXAMPLES_CAN=y
2016-10-06 19:02:51 +02:00
David Sidrane 1c766aef12 Removed comments to allow appconfigs to bring in can
Removed the commented body of the 'if CONFIG_CAN' in the appconfigs
2016-10-06 19:02:51 +02:00
Gene 5cd85b98c2 Fixed app args buffer overrun in qurt px4_layer main.cpp and qshell.cpp 2016-10-06 11:06:57 +02:00
Lorenz Meier f543463349 Disable FrSky for FMUv2 2016-10-06 09:11:26 +02:00
Beat Küng 9ceb5a7e2e mavlink: extend status output 2016-10-06 09:01:57 +02:00
Beat Küng bad107a374 navio_sysfs_pwm_out: avoid dynamic memory allocation & fix a memory leak
memory leak was in send_outputs_pwm()
2016-10-06 09:01:25 +02:00
Beat Küng b864983c5e navio_sysfs_rc_in: avoid dynamic memory allocation for path 2016-10-06 09:01:25 +02:00
Beat Küng a42f0f5a62 gps: fix code style 2016-10-06 09:00:09 +02:00
Beat Küng 6d0288d494 gps: update submodule 2016-10-06 09:00:09 +02:00
Beat Küng 80771ce8b3 gps: remove gps_driver_interface_t and use GPSHelper::Interface instead 2016-10-06 09:00:09 +02:00
Miguel Arroyo c6f43689e7 Adds Auto Mode Scanning 2016-10-06 09:00:09 +02:00
Miguel Arroyo 2799525462 Commandline Interface and Mode options 2016-10-06 09:00:09 +02:00
Hidenori 9bd3f6c9bf Navio: Delete (wrong) unnecessary ifdef and modify for new GPSDriverUBX constructor 2016-10-06 09:00:09 +02:00
Hidenori e7b582502a Navio: change the GPS device 2016-10-06 09:00:09 +02:00
Hidenori 96a5baa12b Navio: fix style 2016-10-06 09:00:09 +02:00
Hidenori 56ef984529 Navio2: modify for SPI-connected GPS and fix bug in GPIO driver 2016-10-06 09:00:09 +02:00
José Roberto de Souza b9728ecf39 Uploader tool: Add option to set different baudrates for bootloader and flight stack
By default the baudrate in flight stack (Mavlink or NSH) 57600 and the default
baudrate of bootloader is 115200. So we may need to set different
baudrates.
2016-10-05 11:25:14 +02:00
José Roberto de Souza 7e0946466e Uploader tool: Reboot board and keep it in bootloader
The Mavlink reboot messages was only requesting the board to reboot.
If the flashed bootloader has a small or no timeout user will
never be able to update firmware.
2016-10-05 11:25:14 +02:00
Michael Schaeuble 6bb03f3665 Add pitch angle to AK8963 for Bebop 2016-10-05 09:56:54 +02:00
Nate Weibley bc44ba2907 Fix QtCreator auto whitespace formatting 2016-10-05 08:58:57 +02:00
Nate Weibley 71e87cf287 Set maximum publishing rate to match MPU6000
The integrators were set to publish at 800Hz which was overwhelming
the CPU with the EKF running. This brings them in line with what we
get from the MPU6k device.
2016-10-05 08:58:57 +02:00
Nate Weibley fde165b4f1 Fix 2000dps gyro rate setbits 2016-10-05 08:58:57 +02:00
Nate Weibley 57d7a00261 Set BMI160 bus speed to 10MHz
Unliked the MPU6000 from which this driver was based, the bosch
sensor does not have a requirement to handle registers at different
speeds.
2016-10-05 08:58:57 +02:00
Glenn Bitar 6d41ab9e16 Fixed order of arguments in px4_task_spawn_cmd.
Fixes #5601
2016-10-05 08:34:58 +02:00
Beat Küng c81a1631ec simulator_mavlink: init hil_attitude with 0 & set angular speed 2016-10-04 12:56:25 +02:00
Mark Whitehorn 9500b7f01f update submodule 2016-10-04 12:54:58 +02:00
Mark Whitehorn ec1609350f fix jMAVSim body-fixed XYZ Euler Angles 2016-10-04 12:54:58 +02:00
Lorenz Meier 29a4113ce3 MAVLink app: Handle reboot command properly on COMMAND_INT 2016-10-03 22:35:07 +02:00
James Goppert cb5728297e LPE fix to enable visual odom. only navigation. (#5588) 2016-10-03 14:58:02 -04:00
Daniel Agar 03bfcae351 circleci better manual submodules clean (#5590) 2016-10-03 12:59:40 -04:00
James Goppert 7c2798269c Added vision delay compensation to LPE. (#5585) 2016-10-03 02:28:46 -04:00
bharathr 2f6abf26a3 Updated mainapp.config for 200qx and 210qc airframes (based off the generic flight version) 2016-10-02 16:06:08 +02:00
Lorenz Meier c24046ca5b FMUv1: Save resources in config 2016-10-02 11:50:34 +02:00
Lorenz Meier 93ad4fa440 rcS: The param save command is unnecessary as param set already stores to disk. 2016-10-02 11:29:53 +02:00
Artem Sabadyr 74b2780874 GPS driver: use FIONREAD on NuttX only 2016-10-02 11:19:55 +02:00
Artem Sabadyr 4c04b7bb53 gps read optimization 2016-10-02 11:19:47 +02:00
James Goppert fe40e9cfae LPE vision estimation fixes. (#5505) 2016-10-01 09:02:12 -04:00
James Goppert f6bed6f2d2 Update sitl gazebo. 2016-10-01 08:25:49 -04:00
James Goppert 91f92aa7d3 Update sitl gazebo. (#5580) 2016-10-01 07:58:56 -04:00
nephen 0027333e6d add pci-Bitcraze to px4_base.cmake 2016-09-30 23:06:57 +02:00
Roman cf8f484868 mixer class: updated comments on slew rate limit method
Signed-off-by: Roman <bapstroman@gmail.com>
2016-09-30 13:55:53 +02:00
Roman c2a511d81d multirotor mixer slew rate limiting: naming and fixes
- avoid dividing by zero when calculating max delta output
- better comments when calculating max delta output
- better naming of functions and variables

Signed-off-by: Roman <bapstroman@gmail.com>
2016-09-30 13:55:53 +02:00
Roman cced6fc8b2 multirotor mixer: use correct version of delete operator for array pointer
Signed-off-by: Roman <bapstroman@gmail.com>
2016-09-30 13:55:53 +02:00
Roman 8b889caa33 slew rate limiting: implemented for fmu
Signed-off-by: Roman <bapstroman@gmail.com>
2016-09-30 13:55:53 +02:00
Roman 2607769470 slew rate limiting: moved logic to multirotor mixer
Signed-off-by: Roman <bapstroman@gmail.com>
2016-09-30 13:55:53 +02:00
Roman 66ddea01d1 implemented slew-rate 2016-09-30 13:55:53 +02:00
Beat Küng b6b8892606 hrt_queue: add px4_posix.h include for px4_getpid() 2016-09-30 13:50:51 +02:00
Beat Küng 489f63a3d3 rc_check: replace mavlink_and_console_log_critical with mavlink_log_critical
these functions got merged.
2016-09-30 13:50:51 +02:00
Beat Küng 76733ce54b uorb tests: move orb metadata struct definition into cpp file
If they're in the header and the header is used in multiple .cpp, there
are multiple definitions. Oddly it did not lead to an error, but there
were multiple structs of the same topic but with different adresses.
This lead to a metadata mismatch, when running eg:
uorb_tests
uorb_tests latency_test
2016-09-30 13:50:51 +02:00
Beat Küng 549d456ec7 uorb devices: set errno on write error 2016-09-30 13:50:51 +02:00
Beat Küng e061842219 posix main: only try to generate symlinks if data path argument given
if not given, the dirs are either not needed (eg RPI) or assumed to
exist already
2016-09-30 13:50:51 +02:00
Beat Küng 98ac60e3fd Tools: remove unused scripts {posix,qurt}_apps.py
These were replaced by cmake, with the template cmake/posix/apps.h_in
2016-09-30 13:50:51 +02:00
Beat Küng 50b8ed0a89 commander: initialize gps & baro as failure state
This avoids error messages on startup.
2016-09-30 13:50:51 +02:00
Beat Küng ce0d31b7d9 mavlink log: ensure all critical & emergency msgs are also logged to console & ulog
Critical messages that the user sees should also go to the log file, so
that the exact error (with time) can later be analyzed from the log file.
2016-09-30 13:50:51 +02:00
Beat Küng 241fd629ce ERROR macro: get rid of the many 'oddly, ERROR is not defined for c++', use PX4_ERROR 2016-09-30 13:50:51 +02:00
Beat Küng c606554da3 PreflightCheck.cpp: use __PX4_POSIX_RPI instead of __LINUX for RPI 2016-09-30 13:50:51 +02:00
Beat Küng cf5338df02 accelsim: lower publisher rate to 250Hz 2016-09-30 13:50:51 +02:00
Beat Küng 27aaf244af fix accelsim: ACC_READ cannot be 0 (it's used to check if a bit is set)
before that, accel data was all 0, but since the gyrosim also publishes
accel data, it was not a problem.
2016-09-30 13:50:51 +02:00
Beat Küng d7ed47e2e5 px4_posix_tasks.cpp: make sure to copy the thread name into the thread data struct
The thread name is used from within the entry of the new thread, but the
provided name could live on the stack of the caller thread. Thus we need to
copy the name.
2016-09-30 13:50:51 +02:00
Beat Küng ac189704ed simulator: flush output after waiting message output
Just to make sure the user sees the message.
2016-09-30 13:50:51 +02:00
Beat Küng f25947b964 hrt_work_queue posix: only send a wake-up signal if not called from own thread
The simulated timer interrupt always adds a new scheduled work task, which
is called from the work queue thread. Sending the signal creates measurable
overhead (~5% of the px4 CPU runtime) and is unnecessary, since the thread
is not sleeping anyway.
2016-09-30 13:50:51 +02:00
Beat Küng 1d111cb254 px4_getpid: return the taskmap index instead of pthread_self()
this makes it consistent with other functions, like px4_task_spawn_cmd()
and px4_task_kill()
2016-09-30 13:50:51 +02:00
Beat Küng a51d1bc5dc jmavsim_run.sh: add optional -p <port> argument 2016-09-30 13:50:51 +02:00
Beat Küng 35e93c24e8 fix sitl_multiple_run.sh: adapt to path updates 2016-09-30 13:50:51 +02:00
Julian Oes 763d2d0447 ecl: point to interim branch for now 2016-09-30 09:25:26 +02:00
Lorenz Meier 17a1d31b79 Update L1 controller stack 2016-09-30 09:16:36 +02:00
Lorenz Meier 69f6708f37 Increase sensors stack 2016-09-30 09:16:36 +02:00
Julian Oes 7f8f6c3879 ecl: updated submodule again 2016-09-30 08:11:51 +02:00
Julian Oes b1708f3871 cmake: only optimize for size on NuttX
With this change only builds for NuttX which are very much flash size
constraint are optimized for size. All other builds (e.g. SITL,
Snapdragon, etc.) are left at the default for debugging or -O2 for the
usual use.
2016-09-30 08:11:51 +02:00
Julian Oes 8ff237c69f Remove size optimization for individual modules
It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
2016-09-30 08:11:51 +02:00
Julian Oes aa6d9e363f mavlink: fix a shadowing warning 2016-09-30 08:02:55 +02:00
Julian Oes ab4441c00b mavlink: add comment for Snapdragon 2016-09-30 08:02:55 +02:00
Julian Oes 1b69f9cb23 mavlink: don't miss first vehicle_command_ack
This fixes a corner case where the first advertise/publish of a
vehicle_command_ack was missed. What happened was that the
orb_subscribe_multi was not called until the topic had been published
and therefore orb_exists was happy. This means that by the time
orb_subscribe_multi was finally called, the first vehicle_command_ack
was already history and not detected by orb_check.

This changed adds a flag to the MavlinkOrbSubscription which tells it to
subscribe to a topic from the beginning.
2016-09-30 08:02:55 +02:00
Julian Oes 158a0be6c4 commander: whitespace fix 2016-09-30 08:02:55 +02:00
Beat Küng 1eca97757c sitl_run.sh: fix $rootfs not set (needed for efk2 replay) 2016-09-29 10:53:33 +02:00
Beat Küng bb61144efc cmake: add posix_sitl_inav target 2016-09-29 07:28:03 +02:00
Daniel Agar acc1cc3158 travis-ci fix s3 deploy (#5564)
- deploy all branches to s3
2016-09-29 00:10:29 -04:00
Beat Küng 92d160c431 uorb devices: fix for QuRT which has no poll() 2016-09-28 15:31:52 +02:00
Beat Küng 219ab519e3 uorb devices: rename queue_size() & meta() to avoid member shadowing 2016-09-28 15:31:52 +02:00
Beat Küng d1850f5112 uorb top: measure the elapsed time to give more accurate results 2016-09-28 15:31:52 +02:00
Beat Küng 52dde93a31 uorb: merge nuttx & posix files 2016-09-28 15:31:52 +02:00
Beat Küng f601428e82 uorb: add ifdef's where necessary to mitigate diffs between nuttx & posix
now the files are equal
2016-09-28 15:31:52 +02:00
Beat Küng f5654511b8 uorb: more syntax changes to remove diff between nuttx & posix files 2016-09-28 15:31:52 +02:00
Beat Küng 83c5323c3a uorb: remove syntax differences between posix & nuttx src file 2016-09-28 15:31:52 +02:00
Beat Küng fbd7aac4b5 uorb: add 'top' command for a live view of topic updates 2016-09-28 15:31:52 +02:00
Beat Küng 670c93e726 cmake: add support for out-of-tree modules via EXTERNAL_MODULES_LOCATION variable 2016-09-27 15:10:23 +02:00
Lorenz Meier 65e3ae70dd DF update 2016-09-27 11:56:49 +02:00
Lorenz Meier 676e90cd98 Define realtime clock for systems not having one 2016-09-27 11:56:49 +02:00
Lorenz Meier adf56050b9 Use monotonic clock for simulator 2016-09-27 11:56:49 +02:00
Lorenz Meier 5b674ffe48 Update DF to include Travis CI fix for DF
DF Update: Use common CMake version so Darwin handling is correct in PX4

Update DF to use proper constants

Update DF
2016-09-27 11:56:49 +02:00
Lorenz Meier af8cbee6d5 Support 10.11 and 10.12 in parallel in PX4 2016-09-27 11:56:49 +02:00
Lorenz Meier f49eabdb9d Update DF to have 10.11 and 10.12 support in parallel 2016-09-27 11:56:49 +02:00
Lorenz Meier c433e7bf3e Set correct XCode 8 version 2016-09-27 11:56:49 +02:00
Lorenz Meier 88cffaddec Enable CMake
Output CMake version
2016-09-27 11:56:49 +02:00
Lorenz Meier cf671b5134 Fix tests and re-introduce tests into build
Code style fix
2016-09-27 11:56:49 +02:00
Lorenz Meier 1909f2b02f Switch Travis to XCode 8 2016-09-27 11:56:49 +02:00
Lorenz Meier 2b9596cac0 Run clean beffore distclean so that a partial build is wiped as well. 2016-09-27 11:56:49 +02:00
Lorenz Meier 69c28177ac Fix platform headers / files for XCode 8 2016-09-27 11:56:49 +02:00
Lorenz Meier edf0057cee Modify build for XCode 8 2016-09-27 11:56:49 +02:00
Lorenz Meier 398d9642cb Update DF for XCode 8 2016-09-27 11:56:49 +02:00
Daniel Agar fb75240ee9 FW init TECS with PSP_OFF and constrain TAS error 2016-09-27 08:49:45 +02:00
Daniel Agar ebdfa2860b land_detector status cleanup 2016-09-27 08:49:45 +02:00
Daniel Agar 9fd0513be3 vtol remove unused vehicle_status 2016-09-27 08:49:45 +02:00
Dennis Shtatnov e27f396f55 Syslink properly working address params 2016-09-27 08:46:00 +02:00
David Sidrane f750140b6f Make line 280 check happy (#5550) 2016-09-27 08:34:48 +02:00
Daniel Agar 7c0a567eaa navigator explicitly invalidate position setpoint 2016-09-26 23:11:08 +02:00
Daniel Agar 7b03bce416 Navigator mission FOH use previous loiter altitude
-the previous item altitude wasn't valid if switching from LOITER ->
MISSION
-fixes #5395
2016-09-26 23:11:08 +02:00
Julian Oes 660a9e13e7 mavlink_mission: improve comments about casting 2016-09-26 22:55:21 +02:00
Julian Oes 238f597b78 mavlink_mission: remove wrong comment 2016-09-26 22:55:21 +02:00
Julian Oes 047c0e44bd mavlink_mission: support missions with int params
This brings support for the messages MISSION_REQUEST_INT and
MISSION_ITEM_INT which raises the lat/lon accuracy for waypoints.
2016-09-26 22:55:21 +02:00
Julian Oes 997ae98444 navigator: reset cruise speed when out of mission (#5494)
This reset the cruise speed which can be set by mission items/waypoints
to set a custom speed. Once, switched out of mission, it makes sense to
use the speed set by the param again.
2016-09-26 22:54:15 +02:00
Carlo Wood c6a2641507 Fix some pthread related linker stuff. (#5504)
The px4_os_add_flags defined in cmake/posix/px4_impl_posix.cmake did
add (threading) libraries to added_exe_linker_flags, which subsequently
end up in CMAKE_EXE_LINKER_FLAGS and then have no effect because those
flags are passed to the linker before any of the object files and static
libraries.

Those libraries are already added correctly in the corresponding
src/firmware/*/CMakeLists.txt files (for qurt, nuttx AND posix).

I left in the non-library linker flag '-pthread' for the bebop board,
although it seems very weird to me that this is needed (is it?).
If that is needed then it seems weird to link manually (that is,
src/firmware/*/CMakeLists.txt) with -lpthread.

For linux/g++ -pthread is added to the CXXFLAGS as it should be:
this causes the compiler to define _REENTRANT which is needed
for (the interface of) certain libraries to become thread-safe.
Offically one also can just pass -pthread to the linker, which then
causes the right libraries to be linked, but just linking with
-lpthread -lm -lrt works too.

I ran into this while adding support for libcwd, which explicitly
complains that _REENTRANT isn't defined when trying to link with
the thread-safe version of libcwd (-lcwd_r) and then tells you
to use -pthread.
2016-09-26 22:53:41 +02:00
Daniel Agar 6d655d2d6e startup remove old EKF PE_ params (#5533) 2016-09-26 22:51:43 +02:00
Daniel Agar 1d0a667826 Geofence defaults (#5534)
* geofence messages too frequent

* geofence horz/vert disable with 0 instead of -1

-closes #5430
2016-09-26 22:50:36 +02:00
David Sidrane 0eca86443d Master additional targets (#5548)
* Allow Niga to be disabled from command line

* Add a build all nuttx targets
2016-09-26 22:48:37 +02:00
Sander Smeets c4eabbd083 VTOL transition switch parameter checking (#5545)
* VTOL transition switch parameter checking

* Code style
2016-09-26 10:18:23 +02:00
Lorenz Meier bd922e4eed Standard VTOL: report correctly in SIM 2016-09-25 18:37:33 +02:00
Lorenz Meier 9915a416ff Better yaw limits for default VTOLs 2016-09-25 18:37:03 +02:00
Lorenz Meier e42ff72d6a Standard VTOL configs: Limit yaw rate 2016-09-25 18:37:03 +02:00
lovettchris 11f8da5fc6 AUTO_LOITER respect disabled RC link loss param (#5499) 2016-09-23 18:14:32 -04:00
tommises 35b45e02b1 controllib_test fix filename in comments (#5538) 2016-09-23 17:13:54 -04:00
Dennis Shtatnov b9c5d117dd CF2: Linux USB uploading fix 2016-09-21 17:20:08 -04:00
Andreas Antener e7d90b1cd3 reduced the wait time at the end of the motor ramp to not unnecessary stress the system 2016-09-21 08:53:15 +02:00
Andreas Antener 3b58caa32a Updated motor RAMP timing to match slew rate limiter 2016-09-21 08:53:15 +02:00
Daniel Agar 69ae0091b8 VTOL QuadChute only if not landed 2016-09-21 08:36:00 +02:00
Dennis Shtatnov cfe59e74b2 CF2: Unique Board ID 2016-09-20 19:21:24 -04:00
Daniel Agar 9fb167b642 add crazyflie to builds (#5516)
* Makefile simplify check and quick_check

* make check add crazyflie_default
2016-09-20 21:05:44 +02:00
Beat Küng 21ce157763 lps25h: use STACK_MAIN instead of STACK 2016-09-20 18:55:25 +02:00
Beat Küng 281c450b6e fix syslink: rc.timestamp_publication -> rc.timestamp
changed in d297d31c23
2016-09-20 18:55:05 +02:00
Daniel Agar c4b9b05af9 make check_format also check git whitespace (#5503)
-fixes #5484
2016-09-20 12:45:42 -04:00
Nacho Carnicero 392391e8df Fix VTOL status in forward transition for tiltrotor models 2016-09-19 20:27:14 +02:00
Mark Whitehorn 95f899fee7 always publish simulator groundtruth attitude 2016-09-19 13:07:02 +02:00
Mark Whitehorn 8f64825297 switch to new logger for posix_sitl_default 2016-09-19 13:05:14 +02:00
Mark Whitehorn ca9ac1c807 add default simulator groundtruth topic only for SITL builds 2016-09-19 13:05:14 +02:00
Mark Whitehorn f24b199775 add HIL_STATE message handler and publish to uORB
add missing break

uorb topics generator: add multi-topics to the list of all topics

topic names with '# TOPICS <name>' were previously not in orb_get_topics().
This means the logger could not find them.

Affects for example actuator_controls_0.

px_generate_uorb_topic_files.py: add multitopics to generate_topics_list_file_from_files method

switch simulated attitude to new topic: vehicle_attitude_groundtruth

logger: add input_rc topic. needed for web plotting

input_rc.msg: remove timestamp_publication, use timestamp instead

mixer.cpp: warnx -> PX4_ERR

logger: initialize timer_call to 0 (hrt_call_every reads some fields)

position_setpoint_triplet topic: set the timestamp when publishing

px_generate_uorb_topic_files.py: add multitopics to generate_topics_list_file_from_files method

add vehicle_attitude_groundtruth to default topics

change to hil_state_quaternion
2016-09-19 13:05:14 +02:00
Beat Küng 79f2cd79d9 px_generate_uorb_topic_files.py: add multitopics to generate_topics_list_file_from_files method 2016-09-19 13:03:40 +02:00
Beat Küng 3a084fbdb8 position_setpoint_triplet topic: set the timestamp when publishing 2016-09-19 13:03:40 +02:00
Beat Küng 89a7e0cf87 uorb topics generator: add multi-topics to the list of all topics
topic names with '# TOPICS <name>' were previously not in orb_get_topics().
This means the logger could not find them.

Affects for example actuator_controls_0.
2016-09-19 13:03:40 +02:00
Beat Küng 4e1652fa6b logger: initialize timer_call to 0 (hrt_call_every reads some fields) 2016-09-19 13:03:40 +02:00
Beat Küng 44ac7d11e7 mixer.cpp: warnx -> PX4_ERR 2016-09-19 13:03:40 +02:00
Beat Küng d297d31c23 input_rc.msg: remove timestamp_publication, use timestamp instead 2016-09-19 13:02:31 +02:00
Beat Küng 3a94afb03c logger: add input_rc topic. needed for web plotting 2016-09-19 13:02:31 +02:00
Dennis Shtatnov f334a6225a Syslink cli deck detection 2016-09-19 11:54:53 +02:00
Dennis Shtatnov 937f3477d3 Syslink memory/deck interface 2016-09-19 11:54:53 +02:00
Dennis Shtatnov 83105fca95 CF2: Buzzer 2016-09-19 11:54:53 +02:00
Dennis Shtatnov c9a17fdd68 CF2: Free up serials
There are only two exposed serial connections, which are used as other things for the decks, so don't utilize any by default
2016-09-19 11:54:53 +02:00
Dennis Shtatnov eafc0dad4a CF2: Disable UART console to free up expansion pins
nshterm should still work. Using low console instead which should just discard all characters for the plain system console
2016-09-19 11:54:53 +02:00
Dennis Shtatnov 984e7521d4 CF2: Charging and RX/TX LEDs working 2016-09-19 11:54:53 +02:00
Beat Küng c191a82882 gazebo: update submodule 2016-09-19 09:18:37 +02:00
Beat Küng 69865e4e04 vmount: fix mavlink input: angles are given in deg 2016-09-19 08:03:02 +02:00
Beat Küng ead9b2111c vmount: fix calculation of GPS location to angles 2016-09-19 08:02:27 +02:00
Beat Küng 3ae2ca74c5 posix-configs: start vmount for typhoon 2016-09-19 07:55:38 +02:00
Beat Küng 057d71e101 posix-configs: use 'mixer append' command for typhoon mount mixer 2016-09-19 07:54:51 +02:00
Andreas Antener 5825b8c3e7 Geofence: renamed action on flag, reset only if none of the possible warning actions is set 2016-09-18 21:14:18 +02:00
Carlo Wood a03441b818 Fix the multi- target targets (#5489) (#5491)
On second thought, using % just isn't correct. When a make
target looks like:

foo% bar%:
	...

Then that implies that it will build BOTH foo% and bar% whenever
that rule is triggered (by either) for any value of the pattern %.

Clearly that is not what we want / intend.

So, this commit goes back to using config targets without a % in it
by generating a full list of them.

It also turns sitl_deprecation into a Hidden Target.

Finally, now that we have those target lists anyway, I added
a 'help' and 'list_config_targets' targets that print the
available targets.

Note that the '%' catch-all target only works when all other targets
either have a recipe or are marked as .PHONY, otherwise such targets
are only interpretted as dependencies and still executre the '%'
target afterwards, which is not what we want.
2016-09-18 01:44:45 +02:00
Lorenz Meier 71fd4b9e98 Uploader tool: Try MAVLink reboot command first 2016-09-17 23:49:41 +02:00
Lorenz Meier d98bbd9b82 Fix issue #5501. Link termination now requires param 2 = 10 2016-09-16 11:34:40 +02:00
Julian Oes 4453e4201b navigator/mavlink: fixes for mission item reached message (#5486)
* navigator/mavlink: always send last reached item

Since we can't rely on mavlink that every message arrives, it makes
sense to continuously send the last reached waypoint.

* navigator: don't report reached for takeoff

If a takeoff waypoint has been inserted, we should not report that we
reached a mavlink mission item because we actually have not.
2016-09-13 21:52:28 +02:00
Carlo Wood d2626d725d Makefile cleanup - fix merge conflict change 2016-09-13 16:31:08 +02:00
Carlo Wood e93324785b list_vmd_make_targets and list_cmake_targets
* This allows one to run 'make posix list_vmd_make_targets' and get output like

>make posix list_vmd_make_targets
[...]
-- Build files have been written to:
/usr/src/debian/px4/Firmware/Firmware.git/build_posix_sitl_default
PX4 CONFIG: /usr/src/debian/px4/Firmware/Firmware.git/build_posix_sitl_default
Scanning dependencies of target list_vmd_make_targets
[100%] List of acceptable 'posix_sitl_default' <viewer_model_debugger> targets:
none
none_iris
none_iris_opt_flow
none_tailsitter
[...]
replay_solo_valgrind
replay_typhoon_h480_valgrind
[100%] Built target list_vmd_make_targets

Or, run 'make list_vmd_make_targets' from the build_posix_* directory.

* This adds the list_cmake_targets make target to print all
cmake targets that one can match with PX4_NO_OPTIMIZATION.
PX4_NO_OPTIMIZATION is ignored (do optimization as normal)
when the CONFIG isn't posix_sitl_*.

* Add comment in Makefile on how/where to find all targets.
2016-09-13 16:31:08 +02:00
Carlo Wood 6f94f7031b More Makefile cleanup.
Use $(MAKE) -C build_dir ..., not (cd build_dir; make ...)
(ie, see https://blog.flameeyes.eu/2010/10/tell-tale-signs-that-your-makefile-is-broken)

Also talk about 'make targets' where appropriate, instead of 'cmake targets' %-).
2016-09-13 16:31:08 +02:00
Carlo Wood 77d356d275 Target specific optimization control.
This allows one to set a semi-colon separated list of regular
expressions in the environment variable PX4_NO_OPTIMIZATION
to control which (cmake generated) targets should be compiled
without optimization.

Suppressing optimization can be necessary for debugging in
a debugger, especially when trying to step through the code
or needing to print variables that otherwise are optimized out.

EXAMPLE

export PX4_NO_OPTIMIZATION="px4;^modules__uORB;^modules__systemlib$"

will result in the following messages during cmake configuration:

[...]
-- Disabling optimization for target 'platforms__posix__px4_layer'
because it matches the regexp 'px4' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__systemlib' because it
matches the regexp '^modules__systemlib$' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__uORB' because it matches
the regexp '^modules__uORB' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'examples__px4_simple_app' because
it matches the regexp 'px4' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__uORB__uORB_tests' because
it matches the regexp '^modules__uORB' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'px4' because it matches the regexp
'px4' in env var PX4_NO_OPTIMIZATION

Note that a list of all (currently used) target names can be printed
with the following command line from within the required build directory:

find . -wholename '*/CMakeFiles/*.dir/flags.make' | xargs dirname | xargs basename -a | sort -u | sed -e 's/.dir$//'
2016-09-13 16:31:08 +02:00
Carlo Wood 541c8a06ca Partly cleanup and simplify cmake/configs/posix_sitl_* config files.
While the config_sitl_rcS_dir is used more extensively (and actually
only depending on the base cmake target), the variables
config_sitl_viewer and config_sitl_debugger are just used to be
passed on for the run_config target; config_sitl_debugger is even
*always* 'disable'. Hence, they don't really need to be cached
(INTERNAL or not). Before this patch FILEPATH was used instead
of INTERNAL, but I doubt very much that that was intended. That
only makes sense when cmake-gui would be used and then would pop-up
a file browser to let the user pick a file (while really they
need to pick a directory, so it's wrong either way).

The ONLY reason caching would be used is when a developer edits
the build_posix_sitl_*/CMakeCache.txt files, changes these values
and then runs cmake in the build directory again, now overriding
the values intended here. Nevertheless, I left in the caching.

The main change in this commit (that theoretically has no real effect)
is that I removed the duplicated maintenance of
posix_sitl_broadcast.cmake. When that file was added, it was an
exact copy of posix_sitl_default.cmake and is since not always
maintained to remain the same. I don't think that difference is
in anyway relevant for the broadcasting part though.

Note that I think that something like that also holds for the
posix_sitl_replay.cmake; it would be a lot better - maintenance-wise
- when it was just derived from (or the same as) posix_sitl_default,
I think.
2016-09-13 16:31:08 +02:00
Carlo Wood 900026818b Makefile cleanup.
Doesn't really do anything, but while working on understanding
things I did this cleanup, making the Makefile a lot shorter
and more flexible for future changes ;).
2016-09-13 16:31:08 +02:00
Carlo Wood 03d176d097 Bug fixes, typos, indentation.
Over time I made a few changes unrelated to what I'm really working on.
These changes are hereby committed first. The bug fixes are related to
what I'm doing in that I need them to be fixed for future commits.

Tools/sitl_run.sh: rename label to rcS_dir and fix usage help.
cmake/common/px4_base.cmake: Remove the check on OUT_UNPARSED_ARGUMENTS,
  and a few typos and indentation issues.
cmake/configs/posix_sitl_replay.cmake: Set the correct variable
  (config_sitl_rcS_dir) to the correct directory.
cmake/nuttx/px4_impl_nuttx.cmake: typos and indentation issues,
  and removal of a redundant FORCE (INTERNAL implies FORCE).
cmake/posix/px4_impl_posix.cmake: typos and indentation issues.
cmake/qurt/px4_impl_qurt.cmake: typos and indentation issues.
src/modules/mavlink/mavlink_ftp.cpp : possible strict-aliasing breakage.

NOTES

The second argument passed to sitl_run.sh is the value of
config_sitl_rcS_dir. This fact is missing from the usage help.
I renamed 'label' to 'rcS_dir' to better reflect this.
Also, for the 'replay' config the wrong variable was set causing
the call to sitl_run.sh to skip an argument and fail (ie the
debugger was passed as rcS_dir and so on).

The check on OUT_UNPARSED_ARGUMENTS in px4_parse_function_args
basically causes every passed IN variable to be REQUIRED and is
therefore a bug. The test for the presence of the REQUIRED arguments
follows directly after and is sufficient for this job. This bug went
unnoticed because currently every argument to OPTIONS, ONE_VALUE,
and MULTI_VALUE is actually passed to the function(s) calling
px4_parse_function_args (them being REQUIRED or not).

The changes in mavlink_ftp.cpp are to avoid a possible aliasing bug
and (mostly) to avoid the compiler warning/error: dereferencing type-
punned pointer will break strict-aliasing rules [-Werror=strict-aliasing].
2016-09-13 16:31:08 +02:00
Andreas Antener 6c7e5651ce Geofence: moved rtl_on reset up so it always happens when falling out of RTL 2016-09-13 14:32:01 +02:00
Andreas Antener 5a7046027c added rattitude to geofence exit condition 2016-09-13 14:32:00 +02:00
Andreas Antener a59038e3cb Geofence: fix reset after violation and also if RTL/Loiter switches are not assigned 2016-09-13 14:32:00 +02:00
Roman ab4731a99f fw_pos_control_l1: for tailsitters we need to rotate the body acceleration
vector as it has it's reference in the mc frame

Signed-off-by: Roman <bapstroman@gmail.com>
2016-09-13 14:32:00 +02:00
Andreas Antener e1e410783a tailsitter: correctly use roll/pitch inputs when optimal recovery is enabled 2016-09-13 14:32:00 +02:00
Andreas Antener 8c9f4e8ab8 added which transition the vtol is in to vehicle status 2016-09-13 14:32:00 +02:00
Andreas Antener 46105f735e finish back transition when a mode change from manual to auto happens during the back transition 2016-09-13 14:32:00 +02:00
Andreas Antener c6e4926d4e prevent instant transition to fixed-wing while already in back transition, prevents unsafe flying state 2016-09-13 14:32:00 +02:00
Beat Küng 670697b0ac fw_att_control_main: fix implicit float to double conversion issue
GCC 6.1.1 output:
../src/modules/fw_att_control/fw_att_control_main.cpp:884:41: error:
implicit conversion from ‘float’ to ‘double’ to match other operand of
binary expression [-Werror=double-promotion]
2016-09-13 11:43:22 +02:00
Daniel Agar 31ddf6bdd9 sitl_run.sh use full path to jmavsim_run.sh 2016-09-13 11:30:38 +02:00
Beat Küng e7afecb544 Tools: add separate jmavsim_run.sh script
It is useful to run jmavsim separately, for example when debugging mainapp
separately, or running some other external tool on mainapp (like heap
analysis)
2016-09-13 11:30:38 +02:00
Lorenz Meier 7d7e40f594 UAVCAN: Adjust stack size to platform 2016-09-11 20:07:30 +02:00
Lorenz Meier 29d33a12dc Simulator: Adjust way too small task stack 2016-09-11 20:07:30 +02:00
Lorenz Meier f815d9fa74 sdlog2: Adjust writer stack size 2016-09-11 20:07:30 +02:00
Lorenz Meier 1c2b932cf8 MAVLink receiver: Adjust stack size 2016-09-11 20:07:30 +02:00
Lorenz Meier bb48787811 Logger: Adjust pthread stack size 2016-09-11 20:07:30 +02:00
Lorenz Meier 9a8e6de7fe EKF2: Remove QuRT hackery 2016-09-11 20:07:30 +02:00
Lorenz Meier c52c692c4f Commander: Adjust pthread stack size for platform 2016-09-11 20:07:30 +02:00
Lorenz Meier 5b69e58925 Provide macros and extensions to the task spawn command to set the stack sizes right 2016-09-11 20:07:30 +02:00
Simon Wilks efd64e2cd2 Update the title metadata and gains after some tuning flights. (#5480) 2016-09-11 18:46:00 +02:00
Dennis Shtatnov 52fdbf4acc Syslink Bridge to Mavlink (#5479) 2016-09-11 11:23:15 +02:00
Daniel Agar 446f8e3a36 make quick_check even quicker 2016-09-09 18:50:51 -04:00
James Goppert d5c96ec66a LPE rate and stddev changes for mocap/vision. (#5467) 2016-09-07 23:56:10 +00:00
James Goppert 76c2d92b7e Fix for lpe accel bias saturation. (#5466)
* Fix for lpe accel bias saturation.

* Formatting.
2016-09-07 23:53:50 +00:00
Andreas Antener 3163cf90c9 FW: simplified flap/flaperon logic and always move them at the same rate (don't jump) 2016-09-07 19:29:32 +02:00
Beat Küng be4db3c5df vehicle_command topic: use uorb queuing with length 3
Just to make sure we don't lose any messages.
2016-09-07 18:47:12 +02:00
James Goppert c1b73a068e qavr tuning 2016-09-07 10:26:12 -04:00
Lorenz Meier f34a56999f Remove SRF02 driver to make flash space 2016-09-07 13:29:41 +02:00
Bart Slinger 79d8d580b1 Append AUX mixer for HITL simulation (#5457) 2016-09-07 12:09:22 +02:00
Andreas Antener cbbf5e2e7c filtering files for code check seperately to enable fast use of git pre-commit hook to check code style
ask user to install pre-commit hook when code style is checked
2016-09-07 11:25:51 +02:00
Michael Schaeuble 93201835d3 Fix code style 2016-09-07 08:24:08 +02:00
Michael Schaeuble 57fee8b9de Update DF submodule 2016-09-07 08:24:08 +02:00
Michael Schaeuble 1fac4c4874 Improve code documentation and code cleanup 2016-09-07 08:24:08 +02:00
Michael Schaeuble 40bf8f75d6 Add Bebop mixer and controller gains 2016-09-07 08:24:08 +02:00
Michael Schaeuble ad8f51f662 Update PX4 config to new functionality 2016-09-07 08:24:08 +02:00
Michael Schaeuble d84a325010 Integrate DF BebopBus into the wrapper 2016-09-07 08:24:08 +02:00
Michael Schaeuble 5d3e9df731 Add DF wrapper for BebopBus driver 2016-09-07 08:24:08 +02:00
Miguel Arroyo 8dfbb43e00 Adds Navio Kill Switch Logic (#5461) 2016-09-07 08:17:41 +02:00
Andreas Antener 06bfecd829 Geofence: use correct types for float params 2016-09-07 08:05:28 +02:00
Andreas Daniel Antener 9ea4c33ede Battery: directly evaluate critical battery state if set, wait longer for USB detection to happen (#5460) 2016-09-07 07:26:06 +02:00
Lorenz Meier e011a528eb Enable a workaround for #5438 (#5450)
* Enable a workaround for #5438

* Disable Travis Slack integration

* Fix formatting
2016-09-06 23:34:02 +02:00
Beat Küng 78df9de4c4 update jmavsim submodule 2016-09-06 16:25:13 +02:00
Beat Küng 9c0380c31d update jmavsim submodule 2016-09-06 15:58:48 +02:00
Beat Küng 44520522ac vmount: make sure the test command works, even if MNT_MODE_IN is 0 2016-09-06 11:39:22 +02:00
Lorenz Meier 3f07b03911 SITL: Tune standard VTOL to have better position control performance & update gazebo 2016-09-06 11:35:52 +02:00
Beat Küng 90c7b06152 mavlink hil: add HIL_CONTROLS publication for compatibility (eg. with mavros) 2016-09-06 11:33:18 +02:00
Beat Küng 3de4ec7093 Update SITL gazebo 2016-09-06 11:33:18 +02:00
Beat Küng 7e05c12f5d px4fmu hexa mixer: add support for mount/gimbal output 2016-09-06 11:33:18 +02:00
John Hsu 340cb05f70 Add configurations for Zephyr SITL. Add init script for Zephyr SITL. Update hexa_x.main.mix with leg control. 2016-09-06 11:33:18 +02:00
Beat Küng 010c9e937b SITL: switch to HIL_ACTUATOR_CONTROLS mavlink message & add pwm_out_sim support for 16 outputs 2016-09-06 11:33:18 +02:00
Beat Küng 41913c4a80 vmount: fix print status output, adjust stack size, improve error handling 2016-09-06 11:33:18 +02:00
Beat Küng 0a95c447b0 vmount: add 'vmount test' command to set a specific angle 2016-09-06 11:33:18 +02:00
Beat Küng ccde51304a cmake px4fmu-v2: disable vmount for now, due to flash overflow 2016-09-06 11:33:18 +02:00
Beat Küng 94dbf358bd vmount: refactor architecture & use C++
This splits vmount into inputs and outputs modules with a small API in
between. It allows for greater flexibility, as any input method can be
combined with any output method. At the same time it is easy to add a new
input or output module.
2016-09-06 11:33:18 +02:00
Beat Küng 8757b9a9a5 cmake posix sitl: add vmount driver 2016-09-06 11:33:18 +02:00
Leon faebdeedcf vmount: add mount and ROI implementation
MavLink spec implementation

implemented vehicle_roi topic

rename old gimbal to rc_gimbal

little changes

corrected RC Gimbal group

Starting ROI implementation in commander

implementation done, needs to be tested

uhm..

add todo

Change to float32 for x,y and z

remove mission topic again, not needed

change roi coordinates to lat, lon and alt

adjust to float64

starting mount implementation

correcting small mistakes, compiles now

add todos

further progress

implementing parameters

adjust default parameters

started implementation of mavlink

fix typo

change to lat, lon and alt

fix typo :D

change to double (to represent float64)

add global_position_

add mount topic

commander mount implementation done

cleanup

almost finished

little fix

codestyle fixes

leave pitch at 0 degrees

added pitch calculation

codestyle changes

Undo vehicle_mount, react to updated parameters, parsing of CMD_DO_MOUNT_* in mount.cpp

start implementing mode override

forgot a semikolon.

add debug

Finish implementation of mount override and manual control.

fix codestyle

correct cleanup

rename to vmount

works now

fix rebase error

fix polling

refactoring and custom airframe for gimbal

couple changes

remove warnx

almost done

finally

What is going on?

change back to actuator_controls_2

working

bump parameter version number and some clarification

fix submodules
2016-09-06 11:33:18 +02:00
Beat Küng e6391189bc px4_simple_app: update printf to latest format version 2016-09-06 10:41:46 +02:00
Beat Küng 0da44b7166 posix main: make <data_directory> argument optional, default to CWD 2016-09-06 10:41:36 +02:00
Daniel Agar f07cd13fe8 circleci update to tolerate submodule changes (#5451)
- remove broken ccache setup
2016-09-05 00:47:48 -04:00
Carlo Wood 4a5eae23a2 Increase stack space on posix 64bit architectures. (#5447)
When running a simulation with, for example,
make posix jmavsim
px4 crashed almost 100% reproducable near start up.

This turned out to be a stack overflow. On gitter
it was suggested that the main reason for this could
be stack sizes, as currently used, assume a 32bit pointer
size and that doubling the stack size for everything
but NuttX would be the Right Thing.

This is the solution that I came up with (it makes
my core dumps disappear).
2016-09-04 23:04:04 +02:00
Lorenz Meier f607069a57 Purge old configs 2016-09-04 21:57:19 +02:00
Lorenz Meier 3aa66da20f Build serdis / sercon with size optimization 2016-09-04 21:44:30 +02:00
Lorenz Meier 07966de432 Build serdis / sercon with size optimization 2016-09-04 21:43:44 +02:00
Lorenz Meier 8709078c38 Save some flash for much too verbose output 2016-09-04 20:55:03 +02:00
Dennis Shtatnov 585147d5b7 Working LPS25H driver 2016-09-04 19:12:08 +02:00
Dennis Shtatnov 1fd3636ab3 Flyable gains for CF2 2016-09-04 19:12:08 +02:00
Dennis Shtatnov c842b0457f Syslink for battery, RSSI, and initial radio control 2016-09-04 19:12:08 +02:00
Dennis Shtatnov b99b886576 CF2 correct motor map and LEDs 2016-09-04 19:12:08 +02:00
Dennis Shtatnov e91821d2a2 Merge Crazyflie motor driver with FMU
Comment corrections
2016-09-04 19:12:08 +02:00
Dennis Shtatnov e6b98b2ab8 Tweak configs for CF2
Fix build error

Capitalization mistake for headers

Non-Mac compiler issue

Baudrate for crazyflie nrf and fix code style

Save space

Cleanup mpu9250 driver
2016-09-04 19:12:08 +02:00
Dennis Shtatnov 5100785f51 MPU9250 I2C mode
Fixes for other boards

Functioning sensors
2016-09-04 19:12:08 +02:00
Dennis Shtatnov 9c8e56401b Working motors and mtd for CF2 2016-09-04 19:12:08 +02:00
Tim Dyer b65ff53b00 Initial build for Crazyflie 2.0
Working crazyflie firmware build

* Console on USART3
* Could not disable building PX4IO firmware, currently commented out

Don't build PX4IO firmware if the board doesn't ask for it

Added crazyflie motor driver

Fixed wrong register

CLK_SEL is in PWR_MGMT_1

Initial I2C/SPI MPU9250 device

* Tested with I2C
* Need to add error checking
* Intermittent crash on stop call

Working ak8963 mag driver

Functional lps25h driver. Work in progress.

Works well enough to probe and allow sensors task to start.

Added serial port test module

HACK! Get sensors module working

Set crazyflie PWM range

Extend baudrate for Crazyflie's NRF radio

Added dummy tone alarm to allow for init

Added autostart script for Crazyflie
2016-09-04 19:12:08 +02:00
Lorenz Meier c1e681df60 HMC: Fill extended mag report completely 2016-09-04 19:11:46 +02:00
Lorenz Meier 45f740e210 Device: Allow access to device id 2016-09-04 19:11:28 +02:00
Lorenz Meier 31bba3a847 Report mag data 2016-09-04 19:10:57 +02:00
Lorenz Meier 8c49372e7a Better error reporting for sdlog2 2016-09-04 18:47:41 +02:00
Carlo Wood cc69dd5665 printf format fixes. (#5444)
After I got a compiler warning for a printf format in this file
(which I cannot reproduce anymore; for some reason g++ is usually
quite happy with all the errors in this file), I fixed all 'printf'
formats to match the type of their arguments as follows:

uint8_t         : %hhu
uint16_t        : %hu (or %hx)
uint32_t        : %u (or %x)
int16_t         : %hd
int and int32_t : %d
long int        : %ld

Since this file is C++, what we REALLY should be using is
ostream operator<<'s of course (type safe by design and faster
(compile time type matching, no need for format decoding)).
2016-09-04 14:28:23 +02:00
Miguel Arroyo f999fbe440 Publishes LPE GPS epv and eph as estimator status. (#5413)
* Publishes LPE GPS epv and eph as estimator status.

* Adds timestamp
2016-09-03 22:00:51 +02:00
Nicolas de Palezieux a071ef94db always update armed flag (#5434)
otherwise the battery estimator does not compute bat_v_empty_dynamic correctly
2016-09-03 21:59:27 +02:00
Otávio d03611763a Use readdir instead of readdir_r (#5421)
readdir_r is deprecated since glibc version 2.24 and glibc manual
recomends usage of readdir instead of readdir_r.
Replacing readdir_r by readdir will also not be a problem for Nuttx,
because readdir_r is using readdir and filling parameters with the
return information.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2016-09-03 13:45:40 +02:00
Michael Schäuble b9b9f17eee Fix build errors (#5436)
* Use sorted to fix python3 build error

* Add drv_hrt.h include to Bebop df wrappers
2016-09-03 12:34:27 +02:00
Lorenz Meier 723d3c121a Find and use Python 2 (#5442)
This will make the build works in distros that have Python 3 as default
and will not break anything in distros that have Python 2 as default.
2016-09-03 12:33:48 +02:00
Mark Whitehorn a054fb1e04 fix altitude setpoint bug (#5409) 2016-09-03 12:33:36 +02:00
Lorenz Meier ea212a8ef5 LPE: Avoid false positives for GPS 2016-09-03 12:30:42 +02:00
Nate Weibley 686fd5b125 Convert geofence distance params to float (#5435) 2016-09-02 11:49:53 -04:00
Beat Küng ced33e982b update mavlink submodules 2016-09-01 13:37:42 +02:00
Beat Küng 33fdb072df uORBMain: disable message logging to the ulog on Snapdragon 2016-09-01 09:59:17 +02:00
Lorenz Meier 48a94e3570 Fixed i2c not running (#5408) 2016-09-01 09:19:30 +02:00
stmoon d219b8cf46 fix the bug for double space 2016-09-01 08:44:16 +02:00
Nate Weibley 22d286b9ce Fix version generation for release builds, #5308 (#5422) 2016-08-31 22:03:00 +02:00
Lorenz Meier 1d99f83b34 Add config for LPE and plane 2016-08-31 09:17:01 +02:00
James Goppert 9d861f021c Use git tag in cpack package. 2016-08-29 22:17:40 -04:00
James Goppert f6d7fef7c2 Added more gains for dji matrice. 2016-08-29 22:05:59 -04:00
James Goppert 8707cbc315 Fix version. 2016-08-29 22:05:48 -04:00
Lorenz Meier 5a734de319 Commander: Increase stack space 2016-08-29 23:36:34 +02:00
Lorenz Meier ece70dc18d Revert "commander: Running a bit low on space"
This reverts commit 2a90f7e9c0.
2016-08-29 23:35:56 +02:00
Lorenz Meier 2a90f7e9c0 commander: Running a bit low on space 2016-08-29 22:47:07 +02:00
James Goppert 36acb90680 Fix gps noise matrix for LPE. 2016-08-29 16:08:28 -04:00
Andreas Daniel Antener 02029882db SITL CI: gracefully fail tests early (#5405) 2016-08-28 21:56:31 +02:00
Lorenz Meier 15e50b26dc Fix MAVLink subscription 2016-08-28 15:53:42 +02:00
Lorenz Meier 8dc8ae7de8 MAVLink app: Only hold buffers for published topics 2016-08-28 10:49:41 +02:00
Lorenz Meier d4b588f84a Fix proto version selection 2016-08-28 10:40:00 +02:00
Lorenz Meier 19c2ae615f MAVLink: Do no not init fds struct 2016-08-28 10:26:59 +02:00
Lorenz Meier 1a716e1a0d Update MAVLink 2.0 headers 2016-08-28 10:08:15 +02:00
Lorenz Meier 6f19531ce4 MAVLink: Cleanup of port handling, switch to MAVLink 2 if receiving MAVLink 2. Announce MAVLink 2 capability in autopilot_version message
commit
2016-08-28 10:08:15 +02:00
James Goppert 6b08e8ce1f Improvements to lpe for flow and gps. (#5401) 2016-08-27 23:50:24 -04:00
James Goppert be1417f613 LPE alt init now allows baro only init without GPS w/o changing flag. (#5398)
Flight test went well, merging.
2016-08-27 21:57:32 -04:00
James Goppert 4499006744 Condition LPE covariance to avoid blowing up in edge cases. (#5377)
Merging this as it is definitely more robust than what we have now.
2016-08-27 21:18:27 -04:00
James Goppert dbc5e90993 Change to sitl to allow no board rotation for gazebo. (#5400)
* Change to sitl to allow no board rotation for gazebo.

* Fix typo in typhoon launch file and create config for lpe.

* Exit early on test failures
2016-08-27 20:03:54 -04:00
Mark Whitehorn bad6f0032c change board rotation to zero (#5392) 2016-08-27 22:56:08 +02:00
Lorenz Meier 25182108f9 Ensure NuttX build depends on defconfig 2016-08-27 12:56:31 +02:00
Lorenz Meier 5ef6d7952f MAVLink app: Enforce code style 2016-08-26 23:43:49 +02:00
Lorenz Meier 720c445f21 MAVLink: Code style 2016-08-26 23:43:33 +02:00
Lorenz Meier e67a6bdfc2 MAVLink: No need to restore previous port config on exit 2016-08-26 23:38:46 +02:00
Nicolas de Palezieux ebce93f338 only advertise range topic of px4flow board if it is the primary range device (#5390)
this allows selecting another range device such as a lidar by starting that app first
2016-08-26 14:28:46 +02:00
Lorenz Meier a1627fad9a Slack: Only report Travis CI failures 2016-08-26 12:11:48 +02:00
Luís Rodrigues cda4338095 Configuration parameter for TeraRanger One (#5359) 2016-08-26 12:03:18 +02:00
Lorenz Meier 3d7906647e Test Travis fix for OS X 2016-08-26 11:16:00 +02:00
mazahner 73014acf97 Only Compile and create dependencies for the Messages specified in msg/CMakeLists.txt
this lets a user select what msgs should be compiled for his project
Care must be taken though, to compile all orb_topcis that are required by the Rest of the Code.
Otherwise many compile errors will occur.

This commits adds by default the ./msg include path to reference to other msgs.
if an exisiting msg is used in another msg.
2016-08-25 22:30:13 +02:00
David Sidrane add2aa0680 Update Nuttx Submodule to included Proper MAC El Capitan USB fix ==master (#5385) 2016-08-25 21:59:59 +02:00
Lorenz Meier 1dfe51b11b Travis CI: OS X needs to build at least onene Firmware target 2016-08-25 21:48:30 +02:00
Lorenz Meier f511d49cc2 Improvements to SITL to make paths more flexible. (#5181) (#5255)
* Path cleanup for SITL.

* Restructured sitl scripts dir.

* Set integration tests to use ekf2 for vtol.

* Fix sitl paths for mac.
2016-08-25 21:47:45 +02:00
Beat Küng 61f7470e7e df wrappers: fix invalid NaN to int16 conversion (set to 0 instead)
The result of this conversion is undefined!
2016-08-25 13:14:15 +02:00
Beat Küng a7ef9b4954 fix navio_gpio: use uintptr_t for pointer type instead of uint32_t 2016-08-25 13:14:15 +02:00
Beat Küng 4b6e6572b9 fix navio_sysfs_pwm_out: use correct type for buflen (required by MultirotorMixer::from_text) 2016-08-25 13:14:15 +02:00
David Sidrane d4530d3a39 Update Nuttx Submodule to included MAC El Capitan USB fix ==master (#5380) 2016-08-25 09:24:52 +02:00
Tiktiki 111b41bc86 Removed configuration files from master (depreciated). (#5379)
* Update multi_tables.py

* Update mixer_multirotor.cpp

* Create gk

* Rename gk to 13011_greenkoptr

* Update 13011_greenkoptr

* Create greenkoptr.main

* Update and rename greenkoptr.main to greenkoptr.main.mix

* Create greenkoptr.aux.mix

* Update greenkoptr.main.mix

* Update 13011_greenkoptr

* Update multi_tables.py

Corrected HEX_T position and rotation for motors 1-2-5-6

* Delete 13011_greenkoptr

* Delete greenkoptr.aux.mix

* Delete greenkoptr.main.mix

* Update mixer_multirotor.cpp
2016-08-25 00:32:35 +02:00
Mark Whitehorn 545152f676 remove "transitional support" (#5378) 2016-08-24 23:05:39 +02:00
Beat Küng 96384bdc29 df wrappers: add drv_hrt.h include 2016-08-24 21:30:50 +02:00
Beat Küng eede43a786 px4_log.h: move px4_log_initialize() out of #ifdef 2016-08-24 21:24:35 +02:00
Beat Küng b8e247a018 muorb: add drv_hrt.h include for hrt_absolute_time 2016-08-24 21:24:35 +02:00
Beat Küng 441a05d976 uorb unittests stubs: add orb_advertise_queue 2016-08-24 21:24:35 +02:00
Beat Küng 528ca931af logger: only add data message to the log if orb_copy succeeds, when adding a new instance 2016-08-24 21:24:35 +02:00
Beat Küng df53fb0fde logging: publish a message for PX4_{WARN,ERR} & store them to the ulog file
- ulog file message rate limited to 50Hz
- queuing with size 2
- this replaces the mavlink log message in the ulog
  (but the mavlink warnings & errors still go to the ulog)
2016-08-24 21:24:35 +02:00
Beat Küng eae1585e38 logger: store full file name in logger, remove it from log writer
- also add log file to the status output
2016-08-24 21:24:35 +02:00
Beat Küng aefd217fc0 uorb subscription: remove _interval & use orb_get_interval() instead 2016-08-24 21:24:35 +02:00
Beat Küng 6b4c24fb12 px4_log: remove __px4_log_level_current
- there is no way to change it at runtime
- it was implemented wrong (<= comparison disabled the PANIC log level)
2016-08-24 21:24:35 +02:00
Beat Küng e2afb0be6b px4_log.h: remove hrt_absolute_time() declaration (it does not belong here) 2016-08-24 21:24:35 +02:00
Beat Küng d404359888 local_position_estimator_main: warnx -> PX4_{WARN,INFO,DEBUG} 2016-08-24 21:24:35 +02:00
Julian Oes 14ed65f0e4 sitl_run.sh: use ps instead of jps (#5376)
The tool jps does not seem to be available on macos Java.
2016-08-24 17:07:14 +02:00
Beat Küng 0127f4017a NuttX: update submodule 2016-08-23 20:17:16 +02:00
Lorenz Meier fadac79617 Add 9250 startup for FMUv2 2016-08-23 19:51:57 +02:00
Beat Küng 1fffd731b1 print_load_posix under DARWIN: remove unused variable basic_info (#5364) 2016-08-23 09:09:55 +02:00
Lorenz Meier 79678c5f25 MPU6K fix code style 2016-08-19 22:24:41 +02:00
Bart Slinger 7f04e3c759 Helicopter aiframe and basic PID control (#5339)
* Helicopter aiframe and basic PID control

* codestyle

* Blade 130x gains working but not optimal

* Changed behaviour of feedforward for all multicopter
2016-08-19 22:20:59 +02:00
Mark Whitehorn 75c95955fc Update 4050_generic_250 (#5343) 2016-08-19 22:20:27 +02:00
Mark Whitehorn 1b5964dc42 Update 4009_qav250 (#5344) 2016-08-19 22:19:47 +02:00
Lorenz Meier 7579ebf4e8 Fix failing mac test 2016-08-19 22:19:05 +02:00
Julian Oes 62297c3d86 DriverFramework: updated submodule (#5351)
- Fix if _retries variable is not set to prevent "UINT_MAX-1"
  retries.
- Update for the cmake_hexagon submodule.
2016-08-19 22:17:13 +02:00
Gus Grubba 821d7062df Support for new log file extension. (#5355) 2016-08-19 22:16:46 +02:00
Lorenz Meier 306a911dc9 Fix MPU6K driver ICM extensions 2016-08-19 22:09:05 +02:00
Beat Küng c3c8fa55b3 RC st24: change channel input range from [0,4096] to [500,3500] (#5350)
QGC failed to calibrate RC with the old range.
2016-08-19 20:45:56 +02:00
Lorenz Meier fe62c259e8 Fix MPU6K initialization 2016-08-19 11:10:11 +02:00
James Goppert 90b509a73f Update driver framework. (#5347) 2016-08-18 19:32:57 -04:00
James Goppert 372d16ee5e Update matrix. (#5346) 2016-08-18 18:01:55 -04:00
James Goppert 569e87d46b Update sitl gazebo. (#5345) 2016-08-18 17:22:13 -04:00
Lorenz Meier 192cde408a Remove unnecessary C++11 usage in UAVCAN 2016-08-18 21:44:15 +02:00
James Goppert 818840b576 Path cleanup, low impact changes (#5340)
* Low impact changes from path_cleanup branch.

This is a step towards minimizing the diff with path_cleanup branch.

* Update ecl.

* Revert matrix update.

* Revert ecl and matrix.

* Update sitl gazebo.

* Revert sitl_gazebo and matrix changes.
2016-08-18 15:37:23 -04:00
Lorenz Meier d32a7ffb8d Probe for ICM20608 2016-08-18 21:02:48 +02:00
Pavel Kirienko 24e90e3c90 UAVCAN servers: fixed member initialization; removed dead stuff 2016-08-18 17:14:53 +02:00
Pavel Kirienko d12be196a2 Fixed #5153 2016-08-18 17:14:53 +02:00
Pavel Kirienko 2784c3c5f0 Improved uavcan activity indication 2016-08-18 17:14:53 +02:00
Pavel Kirienko 64d7946cdc Fixed beep duration 2016-08-18 17:14:53 +02:00
Pavel Kirienko 36efc8c83e Fixed beeping 2016-08-18 17:14:53 +02:00
Pavel Kirienko 61ffc6c432 Fixed implementation of the ESC auto-enumeration feature 2016-08-18 17:14:53 +02:00
Pavel Kirienko 2fad9a6397 ESC status: printing temperature in Celsius 2016-08-18 17:14:53 +02:00
Pavel Kirienko 42031ab572 Better beeping during ESC enumeration 2016-08-18 17:14:53 +02:00
Pavel Kirienko e27d3f4e13 Added new configuration parameter UAVCAN_ESC_IDLT.
This parameter, when enabled, enforces that the UAVCAN ESC driver never outputs zero throttle
while the system is armed. This feature is disabled by default, so the change will not break
the experience of current users.
2016-08-18 17:14:53 +02:00
Hidenori 2ba70c5d89 rename Tools/rpi/clang-check.sh to Tools/clang-tool.sh
extended in two ways: target specification and tool selection.
2016-08-18 16:11:05 +02:00
Hidenori 211c2b9ca6 Rename clang toolchain file 2016-08-18 16:11:05 +02:00
Hidenori 9181f97f71 RPi: move clang-check.sh to Tools/rpi 2016-08-18 16:11:05 +02:00
Hidenori a1f89e4fd9 RPi: add a comment to clang-check.sh 2016-08-18 16:11:05 +02:00
Hidenori a8d3b15d73 RPi: add clang & clang-check support 2016-08-18 16:11:05 +02:00
Lorenz Meier ae00abe468 Fix typo 2016-08-18 15:44:51 +02:00
Tiktiki dfed00d870 Update multi_tables.py
Corrected HEX_T position and rotation for motors 1-2-5-6
2016-08-18 15:27:32 +02:00
Tiktiki 03e5d7490f Update 13011_greenkoptr 2016-08-18 15:26:26 +02:00
Tiktiki 7d4e7aff20 Create greenkoptr.main
Update and rename greenkoptr.main to greenkoptr.main.mix

Create greenkoptr.aux.mix

Update greenkoptr.main.mix
2016-08-18 15:26:25 +02:00
Tiktiki a962098645 Create gk
Rename gk to 13011_greenkoptr

Update 13011_greenkoptr
2016-08-18 15:26:21 +02:00
Tiktiki 021da9b2e1 Update mixer_multirotor.cpp 2016-08-18 15:25:24 +02:00
Tiktiki 3daf4a3a67 Update multi_tables.py 2016-08-18 15:25:24 +02:00
Andreas Bircher 9fe95275bb removing unnecessary parts 2016-08-18 15:12:39 +02:00
Andreas Bircher 70cd06bc84 initial version camera turn on / off 2016-08-18 15:12:39 +02:00
Lorenz Meier a97c5ec4e1 MPU6K compile and code style fixes 2016-08-18 13:50:29 +02:00
Lorenz Meier 3d1f1522d9 MPU6K driver improvements 2016-08-18 12:55:54 +02:00
sander 1efe011522 code style 2016-08-17 23:58:04 +02:00
sander 5bb36162be Start time based transition blending half-way 2016-08-17 23:58:04 +02:00
sander e6834579e5 Use altitude acc rad 2016-08-17 23:58:04 +02:00
sander 7afa21ebb7 Revert altitude acceptance radius to combat overshoot 2016-08-17 23:58:04 +02:00
Mark Whitehorn f1a1c9d7da add breakpoint and slope params for TPA 2016-08-17 23:15:36 +02:00
Mark Whitehorn 5c78af0f36 simple linear throttle PID attenuation test 2016-08-17 23:15:29 +02:00
JochiPochi 31e634b082 mpu6000 driver: set icm registers only on icm devices 2016-08-17 20:50:44 +02:00
JochiPochi e3557e0d3e mpu6000 driver: Add DLPF set function for IMC20608 2016-08-17 20:50:44 +02:00
JochiPochi ce27cc8326 mpu6000: Separate DLPF params for MPU and ICM family of sensors 2016-08-17 20:50:44 +02:00
Lorenz Meier 9f9c51eab3 Fix MPU6500 devtype define 2016-08-16 23:32:44 +02:00
James Goppert 7472c9033b Formatting fix. 2016-08-16 01:39:47 -04:00
Lorenz Meier 73362f325b Update mapping 2016-08-15 23:31:58 +02:00
Lorenz Meier 39ce001c41 MAVLink: use only the memory it needs 2016-08-15 19:53:21 +02:00
Lorenz Meier d810726c6e EKF2: Only use the memory it needs 2016-08-15 19:53:21 +02:00
Lorenz Meier a7ad722b98 Use less memory for ESC driver 2016-08-15 19:53:21 +02:00
Lorenz Meier 7cc0b32e74 Make altitude more efficient and estimator status safe in terms of memory overflow 2016-08-15 19:53:21 +02:00
Lorenz Meier 5786b73772 Tweak startup order for memory 2016-08-15 19:53:21 +02:00
Lorenz Meier a130b6a65c style cleanup 2016-08-15 19:53:21 +02:00
Lorenz Meier 1a9688c42f Commander: signal high memory usage 2016-08-15 14:58:33 +02:00
Lorenz Meier 8934aaa912 Load mon: populate memory usage i field for NuttX 2016-08-15 14:53:48 +02:00
Lorenz Meier eceb7e21b2 Include memory in CPU load message 2016-08-15 14:53:26 +02:00
Lorenz Meier 8b66a76432 Fix FMU init 2016-08-15 10:49:43 +02:00
Lorenz Meier 4b9e1d58f7 Fix ESC driver to also include direction information 2016-08-15 10:49:43 +02:00
Lorenz Meier 0c9ead44f1 Update ASCv1 template 2016-08-15 10:49:43 +02:00
Lorenz Meier e6dcc0a2ed Complete ASC config 2016-08-15 10:49:43 +02:00
Lorenz Meier 90b5fcc1ec Strip tone alarm 2016-08-15 10:49:43 +02:00
Lorenz Meier 7ef8d197c6 Patch up ASC config 2016-08-15 10:49:43 +02:00
James Goppert b36d705688 Update matrix. (#5310) 2016-08-12 14:24:35 -04:00
James Goppert bedf081d92 Sitl gazebo update. (#5309) 2016-08-12 13:49:48 -04:00
Lorenz Meier 5d0f57d61e Update Makefile to build for QGC 2016-08-12 13:55:16 +02:00
Lorenz Meier 0551275b9c Update prototype and board ID 2016-08-12 13:55:16 +02:00
Lorenz Meier ed6c63e48f TAPv1: Harmonize with FMUv1 (since they are pretty much the same) 2016-08-12 13:55:16 +02:00
Lorenz Meier f231feb0f6 FMUv1: Harmonize with FMUv2 2016-08-12 13:55:16 +02:00
Lorenz Meier 39303aa87a Set default battery config 2016-08-12 13:55:16 +02:00
David Sidrane ac1003875a USB Fix:iForce Soft Disconnect
The STM32F404 OTG FS has an internal soft pull-up.

The HW also has one too. So we need to overcome it to force a soft disconnect.
2016-08-12 13:55:16 +02:00
David Sidrane 6f973f1d6c Better Portability with clear naming 2016-08-12 13:55:16 +02:00
David Sidrane b9d93f2cad OTG_FS_ID that is on PA10 is managed by stm32 otg fs device Driver
N.B The driver set FDMOD, Force device mode and Writing a 1 to this bit
forces the core to device mode irrespective of the OTG_FS_ID input
pin.
2016-08-12 13:55:16 +02:00
David Sidrane 6173649c43 Minor corrections 2016-08-12 13:55:16 +02:00
Lorenz Meier 8bd4a624a7 Added voltage scaling. Need to move this to board_config.h instead 2016-08-12 13:55:16 +02:00
Lorenz Meier d21023c966 FMU: Power on radio if prsent 2016-08-12 13:55:16 +02:00
Lorenz Meier 2fad39aaae tap: Init both USB pins 2016-08-12 13:55:16 +02:00
Lorenz Meier 3fff9e5826 Harmonize TAP config with FMUv4 config 2016-08-12 13:55:16 +02:00
Lorenz Meier 3203d3f770 More USB buffer 2016-08-12 13:55:16 +02:00
Lorenz Meier 7e878e221c FMUv4: Code style 2016-08-12 13:55:16 +02:00
Lorenz Meier 5678b4cc83 Enable RC lib 2016-08-12 13:55:16 +02:00
Lorenz Meier 957b01a8eb Enable serial for RC input 2016-08-12 13:55:16 +02:00
Lorenz Meier 63275ef92f Sensors: Perform init on best effort basis 2016-08-12 13:55:16 +02:00
Lorenz Meier c3022bf713 FMU: Accomodate serial only RC input 2016-08-12 13:55:16 +02:00
Lorenz Meier 1c0a494b4d Code style 2016-08-12 13:55:16 +02:00
Lorenz Meier 64e47f2fae Boot improvements for TAP 2016-08-12 13:55:16 +02:00
Lorenz Meier a52d0ca00a Remove hysteresis tests on Mac OS 2016-08-12 13:53:02 +02:00
Andreas Antener 2e44fe9edd update previous waypoint before transition command 2016-08-12 11:50:38 +02:00
Lorenz Meier 5175d45e74 Update Gazebo 2016-08-11 22:07:19 +02:00
Andreas Antener 5eaf104318 fixed optimal recovery condition 2016-08-10 22:47:26 +02:00
Andreas Antener 853a5b77fd disabled attitude setpoint change in MC controller when optimal recovery is active 2016-08-10 22:47:26 +02:00
Andreas Antener 9087ef5990 only recalculate rotation matrix and quaternion when not in velocity control 2016-08-10 22:47:26 +02:00
Andreas Antener ae533b01b6 removed unused code 2016-08-10 22:47:26 +02:00
David Sidrane deeefe5dd1 Describe the issues that requires the +=2 on arg[c|v] for NuttX (#5293)
This may be moot and should be revisited if only px4_getops is used, but this pr politely documents the reson for the logic.
2016-08-10 06:19:59 -10:00
Lorenz Meier 17561daefb TAP power: Shut down faster 2016-08-10 12:33:04 +02:00
Andreas Daniel Antener 9f4a91ab19 initialize waypoint transfer sequence with -1 (#5274) 2016-08-10 08:39:54 +02:00
huanglilong 6f7b78821a fix fake gps bugs (#5285) 2016-08-09 21:24:11 +02:00
Lorenz Meier c62b886da5 Ua venture hottupdate (#5289)
* Change default port to Serial4 and improve status outputs.

* Reduce stack size.
2016-08-09 21:19:41 +02:00
Lorenz Meier b8c377b91a Temporarily disable new logger 2016-08-09 16:00:42 +02:00
Lorenz Meier a664747d0a Remove unused sensors 2016-08-09 16:00:28 +02:00
Lorenz Meier 43f772154c TAP: adjust ESC buffer size 2016-08-09 16:00:00 +02:00
Lorenz Meier aae3a37983 GPS: Do not use nonblocking access 2016-08-09 15:59:34 +02:00
Daniel Agar 12a5ce7a0a temporarily disable uorb test on OSX (#5280) 2016-08-08 20:59:24 -04:00
Lorenz Meier 630cebeabc Relax uORB test for Darwin CI system 2016-08-07 14:05:03 +02:00
Lorenz Meier e24d18f810 Hysteresis test: Relax time for all tests for OS X CI system 2016-08-07 14:05:03 +02:00
Lorenz Meier 207a04bba0 Fix uORB tests for Mac OS 2016-08-07 14:05:03 +02:00
Lorenz Meier ead8e31de4 Hysteresis test: Fix for Mac OS CI 2016-08-07 14:05:03 +02:00
Lorenz Meier 7b5917567a Fix Mixer test for OS X 2016-08-07 14:05:03 +02:00
Daniel Agar 8b9bef3872 osx fix and enable tests 2016-08-07 14:05:03 +02:00
Roman Bapst ba047f234d ekf2 replay: added magic values for range min/max distance (#5268)
- replay was not working without these values as only range measurements
were given to the filter which were between the min/max value

Signed-off-by: Roman <bapstroman@gmail.com>
2016-08-07 11:30:54 +02:00
Lorenz Meier 393acf2231 Start ESC drivers 2016-08-07 11:15:48 +02:00
Lorenz Meier 0e9c352927 Simplify TAP config 2016-08-07 11:15:48 +02:00
David Sidrane c5e11cd16f TAP:Added i2c speed setting to init 2016-08-07 11:15:48 +02:00
David Sidrane e8ae0fe13c Made the MPU6000 driver a highbread using both hrt for SPI or workqueue for I2C 2016-08-07 11:15:48 +02:00
David Sidrane 5f342c3b5f Added I2C to MPU6000 driver 2016-08-07 11:15:48 +02:00
Lorenz Meier a0cad961b3 Remove non-used app from config 2016-08-07 11:12:20 +02:00
Lorenz Meier 58135d892b Sync estimator CMake configs for all boards 2016-08-07 10:40:17 +02:00
Lorenz Meier 990304ee22 Fix check code style to work on Mac OS 2016-08-07 10:40:17 +02:00
Lorenz Meier a73d5037f2 Fix FMUv4 build 2016-08-07 10:40:17 +02:00
Lorenz Meier cf776aeb0a Fix compilation of examples 2016-08-07 10:40:17 +02:00
Lorenz Meier 148b6e6135 Update CMake config paths 2016-08-07 10:40:17 +02:00
Lorenz Meier cba4bcd2fb Multiplatform controllers: Move to examples and fix code style 2016-08-07 10:40:17 +02:00
Lorenz Meier ee5cdab963 Move old estimators to examples 2016-08-07 10:40:17 +02:00
Daniel Agar cff9e90bec position_estimator_inav fix and enforce code style 2016-08-07 10:40:17 +02:00
Daniel Agar 4049ec2e96 mc_pos_control fix and enforce code style 2016-08-07 10:40:17 +02:00
Daniel Agar d4196f7f0c mc_att_control fix and enforce code style 2016-08-07 10:40:17 +02:00
Daniel Agar 8f01324890 ekf2 fix and enforce code style 2016-08-07 10:40:17 +02:00
Daniel Agar 968a3d499b add make format (check_code_style_all.sh --fix) 2016-08-07 10:40:17 +02:00
Daniel Agar a260a6eead check code style list unformatted modules 2016-08-07 10:40:17 +02:00
Lorenz Meier 61d5d8ce2a Makefile: Remove remaining EKF2 config bits 2016-08-07 10:39:51 +02:00
Lorenz Meier 3cc64b3b7b LPE: Remove unused var 2016-08-07 10:39:31 +02:00
Lorenz Meier fb4c620f94 Replace EKF1 with EKF2 in rover config 2016-08-06 23:34:35 +02:00
Julian Oes 68986604e9 df_mpu9250_wrapper: calibration after rotation
Same as for the df_hmc5883_wrapper.
2016-08-06 21:01:37 +02:00
Julian Oes 1dd2c94949 df_hmc5883_wrapper: use calibration after rotation
The calibration values need to be applied after the rotation, otherwise
the offsets and scale can be applied to the wrong axes.
2016-08-06 21:01:37 +02:00
Daniel Agar 2a15578f8d FW implement MAV_CMD_DO_GO_AROUND 2016-08-06 20:56:53 +02:00
Hidenori aa3ffa28c8 add copyright header 2016-08-06 20:47:55 +02:00
Hidenori 5920711c20 fix style 2016-08-06 20:47:55 +02:00
Hidenori eded7bf772 Navio: add rgbled test and tweak implementation 2016-08-06 20:47:55 +02:00
Hidenori 9a5f88d6bf Navio: fix GPIO register definition 2016-08-06 20:47:55 +02:00
Hidenori ff647e7bc8 Navio: GPIO driver command fix and update ifdefs 2016-08-06 20:47:55 +02:00
Hidenori 3049b9af01 Navio2: add support for GPIO and RGBLED 2016-08-06 20:47:55 +02:00
Lorenz Meier 40ba3f5131 Initial config for ASC module 2016-08-06 20:45:11 +02:00
Beat Küng c0e3ab632e orb: proper locking for DeviceNode::{add,remove}_internal_subscriber 2016-08-06 20:44:23 +02:00
Beat Küng b86cf2b017 orb status: print information about lost messages 2016-08-06 20:44:23 +02:00
Beat Küng 7280f71cef orb: rm static from DeviceMaster::_node_map & use the non-static getDeviceNode in uORB::Manager
Reasons:
- DeviceMaster::_node_map does not need to be shared among instances,
  because there is at most 1 instance per Flavor and different Flavors
  have non-intersecting device paths.
- Keeping it static would also require a static lock
- DeviceMaster::_node_map was not locked at all when used from
  uORB::Manager

So this fixes two synchronization issues:
- Different DeviceMaster objects could access the same static data in
  parallel
- getDeviceNode() called from uORB::Manager did not use any locking at all
2016-08-06 20:44:23 +02:00
Beat Küng 45a0a7c5ab refactor orb: uORB::Manager is responsible for the DeviceMaster objects
This has the following benefits:
- Manager can ensure that there is at most one instance of DeviceMaster
  per Flavor
- The Manager needs access to (static) data of DeviceMaster already.
  This will make it easier to access this data in a non-static way, and
  does not introduce new dependencies.
2016-08-06 20:44:23 +02:00
Andreas Antener 2dd29ec4a1 VTOL: publish stabilized FW attitude to correct topic 2016-08-06 20:43:49 +02:00
Lorenz Meier c97a18b6a4 Fix README name 2016-08-06 20:42:44 +02:00
h3ct0r 3deefb1a79 Fixed some edge cases on the geo_tag_images.py script. Added explanation to the --kml function. Added more examples for the execution of the script. 2016-08-06 20:42:24 +02:00
Beat Küng 124e1c26d9 gps injection: use the orb queuing API instead of multiple instances
It uses a queue length of 6. There are 3 RTCM msgs/s, but due to
fragmentation and WiFi lags, there can be more than that. During several
tests, a length of 6 showed no queue overflows.
2016-08-06 20:41:38 +02:00
sander 9398a4819f Only check mission when needed 2016-08-06 20:40:41 +02:00
Julian Oes 3e87ec5153 navigator: mission check refactor
The mission feasability checker was called with the same arguments
twice which made it hard to understand when a mission is marked valid.

The mission check should run in these two cases:
- When initializing (if home comes up) if there is already a mission saved.
- When the mission gets updated.
2016-08-06 20:39:56 +02:00
Lorenz Meier c76c8fda04 MC pos control: Drop default position controller gain 2016-08-06 11:50:08 +02:00
Lorenz Meier bcd5f98cb1 Navigator: Fix mission feedback and wording 2016-08-06 10:34:20 +02:00
Roman 278b607f62 Update ECL library 2016-08-06 10:18:58 +02:00
Lorenz Meier 37230f4c5d Revert "navigator: mission check refactor"
This reverts commit a956429c4c.
2016-08-05 22:10:34 +02:00
Lorenz Meier 102f5b54d7 Revert "Improvements to SITL to make paths more flexible. (#5181)"
This reverts commit 699b6a2cb3.
2016-08-05 21:29:49 +02:00
Mark Whitehorn bbe3525377 fix VTOL vehicle_status timestamp (#5252)
* fix VTOL vehicle_status timestamp

* run astyle
2016-08-05 17:00:12 +02:00
James Goppert 6ac79aa55f Formatting. 2016-08-05 06:52:35 -04:00
Lorenz Meier 08f5ece306 Remove on arming reset, be less verbose in normal conditions output 2016-08-05 06:51:54 -04:00
James Goppert 699b6a2cb3 Improvements to SITL to make paths more flexible. (#5181) 2016-08-05 06:23:59 -04:00
sander bc7178c538 Allow mission with active DL and DLL failsafe off 2016-08-05 10:19:06 +02:00
sander e8a87538b8 Code style 2016-08-05 10:19:06 +02:00
sander 95e80cc29b Only RTL when mission finishes mid air on DL Lost 2016-08-05 10:19:06 +02:00
Julian Oes a956429c4c navigator: mission check refactor
The mission feasability checker was called with the same arguments
twice which made it hard to understand when a mission is marked valid.

The mission check should run in these two cases:
- When initializing (if home comes up) if there is already a mission saved.
- When the mission gets updated.
2016-08-05 10:17:06 +02:00
Michael Schaeuble 8566cabd76 Make some code-style fixes 2016-08-05 10:15:11 +02:00
Michael Schaeuble a3a855203c Update Bebop mainapp.config with new functionality 2016-08-05 10:15:11 +02:00
Michael Schaeuble 8351afdca8 Initialize mag scaling with reasonable defaults 2016-08-05 10:15:11 +02:00
Michael Schaeuble 6aa8fcdf53 Enable commander module for Parrot Bebop 2016-08-05 10:15:11 +02:00
Michael Schaeuble 0b7fa4f5ad Apply sensor calibration after coordinate frame rotation 2016-08-05 10:15:11 +02:00
Michael Schaeuble e600e29ea4 Add DF wrapper for AK8963 2016-08-05 10:15:11 +02:00
Lorenz Meier 0481c002df Navigator: Initialize subscription and disallow copy constructors for classes that have pointer members 2016-08-05 10:13:52 +02:00
Lorenz Meier 074a71173b Systemlib: Address init and copy constructors 2016-08-05 10:13:24 +02:00
Lorenz Meier db174cf8b1 Disable EKF2 3D fusion temporarily in SITL, fix missing fast-init params for some configs 2016-08-05 10:12:44 +02:00
Bart Slinger 815c367294 Add helicopter airframe icon (#5234) 2016-08-04 17:26:17 +02:00
Beat Küng 8aa3b245a5 fix sdlog2: use LOG_DGPS_MSG for second gps (#5235) 2016-08-04 17:18:02 +02:00
Julian Oes aaeeb1684d DriverFramework: update submodule (#5233)
This brings support for the Ak8963 for Bebop.
2016-08-04 16:04:02 +02:00
Vasily Evseenko aa0c89c3ec Fix i2c collision with rgbled 2016-08-04 15:09:33 +02:00
Vasily Evseenko b4d9f44904 Wait conversion_interval before first measurement 2016-08-04 15:09:33 +02:00
Vasily Evseenko 078aca1966 Fix SENS_EN_SF1XX description 2016-08-04 15:09:33 +02:00
Vasily Evseenko 6689a3d1b1 Add SENS_EN_SF1XX param to specify sensor model
Fix missing orb_unadvertise on shutdown
Fix missing closing of file descriptors
2016-08-04 15:09:33 +02:00
Vasily Evseenko 6d3aba1c5f Fix code style 2016-08-04 15:09:33 +02:00
Vasily Evseenko 49844f52d5 Fix SF10a driver. Add support for SF11c and rename to SF1xx 2016-08-04 15:09:33 +02:00
Julian Oes 00d4eae373 attitude_estimator_q: don't filter output rates
Since we're already filtering the incoming gyro and accel sensor
signals, we don't need to filter the output rates again.
2016-08-04 11:33:44 +02:00
Julian Oes ea9c8b968a attitude_estimator_q: don't spam console
We should not spam the console just because the input data is
degenerate, it would only make things worse because everything would
slow down due to the printfs.
2016-08-04 11:33:44 +02:00
Julian Oes d748f6ca71 attitude_estimator_q: filter accel and gyro data
Since accel and gyro are not filtered in the drivers anymore, we need to
filter them in this estimator in order to achieve a similar performance.
2016-08-04 11:33:44 +02:00
Eike cfa203ca22 Remove LPOS.Z reset (#5228) 2016-08-04 11:32:26 +02:00
Mark Whitehorn 422cf7e21c assign timestamp in vtol vehicle_rates_setpoint message (#5227) 2016-08-04 08:22:33 +02:00
James Goppert eeb73888fd update sitl_gazebo (#5224) 2016-08-03 18:46:25 -04:00
Andreas Daniel Antener f3c5c2c5a9 use thrust scale parameter for vtol pusher support (#5207) 2016-08-03 23:41:01 +02:00
James Goppert feccb9bfc1 Make integraiton test script work with kinetic. 2016-08-03 17:17:07 -04:00
Lorenz Meier 5b06b40ed9 Set SITL as default target now that Pixhawk is not necessarily the default HW 2016-08-03 23:04:35 +02:00
Lorenz Meier e287b05d67 NuttX: Add file change which allows really fast log download 2016-08-03 21:10:34 +02:00
Nate Weibley 547592fddf Use a persistent file* and seek less for log download
Opening/seeking/closing the file for each data chunk was extremely
expensive and drastically slowed the download process as the position
in the file increased. Over USB with large files this change + nuttx
update results in ~ 10x speedup for log downloads.
2016-08-03 14:33:01 -04:00
James Goppert 391eb7f8df Sitl update. (#5220) 2016-08-03 13:19:26 -04:00
Andreas Antener 579d420db1 VTOL: enable MC motors after instant back transition 2016-08-03 13:56:07 +02:00
Andreas Antener 86d1488e52 added missing const keyword 2016-08-02 21:09:45 +02:00
Andreas Antener d089c427ec quadchute code style fix 2016-08-02 21:09:45 +02:00
Andreas Antener 6f1eda2b18 added single point to decide if we need quadchute, let the reason be passed from the source where we know what's going on 2016-08-02 21:09:45 +02:00
Andreas Antener 92ddc30b69 moved min alt param 2016-08-02 21:09:45 +02:00
Andreas Antener 92185945bc make quadchute work during transitions 2016-08-02 21:09:45 +02:00
sander 0cc44a82c5 Code style 2016-08-02 21:09:45 +02:00
sander 45a4472a47 Do not apply back transition duration for QuadChute 2016-08-02 21:09:45 +02:00
Andreas Antener bae5416819 removed duplicate memset 2016-08-02 21:05:00 +02:00
Lorenz Meier 033e9e140d Update MAVLink 2.0 version 2016-08-02 14:55:12 +02:00
Lorenz Meier e2d1524a7a Mission feasibility checker: Better feedback for landing waypoints 2016-08-02 14:54:40 +02:00
Lorenz Meier 670b0f7c6d Commander: MAVLink is an off-vehicle API we should not depend internally on 2016-08-02 14:54:16 +02:00
James Goppert 437221bec2 Make LPE default estimator. (#4483) 2016-08-02 02:02:01 -07:00
Beat Küng c22e7ed5c9 Tools/mavlink_shell.py: implement a simple shell with history 2016-08-02 09:10:18 +02:00
Beat Küng aefa319fc4 fw_pos_control_l1: fix compiler problem (implicit float conversion) (#5198)
issue (GCC 6.1.1):
../src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp:1284:27: error: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Werror=double-promotion]
  if ((fabs(air_gnd_angle) > M_PI) || (ground_speed_2d.length() < 3.0f)) {
2016-08-02 00:04:44 -07:00
Vasily Evseenko 457526ebe7 Don't push bad values from lidar to EKF2 (#5196)
Report terrain altitude
2016-08-01 23:30:40 -07:00
James Goppert a58c2f416f Update sitl_gazebo. (#5195) 2016-08-01 15:30:31 -04:00
Julian Oes ccea9c9e6f fmu: flash safety button correctly even disabled (#5189)
If the circuit breaker to disable IO safety is engaged, the safety
button should still blink in the appropriate pattern: double flash for
safety off, solid on for armed.
2016-08-01 02:18:36 -07:00
Julian Oes 623b99327d param: lock the bus as short as possible (#5187)
Since the FRAM and the baro are on the same bus on the Pixracer, we
currently need to lock down everything (instead of just this SPI bus)
for the time when the params are written.
Therefore, we need to keep this locking as short as possible.

This change makes the locking even shorter by moving all param_get and
param_name and param_size calls out of the lock.
2016-08-01 02:15:21 -07:00
sander 5710a0c040 Remove default geofence from gazebo_standard_vtol 2016-07-31 22:09:44 +02:00
Lorenz Meier a38263b8e7 Enforce enough braking power when users set higher horizontal speeds 2016-07-31 17:43:15 +02:00
Julian Oes dd70b3752a mpu9250: set accel DLPF to 41 Hz (#5177)
Previously, the accel DLPF was not set, so it's not clear what the
settings are or should be.
2016-07-31 08:04:01 -07:00
Lorenz Meier d809faec63 Fixes for Gazebo 2016-07-31 16:52:53 +02:00
Julian Oes 21bc5d1716 land_detector: remove leftover printf (#5178) 2016-07-31 07:49:11 -07:00
Lorenz Meier 4e81263d3a Updated Tools/sitl_gazebo 2016-07-31 15:56:35 +02:00
Lorenz Meier 11f1a11934 Lock yaw integral if we hit a yaw limit 2016-07-31 14:14:55 +02:00
Lorenz Meier a1c8585342 EKF2: Report zero as position until local pos is valid 2016-07-31 14:01:32 +02:00
Lorenz Meier c835fb36a6 5611: Bump sampling frequency back up to 40 Hz from 25 Hz to help with altitude estimation 2016-07-31 12:20:48 +02:00
Julian Oes 0d80a77e46 unit_tests: move hysteresis test to new framework 2016-07-30 12:26:56 +02:00
Julian Oes 8f1d350d3c unit_test: add ut_assert_true and ut_assert_false 2016-07-30 12:26:56 +02:00
Julian Oes 6bf4bd5f35 land_detector: remove unused variable 2016-07-30 12:26:56 +02:00
Julian Oes 50cac88e5b land_detector: big refactor, share update function
This is a big refactor and general cleanup of the land detector. The
main functional change is to share the hysteresis lib across all land
detectors.
2016-07-30 12:26:56 +02:00
Julian Oes 9f928308c4 land_detector: astyle 2016-07-30 12:26:56 +02:00
Julian Oes 3d0fa410a8 hysteresis: astyle 2016-07-30 12:26:56 +02:00
Julian Oes fd6ad6565c commander: use hysteresis lib for auto_disarm
Since the auto disarm hysteresis was implemented wrongly, it's now
replaced with the hysteresis library call.
2016-07-30 12:26:56 +02:00
Julian Oes f7ad8c03b4 hysteresis: use 64bit for everything in us 2016-07-30 12:26:56 +02:00
Julian Oes 93acff8641 MulticopterLandDetector: remove always true call
The result from `!get_freefall_state()` was always true because
`get_freefall_state()` is already called before `get_landed_state()` is
called. Only if we're not in a freefall, we check if we are landed.
2016-07-30 12:26:56 +02:00
Julian Oes 740bfc0b32 MulticopterLandDetector: use hysteresis lib
The hysteresis was not properly implemented in the land detector and is
therefore replaced by the library call, both for the freefall detector
and the land detector.
2016-07-30 12:26:56 +02:00
Julian Oes ee1669e174 hysteresis: add to systemlib CMakeLists.txt 2016-07-30 12:26:56 +02:00
Julian Oes f365832c0b hysteresis: we needed different hysteresis
Sometimes, we only need a histeresis in one direction.
2016-07-30 12:26:56 +02:00
Julian Oes 401d807261 systemlib: added library for hysteresis
There have been two cases where a hysteresis function wasn't working
correctly. It is therefore a good idea to abstract the hysteresis
functionality into a library.
2016-07-30 12:26:56 +02:00
Julian Oes 36299c59b4 unittests: whitespace 2016-07-30 12:26:56 +02:00
sander 788f04ea58 Remove debug info 2016-07-30 11:43:52 +02:00
sander 94fc8bda02 Fix indenting 2016-07-30 11:43:52 +02:00
sander 2bca19fc5e Remove acceptance radius from takeoff altitude for MC 2016-07-30 11:43:52 +02:00
sander e4f20f98cd Implement altitude acceptance radius 2016-07-30 11:43:52 +02:00
Lorenz Meier b5ef5cabb5 Updated src/drivers/gps/devices 2016-07-30 11:40:50 +02:00
James Goppert 5f16c97662 Added mb12xx sensor enable. (#5164) 2016-07-29 16:18:27 -04:00
Daniel Agar 390a7165dd make tests (#5163)
* make tests use px4 instead of mainapp

* commander_tests ALTCTL - not rotary requires altitude
2016-07-29 11:46:47 -04:00
Julian Oes 5a262ec6bc uorb: came across a wrong comment 2016-07-29 17:44:50 +02:00
Julian Oes a18eabead4 navigator: whitespace 2016-07-29 17:44:50 +02:00
Daniel Agar 2de66b1a9d FW navigation in high winds (#5097) 2016-07-29 06:05:48 -07:00
Beat Küng ad2a13dcc8 cmake TAP config: add topic_listener 2016-07-29 14:50:03 +02:00
Beat Küng 0fa3bd4691 ms5611: use px4_getopt instead of getopt
- px4_getopt is threadsafe
- getopt does not do argument reordering (ms5611 start -T 5607 did not work)
2016-07-29 14:50:03 +02:00
David Sidrane 1b0f41e36e Added support to MS5611 Driver for MS5607 2016-07-29 14:50:03 +02:00
Lorenz Meier fa421a91e2 Add missing teest targets for MindPX 2016-07-29 14:10:44 +02:00
Lorenz Meier 6ab9dc0acf Testing cleanup from Daniel Agar 2016-07-29 13:49:14 +02:00
Daniel Agar 99aa5f49fc FW ALTCTL requires altitude 2016-07-29 13:48:21 +02:00
Daniel Agar 6aa935fed6 FW don't allow ACRO or RATTITUDE 2016-07-29 13:48:21 +02:00
Lorenz Meier e70223c2be Allow transition commands also in manual if no switch is used 2016-07-29 13:43:24 +02:00
Roman 1f1839d978 sensors: fixed code style
Signed-off-by: Roman <bapstroman@gmail.com>
2016-07-29 13:28:09 +02:00
Roman 9ece090dbe vtol_att_control: use transition switch instead of aux1
Signed-off-by: Roman <bapstroman@gmail.com>
2016-07-29 13:28:09 +02:00
Roman 499d362b8b added transition switch 2016-07-29 13:28:09 +02:00
Beat Küng 302719527a nuttx defconfig: increase nr of file descriptors, due to mavlink shell 2016-07-29 13:07:17 +02:00
Beat Küng e8d44da2c0 Tools: add mavlink_shell.py script to start a shell over mavlink 2016-07-29 13:07:17 +02:00
Beat Küng 2241ab9cac mavlink: add a shell using SERIAL_CONTROL MAVLink message 2016-07-29 13:07:17 +02:00
Julian Oes 78a9472b25 px4iofirmware: astyle 2016-07-29 12:46:17 +02:00
Julian Oes dcb7c0e4c2 px4iofirmware: correct newline 2016-07-29 12:46:17 +02:00
Julian Oes 79a1b84b09 px4iofirmware: clean up override decision
The override checking was scattered across two places and is now unified
in controls_tick(). The part in mixer_tick only decides which mixer (or
none) to use give the override flag.
2016-07-29 12:46:17 +02:00
Julian Oes de76c398ca px4io: whitespace fixes 2016-07-29 12:46:17 +02:00
Julian Oes ec035b7268 px4iofirmware: no override in multirotor mode
This fixes a bug where multirotors got into override mode when the FMU
is dead/not responding.
The main bug was that the check was for FMU_OK || MANUAL_OVERRIDE_OK
in order to get further in the override checks.

Also a mixer_tick was called inside the controls_tick even though these
are called in px4io.c after each other anyway.
2016-07-29 12:46:17 +02:00
Julian Oes 57b3bbf657 px4iofirmware: don't set FMU_OK flags immediately
The FMU_OK flags are later checked anyway based on
system_state.fmu_data_received_time.
2016-07-29 12:46:17 +02:00
Julian Oes 31d5c59ab7 px4iofirmware: remove unused define 2016-07-29 12:46:17 +02:00
Julian Oes a9a5f3a19e px4io: add FMU fail test mode
In order to test what happens in px4iofirmware when the FMU stops
sending PWM or control commands, I added a test mode. When the test mode
is activated, no controls are sent.
2016-07-29 12:46:17 +02:00
Julian Oes 55d21242fe Snapdragon: keep copying mainapp.config for now
mainapp.config can't be renamed to px4.config just yet because it would
clash with the name used for the DSP side.
2016-07-29 11:15:10 +02:00
James Goppert b6a9ff756c Rename mainapp to px4. 2016-07-29 11:05:01 +02:00
Sebastian Quilter 3b7ba915a8 small refactor (#5155) 2016-07-28 14:49:37 -07:00
Eric Ye 9f5b081257 Wrap help line to fit through mini-dm. (#5157)
It currently gets cut off on mini-dm, split it into multiple lines
so all of it comes through.
2016-07-28 14:47:57 -07:00
sander 4b414d96eb Init _mission_throttle 2016-07-28 16:44:27 +02:00
sander 0ce08ed9f8 Code style 2016-07-28 16:44:27 +02:00
sander ce3749d04f Make tecs init airspeed mode dependent 2016-07-28 16:44:26 +02:00
sander 0cf77a30b1 Init tecs with transition airspeed for vtols without airspeed sensor 2016-07-28 16:44:26 +02:00
David Sidrane 415fbae31e Fix build for HW w/o mux 2016-07-28 08:50:59 +02:00
Beat Küng 50a14cfd29 tap_esc: disable the _mode param, use the number of configured channels instead
Not sure why the Mode enum exists in the first place...
2016-07-28 08:50:59 +02:00
Beat Küng 3a0f4c84a5 motor_test: add iterate command 2016-07-28 08:50:59 +02:00
Beat Küng cbcbce3a28 tap_esc: use correct number of outputs 2016-07-28 08:50:59 +02:00
Beat Küng 6245a9b134 motor_test: make -m & -p optional (select all motors/0 output if not given) 2016-07-28 08:50:59 +02:00
Beat Küng d660fb094b tap_esc: add RPMSTOPPED macro, make sure driver starts with stopped motors 2016-07-28 08:50:59 +02:00
Beat Küng d6d3a56116 tap_esc: add buffer size check for _esc_feedback.esc[] 2016-07-28 08:50:59 +02:00
Beat Küng c55c978145 tap_esc: reset outputs only when armed really changed (not on each topic update) 2016-07-28 08:50:59 +02:00
Beat Küng 4045068187 tap_esc: properly initialize _outputs 2016-07-28 08:50:59 +02:00
Beat Küng 8602ff7856 tap_esc: fix code style, IS_armed -> _is_armed 2016-07-28 08:50:59 +02:00
Beat Küng 3f9f320f18 tap_esc: improve error handling & reporting 2016-07-28 08:50:59 +02:00
Beat Küng a8e28c7232 tap_esc: fix argument ordering in memset 2016-07-28 08:50:59 +02:00
David Sidrane 632e4630b1 TAP:ESC motors and LED working - The code is still hardcoded for 4 ESC
But the basics are working. N.B. To Stop the moros a value of 0 need to be
sent. LED color mask are misleeding - LED is On or Off per ESC.
2016-07-28 08:50:59 +02:00
Julian Oes a71cfe92f1 fmu: whitespace fix 2016-07-28 08:49:22 +02:00
Julian Oes 664092b7d4 fmu: support ESC calibration
The FMU was lacking support to do the ESC calibration. This is needed
for Pixracer.
2016-07-28 08:49:22 +02:00
Julian Oes 3289e0cee6 fmu: don't disarm with disarmed set
If disarmed PWM values have been set, we can't accept a disarm command.
If we did, the PWM output stop alltogether after the high pulse of the
ESC calibration.
2016-07-28 08:49:22 +02:00
Julian Oes d63870ad71 fmu: don' de-initialize
Once the PWM outputs are initialized, there is no point in
de-initializing them again.
2016-07-28 08:49:22 +02:00
Julian Oes f4e35873a1 DriverFramework: updated submodule (#5148)
This brings fixes for Edison which should not have any influence on
Snapdragon or Raspberry Pi.
2016-07-27 23:47:53 -07:00
Sander Smeets c4eb65862f Reduce esc calibration pwm timeout (#5011) 2016-07-27 01:52:20 -07:00
Daniel Agar a9cb2d2fbe navigator mission don't report loiter if landed 2016-07-27 10:39:07 +02:00
Julian Oes c4cb916afa Fix sdlog2/logger path/file name overflows. (#5138)
* logger: prevent logpath buffer overflows

The handling of the log path had the potential to cause buffer
overflows, especially on POSIX platforms where the paths are often much
longer than just 64 chars.

* sdlog2: prevent logpath buffer overflows

When the log folder path was created, this was done with the unsafe
sprintf function instead of snprintf. This caused buffer overflows in
SITL but the overflow was usually not detected until recent testing of
some work in progress.
2016-07-27 00:55:29 -07:00
Julian Oes 4656b34244 DriverFramework: update submodule
This fixes a gyro/accel scaling bug on Snapdragon.
2016-07-26 17:11:29 +02:00
Beat Küng 4fa59c3cde sdlog2 README: describe geotagging.py script 2016-07-26 10:20:22 +02:00
h3ct0r b6e57e1347 Added geo tagger script to geo reference any set of arbitraty JPG images that does not have the CAM trigger, but have a valid creation date 2016-07-26 10:14:51 +02:00
Julian Oes 83feb83fe2 cmake: don't build load_mon for POSIX/QURT 2016-07-26 09:58:12 +02:00
Gus Grubba c3b58822a8 Fixes to log download (#5133)
* Fixes to log download

* Fixing indentation
2016-07-25 08:15:23 -04:00
Andreas Antener 50175ca7ea manual condition includes threshold values 2016-07-25 08:56:19 +02:00
Roman aea7bd5b47 fw_attitude_control: calculate attitude setpoint for STAB mode
- attitude setpoint generation for stabilized mode was shifted back
to the fw attitude controller. since the fw position controller is polling
on global position attitude setpoints were not generated when global
position was not published.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-07-25 08:56:19 +02:00
Andreas Antener f069880504 VTOL: don't wait on TECS in FW state if TECS is not running 2016-07-25 08:56:19 +02:00
Andreas Antener 254358ef86 fixed implicit conversion 2016-07-25 08:56:19 +02:00
Andreas Antener 89a2f5057f fixed code style 2016-07-25 08:56:19 +02:00
Andreas Antener 6ff65cd8b2 reset attitude setpoint where necessary 2016-07-25 08:56:19 +02:00
Andreas Antener 0a997577f5 allow manual yaw in all manual modes and also use it as threshold to snap into heading lock 2016-07-25 08:56:19 +02:00
Andreas Antener 9f7f6e4d3d removed roll lock for altitude hold 2016-07-25 08:56:19 +02:00
Roman 6226a0c77d fw_pos_control_l1: fixed code style
Signed-off-by: Roman <bapstroman@gmail.com>
2016-07-25 08:56:19 +02:00
Roman ec334f7c9b fw_pos_control_l1: limit max roll and pitch setpoints for manual modes
Signed-off-by: Roman <bapstroman@gmail.com>
2016-07-25 08:56:18 +02:00
tumbili 8c8120e2fc fw position controller: logic cleanup
cleaned up logic when not to use pitch setpoint from TECS

Signed-off-by: tumbili <roman@px4.io>
2016-07-25 08:56:18 +02:00
tumbili fd51bf44d5 fw position / fw attitude control: move attitude setpoint generation to
position controller

- attitude setpoints for all modes are now computed in the fw position
controller

Signed-off-by: tumbili <roman@px4.io>
2016-07-25 08:56:18 +02:00
Roman e3f3233ee4 fw position controller: fixup attitude setpoint generation
- generate complete attitude setpoint for position and altitude
control mode
- fix generation of roll setpoint for position control which lead to
wing rock
- add roll and pitch setpoint offsets so that they are logged as well

Signed-off-by: Roman <bapstr@ethz.ch>
2016-07-25 08:56:18 +02:00
Lorenz Meier 880fa47ba2 Fix install in Mac OS X Gazebo 2016-07-24 23:09:17 +02:00
James Goppert 7458f1e07d Update sitl_gazebo. (#5136)
* Update sitl_gazebo.

* Update sitl_gazebo.
2016-07-24 17:07:14 -04:00
James Goppert 563122f5d3 sitl_gazebo update. 2016-07-24 16:30:01 -04:00
James Goppert 4f62a35993 Fixed sitl_gazebo. 2016-07-24 16:27:12 -04:00
James Goppert 05315abc89 Optical flow simulator and install cleanup. (#5132)
sitl CI is having some issue cloning, but I have verified it locally for various configs
2016-07-24 13:07:14 -04:00
Eric Ye 5cee3fa0e1 Proper return value on qshell help 2016-07-23 08:25:03 +02:00
Eric Ye 76d74640ae Add "help" to qshell for qurt
Fixes issue #5111
2016-07-23 08:25:03 +02:00
Julian Oes 7399e60e96 ecl: update submodule
This includes just some minor fixes.
2016-07-23 08:05:47 +02:00
James Goppert a4ef364f80 Added innovation logging to LPE. (#5124) 2016-07-22 19:19:30 -04:00
Henry Zhang 0730e681bc Nuttx config: MAVLink app needs more FDs. 2016-07-22 11:16:18 +02:00
Henry Zhang 2b93f16118 mindpx-v2: build topic_listener, sd_bench, tests, motor_ramp. 2016-07-22 11:16:18 +02:00
Julian Oes 317fd270d1 RPi: add mainapp.config again
This file got deleted accidentally because all .config files were in
gitignore.
2016-07-22 09:33:43 +02:00
Julian Oes b99f51a035 gitignore: don't ignore all .config files 2016-07-22 09:33:43 +02:00
Michael Schaeuble ae66085f89 MPU6050: Apply calibration after coordinate frame rotation 2016-07-22 09:21:55 +02:00
Michael Schaeuble 1fc8e38157 Fix incorrect indentation 2016-07-22 09:21:55 +02:00
Michael Schaeuble 7d11b32981 Add correct rotation for MPU6050 on Bebop 2016-07-22 09:21:55 +02:00
Michael Schaeuble 2197bf518d Fix code style 2016-07-22 09:21:55 +02:00
Michael Schaeuble 28de6d2cbd Update mainapp.config and add MPU6050 2016-07-22 09:21:55 +02:00
Michael Schaeuble d94bdb0829 Add missing defines for Bebop sensor drivers 2016-07-22 09:21:55 +02:00
Michael Schaeuble e73d8d73e1 Add DF wrapper for MPU6050 2016-07-22 09:20:27 +02:00
Beat Küng 8ab841e046 sensors: poll on best-voted gyro (#5106)
This is a follow-up to 399d4ef833
2016-07-21 14:52:32 -07:00
Beat Küng 03b3bfa98d tap: add the motor_test command to the build config 2016-07-20 14:04:15 +02:00
Beat Küng 2c0c30eadf drv_tap_esc.h: fix file permissions 2016-07-20 14:04:15 +02:00
Beat Küng 38e4882b5f tap_esc: subscribe to test_motor topic and set outputs accordingly in non-armed state
This makes it possible to use the 'motor_test' command
2016-07-20 14:04:15 +02:00
Beat Küng 0f6a6f7150 mavlink_messages.cpp: only warn once, when MAVLink log opening fails
This happens for example if no SD card is present.
2016-07-20 13:07:32 +02:00
Beat Küng 9a8c092116 mavlink_messages.cpp: fix coding style: prepend _ to class members 2016-07-20 13:07:32 +02:00
David Sidrane 5ded579bf3 TAP:More IO Init (#5096) 2016-07-19 11:58:44 -10:00
Beat Küng 7b52eced66 commander: write timestamp of commander_state topic on init and state change 2016-07-19 09:21:35 +02:00
David Sidrane a420d47797 Minor fix usage (#5094) 2016-07-18 15:01:55 -10:00
Beat Küng 5b85fdb636 fix sdlog2 replay: changed format string from 9c73eae941 (#5090) 2016-07-18 15:25:49 +02:00
James Goppert 9fcf121380 LPE: Don't use home as local origin (#5067) 2016-07-17 10:16:17 -04:00
Mark Whitehorn 981353f439 fix bug in RC scan for SUMD input 2016-07-16 16:35:03 +01:00
Julian Oes fa614a3cc1 RPi: just use RPI instead of RPI2.
The reason for this change is that RPi2 and RPi3 are compatible, and
hopefully all differences coming up can be resolved without ifdefs but
at runtime.
2016-07-16 15:51:00 +01:00
Julian Oes 2bf40efe8b RPi2: fuse mainapp/common and navio2
We currently only support Navio2, so let's fuse the two configurations.
2016-07-16 15:51:00 +01:00
Miguel Arroyo 17be06cf1a Fixes Navio2 Config Typo 2016-07-16 15:51:00 +01:00
Julian Oes 1939b88a33 RPi2: use cross/native instead of release/default 2016-07-16 15:51:00 +01:00
Julian Oes f241518d0e RPi2: bring default and release cmake in sync
The two cmake files for default and release where out of
sync. This change bases them on a common cmake file.
2016-07-16 15:51:00 +01:00
Daniel Agar d733fc9139 travis-ci use tagged docker image (#5068) 2016-07-16 08:41:19 -04:00
Beat Küng a1b710025b Improve new logger update rate (#5073)
* logger: disable some default topics, which are most likely not used

This is also to safe CPU and lower the amount of file descriptors used.

* logger: use the hrt timer for more accurate scheduling

Under NuttX with the default rate of 285Hz, the actual measured rate was
only 200Hz while on Linux it was ~280Hz. The reason is that NuttX only
uses a usleep() granularity of 1ms, so that the typical sleep time is
longer than what we set.

Now the logger waits on a semaphore, which gets activated periodically
with a hrt timer. With this the measured rate is exactly the expected one,
285Hz.
2016-07-15 16:55:32 -07:00
Beat Küng ee58f0d11d encoders.msg: remove this topic, it's never published (#5074) 2016-07-15 14:59:52 -07:00
lovettchris b48c081e5c Reset _transfer_in_progress if mavlink transfer times out. (#5077) 2016-07-15 14:59:30 -07:00
Julian Oes 87e964ec10 commander: POSCTL with localpos for MC
Fixedwings need a global position estimate for POSCTL.
2016-07-15 14:43:36 +01:00
Julian Oes f430c39f5b commander: allow POSCTL with local position
We want to allow flying POSCTL with optical flow only without GPS.
2016-07-15 14:43:36 +01:00
Julian Oes 1cfa429efe DriverFramework: update submodule
Small additions for Intel Edison.
2016-07-15 12:58:10 +02:00
David Sidrane 33e4f38d82 Add GPS and Compass (#5066) 2016-07-14 08:26:40 -10:00
David Sidrane e2a6ae676f More complete IO init (#5065) 2016-07-14 07:32:11 -10:00
Beat Küng 4a199c1360 gyro calibration: avoid double initialization of gyro_scale data
They're initialized in do_gyro_calibration already
2016-07-14 14:17:38 +02:00
Julian Oes f1b8bed5df gyro_calibration: set scale to 1 instead of 0 2016-07-14 13:13:56 +02:00
David Sidrane 8a2df2a458 Avoid unnecessary Write Cycle 2016-07-13 20:42:05 +02:00
David Sidrane 5d1bd6fb2c TAP used FLASH Based parameter storage - needs timing eval 2016-07-13 20:42:05 +02:00
David Sidrane 8d13dba0cc Update NuttX with backport of stm32 FLASH driver to support F4 ==master_flash 2016-07-13 20:42:05 +02:00
David Sidrane 5e8d6375c9 Back Port nuttx_v3 FLASH based parameter hooks 2016-07-13 20:42:05 +02:00
David Sidrane 39ce201efe TAP:Fix build to use correct ROMFS 2016-07-13 20:19:05 +02:00
David Sidrane 78bc7d850b Fix Syntax error - but I suspect the USE_IO logic can be simplified 2016-07-13 07:52:58 -10:00
Julian Oes 3ed8b735c2 mavlink: only warn once if broadcast fails
This fixes the issue where the console was spammed if a broadcast failed
after a connection had previously been established.
2016-07-13 19:40:59 +02:00
Beat Küng 399d4ef833 sensors: only poll on first gyro for now
This fixes a bug with following setup:
- two (or N > 1) connected gyros
- ekf2 enabled
In this case, sensors would publish with the combined rate of the gyros,
but with N following messages having the same gyro data & timestamp.
Apparently ekf2 cannot handle this, the other estimators can.

We may want to rethink what the proper solution is here.
2016-07-13 14:35:03 +02:00
Julian Oes eda2915f0b mavlink: whitespace fix 2016-07-13 10:10:45 +02:00
Julian Oes d9343fa925 mavlink: use new copy_if_updated interface 2016-07-13 10:10:45 +02:00
Julian Oes 8345a0368b mavlink: add function to copy only if updated
The MavlinkOrbSubscription only had an interface to either always copy
or copy based on a timestamp. This commit adds a copy interface if the
topic has been updated.
2016-07-13 10:10:45 +02:00
Julian Oes 8ded6a58ab mavlink_log: enable queueing
We don't want to drop messages if possible for mavlink log messages, so
let's use the orb queueing.
2016-07-13 10:10:45 +02:00
Julian Oes 314ee6b7e0 commander: remove some if confusion
This is a try to simplify the if statements a bit. Also, a check of
new_arming_state which was impossible, is removed.
2016-07-13 10:10:45 +02:00
Julian Oes 631ce1fc55 commander: proper arguments for preflight check 2016-07-13 10:10:45 +02:00
Andreas Antener af8cd3f880 correctly scale and trim outputs in IO 2016-07-13 09:29:13 +02:00
Roman 13905c2480 px4io driver: send roll, pitch and yaw scale parameter values to io
Signed-off-by: Roman <bapstr@ethz.ch>
2016-07-13 09:29:12 +02:00
Roman 08bbd6dbfa px4iofirmware: added scale parameters for roll, pitch and yaw
since pure manual control for fixed wings in handled on the io side
the scale parameters for roll, pitch and yaw had to be introduced there
as well.

Signed-off-by: Roman <bapstr@ethz.ch>
2016-07-13 09:29:12 +02:00
tumbili 71e2a43790 consider scale parameters in rc calibration code 2016-07-13 09:29:12 +02:00
tumbili f0dd5a103c allow scaling controls in full manual mode for fixed wings 2016-07-13 09:29:12 +02:00
tumbili 784883af22 added parameters to allow scaling controls in full manual mode
for fixed wings
2016-07-13 09:29:12 +02:00
xiaoyuli 7718343b27 fix the function of disabling safety switch (#5031) 2016-07-12 23:43:17 +02:00
Daniel Agar de14418e93 fw_pos_ctrl_l1 var naming consistency and effc++ 2016-07-12 23:40:39 +02:00
Daniel Agar ebce725720 px4fmu-v2 disable motor_ramp 2016-07-12 23:36:05 +02:00
Daniel Agar 59b4350aa0 implement MAV_CMD_NAV_LOITER_TO_ALT and general mission cleanup 2016-07-12 23:36:05 +02:00
Lorenz Meier 7419151314 Update EKF2 replay timestamp handling 2016-07-12 22:17:22 +02:00
David Sidrane 0576031a81 TAP PID (#5036) 2016-07-12 05:07:03 -10:00
Beat Küng f8382a2713 upload scripts: add TAP for the uploader script 2016-07-12 16:00:33 +02:00
David Sidrane 5cc58fa067 Reserving 32Kib of FLASH for parameters (#5035) 2016-07-12 03:57:31 -10:00
James Goppert 817f695297 Change to LPE terrain model to account for velocity scaling. (#5027) 2016-07-11 16:02:39 -04:00
Lorenz Meier a740d80a20 Mag voter: Be more forgiving on load changes 2016-07-11 15:16:35 +02:00
Lorenz Meier 021f0840ae Fix Hobbyking Pixracers 2016-07-11 15:03:07 +02:00
tommises 4fa2c54485 Mocap timestamp cleanup (#5021) 2016-07-11 12:46:29 +02:00
Beat Küng c9652fd42a logger: update set of default topics to match functionality of sdlog2
logging rate with these topics: ~50KB/s

The rates may need to be adjusted
2016-07-11 10:04:44 +02:00
Beat Küng 4ec9e53deb param SYS_LOGGER: remove experimental for new logger
It's ready to be used!
2016-07-11 10:03:02 +02:00
Beat Küng 68e14ceb29 tap startup script: add -t param for logger 2016-07-11 10:01:16 +02:00
Beat Küng 49614cfe38 SITL init scripts: add replay tryapplyparams & replay trystart
These will only start replay if there's an environment variable 'replay',
otherwise they do nothing.

We apply the parameters even before loading the modules, so that the
modules 'see' the same state as the recorded system had. We will have to
see how well this works in practice.
2016-07-11 09:26:35 +02:00
Beat Küng db13ac4c53 posix_sitl_default.cmake: add -DORB_USE_PUBLISHER_RULES if it's a replay build 2016-07-11 09:25:16 +02:00
Beat Küng e9726af54c Makefile: check for 'replay' env variable and change build dir accordingly
For replay with the new logger, we want a separate build dir so that the
parameters file and orb rules don't get mixed up.
2016-07-11 09:25:07 +02:00
Randy Mackay 80134d2b7d IR-LOCK: rework driver (from jschall) (#5024)
* irlock: change output format to tangent of angles

* irlock: put all targets in single struct

* irlock: eliminate tanf function in constant
2016-07-11 09:05:29 +02:00
Lorenz Meier 71d150f6ec MAVLink app: Fix rate handling 2016-07-10 17:05:33 +02:00
Lorenz Meier c7130081cc Update ECL 2016-07-10 16:33:07 +02:00
Lorenz Meier 02b3adc4a7 Update DriverFramework 2016-07-10 16:32:59 +02:00
Lucas De Marchi 18330f7ab7 Move __STDC_FORMAT_MACROS to build system
__STDC_FORMAT_MACROS changes the behavior of inttypes.h to allow
defining format macros for printf-like functions. It needs to be defined
before any include is done, otherwise due to include chains and header
guards it may not take effect.

Instead of having to define it everywhere it is used, move the define to the
build system. Also update ecl and DriverFramework submodules to deal with the
changed definitions.
2016-07-10 16:31:36 +02:00
tommises d2194d787f Refactored Mavlink stream configuration (#5015)
Streams ordered same way in all modes.
2016-07-10 16:22:22 +02:00
Lorenz Meier f39d284193 Update vision fields for attitude_estimator_ekf 2016-07-10 14:21:56 +02:00
Lorenz Meier 7601788c43 INAV: clean up vision timestamps 2016-07-10 12:44:00 +02:00
Lorenz Meier 8b3045baa2 MAVLink: clean up vision timestamps 2016-07-10 12:43:47 +02:00
Lorenz Meier c0a406b81f LPE: Clean up vision timestamps 2016-07-10 12:43:34 +02:00
Lorenz Meier 826eaed2ee EKF2: Clean up vision timestamps 2016-07-10 12:43:21 +02:00
Lorenz Meier 4f875560b7 Att Q Estimator: New vision timestamp 2016-07-10 12:43:10 +02:00
Lorenz Meier 07384d6b5a Vision msg: Cleanup timestamp 2016-07-10 12:42:56 +02:00
tommises 19b56c1574 Use timestamp received from companion computer as timestamp_boot 2016-07-10 12:29:19 +02:00
tommises 5bd574dd05 Fixed timestamp synchronization 2016-07-10 12:29:19 +02:00
tommises f69e9a3d37 Fixed VISION_POSITION_ESTIMATE.usec
Fixed units to be microseconds and not milliseconds.
2016-07-10 12:29:19 +02:00
David Sidrane a23785842c tap-v1 Uses New PWM LED driver structure 2016-07-10 11:46:47 +02:00
David Sidrane ea4d9a34fd mindpx-v2 Uses New PWM LED driver structure 2016-07-10 11:46:47 +02:00
David Sidrane a36f392b58 Rework PWM LED Driver 2016-07-10 11:46:47 +02:00
David Sidrane da96144e80 Added Power button and cleanup sdio 2016-07-10 11:46:47 +02:00
David Sidrane 5de19500c2 TAP-v1 set Console Baud Rate to 57600 2016-07-10 11:46:47 +02:00
Mark Whitehorn 09227526b6 enable use of GPS time for new logger folder/file naming (#5010) 2016-07-10 11:15:27 +02:00
Lorenz Meier 7afe2e8dd8 Iris SITL: Default gains 2016-07-08 00:02:48 +02:00
Lorenz Meier eb6af9afb9 VTOL updates 2016-07-07 23:30:57 +02:00
Lorenz Meier 38652ec940 SITL: Re-tune multicopter gains 2016-07-07 23:28:21 +02:00
Miguel Arroyo 3c11c0d8d8 Adds Calibration Support for RPi2 and Navio2 (#4999) 2016-07-07 22:38:17 +02:00
Andreas Bircher 2317589950 fixing the publishing of the triggering stamps (#5005) 2016-07-07 16:50:46 +02:00
Lorenz Meier e86c1851a7 Mag fusion update to ECL 2016-07-07 16:49:28 +02:00
Julian Oes ddba274496 sdlog2: fix poll_counter that I broke earlier 2016-07-07 16:48:27 +02:00
Julian Oes 544ea72d4c Snapdragon: set CPUs scaling to performance mode
Sdlog2 misses least updates when the CPU scaling governor is set at
maximum performance. This is not optimal to save power but the best
effort until there is a RT patched kernel on Snapdragon.
2016-07-07 16:48:27 +02:00
Julian Oes 03dbcf5464 sdlog2: don't forget to copy after poll
The previous changes broke sdlog2 on NuttX because no orb_copy was
called after polling in the case when sdlog2 was not actually logging.
2016-07-07 16:48:27 +02:00
Julian Oes 772dc302b6 sdlog2: raise min write size back
Turns out in practice there was not really a difference, so there was
no reason to change it.
2016-07-07 16:48:27 +02:00
Julian Oes fe91527604 sdlog2: poll for sensor and replay on Snappy
This brings better performance, so less missed updates on Snappy, as
well as a bit of a cleanup of the poll and orb_copy logic.
2016-07-07 16:48:27 +02:00
Julian Oes 5f18f9bbba sdlog2: select MIN < MAX bytes to write
Previously, the MAX and MIN were both 512 meaning that usually it would
start writing at > 512 bytes but only write 512 bytes which results in
a 512 bytes write shortly followed by a e.g. 30 bytes write.

Also, performance (measured in missed poll updates) seems slightly
better on Snapdragon with bigger chunks.
2016-07-07 16:48:27 +02:00
Julian Oes 1631cfdc83 Eagle: SDLOG_PRIO_BOOST to raise sdlog2 priority
This should lead to less drops on Snapdragon although it's hard to
verify this.
2016-07-07 16:48:27 +02:00
Julian Oes f7bb43b20b DriverFramework: update submodule (#5004)
This brings various PRs and fixes.
2016-07-07 16:24:13 +02:00
Beat Küng 168c744232 replay: fix string printf output: add .c_str() 2016-07-07 12:51:42 +02:00
Beat Küng 6e44760819 replay: add 'tryapplyparams' command
This only applies parameters from the log file and user-supplied overrides.
It is intended to be called as one of the first startup commands (after
param load), so that during startup, all applications find the parameters
from the replayed system.

Note that this is an optional command and 'replay start' will again load
and apply the parameters in any case.
2016-07-07 12:51:42 +02:00
Beat Küng 84a1a10006 logger: check if we are in replay mode via ENV variable 'replay' 2016-07-07 12:51:42 +02:00
Beat Küng 28ad6066aa replay: add replay module, build for sitl_default, but do not load on startup
This adds a new module that does:
- read an parse an ULog file, given via ENV variable 'replay'
- apply all parameters from the log file
- read and apply user-defined override parameters from a file
- publish all messages in 'real-time' from the log file and add a constant
  offset to the timestamp to match the system time.
- apply changed parameters in the log (which are not overridden)
2016-07-07 12:51:42 +02:00
Beat Küng ffcefd9047 orb: read & apply publisher rules from file (currently disabled via #ifdef)
If enabled, orb reads a rules file (./rootfs/orb_publisher.rules) on
startup. This can contain rules about which module is allowed to publish
which topic. It is completely transparent, so a publisher does not know
if he's not allowed to publish, and publications will look as if they
succeeded.

To test, add
#define ORB_USE_PUBLISHER_RULES
to uORBManager.hpp
2016-07-07 12:51:42 +02:00
Daniel Agar 4252511b8e add bitmask param metadata 2016-07-07 12:42:59 +02:00
Andreas Bircher 9974b6f747 Camera trigger update (#4998)
* updating the camera driver, correct init and keepAlive function

* removing debug output
2016-07-07 11:40:11 +02:00
Lorenz Meier 15880f8d13 Less verbose 2016-07-07 11:40:11 +02:00
Lorenz Meier aa77e8ee23 Cleanup 2016-07-07 11:40:11 +02:00
Lorenz Meier 50b93b161c Camera trigger: Make interface dependent on parameter, not command line 2016-07-07 11:40:11 +02:00
Lorenz Meier 78f7f00ae2 Camera trigger: Make interface dependent on parameter, not command line 2016-07-07 11:40:11 +02:00
Lorenz Meier 4683e20187 Clean up camera trigger interface code 2016-07-07 11:40:11 +02:00
Beat Küng 9c73eae941 sensor_combined: replace accel & gyro integral with value, use float for dt
Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.

Note that this breaks the replay format for sdlog2 replay
2016-07-07 11:35:50 +02:00
Beat Küng 8e136779ec stack sizes: reduce stack sizes for modules that use sensor_combined
The sensor_combined topic got reduced from ~780 bytes to 72 bytes.
2016-07-07 11:35:50 +02:00
Beat Küng c5ea4b43be sensor_combined.msg: make timestamps relative
This is needed for the new logger & saves some space as well.
2016-07-07 11:35:50 +02:00
Beat Küng c66f26245c sensor_combined.msg: use uint32 for integral_dt
There is no reason to make this 64 bit. The same should be done in
the sensor raw messages, together with further cleanup.
2016-07-07 11:35:50 +02:00
Beat Küng 30301187f0 cleanup sensors_init: remove the static const int ERROR and use PX4_ERROR 2016-07-07 11:35:50 +02:00
Beat Küng d846ad5dac sensors: move voting into sensors module
- voting is now at a central place instead of duplicated within the
  estimators
  -> this also means that estimators that did not do voting so far,
     now have voting, like ekf2
- estimators requiring more than that can still subscribe to the raw
  sensors
- allows sensors_combined to be 3 times smaller
  - reduces logger, memcpy (cache) & RAM overhead
- all modules requiring only 1 or 2 sensor values now automatically get
  the voted result
- this also adds voting to baro
2016-07-07 11:35:50 +02:00
Beat Küng c50d267bfb sensors: cleanup includes and logging (warnx -> PX4_WARN/ERR/INFO) 2016-07-07 11:35:50 +02:00
Beat Küng 0c30ee8d37 fix resource leak in attitude_estimator_q_main: unsubscribe topics 2016-07-07 11:35:50 +02:00
Beat Küng b4ecc5a8d9 sensor_combined cleanup: remove many unneeded fields
Decreases the message size from 780 to 280 bytes.
In particular, all modules using sensor_combined must use the integral now.
The sensor value can easily be reconstructed by dividing with dt.

Voters now need to be moved into sensors module, because error count and
priority is removed from the topic.

Any module that requires additional data from a sensor can subscribe to
the raw sensor topics.

At two places, values are set to zero instead of subscribing to the raw
sensors (with the assumption that no one reads them):
- mavlink mavlink_highres_imu_t::abs_pressure
- sdlog2: sensor temperatures
2016-07-07 11:35:50 +02:00
Beat Küng c407123a72 cleanup sensor_combined: remove adc & differential_pressure fields
These are not really used. differential_pressure is just copied from the
topic with the same name.

for sdlog2 we assume no one needs the diff pressure fields and set it to 0.
We plan to switch to the new logger soon anyway.
2016-07-07 11:35:50 +02:00
Beat Küng 2c2477a07d fix sensors leaks: unsubscribe topics when exiting 2016-07-07 11:35:50 +02:00
Beat Küng ac45c9001b sensors: cleanup syntax: replace &x[0] with x 2016-07-07 11:35:50 +02:00
Beat Küng 78b45c4778 sensors: remove duplicated initialization 2016-07-07 11:35:50 +02:00
Beat Küng ddc4d70d51 airspeed_calibration: remove unused include 2016-07-07 11:35:50 +02:00
David Sidrane 1d5c5497b5 Reduces wasted FLASH by > 4K (#4994)
* Reduces wasted FLASH by > 4K

* Removed PX4_IMPLEMENT_PX4_LOG_MODULENAME

* Moved implamentation of px4_log_modulename to px4_log.c
2016-07-06 23:52:08 +02:00
James Goppert 056f73f5d2 Changed LPE distance sensor timeout logic. (#4996) 2016-07-06 10:31:55 -04:00
Lorenz Meier 703141d650 Estimator cleanup 2016-07-06 13:37:46 +02:00
Lorenz Meier 332f669d9b Add tap-v1 config 2016-07-06 13:34:35 +02:00
Lorenz Meier 7ed0eba50e USB config is now in main boot 2016-07-06 13:31:24 +02:00
Lorenz Meier 8a2155f2af UAVCAN is now in main RCs 2016-07-06 13:31:11 +02:00
Lorenz Meier 96f053273c Always start default mc apps 2016-07-06 13:30:58 +02:00
Beat Küng 09ecc84cc7 gps file dump: re-implement with an uORB topic & write to the log file (#4987)
Drawbacks of the previous method: when writing to the SD card, there are
high delays in the write() call of several 100ms, every now and then. The
frequency and length of these events depend on:
- SD card
- used logger bandwidth
- bandwidth of gps data (RTCM)
Since the whole gps thread was blocked during this period, it lead to
gps timeouts and lost module.

What we do now is: publish an orb topic with queuing. This makes it async
and the logger takes care of buffering. This means it's best to:
- use high logger rate
- use large logger buffer
- reduce logger bandwith by disabling unused topics
2016-07-06 09:32:37 +02:00
James Goppert 7e883809e3 Bump matrix version to 1.0.1. 2016-07-06 01:43:59 -04:00
James Goppert c38f23c0e1 Bump matrix version. (#4993) 2016-07-05 21:20:17 -04:00
James Goppert 9c0ed52bb8 Updated matrix lib to 1.0.0. (#4991)
* Updated matrix lib to 1.0.0.

* Bump matrix version.
2016-07-05 17:38:35 -04:00
James Goppert 09ddc24801 Added agl smoothing to LPE. (#4976) 2016-07-05 16:54:08 -04:00
Julian Oes 3524fd7d24 ekf2: don't ignore function argument (#4990) 2016-07-05 17:40:37 +02:00
Ivan Dimitrov e342299204 Fixed filename in the Doxygen field. See issue "wrong doxygen descriptor (file name) #4979" 2016-07-05 15:17:05 +02:00
Beat Küng c4e77cf411 logger: fix '-r 0' parameter: should be unlimited rate instead of 1Hz 2016-07-05 14:08:25 +02:00
Beat Küng c94fe845ec fix logger: remove space in format for changed parameters 2016-07-05 14:08:25 +02:00
Beat Küng a455962e17 logger: only call write_add_logged_msg when sucessfully subscribed 2016-07-05 14:08:25 +02:00
Eike dc1f343501 Change lower range limit of SF10a to 0.01m (#4977)
* SF10a driver added

* Remove Sf10a driver

* Set lower range boundary to 0.01m for LPE
2016-07-04 21:41:58 +02:00
Daniel Agar 7f89994785 use NAV_ACC_RAD for vertical waypoint acceptance (#4978) 2016-07-04 21:41:16 +02:00
Daniel Agar a9a3050682 EKF2 HIL gps decrease s_variance_m_s 5.0 -> 1.0 (#4973) 2016-07-04 08:18:15 +02:00
Andreas Antener 8d254058fa added square wave mode and PWM max parameter 2016-07-03 22:23:25 +02:00
bharathr d96810f250 Removed px4 config file for 200qx P1 board, updated P2 board version to support Qualcomm ESCs 2016-07-03 12:43:54 +02:00
bharathr 29be7c3003 Updated motor-esc mappings in 200qx config file 2016-07-03 12:43:54 +02:00
bharathr 9131647566 Fixed UART_ESC_MODEL parameter in 200qx config file 2016-07-03 12:43:54 +02:00
bharathr 00243a9842 Updated 200qx config files (removed calib files, cleaned up and renamed all files) 2016-07-03 12:43:54 +02:00
Martin K. Schröder 97d9fd38be Update Matrix.hpp (#4966)
This was horribly wrong. Matrix is first cast into a matrix of size NxM (which is supposed to be the size of the result - NOT the starting point) so the transpose result becomes garbage. Instead make "Me" an MxN matrix as the original. Took me a whole evening to figure out this problem. Now my Kalman filter finally returns good results.
2016-07-03 12:29:58 +02:00
Lorenz Meier bc6e83f5e3 Version reporting: Be more accurate about platforms 2016-07-02 13:00:07 +02:00
Lorenz Meier d85e416680 Fix default handling for battery params 2016-07-02 12:59:49 +02:00
Lorenz Meier 9258bb2ae8 v1.4.0 transitional support for battery count 2016-07-02 12:08:57 +02:00
Lorenz Meier 88cf8f23f6 Fix ver command 2016-07-02 12:08:30 +02:00
Lorenz Meier fd17c87eb4 Fix release parsing 2016-07-02 12:00:56 +02:00
Lorenz Meier 972a6f7be8 Fix MAVLink reporting of Firmware version, implement dev / release version reporting 2016-07-02 11:43:24 +02:00
Lorenz Meier 2a729028bd SITL: Set battery cells 2016-07-02 11:41:23 +02:00
tumbili 7e282f579b sensors app: logic fixed and cleanup
- do not exit sensors app if sensor init failed
- do not spam console if we fail over first/second gyro

Signed-off-by: tumbili <roman@px4.io>
2016-07-01 23:11:38 +02:00
Hidenori ee58188162 Split Navio2 specific parts from general RPI2 files
For Navio2, make posix_navio2_release and use navio2.config.
2016-07-01 23:08:17 +02:00
Hidenori 506d1855ff rename files and add navio target 2016-07-01 23:08:17 +02:00
Miguel Arroyo b871b322d2 Using Actuator Control Group 0 & Checkstyle fixes 2016-07-01 23:08:17 +02:00
Hidenori 76ee17e532 RC input and PWM output for Navio2 2016-07-01 23:08:17 +02:00
Daniel Agar 54e14cd4b6 add latest version to README (#4960) 2016-07-01 23:00:35 +02:00
James Goppert cb3120764a Made LPE var pub threshold a parameter. (#4959) 2016-07-01 13:27:29 -04:00
Lorenz Meier a0fdfb0c21 Strip ESC calib commandline tool 2016-07-01 18:23:08 +02:00
Lorenz Meier ed19d1ff6b EKF2 wrapper: Optimize for size 2016-07-01 18:22:56 +02:00
Lorenz Meier fad07a45b9 Mathlib: Optimize for sixe 2016-07-01 18:21:35 +02:00
Lorenz Meier 8162300522 Switch fixed wing to EKF2. Does not link yet. 2016-07-01 18:09:20 +02:00
Lorenz Meier e43625cfc1 ROMFS: Clear out SITL mixers from deployed image, delete unused mixers, move test mixers to test config 2016-07-01 18:08:32 +02:00
Lorenz Meier 42d8459e87 We are not using the conversion scripts in this ZIP file any more 2016-07-01 18:04:47 +02:00
Lorenz Meier 82b2fa5ecb Commander should not depend on MAVLink 2016-07-01 18:04:09 +02:00
Lorenz Meier 37edb43b60 ROMFS: Strip README files 2016-07-01 18:03:38 +02:00
Lorenz Meier 6268cdc86a Solo is just a normal X quad 2016-07-01 18:03:23 +02:00
James Goppert 00dfc99e08 LPE Variance Dependent Publication (#4914)
* Use variance to control publishing for LPE.

* Don't stop publishing if we have gps/ baro.

* LPE tuning and cleanup.

* Added bias saturation to LPE.

* Added vector enabled low pass filter block.

* Added rk4 integration and pub lowpass to LPE.

* Fix std::abs issue on mac/ reset lowpass on state reset.

* Don't estimate gyro bias when rotating at high speed  att_est_q.

* Lowered low pass on position to 5 Hz for LPE.

* Streamline state space update for LPE.

* Added health flags to est2 log.

* Revert to old tuning, more conservative, less faults.

* Formatting.

* Fix for fault message on LPE.

* Added subscription throttling to LPE.

* Formatting.
2016-07-01 11:43:09 -04:00
sander 2a395c3fec Moved to integrationtests 2016-07-01 11:44:37 +02:00
sander 1548a9a2a1 Change mission to new format and reset defaults 2016-07-01 11:44:37 +02:00
Andreas Antener 25e749de77 use MC auto rates always in AUTO
removed duplicate weathervaning limit
2016-07-01 11:31:57 +02:00
Daniel Agar a2b1269b27 check_code_style don't paginate output (#4952)
- fixes #4943
2016-06-30 21:00:11 -04:00
Lorenz Meier 2214e7c202 Commander: Remove annoying GPS fix regained warning 2016-06-30 16:59:17 +02:00
tumbili 998579befc mc pos control: zero yaw setpoint move rate in attitude setpoint topic
- fixed bug where a non-zero yaw setpoint move rate could make the drone
yaw around in non-manual modes

Signed-off-by: tumbili <roman@px4.io>
2016-06-30 16:42:51 +02:00
Lorenz Meier 0a40034159 Takeoff: Fix coordinate scaling (#4947) 2016-06-30 16:26:05 +02:00
Andreas Antener 5dcc62d8f9 allow yaw setpoint offset to be reduced once maxed out 2016-06-30 14:30:59 +02:00
Daniel Agar 377726a9a7 sitl gazebo plane fix land detector startup order (#4932) 2016-06-30 13:56:06 +02:00
Daniel Agar 07fa814597 FW vtol landing always forced (#4939) 2016-06-30 13:55:47 +02:00
Lorenz Meier 9649050c2e Update ECL to master 2016-06-30 13:29:47 +02:00
tumbili 036f42999a vtol delta quad plane: adjusted default controller gains
Signed-off-by: tumbili <roman@px4.io>
2016-06-29 13:29:57 +02:00
tumbili 57a665ad99 vtol delta quad plane: adjusted mixer scaling
Signed-off-by: tumbili <roman@px4.io>
2016-06-29 13:28:58 +02:00
Samay Siga fcee34a9d1 Quad tilt vtol config (#4473)
* Added new VTOL Config

I added new Vehicle ID for our VTOL aircraft - Quad - Tilt Rotor - FW

Added
13010_claire
claire.main.mix
claire.aux.mix

* Added files via upload

* Delete 13010_claire

* Create 13010_claire

* Update 13010_claire

* Update claire.main.mix

* Update claire.aux.mix
2016-06-29 09:14:18 +02:00
Andreas Antener 5ed4e4e3a5 use proper matching for VTOL fixed-wing state regarding position acceptance 2016-06-28 22:44:49 +02:00
Andreas Antener 53b5758eb4 added mission name to assertion outputs 2016-06-28 22:44:49 +02:00
Andreas Antener 85b5b399b9 updated FW horizontal acceptance radius to work with deltaquad 2016-06-28 22:44:49 +02:00
Andreas Antener 26de353d4f added mission file to test name 2016-06-28 22:44:49 +02:00
Andreas Antener 2f581a296e enable VTOL tests on CI again 2016-06-28 22:44:49 +02:00
Andreas Antener c9f278e46f fix rcS for standard vtol 2016-06-28 22:44:49 +02:00
Andreas Antener 0e5a83f3c1 temporarily disabled running mission test on CI 2016-06-28 22:44:49 +02:00
Andreas Antener 37884dc5dd fixed landing and transition detection test 2016-06-28 22:44:49 +02:00
Andreas Antener d995f758c2 added mission test to CI run 2016-06-28 22:44:49 +02:00
Andreas Antener f252ac3eff added mission checks for landing and VTOL transition 2016-06-28 22:44:49 +02:00
Andreas Antener 57fa9d2070 use separate altitude offset check in FW 2016-06-28 22:44:49 +02:00
Andreas Antener 05dc643f17 increased fixed wing radius for mission tests and added more informative output for position matching 2016-06-28 22:44:49 +02:00
Andreas Antener 361abd7f04 added VTOL test missions 2016-06-28 22:44:49 +02:00
Andreas Antener 00d56b9ef8 added VTOL mission test, updated mission test to check mission depending on vehicle state 2016-06-28 22:44:49 +02:00
Andreas Antener 150eb779ae added draft script to run missions against SITL 2016-06-28 22:44:49 +02:00
Andreas Antener 5c88353d05 removed GCS link from mavros 2016-06-28 22:44:49 +02:00
Beat Küng 8a12dee125 cmake: remove all module.mk files & cmake conversion script (#4918)
It seems these files are leftovers.
2016-06-28 09:26:36 +02:00
Beat Küng b28bfce186 position_estimator_inav: fix compiler issue for GCC 6.1.1 (#4923)
GCC output:
implicit conversion from ‘float’ to ‘double’ to match other operand of
binary expression [-Werror=double-promotion]

It seems gcc 6.1.1 uses the float variant of fabs, whereas older gcc's
use the double version. This makes it compile for both.
2016-06-28 09:25:36 +02:00
Roman Bapst ec35e77175 px4io driver: fix reporting of mixer limits (#4922)
mixer limit topic was not filled correctly

Signed-off-by: tumbili <roman@px4.io>
2016-06-27 17:31:43 +02:00
Daniel Agar 050eedc4f8 mavlink publish WIND_COV (#4913)
* mavlink publish WIND_COV

-closes #4678

* px4fmu-v2_default disable logger and sync configs
2016-06-27 16:16:24 +02:00
James Goppert 5935b18581 Added EPH/EPV min to LPE. (#4915) 2016-06-27 08:46:00 +02:00
Eike 04e8b40a5c Posix LPE target (#4911) 2016-06-27 08:43:39 +02:00
Daniel Agar 422acc0b69 travis-ci add check_format to qgc_firmware 2016-06-26 17:42:00 -04:00
Daniel Agar b8b855f2aa param.c fix style 2016-06-26 17:36:45 -04:00
Lorenz Meier 3c2bd4f6dd Param interface: Only mark as changed if value changed 2016-06-26 22:29:14 +02:00
Lorenz Meier acc8acd059 FMU driver: Fix typo 2016-06-26 22:27:45 +02:00
Lorenz Meier 33e259e827 Update controller gains to match better vehicle models 2016-06-26 22:25:55 +02:00
Lorenz Meier 47a4b95217 Updated simulation models 2016-06-26 22:25:26 +02:00
Lorenz Meier e9fb929f50 Annotate build type classes for ver command 2016-06-26 21:38:14 +02:00
Daniel Agar cb320f6e8a param set default battery parameters (#4912) 2016-06-26 21:27:11 +02:00
Lorenz Meier 27e20acbae Leave pin 5 and 6 of the AUX port available for camera triggering when the trigger is enabled 2016-06-25 12:15:32 +02:00
tommises e6bb21db65 Leave some pins available for camera trigger GPIO. 2016-06-25 12:11:19 +02:00
Julian Oes 6618cac10a RPi2: don't forget to start the baro 2016-06-25 12:00:49 +02:00
Julian Oes fedde86bf4 df_lsm9ds1_wrapper: new DF submodule, fixes 2016-06-25 12:00:49 +02:00
Julian Oes e56be33e50 RPi2: switch from ekf2 to q/inav 2016-06-25 12:00:49 +02:00
Julian Oes 8b8766e840 RPi2: put drivers back in 2016-06-25 12:00:49 +02:00
Julian Oes ea7cebbf10 scp_upload.sh: use ENV variable to set IP of RPi2 2016-06-25 12:00:49 +02:00
Julian Oes 4c0ed8bdd5 df_lsm9ds1_wrapper: astyle 2016-06-25 12:00:49 +02:00
Hidenori ef729ab2d8 MS5611 driver wrapper for RPi 2016-06-25 12:00:49 +02:00
Miguel Arroyo f0dbae2e19 Adds LSM9DS1 DriverFramework 2016-06-25 12:00:49 +02:00
Miguel Arroyo 8b8513fe8c Adds LSM9DS1 Wrapper 2016-06-25 12:00:49 +02:00
Henry Zhang ae6600e48f MAVLink app: fix mavlink forwarding issue. (#4907) 2016-06-25 11:02:01 +02:00
Andreas Daniel Antener 705a08bbbd do not modify attitude setpoint in velocity controlled mode (#4905) 2016-06-25 10:59:50 +02:00
Daniel Agar 8ba5afcd5a circleci ccache (#4906) 2016-06-25 00:25:13 -04:00
Daniel Agar 52c790b184 circleci sync submodules recursive 2016-06-24 20:21:46 -04:00
Lorenz Meier 645204eb42 Update MAVLink library versions 2016-06-24 12:47:59 +02:00
Lorenz Meier e432a406b6 Update MAVLink submodules 2016-06-24 11:45:23 +02:00
James Goppert bf9f3b6061 Added QAV-R (raceblade) 5". (#4897)
* Added QAV-R (raceblade) 5".

* Added I gain for qav-r.
2016-06-24 11:44:39 +02:00
Lorenz Meier 286efb6b34 Remove POOSIX porting noise from ms5611 driver (#4896) 2016-06-24 10:39:55 +02:00
Lorenz Meier d49598b8b3 Build SF10A on FMUv4 2016-06-24 10:31:28 +02:00
Lorenz Meier 7b2367cdff Remove unused topic from SF10A 2016-06-24 10:31:17 +02:00
ecmnet 993831aba8 SF10A driver fix 2016-06-24 10:28:25 +02:00
Roman eabc4647c2 mavlink receiver: fixed unit conversions for current
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-24 08:35:27 +02:00
Roman f754d23a0f mavlink receiver: fixed computation of cell count
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-24 08:10:35 +02:00
Lorenz Meier 925c340915 Remove unused code from simulated driver 2016-06-24 00:24:09 +02:00
Beat Küng e0c11f5545 fix ekf2_replay_main.cpp: remove timestamp_velocity from gps topic 2016-06-24 00:22:01 +02:00
Beat Küng cf5d959f1b gnss.cpp: switch to relative gps timestamp 2016-06-24 00:22:01 +02:00
Beat Küng 940ac5471d ekf2: remove unused gps_msg.time_usec_vel 2016-06-24 00:22:01 +02:00
Beat Küng f8e9a19889 gps_position: convert uint64 timestamp_time -> int32 timestamp_time_relative
We need to make this timestamp relative to the main timestamp. Necessary
for replay, and saves some space.
2016-06-24 00:22:01 +02:00
Beat Küng e2a7145379 vehicle_gps_position: remove timestamp_variance & timestamp_velocity (they're not used) 2016-06-24 00:22:01 +02:00
Beat Küng 89f5bd27e8 vehicle_gps_position: use timestamp field instead of timestamp_position
timestamp was unused. This allows to remove timestamp_position.
2016-06-24 00:22:01 +02:00
Lorenz Meier bf0b3c1585 More complete ESC feedback, ensure to include a timestamp 2016-06-24 00:08:24 +02:00
Lorenz Meier 34c0d3e99a Add TAP to vendor list 2016-06-24 00:08:24 +02:00
Lorenz Meier b04e2526a1 Fix compile errors for tap ESC 2016-06-24 00:08:24 +02:00
Lorenz Meier de1c865881 Move TAP ESC to FMUv4 to save flash on FMUv2 2016-06-24 00:08:24 +02:00
Lorenz Meier 1f8b75c9f3 Enable it in build 2016-06-24 00:08:24 +02:00
Lorenz Meier fab201a2d6 Initial import of TAP controllers 2016-06-24 00:08:24 +02:00
Mark Whitehorn 40a7bd009f implement Spektrum bind function for Pixracer R14 (#4887) 2016-06-23 23:27:51 +02:00
Lorenz Meier 024a86c309 Simulator: fix battery sim 2016-06-23 22:32:14 +02:00
Roman Bapst 571798c318 Pr external battery monitoring (#4881)
* mavlink receiver: added handling of battery status

handle incoming battery status messages in order to support external
battery monitoring

Signed-off-by: Roman <bapstr@ethz.ch>

* sensor params: added parameter for battery monitoring source

Signed-off-by: Roman <bapstr@ethz.ch>

* sensors: only publish battery status if we don't have external battery
monitoring activated

Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-23 18:41:38 +02:00
sirPerna 9f95f457a9 Update default Caipirinha parameters (#4883)
* Update default parameters for TBS Caipirinha

* reverse channel 0 doesn't exist
2016-06-23 18:09:07 +02:00
Daniel Agar b09872e795 travis-ci fix git shallow clone for git ver (#4885) 2016-06-23 11:04:36 -04:00
tumbili c2825f701a ekf_att_pos_estimator: fixed saving params when landed
fixed logic such that parameters are saved when vehicle just landed.
only save parameters once when state changed from in_air to landed.

Signed-off-by: tumbili <roman@px4.io> and bkueng <beat-kueng@gmx.net>
2016-06-23 15:56:51 +02:00
tumbili 8026273cb0 land_detector: do not publish if landing or freefall state has not changed
Signed-off-by: tumbili <roman@px4.io> and bkueng <beat-kueng@gmx.net>
2016-06-23 15:56:51 +02:00
Beat Küng 7dea8d4a24 fix 10020_3dr_quad script: load proper mixer file (#4880)
fixes regression from 85245471c0
2016-06-23 14:54:20 +02:00
Nate Weibley 0551e001e2 Properly reflect flow control state if IOCTL fails (#4873)
The flow control state is improperly reflected as enabled if the arch/HAL rejects an IOCTL to turn it on. Mavlink::enable_flow_control updates _flow_control_enabled only if the IOCTL call does not fail.
2016-06-23 10:17:17 +02:00
Roman 27e61127a8 ekf2: fix if else logic
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-23 09:08:35 +02:00
Roman 6f6ae78cf2 ekf_att_pos_estimator: added logic for airspeed modes
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-23 09:08:35 +02:00
tumbili c1ba7ab62b vtol attitude control: fixed code style
Signed-off-by: tumbili <roman@px4.io>
2016-06-23 09:08:35 +02:00
sander bbf852787e Rename param to throttle 2016-06-23 09:08:35 +02:00
sander 3002852bfa Allow throttle updates below 10% 2016-06-23 09:08:35 +02:00
sander f2e425b75b commenting 2016-06-23 09:08:35 +02:00
sander 9d59ba125d remove debug info 2016-06-23 09:08:35 +02:00
sander 37531c018a Implement MAV_CMD_DO_CHANGE_SPEED throttle 2016-06-23 09:08:35 +02:00
Roman 7f8c183d99 added airspeed mode enum to control state topic
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-23 09:08:35 +02:00
Roman 22db94e352 removed debug printf
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-23 09:08:35 +02:00
sander cea2350d2e Time based front transition blending 2016-06-23 09:08:35 +02:00
sander b54982965b Allow VTOL transition based on time 2016-06-23 09:08:35 +02:00
tumbili 1bce38bd9b code style formatting 2016-06-23 09:08:35 +02:00
tumbili c2da51ccf5 use airspeed mode parameter to decide which method used to publish
control state airspeed
2016-06-23 09:08:34 +02:00
tumbili 099becb353 added parameter for airspeed mode selection
this will enable small planes flying without an
airspeed sensor
2016-06-23 09:08:34 +02:00
Daniel Agar e0a214da20 travis-ci OSX don't use homebrew (#4875)
* the OSX builds were spending the majority of the time just updating homebrew and installing a couple packages
2016-06-23 01:22:47 -04:00
Daniel Agar 3194153b21 travis-ci homebrew cleanup (#4874) 2016-06-22 21:55:12 -04:00
Daniel Agar b247dac120 travis-ci optimizations (#4870)
* move gcc 4.9 build to circleci

* travis-ci update to xcode 7.3

* travis-ci limit git fetching for OSX

* Makefile split firmware targets for CI

* OSX ccache
2016-06-22 17:42:49 -04:00
Lorenz Meier 56ddd29f1a Commander: Update params on last step of mag cal 2016-06-22 16:03:01 +02:00
Beat Küng e7f31393bc orb: reduce size of SubscriberData struct (#4771)
- priority field uses only the lower 8 bits, so we can merge with the
  update_reported flag
- orb_set_interval is not used often, so make the necessary data an
  optional pointer and alloc only when needed.

Memory savings:
- pixracer (w. ekf2): 7.3kB
- pixhawk: 5.3kB
2016-06-22 15:28:23 +02:00
Julian Oes dfa2ec8c6c DriverFramework: updated submodule (#4867)
This brings some makefile and script fixes, as well as an updated dspal.
2016-06-22 15:19:29 +02:00
Roman Bapst 37108870e1 fw_pos_control_l1: added roll setpoint for logging (#4869)
in altitude control mode for fixed wings the roll setpoint was not
logged because the position controller publishes the attitude setpoint
but the desired roll setpoint is calculated in the attitude control
module. Now the position controller calculates the roll setpoint as well
for the sake of logging.

Signed-off-by: tumbili <roman@px4.io>
2016-06-22 15:19:11 +02:00
Daniel Agar 36103d33d2 travis-ci only build qgc firmware 2016-06-22 13:51:39 +02:00
Daniel Agar 3f3a44fec5 cmake status message if MEMORY_DEBUG enabled 2016-06-22 13:51:39 +02:00
Daniel Agar 924fb49bf5 fw_pos_control_l1 shorten task name
-limited to 16 chars
2016-06-22 13:51:39 +02:00
Daniel Agar b65291579f show bad formatting diff 2016-06-22 13:51:39 +02:00
Daniel Agar 4d0bb9f1e2 update eclipse project file templates 2016-06-22 13:51:39 +02:00
jwilson 9794bb2f2f Running fix_code_style.sh on the requested source files. 2016-06-22 08:57:06 +02:00
jwilson acc1f04b67 Unfortunately, lot's of whitespace changes, required to satisfy unspecified code style format errors. 2016-06-22 08:57:06 +02:00
jwilson 1091319274 Removing shmem_posix.c from the unit testing since param_shmem_test is disabled. 2016-06-22 08:57:06 +02:00
jwilson a2c16a3b5e Another attempt to fix the build problem in the shmem code. 2016-06-22 08:57:06 +02:00
jwilson 701d6314d2 Fixes build problem in the shmem code. 2016-06-22 08:57:06 +02:00
jwilson a73ac821ab Fixes shared memory locking bug and eliminates the need for an AppsProm driver to reserve a shared memory region. 2016-06-22 08:57:06 +02:00
tumbili 6739ae9dfc ekf2: substract gyro bias from control state rates
Signed-off-by: tumbili <roman@px4.io>
2016-06-22 07:10:20 +02:00
tumbili c84870046e updated ecl: added method to return ekf bias state
Signed-off-by: tumbili <roman@px4.io>
2016-06-22 07:10:20 +02:00
Lorenz Meier b563fae118 Fix request data stream handling 2016-06-22 00:09:13 +02:00
Lorenz Meier de675845af Fix navigator timeout logic 2016-06-22 00:04:31 +02:00
Lorenz Meier 2f113a4ce3 MAVLink: Allow data rate updates 2016-06-21 16:38:53 +02:00
Lorenz Meier 1869ffd15f Fix unknown command message for Spektrum bind 2016-06-21 13:36:35 +02:00
Julian Oes 91127d51c0 commander: stay in failsafe even when landed
If the failsafe state is ended when landed, we would switch back to
POSCTL and therefore take off again, however, all we want is stay on
ground and wait for the auto disarm.
2016-06-21 10:21:34 +02:00
dong.chen 5ad671ed4c Solve the problem When lost rc signal, it will rtl repeated. 2016-06-21 10:21:34 +02:00
Julian Oes c7ec07be70 commander: properly use new param
The param COM_ARM_WO_GPS is set to 1 by default to allow arming without
GPS. This then sets a bool arm_without_gps which translates to
!GNSS_check in preflightCheck.
2016-06-21 10:21:34 +02:00
Julian Oes f67e74935e commander: remove leftover printf 2016-06-21 10:21:34 +02:00
Julian Oes 66dd72555a navigator: change default of RC loss param to RTL 2016-06-21 10:21:34 +02:00
Julian Oes ef04085ac5 commander: go to ALTCTL if GPS is lost in POSCTL
Previously, we renained in POSCTL and would drift away if GPS was lost.
2016-06-21 10:21:34 +02:00
Julian Oes 67a4a57491 commander: only warn if termination happens
The termination warnings were printed even if termination was not
actually enabled. This was confusing and is therefore fixed.
2016-06-21 10:21:34 +02:00
Julian Oes 872b08f677 commander: remove unneeded include 2016-06-21 10:21:34 +02:00
Julian Oes fdff6ea325 Revert "commander: remove unused/wrong failsafe handling"
This reverts commit 9e704a5e121c7516e2133d02b328500d9d66fb67.
2016-06-21 10:21:34 +02:00
Julian Oes d0355cef1f Revert "commander/navigator: remove param NAV_RCL_ACT"
This reverts commit 77ea4cebf41cd106fe771b9eb469aa2326339467.
2016-06-21 10:21:34 +02:00
Julian Oes 049146ef9c commander: param to allow arming without GPS 2016-06-21 10:21:34 +02:00
Julian Oes 3e9d1388af commander: remove unused/wrong failsafe handling
The deleted code conflicts with the failsafe handling in set_nav_state.
Also, flight termination was usually disabled by circuit breaker which
means this code had no effect anyway.
2016-06-21 10:21:34 +02:00
Julian Oes 016d514d80 commander/navigator: remove param NAV_RCL_ACT
The param NAV_RCL_ACT was not implemented as described. Also, it has the
completely the wrong name. It should be a COM param and not NAV.
Therefore, remove the param and delete the partly implemented
and probably never used functionality.
2016-06-21 10:21:34 +02:00
Julian Oes ea10c8c8a3 circuit_breaker: change default for GPS failure
We should definitely take action when GPS fails, this circuit breaker
shouldn't be engaged anymore.
2016-06-21 10:21:34 +02:00
Julian Oes 739d1cfd3f navigator: always run the loop, even without GPS
If the navigator stops when no more position updates arrive, it won't
switch to land mode when DESCEND is requested by the commander.
2016-06-21 10:21:34 +02:00
Julian Oes fe29d99d62 commander: use the gps_failure flag
The gps_failure flag had been ignored in some navigation states.
2016-06-21 10:21:34 +02:00
Julian Oes 4d10759699 commander: use DESCEND mode and not LANDGPSFAIL
Always use the DESCEND mode and not LANDGPSFAIL because LANDGPSFAIL will
try to loiter for some time and then request termination instead of
descending gently and trying to land.
2016-06-21 10:21:34 +02:00
Henry Zhang 178f32ab41 Commander:fill missing command ack. (#4814) 2016-06-21 10:20:33 +02:00
Chris Lovett 847d9ec4f4 Fix code style using Tools/fix_code_style.sh 2016-06-21 10:10:50 +02:00
Chris Lovett 534e10c96a Implement code review feedback. Add get_id_static to MavlinkStream items. Add implementation of MAV_CMD_SET_MESSAGE_INTERVAL, MAV_CMD_GET_MESSAGE_INTERVAL. Add deprecation message to REQUEST_DATA_STREAM. 2016-06-21 10:10:50 +02:00
Chris Lovett 4ef4be2d70 MavlinkReceiver::handle_message_request_data_stream walks into deleted memory when you send the "stop" bit on a stream. It also fails to restart the stream because it deletes the stream when you send the stop command, so restart needs to use stream_list to find the stream again. 2016-06-21 10:10:50 +02:00
Lorenz Meier 3f45d008eb Fix stack main usage in motor ramp app 2016-06-21 09:43:00 +02:00
Julian Oes 8aee4432a9 px4io: set safety on before going into bootloader (#4860)
Sometimes when flashing new firmware, the IO update fails because safety
is off. In this case, we should set safety on first before putting the
IO board into bootloader mode.
2016-06-21 09:15:38 +02:00
Lorenz Meier 85245471c0 Update 3DR quad config, remove rendundant entries 2016-06-20 22:37:05 +02:00
Andreas Antener 2c29652136 fixed code style in motor_ramp 2016-06-20 20:59:43 +02:00
Andreas Antener 0581f1af52 added motor_ramp to fmu v4 2016-06-20 20:24:46 +02:00
Andreas Antener 2dc97fc680 added check for running attitude controllers, cleaned-up output 2016-06-20 20:24:46 +02:00
Andreas Antener 4e0980aeb9 fixed sine output 2016-06-20 20:24:46 +02:00
Andreas Antener 7f56961e26 removed unnecessary output texts 2016-06-20 20:24:46 +02:00
Roman 87dc996a41 added option to output sine wave 2016-06-20 20:24:46 +02:00
Andreas Antener b3c3d6f88f fixed format error 2016-06-20 20:24:46 +02:00
Andreas Antener 7c76c7c25a added warning, set hold time to 1 sec 2016-06-20 20:24:46 +02:00
Andreas Antener a7834693e8 updated usage, increased prio and lowered max hold time 2016-06-20 20:24:46 +02:00
Andreas Antener d8cdb2032c constantly set outputs for ramp, otherwise the ESC doesn't keep it's setting (why?) 2016-06-20 20:24:46 +02:00
Andreas Antener ede032c557 ouput pwm values directly 2016-06-20 20:24:45 +02:00
Andreas Antener fabb37975d added motor_ramp to v2 config 2016-06-20 20:24:45 +02:00
Andreas Antener 0b930a36b9 added parameters to motor_ramp 2016-06-20 20:24:45 +02:00
Andreas Antener 1aeb139157 added motor ramp app, draft impl 2016-06-20 20:24:45 +02:00
Andreas Antener d1b27ab056 moved params NAV_OBL to COM_OBL 2016-06-20 19:23:11 +02:00
Andreas Antener 8727295f8e fix OBL parameters in commander 2016-06-20 19:03:10 +02:00
Andreas Antener d3d9f013f4 set OBL parameters for iris 2016-06-20 19:03:10 +02:00
Andreas Antener 095997ca59 changed order of arguments for readability 2016-06-20 19:03:10 +02:00
Andreas Antener fedb9de6ef fixed offboard loss timing handling 2016-06-20 19:03:09 +02:00
Andreas Antener ced8376268 added offboard lost actions with additional timeout 2016-06-20 19:03:09 +02:00
Daniel Agar e42b5804a0 travis-ci only run make check within docker (#4854)
* otherwise the build environment doesn't get the proper return code
2016-06-20 10:03:37 -04:00
Julian Oes d92496a7f7 df_ms5607_wrapper: astyle (#4853) 2016-06-20 15:29:30 +02:00
Michael Schaeuble f95f37cb7b Update to DF commit with the MS5607 driver 2016-06-20 12:55:01 +02:00
Michael Schaeuble 83ec092b46 Update bebop configuration and use parameters 2016-06-20 12:55:01 +02:00
Michael Schaeuble cc0d28e59b Update DF to include the MS5607 driver 2016-06-20 12:55:01 +02:00
Michael Schaeuble 0d9c031a2c Check for bebop ip as environment variable 2016-06-20 12:55:01 +02:00
Michael Schaeuble 847562f5d7 Don't build px4_simple_app anymore 2016-06-20 12:55:01 +02:00
Michael Schaeuble 47613fefa0 Don't advertise garbage, apply same fix from #4735 2016-06-20 12:55:01 +02:00
Michael Schaeuble 52d8723d55 Add df_ms5607_wrapper (a renamed copy from BMP280) 2016-06-20 12:55:01 +02:00
Michael Schaeuble 696a378120 Add modules and commands to bebop build 2016-06-20 12:55:01 +02:00
Michael Schaeuble 9933494d53 Add parrot bebop build structure 2016-06-20 12:55:01 +02:00
Lorenz Meier b2cfe05881 Adjust Typhoon H480 gains 2016-06-20 12:54:22 +02:00
Julian Oes 146c8ddbc3 px4_getopt: astyle 2016-06-20 09:37:43 +02:00
Lorenz Meier 97f6ad4e53 Even better Gazebo models 2016-06-18 19:28:48 +02:00
Lorenz Meier a812224103 Update standard VTOL 2016-06-18 18:18:00 +02:00
Lorenz Meier 95430180f0 Update gazebo 2016-06-18 17:37:24 +02:00
Lorenz Meier c647b6db4d Update gains 2016-06-18 17:36:48 +02:00
Lorenz Meier d860bdcdc0 Update VTOL gains 2016-06-18 17:03:49 +02:00
Lorenz Meier 229208610e Fix simulator code style 2016-06-18 17:03:11 +02:00
Lorenz Meier e7d02f6272 Update VTOL gains 2016-06-18 16:59:46 +02:00
Lorenz Meier 3ef6ee056f Sync rate control gains 2016-06-18 16:58:04 +02:00
Lorenz Meier 3c9f5694e7 Fix Gazebo models for VTOL and planes 2016-06-18 16:38:49 +02:00
Lorenz Meier 03813cc46b Update fixed VTOL model 2016-06-18 16:29:39 +02:00
Lorenz Meier afdc8cdf55 VTOL: Use standard attitude gains 2016-06-18 16:29:28 +02:00
Lorenz Meier 2242331f08 Update SITL Gazebo 2016-06-18 15:34:37 +02:00
Lorenz Meier eabb504445 Compress Iris Gazebo model 2016-06-18 13:16:05 +02:00
Lorenz Meier 7b109bacf2 Update Gazebo models 2016-06-18 12:08:45 +02:00
Lorenz Meier fd768fe5ac Update models 2016-06-18 10:41:35 +02:00
Lorenz Meier 5d18ea7502 Update models 2016-06-18 10:40:34 +02:00
Lorenz Meier 51df9771b3 Add support for more than 8 outputs, but do not enable it yet 2016-06-18 01:54:31 +02:00
Lorenz Meier 85e3073f14 Simulator: Send all actuator output groups 2016-06-18 01:50:42 +02:00
Lorenz Meier c285e231b7 Update jMAVSim 2016-06-17 22:44:42 +02:00
Lorenz Meier 9230688f54 Commander: Add transition command 2016-06-17 22:44:42 +02:00
Lorenz Meier e8274d3ddb SITL: Add gimbal meshes 2016-06-17 22:44:42 +02:00
Lorenz Meier e6b82898fb Add airframe model 2016-06-17 22:44:42 +02:00
Lorenz Meier 0126e49841 Solo: Use the right mixer 2016-06-17 22:44:42 +02:00
Lorenz Meier dff50072e9 Add new airframe meta files 2016-06-17 22:44:42 +02:00
Lorenz Meier 55267b9ad3 Add new airframe 2016-06-17 22:44:42 +02:00
Lorenz Meier 825ba912c3 Update plane mixer 2016-06-17 22:44:42 +02:00
Lorenz Meier 3770bfd641 Update Gazebo model for plane 2016-06-17 22:44:42 +02:00
Lorenz Meier d50e307243 Update Tailsitter model 2016-06-17 22:44:42 +02:00
Lorenz Meier c248adb18d Fix tuning gains for Solo and tailsitter 2016-06-17 22:44:42 +02:00
Lorenz Meier 96387ed824 Update SITL gazebo 2016-06-17 22:44:42 +02:00
Lorenz Meier acd7c37057 Get closer to correct tailsitter mixer, still incomplete 2016-06-17 22:44:42 +02:00
Lorenz Meier 413233341e Update SITL Gazebo model 2016-06-17 22:44:42 +02:00
Lorenz Meier afa9467dad Final plane mixer 2016-06-17 22:44:42 +02:00
Lorenz Meier 982c25b7da Update SITL Gazebo with new consistent interface 2016-06-17 22:44:42 +02:00
Lorenz Meier 184da9e743 Remove null mixers from plane now that we are doing it correctly 2016-06-17 22:44:42 +02:00
Lorenz Meier f11d42aab3 Simulator MAVLink: Forward port cleanly 2016-06-17 22:44:42 +02:00
Andreas Bircher 46ec1e6b95 fixing cherry-picking divergences 2016-06-17 22:39:02 +02:00
Andreas Bircher 6bd17c7ba4 adding user info 2016-06-17 22:39:02 +02:00
Andreas Bircher e951a356fe fixing the driver interface
Conflicts:
	PX4/src/drivers/camera_trigger/interfaces/src/pwm.cpp
	PX4/src/drivers/camera_trigger/interfaces/src/pwm.h
2016-06-17 22:39:02 +02:00
Andreas Bircher f038b16734 adding arming check before setting PWM 2016-06-17 22:39:02 +02:00
Kelly Steich eed968979f added parameter for choosing the camera interface mode
Conflicts:
	PX4/src/drivers/camera_trigger/camera_trigger.cpp
2016-06-17 22:39:02 +02:00
Andreas Bircher c49a2da261 adding arming check before setting PWM 2016-06-17 22:39:02 +02:00
Kelly Steich 2ec1e508d2 added setup method to constructor of camera interfaces
Conflicts:
	PX4/src/drivers/camera_trigger/interfaces/src/pwm.cpp
2016-06-17 22:39:02 +02:00
Andreas Bircher adffb85962 adding arming check before setting PWM 2016-06-17 22:39:02 +02:00
Kelly Steich 4c5f32ab16 delete the camera interface object in camera trigger destructor 2016-06-17 22:39:02 +02:00
Andreas Bircher f83c53c274 adding the initial pwm trigger logic 2016-06-17 22:39:02 +02:00
Kelly Steich 3671bfb743 added the camera interface info method to the camera trigger info method 2016-06-17 22:39:02 +02:00
Kelly Steich 29f31ae6ac fixed the triggering function logic
Conflicts:
	PX4/src/drivers/camera_trigger/camera_trigger.cpp
	PX4/src/drivers/camera_trigger/interfaces/src/camera_interface.h
	PX4/src/drivers/camera_trigger/interfaces/src/pwm.cpp
	PX4/src/drivers/camera_trigger/interfaces/src/pwm.h
	PX4/src/drivers/camera_trigger/interfaces/src/relay.cpp
	PX4/src/drivers/camera_trigger/interfaces/src/relay.h
2016-06-17 22:39:02 +02:00
Kelly Steich b31c346ea7 new file structure for the camera_trigger driver
Conflicts:
	PX4/cmake/configs/nuttx_px4fmu-v2_default.cmake
2016-06-17 22:39:02 +02:00
Julian Oes 1dec6e83c6 ecl: update submodule (#4839) 2016-06-17 21:16:54 +02:00
Eric Ye c446304751 Update makefile to ask for cmake 3.4.3 (#4831) 2016-06-17 10:47:06 -04:00
Daniel Agar bada390dde fw_pos_control_l1 fix FW_LND_FLALT usage (#4835)
-fixes #4745
2016-06-16 21:02:28 +02:00
David Sidrane 538d9ada25 Needed to avoid name collsion in upcomming Nuttx logger changes (#4830) 2016-06-15 21:51:53 +02:00
Daniel Agar e2801d35e4 fix comment spelling 2016-06-15 20:35:16 +02:00
Daniel Agar 64d9b8eefd fix COM_FLTMODE5 metadata typo 2016-06-15 20:35:16 +02:00
Daniel Agar 4ab8ddec53 rename cb_usb -> circuit_breaker_engaged_usb_check 2016-06-15 20:35:16 +02:00
Daniel Agar c22a9137dd commander cleanup headers 2016-06-15 20:35:16 +02:00
Daniel Agar 7bbfa5d94b cleanup px4_custom_mode 2016-06-15 20:35:16 +02:00
Daniel Agar d16daf5ba4 pwm_out_sim sleep if no fds (#4829)
-fixes #4828
2016-06-15 20:29:19 +02:00
James Goppert 2a26611cf5 Make LPE sonar reading more robust. (#4806) 2016-06-15 12:37:52 -04:00
Julian Oes a76eab367c DriverFramework: update submodule
This brings various PRs in:
- RPi build fixes
- unit tests on CI and on Mac
- some cmake cleanup
- CI style check for DF
2016-06-15 13:36:30 +01:00
Julian Oes d9d5d9d9e4 mc_pos_control: run the loop without position data
By running the loop in mc_pos_control without successfully polling on
position data, we still copy the manual input over so that
mc_att_control can consume it. This allows to fly in manual mode without
GPS and no position estimate.
2016-06-15 13:34:27 +01:00
Beat Küng 26b7ac3884 mavlink: remove an UDP remote port warning, print remote port in mode info 2016-06-15 09:56:34 +02:00
Beat Küng 574a67b93d fix px4_getopt: ensure progress in case of unknown options
Previously sdlog2 got stuck in an endless loop if an unknown argument was
given
2016-06-15 09:55:25 +02:00
Beat Küng 2b85c594b3 fix px4_getopt: correctly handle options that take an argument, but no argument is given
This lead to a segfault, for example 'logger start -r'
2016-06-15 09:53:37 +02:00
CarlOlsson d66af65a92 ekf2: fixed airspeed thr bug 2016-06-14 10:28:40 +02:00
Lorenz Meier b731a9e96c Fix AR Drone scaling param 2016-06-14 08:42:12 +02:00
Daniel Agar 2eac57731c travis-ci fix missing semicolon (#4812) 2016-06-14 02:18:22 -04:00
Daniel Agar f13b75a6d2 travis-ci fix s3 deploy conditions (#4810) 2016-06-14 01:56:42 -04:00
Daniel Agar 2f5357be7a travis-ci use px4io docker images (#4696) 2016-06-14 01:06:43 -04:00
Daniel Agar 6f7e978f33 initial circle-ci configuration (#4807) 2016-06-13 17:39:30 -04:00
Lorenz Meier 4cca4ea954 Add DOI 2016-06-12 11:53:55 +02:00
1092 changed files with 72982 additions and 22216 deletions
+9 -1
View File
@@ -5,6 +5,7 @@
*.px4log
*.dSYM
*.o
*.gch
*.pyc
*~
.*.swp
@@ -64,7 +65,6 @@ CMakeLists.txt.user
GPATH
GRTAGS
GTAGS
*.config
*.creator
*.creator.user
*.files
@@ -73,3 +73,11 @@ GTAGS
# uavcan firmware
ROMFS/px4fmu_common/uavcan/
vectorcontrol/
# CLion ignores
.idea
# gcov code coverage
coverage-html/
coverage.info
+6 -6
View File
@@ -1,12 +1,15 @@
[submodule "mavlink/include/mavlink/v1.0"]
path = mavlink/include/mavlink/v1.0
url = git://github.com/mavlink/c_library.git
url = https://github.com/mavlink/c_library_v1.git
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
[submodule "NuttX"]
path = NuttX
url = git://github.com/PX4/NuttX.git
url = https://github.com/PX4/NuttX.git
[submodule "src/modules/uavcan/libuavcan"]
path = src/modules/uavcan/libuavcan
url = git://github.com/UAVCAN/libuavcan.git
url = https://github.com/UAVCAN/libuavcan.git
[submodule "Tools/genmsg"]
path = Tools/genmsg
url = https://github.com/ros/genmsg.git
@@ -38,6 +41,3 @@
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/GpsDrivers.git
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = git://github.com/mavlink/c_library.git
+88 -96
View File
@@ -3,134 +3,124 @@
language: cpp
git:
depth: 1000
matrix:
fast_finish: true
include:
- os: linux
sudo: false
env: GCC_VER=4.8
- os: linux
sudo: false
env: GCC_VER=4.9
sudo: required
env: GCC_VER=4.9 DOCKER_REPO="px4io/px4-dev-base:2016-10-20"
services:
- docker
- os: osx
osx_image: xcode7
sudo: true
osx_image: xcode8
env: CCACHE_CPP2=1
cache:
ccache: true
pip: true
directories:
- $HOME/.ccache
addons:
apt:
sources:
- kubuntu-backports
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
packages:
- build-essential
- ccache
- clang-3.5
- cmake
- g++-4.9
- gcc-4.9
- genromfs
- libc6-i386
- libncurses5-dev
- ninja-build
- python-argparse
- python-empy
- s3cmd
- texinfo
- zlib1g-dev
- $HOME/.pip/cache/
- $HOME/Library/Caches/pip
before_install:
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
pushd .
&& cd ~ && mkdir gcc && cd gcc
&& if [ "$GCC_VER" = "4.8" ]; then GCC_URL="https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2" ; fi
&& if [ "$GCC_VER" = "4.9" ]; then GCC_URL="https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2" ; fi
&& wget -O gcc.tar.bz2 ${GCC_URL}
&& tar -jxf gcc.tar.bz2 --strip 1
&& exportline="export PATH=$HOME/gcc/bin:\$PATH"
&& if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
&& . ~/.profile
&& popd
&& git clone git://github.com/PX4/CI-Tools.git
&& ./CI-Tools/s3cmd-configure
&& mkdir -p ~/bin
&& wget -O ~/bin/astyle https://github.com/PX4/astyle/releases/download/2.05.1/astyle-linux && chmod +x ~/bin/astyle
&& astyle --version
&& if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
cd ${TRAVIS_BUILD_DIR}
&& git fetch --unshallow && git fetch --all --tags
&& docker pull ${DOCKER_REPO}
;
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew tap PX4/homebrew-px4
&& brew update; brew update
&& brew install cmake ninja
&& brew install genromfs
&& sudo easy_install pip
&& sudo pip install empy
sudo -H easy_install pip
&& sudo -H pip install empy
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ccache
&& sudo mv ccache /usr/local/bin
&& chmod +x /usr/local/bin/ccache
&& mkdir -p ~/bin
&& sudo ln -s /usr/local/bin/ccache ~/bin/c++
&& sudo ln -s /usr/local/bin/ccache ~/bin/cc
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang++
&& sudo ln -s /usr/local/bin/ccache ~/bin/g++
&& sudo ln -s /usr/local/bin/ccache ~/bin/gcc
&& export PATH=~/bin:$PATH
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ninja
&& sudo mv ninja /usr/local/bin
&& chmod +x /usr/local/bin/ninja
;
fi
before_script:
# 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/arm-none-eabi-size
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-objcopy
- ln -s /usr/bin/ccache ~/bin/clang++
- ln -s /usr/bin/ccache ~/bin/clang++-3.4
- ln -s /usr/bin/ccache ~/bin/clang++-3.5
- ln -s /usr/bin/ccache ~/bin/clang
- ln -s /usr/bin/ccache ~/bin/clang-3.4
- ln -s /usr/bin/ccache ~/bin/clang-3.5
- export PATH=~/bin:$PATH
env:
global:
- NINJA_BUILD=1
# AWS KEY: $PX4_AWS_KEY
- secure: "XknnZHWBbpHbN4f3fuAVwUztdLIu8ej4keC3aQSDofo3uw8AFEzojfsQsN9u77ShWSIV4iYJWh9C9ALkCx7TocJ+xYjiboo10YhM9lH/8u+EXjYWG6GHS8ua0wkir+cViSxoLNaMtmcb/rPTicJecAGANxLsIHyBAgTL3fkbLSA="
# AWS SECRET: $PX4_AWS_SECRET
- secure: "h6oajlW68dWIr+wZhO58Dv6e68dZHrBLVA6lPXZmheFQBW6Xam1HuLGA0LOW6cL9TnrAsOZ8g4goB58eMQnMEijFZKi3mhRwZhd/Xjq/ZGJOWBUrLoQHZUw2dQk5ja5vmUlKEoQnFZjDuMjx8KfX5ZMNy8A3yssWZtJYHD8c+bk="
- PX4_AWS_BUCKET=px4-travis
- GIT_SUBMODULES_ARE_EVIL=1
script:
- git submodule update --quiet --init --recursive
- ccache -M 1GB; ccache -z
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
arm-none-eabi-gcc --version && make check VECTORCONTROL=1;
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e CI=true -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=0";
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
make check_posix_sitl_default;
make tests;
fi
- ccache -s
after_success:
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${GCC_VER}" = "4.8" ]]; then
make package_firmware
&& find . -name \*.px4 -exec cp "{}" . \;
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/
&& find . -type f -name 'nuttx-*-default.px4' -exec cp "{}" . \;
&& find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
&& ./CI-Tools/s3cmd-put `find . -maxdepth 1 -mindepth 1 -type f -name '*_default.px4'` build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
&& ./CI-Tools/s3cmd-put Firmware.zip archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/
&& ./CI-Tools/s3cmd-put CI-Tools/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
&& ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
&& ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
&& echo ""
&& echo "Binaries have been posted to:" https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
;
&& mkdir s3deploy-branch && mv *_default.px4 build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml s3deploy-branch/;
fi
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "$GCC_VER" == "4.9" ]]; then
export PX4_S3_DEPLOY=1;
fi
deploy:
provider: releases
api_key:
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
file: "Firmware.zip"
skip_cleanup: true
on:
tags: true
all_branches: true
repo: PX4/Firmware
condition: $GCC_VER = 4.8
# deploy *.px4 to S3 px4-travis/Firmware/$TRAVIS_BRANCH
- provider: s3
access_key_id: $PX4_AWS_KEY
secret_access_key:
secure: $PX4_AWS_SECRET
bucket: px4-travis
local_dir: s3deploy-branch
upload-dir: Firmware/$TRAVIS_BRANCH
acl: public_read
skip_cleanup: true
on:
all_branches: true
condition: $PX4_S3_DEPLOY = 1
# deploy Firmware.zip to S3 px4-travis/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
- provider: s3
access_key_id: $PX4_AWS_KEY
secret_access_key:
secure: $PX4_AWS_SECRET
bucket: px4-travis
local_dir: s3deploy-archive
upload-dir: archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
acl: public_read
skip_cleanup: true
on:
all_branches: true
condition: $PX4_S3_DEPLOY = 1
# on tags deploy Firmware.zip to Github releases
- provider: releases
api_key:
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
file: "Firmware.zip"
skip_cleanup: true
on:
tags: true
all_branches: true
repo: PX4/Firmware
condition: $GCC_VER = 4.9
notifications:
webhooks:
@@ -139,6 +129,8 @@ notifications:
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
slack:
secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
rooms:
- secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
on_pull_requests: false
on_success: never # options: [always|never|change] default: always
on_failure: never # options: [always|never|change] default: always
+115 -22
View File
@@ -121,6 +121,14 @@
# and leads to wrong toolchain detection
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
execute_process(
COMMAND Tools/check_submodules.sh
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
# Use clang
#SET (CMAKE_C_COMPILER /usr/bin/clang-3.6)
#SET (CMAKE_CXX_COMPILER /usr/bin/clang++-3.6)
@@ -132,12 +140,13 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_BUILD_TYPE "" CACHE STRING "build type")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS ";Debug;Release;RelWithDebInfo;MinSizeRel")
set(CONFIG "nuttx_px4fmu-v2_default" CACHE STRING "desired configuration")
set(CONFIG "posix_sitl_default" CACHE STRING "desired configuration")
file(GLOB_RECURSE configs RELATIVE cmake/configs "cmake/configs/*.cmake")
set_property(CACHE CONFIG PROPERTY STRINGS ${configs})
set(THREADS "4" CACHE STRING
"number of threads to use for external build processes")
set(DEBUG_PORT "/dev/ttyACM0" CACHE STRING "debugging port")
set(EXTERNAL_MODULES_LOCATION "" CACHE STRING "External modules source location")
#=============================================================================
# configuration
@@ -152,12 +161,22 @@ set(target_name "${OS}-${BOARD}-${LABEL}")
message(STATUS "${target_name}")
# switch to ros CMake file if building ros
if (${OS} STREQUAL "ros")
include("cmake/ros-CMakeLists.txt")
else() # otherwise use the rest of this file
# Define GNU standard installation directories
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Add support for external project building
include(ExternalProject)
# Setup install paths
if(NOT CMAKE_INSTALL_PREFIX)
if (${OS} STREQUAL "posix")
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE)
endif()
endif()
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/cmake")
message(STATUS "cmake module path: ${CMAKE_MODULE_PATH}")
set(config_module "configs/${CONFIG}")
include(${config_module})
@@ -188,6 +207,9 @@ if(DEFINED config_df_driver_list)
message("DF Drivers: ${config_df_driver_list}")
endif()
# force static lib build
set(BUILD_SHARED_LIBS OFF)
#=============================================================================
# project definition
#
@@ -202,14 +224,28 @@ if (NOT ${CMAKE_VERSION} VERSION_LESS 3.1.0)
endif()
set(version_major 1)
set(version_minor 0)
set(version_patch 1)
set(version_minor 5)
set(version_patch 0)
set(version "${version_major}.${version_minor}.${version_patch}")
set(package-contact "px4users@googlegroups.com")
#=============================================================================
# programs
# find programs and packages
#
# see if catkin was invoked to build this
if (CATKIN_DEVEL_PREFIX)
message(STATUS "catkin ENABLED")
find_package(catkin REQUIRED)
if (catkin_FOUND)
catkin_package()
else()
message(FATAL_ERROR "catkin not found")
endif()
else()
message(STATUS "catkin DISABLED")
endif()
find_package(PythonInterp REQUIRED)
#=============================================================================
@@ -217,6 +253,11 @@ find_package(PythonInterp REQUIRED)
#
enable_testing()
#=============================================================================
# generate compile command database
#
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#=============================================================================
# check required toolchain variables
#
@@ -235,7 +276,7 @@ endforeach()
px4_add_git_submodule(TARGET git_genmsg PATH "Tools/genmsg")
px4_add_git_submodule(TARGET git_gencpp PATH "Tools/gencpp")
px4_add_git_submodule(TARGET git_mavlink PATH "mavlink/include/mavlink/v1.0")
px4_add_git_submodule(TARGET git_gtest PATH "unittets/gtest")
px4_add_git_submodule(TARGET git_gtest PATH "unittests/gtest")
px4_add_git_submodule(TARGET git_uavcan PATH "src/modules/uavcan/libuavcan")
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
px4_add_git_submodule(TARGET git_driverframework PATH "src/lib/DriverFramework")
@@ -246,7 +287,7 @@ px4_add_git_submodule(TARGET git_matrix PATH "src/lib/matrix")
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "cmake/cmake_hexagon")
add_custom_target(submodule_clean
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
COMMAND git submodule deinit -f .
COMMAND rm -rf .git/modules/*
)
@@ -256,12 +297,12 @@ add_custom_target(submodule_clean
#
add_custom_target(check_format
COMMAND Tools/check_code_style.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
add_custom_target(config
COMMAND cmake-gui .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${PX4_BINARY_DIR}
)
#=============================================================================
@@ -278,14 +319,15 @@ px4_os_add_flags(
BOARD ${BOARD}
C_FLAGS c_flags
CXX_FLAGS cxx_flags
OPTIMIZATION_FLAGS optimization_flags
EXE_LINKER_FLAGS exe_linker_flags
INCLUDE_DIRS include_dirs
LINK_DIRS link_dirs
DEFINITIONS definitions)
px4_join(OUT CMAKE_EXE_LINKER_FLAGS LIST "${exe_linker_flags}" GLUE " ")
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags}" GLUE " ")
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags}" GLUE " ")
px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags};${optimization_flags}" GLUE " ")
px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags};${optimization_flags}" GLUE " ")
include_directories(${include_dirs})
#message("INCLUDE_DIRS=${include_dirs}")
@@ -310,7 +352,7 @@ add_custom_target(xml_gen
# external projects
#
set(ep_base ${CMAKE_BINARY_DIR}/external)
set(ep_base ${PX4_BINARY_DIR}/external)
set_property(DIRECTORY PROPERTY EP_BASE ${ep_base})
# add external project install folders to build
@@ -330,6 +372,24 @@ foreach(driver ${config_df_driver_list})
message("Adding DF driver: ${driver}")
endforeach()
#=============================================================================
# external modules
#
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
message(STATUS "External modules: ${EXTERNAL_MODULES_LOCATION}")
add_subdirectory("${EXTERNAL_MODULES_LOCATION}/src" external_modules_src)
set(config_module_list_external_expanded)
foreach(external_module ${config_module_list_external})
list(APPEND config_module_list_external_expanded
${EXTERNAL_MODULES_LOCATION}/src/${external_module})
endforeach()
set(config_module_list
${config_module_list}
${config_module_list_external_expanded}
)
endif()
#=============================================================================
# subdirectories
#
@@ -339,7 +399,7 @@ foreach(module ${config_module_list})
if(external_module)
STRING(REGEX REPLACE "//" "/" EXT_MODULE ${module})
STRING(REGEX REPLACE "/" "__" EXT_MODULE_PREFIX ${EXT_MODULE})
add_subdirectory(${module} ${CMAKE_BINARY_DIR}/${EXT_MODULE_PREFIX})
add_subdirectory(${module} ${PX4_BINARY_DIR}/${EXT_MODULE_PREFIX})
else()
add_subdirectory(src/${module})
endif()
@@ -361,22 +421,55 @@ if (config_io_board)
add_subdirectory(src/modules/px4iofirmware)
endif()
#=============================================================================
# generate custom target to print for all executable and module cmake targets
#
if(all_posix_cmake_targets)
list(SORT all_posix_cmake_targets)
px4_join(OUT posix_cmake_target_list LIST ${all_posix_cmake_targets} GLUE "\\n")
add_custom_target(list_cmake_targets
COMMAND sh -c "printf \"${posix_cmake_target_list}\\n\""
COMMENT "List of cmake targets that can be matched by PX4_NO_OPTIMIZATION:"
VERBATIM
)
endif()
#=============================================================================
# generate git version
#
px4_create_git_hash_header(HEADER ${CMAKE_BINARY_DIR}/build_git_version.h)
px4_create_git_hash_header(HEADER ${PX4_BINARY_DIR}/build_git_version.h)
#=============================================================================
# packaging
#
# Important to having packaging at end of cmake file.
#
execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE git_tag
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}-${CONFIG})
set(CPACK_PACKAGE_VERSION ${version})
set(CPACK_PACKAGE_CONTACT ${package_contact})
set(CPACK_PACKAGE_CONTACT ${package-contact})
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(short-description "The px4 autopilot.")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${short-description})
set(CPACK_GENERATOR "ZIP")
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CONFIG}-${git_tag}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${version}")
set(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_SET_DESTDIR "OFF")
if ("${CMAKE_SYSTEM}" MATCHES "Linux")
find_program(DPKG_PROGRAM dpkg)
if (EXISTS ${DPKG_PROGRAM})
list (APPEND CPACK_GENERATOR "DEB")
endif()
endif()
include(CPack)
endif() # ros alternative endif
# vim: set noet fenc=utf-8 ff=unix ft=cmake :
+2 -2
View File
@@ -66,8 +66,8 @@ Linux or Eagle with a working IP interface (?? does this need further instructio
> adb shell
# bash
root@linaro-developer:/# cd ???
root@linaro-developer:/# ./mainapp
App name: mainapp
root@linaro-developer:/# ./px4
App name: px4
Enter a command and its args:
uorb start
muorb start
+12
View File
@@ -0,0 +1,12 @@
{
"board_id": 65,
"magic": "PX4FWv1",
"description": "Firmware for the Intel Aero FC board",
"image": "",
"build_time": 0,
"summary": "AEROFCv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}
+12
View File
@@ -0,0 +1,12 @@
{
"board_id": 33,
"magic": "PX4FWv1",
"description": "Firmware for the AUAV X2.1 board",
"image": "",
"build_time": 0,
"summary": "AUAV X2.1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}
+12
View File
@@ -0,0 +1,12 @@
{
"board_id": 12,
"magic": "Crazyflie",
"description": "Firmware for the Crazyflie 2.0",
"image": "",
"build_time": 0,
"summary": "CRAZYFLIE",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}
+12
View File
@@ -0,0 +1,12 @@
{
"board_id": 9,
"magic": "PX4FWv1",
"description": "Firmware for the PX4FMUv3 board",
"image": "",
"build_time": 0,
"summary": "PX4FMUv3",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}
+12
View File
@@ -0,0 +1,12 @@
{
"board_id": 64,
"magic": "PX4FWv1",
"description": "Firmware for the TAPv1 board",
"image": "",
"build_time": 0,
"summary": "TAPv1",
"version": "0.1",
"image_size": 0,
"git_identity": "",
"board_revision": 0
}
+150 -155
View File
@@ -42,7 +42,7 @@ endif
CMAKE_VER := $(shell Tools/check_cmake.sh; echo $$?)
ifneq ($(CMAKE_VER),0)
$(warning Not a valid CMake version or CMake not installed.)
$(warning On Ubuntu, install or upgrade via:)
$(warning On Ubuntu 16.04, install or upgrade via:)
$(warning )
$(warning 3rd party PPA:)
$(warning sudo add-apt-repository ppa:george-edison55/cmake-3.x -y)
@@ -50,11 +50,11 @@ ifneq ($(CMAKE_VER),0)
$(warning sudo apt-get install cmake)
$(warning )
$(warning Official website:)
$(warning wget https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.sh)
$(warning chmod +x cmake-3.3.2-Linux-x86_64.sh)
$(warning sudo mkdir /opt/cmake-3.3.2)
$(warning sudo ./cmake-3.3.2-Linux-x86_64.sh --prefix=/opt/cmake-3.3.2 --exclude-subdir)
$(warning export PATH=/opt/cmake-3.3.2/bin:$$PATH)
$(warning wget https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.sh)
$(warning chmod +x cmake-3.4.3-Linux-x86_64.sh)
$(warning sudo mkdir /opt/cmake-3.4.3)
$(warning sudo ./cmake-3.4.3-Linux-x86_64.sh --prefix=/opt/cmake-3.4.3 --exclude-subdir)
$(warning export PATH=/opt/cmake-3.4.3/bin:$$PATH)
$(warning )
$(error Fatal)
endif
@@ -77,17 +77,20 @@ endif
# in that directory with the target upload.
# explicity set default build target
all: px4fmu-v2_default
all: posix_sitl_default
# Parsing
# --------------------------------------------------------------------
# assume 1st argument passed is the main target, the
# rest are arguments to pass to the makefile generated
# by cmake in the subdirectory
FIRST_ARG := $(firstword $(MAKECMDGOALS))
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
j ?= 4
ifndef NO_NINJA_BUILD
NINJA_BUILD := $(shell ninja --version 2>/dev/null)
endif
ifdef NINJA_BUILD
PX4_CMAKE_GENERATOR ?= "Ninja"
PX4_MAKE = ninja
@@ -100,31 +103,41 @@ ifdef SYSTEMROOT
else
PX4_CMAKE_GENERATOR ?= "Unix Makefiles"
endif
PX4_MAKE = make
PX4_MAKE = $(MAKE)
PX4_MAKE_ARGS = -j$(j) --no-print-directory
endif
# check if replay env variable is set & set build dir accordingly
ifdef replay
BUILD_DIR_SUFFIX := _replay
else
BUILD_DIR_SUFFIX :=
endif
# additional config parameters passed to cmake
CMAKE_ARGS :=
ifdef EXTERNAL_MODULES_LOCATION
CMAKE_ARGS := -DEXTERNAL_MODULES_LOCATION:STRING=$(EXTERNAL_MODULES_LOCATION)
endif
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
# Functions
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@); fi
+@Tools/check_submodules.sh
+@(echo "PX4 CONFIG: $@" && cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) $(CMAKE_ARGS) || (cd .. && rm -rf $(BUILD_DIR)); fi
+@echo "PX4 CONFIG: $(BUILD_DIR)"
+@$(PX4_MAKE) -C "$(BUILD_DIR)" $(PX4_MAKE_ARGS) $(ARGS)
endef
define cmake-build-other
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake $(2) -G$(PX4_CMAKE_GENERATOR) || (cd .. && rm -rf $(PWD)/build_$@); fi
+@(cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
endef
# create empty targets to avoid msgs for targets passed to cmake
define cmake-targ
$(1):
@#
.PHONY: $(1)
+@$(eval BUILD_DIR = $(SRC_DIR)/build_$@$(BUILD_DIR_SUFFIX))
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(BUILD_DIR)); fi
+@$(PX4_MAKE) -C "$(BUILD_DIR)" $(PX4_MAKE_ARGS) $(ARGS)
endef
define colorecho
@@ -133,104 +146,60 @@ define colorecho
@tput sgr0
endef
# Get a list of all config targets.
ALL_CONFIG_TARGETS := $(basename $(shell find "$(SRC_DIR)/cmake/configs" ! -name '*_common*' ! -name '*_sdflight_*' -name '*.cmake' -print | sed -e 's:^.*/::' | sort))
# Strip off leading nuttx_
NUTTX_CONFIG_TARGETS := $(patsubst nuttx_%,%,$(filter nuttx_%,$(ALL_CONFIG_TARGETS)))
# ADD CONFIGS HERE
# --------------------------------------------------------------------
# Do not put any spaces between function arguments.
px4fmu-v1_default:
$(call cmake-build,nuttx_px4fmu-v1_default)
px4fmu-v2_default:
$(call cmake-build,nuttx_px4fmu-v2_default)
px4fmu-v2_test:
$(call cmake-build,nuttx_px4fmu-v2_test)
px4fmu-v4_default:
$(call cmake-build,nuttx_px4fmu-v4_default)
px4-stm32f4discovery_default:
$(call cmake-build,nuttx_px4-stm32f4discovery_default)
px4fmu-v2_ekf2:
$(call cmake-build,nuttx_px4fmu-v2_ekf2)
mindpx-v2_default:
$(call cmake-build,nuttx_mindpx-v2_default)
posix_sitl_default:
# All targets.
$(ALL_CONFIG_TARGETS):
$(call cmake-build,$@)
posix_sitl_test:
$(call cmake-build,$@)
# Abbreviated config targets.
posix_sitl_replay:
$(call cmake-build,$@)
# nuttx_ is left off by default; provide a rule to allow that.
$(NUTTX_CONFIG_TARGETS):
$(call cmake-build,nuttx_$@)
posix_sitl_broadcast:
$(call cmake-build,$@)
all_nuttx_targets: $(NUTTX_CONFIG_TARGETS)
posix: posix_sitl_default
broadcast: posix_sitl_broadcast
# Multi- config targets.
eagle_default: posix_eagle_default qurt_eagle_default
eagle_legacy_default: posix_eagle_legacy_driver_default qurt_eagle_legacy_driver_default
excelsior_default: posix_excelsior_default qurt_excelsior_default
# Deprecated config targets.
ros_sitl_default:
@echo "This target is deprecated. Use make 'posix_sitl_default gazebo' instead."
qurt_eagle_travis:
$(call cmake-build,$@)
qurt_eagle_default:
$(call cmake-build,$@)
posix_eagle_default:
$(call cmake-build,$@)
eagle_default: posix_eagle_default qurt_eagle_default
eagle_legacy_default: posix_eagle_legacy_driver_default qurt_eagle_legacy_driver_default
qurt_eagle_legacy_driver_default:
$(call cmake-build,$@)
posix_eagle_legacy_driver_default:
$(call cmake-build,$@)
qurt_excelsior_default:
$(call cmake-build,$@)
posix_excelsior_default:
$(call cmake-build,$@)
excelsior_default: posix_excelsior_default qurt_excelsior_default
posix_rpi2_default:
$(call cmake-build,$@)
posix_rpi2_release:
$(call cmake-build,$@)
posix_bebop_default:
$(call cmake-build,$@)
posix: posix_sitl_default
broadcast: posix_sitl_broadcast
sitl_deprecation:
_sitl_deprecation:
@echo "Deprecated. Use 'make posix_sitl_default jmavsim' or"
@echo "'make posix_sitl_default gazebo' if Gazebo is preferred."
run_sitl_quad: sitl_deprecation
run_sitl_plane: sitl_deprecation
run_sitl_ros: sitl_deprecation
run_sitl_quad: _sitl_deprecation
run_sitl_plane: _sitl_deprecation
run_sitl_ros: _sitl_deprecation
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
.PHONY: all posix broadcast eagle_default eagle_legacy_default excelsior_default run_sitl_quad run_sitl_plane run_sitl_ros all_nuttx_targets
# Other targets
# --------------------------------------------------------------------
.PHONY: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean
.PHONY: uavcan_firmware check check_format format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
.NOTPARALLEL:
gazebo_build:
@mkdir -p build_gazebo
@if [ ! -e $(PWD)/build_gazebo/CMakeCache.txt ];then cd build_gazebo && cmake -Wno-dev -G$(PX4_CMAKE_GENERATOR) $(PWD)/Tools/sitl_gazebo; fi
@cd build_gazebo && $(PX4_MAKE) $(PX4_MAKE_ARGS)
@cd build_gazebo && $(PX4_MAKE) $(PX4_MAKE_ARGS) sdf
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
.PHONY: checks_defaults checks_bootloaders checks_tests checks_alts checks_uavcan checks_sitls checks_last quick_check tests extra_firmware
uavcan_firmware:
ifeq ($(VECTORCONTROL),1)
@@ -238,45 +207,6 @@ ifeq ($(VECTORCONTROL),1)
@(rm -rf vectorcontrol && git clone --quiet --depth 1 https://github.com/thiemar/vectorcontrol.git && cd vectorcontrol && BOARD=s2740vc_1_0 make --silent --no-print-directory && BOARD=px4esc_1_6 make --silent --no-print-directory && ../Tools/uavcan_copy.sh)
endif
checks_defaults: \
check_px4fmu-v1_default \
check_px4fmu-v2_default \
check_mindpx-v2_default \
check_px4-stm32f4discovery_default \
checks_bootloaders: \
checks_tests: \
check_px4fmu-v2_test
checks_alts: \
check_px4fmu-v2_ekf2 \
checks_uavcan: \
check_px4fmu-v4_default_and_uavcan
checks_sitls: \
check_posix_sitl_default \
check_posix_sitl_test \
checks_last: \
check_unittest \
check_format \
check: checks_defaults checks_tests checks_alts checks_uavcan checks_bootloaders checks_sitls checks_last
check_format:
$(call colorecho,"Checking formatting with astyle")
@./Tools/fix_code_style.sh
@./Tools/check_code_style_all.sh
check_%:
@echo
$(call colorecho,"Building" $(subst check_,,$@))
@$(MAKE) --no-print-directory $(subst check_,,$@)
@echo
check_px4fmu-v4_default: uavcan_firmware
check_px4fmu-v4_default_and_uavcan: check_px4fmu-v4_default
@echo
@@ -286,37 +216,83 @@ ifeq ($(VECTORCONTROL),1)
@rm -rf ROMFS/px4fmu_common/uavcan
endif
unittest: posix_sitl_test
@export CC=clang
@export CXX=clang++
@export ASAN_OPTIONS=symbolize=1
# All default targets that don't require a special build environment (currently built on semaphore-ci)
check: check_px4fmu-v1_default \
check_px4fmu-v2_default \
check_px4fmu-v2_test \
check_px4fmu-v4_default_and_uavcan \
check_mindpx-v2_default \
check_posix_sitl_default \
check_tap-v1_default \
check_aerofc-v1_default \
check_px4-stm32f4discovery_default \
check_crazyflie_default \
check_tests \
check_format
# quick_check builds a single nuttx and posix target, runs testing, and checks the style
quick_check: check_posix_sitl_default check_px4fmu-v4_default check_tests check_format
check_format:
$(call colorecho,"Checking formatting with astyle")
@./Tools/check_code_style_all.sh
@git diff --check
format:
$(call colorecho,"Formatting with astyle")
@./Tools/check_code_style_all.sh --fix
check_%:
@echo
$(call colorecho,"Building" $(subst check_,,$@))
@$(MAKE) --no-print-directory $(subst check_,,$@)
@echo
unittest: posix_sitl_default
$(call cmake-build-other,unittest, ../unittests)
@(cd build_unittest && ctest -j2 --output-on-failure)
test_onboard_sitl:
@HEADLESS=1 make posix_sitl_test gazebo_iris
run_tests_posix: posix_sitl_default
@(cd build_posix_sitl_default/ && ctest -V)
tests: check_unittest run_tests_posix
tests_coverage:
@(PX4_CODE_COVERAGE=1 CCACHE_DISABLE=1 ${MAKE} tests)
@(lcov --directory . --capture --quiet --output-file coverage.info)
@(lcov --remove coverage.info '/usr/*' --quiet --output-file coverage.info)
#@(lcov --list coverage.info)
@(genhtml coverage.info --quiet --output-directory coverage-html)
# QGroundControl flashable firmware (currently built by travis-ci)
qgc_firmware: \
check_px4fmu-v1_default \
check_px4fmu-v2_default \
check_px4fmu-v3_default \
check_px4fmu-v4_default_and_uavcan \
check_mindpx-v2_default \
check_tap-v1_default \
check_format
package_firmware:
@zip --junk-paths Firmware.zip `find . -name \*.px4`
clean:
@rm -rf build_*/
@(cd NuttX/nuttx && make clean)
-@$(MAKE) -C NuttX/nuttx clean
submodulesclean:
@git submodule sync --recursive
@git submodule deinit -f .
@git submodule update --init --recursive --force
distclean: submodulesclean
@git clean -ff -x -d -e ".project" -e ".cproject"
distclean: submodulesclean clean
@git clean -ff -x -d -e ".project" -e ".cproject" -e ".idea"
# targets handled by cmake
cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \
run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim replay \
jmavsim_gdb jmavsim_lldb gazebo_gdb_iris gazebo_lldb_tailsitter gazebo_iris gazebo_iris_opt_flow gazebo_tailsitter \
gazebo_gdb_standard_vtol gazebo_lldb_standard_vtol gazebo_standard_vtol gazebo_plane gazebo_solo
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
# All other targets are handled by PX4_MAKE. Add a rule here to avoid printing an error.
%:
$(if $(filter $(FIRST_ARG),$@), \
$(error "$@ cannot be the first argument. Use '$(MAKE) help|list_config_targets' to get a list of all possible [configuration] targets."),@#)
.PHONY: clean
@@ -327,3 +303,22 @@ CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
# @echo "build configurations."
# @echo
empty :=
space := $(empty) $(empty)
# Print a list of non-config targets (based on http://stackoverflow.com/a/26339924/1487069)
help:
@echo "Usage: $(MAKE) <target>"
@echo "Where <target> is one of:"
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | \
egrep -v -e '^[^[:alnum:]]' -e '^($(subst $(space),|,$(ALL_CONFIG_TARGETS) $(NUTTX_CONFIG_TARGETS)))$$' -e '_default$$' -e '^(posix|eagle|Makefile)'
@echo
@echo "Or, $(MAKE) <config_target> [<make_target(s)>]"
@echo "Use '$(MAKE) list_config_targets' for a list of configuration targets."
# Print a list of all config targets.
list_config_targets:
@for targ in $(patsubst nuttx_%,[nuttx_]%,$(ALL_CONFIG_TARGETS)); do echo $$targ; done
+1 -1
Submodule NuttX updated: f0f4bdc872...af5d2b058c
+40 -10
View File
@@ -1,35 +1,65 @@
## PX4 Pro Drone Autopilot ##
[![Build Status](https://travis-ci.org/PX4/Firmware.svg?branch=master)](https://travis-ci.org/PX4/Firmware) [![Coverity Scan](https://scan.coverity.com/projects/3966/badge.svg?flat=1)](https://scan.coverity.com/projects/3966?tab=overview)
[![Releases](https://img.shields.io/github/release/PX4/Firmware.svg)](https://github.com/PX4/Firmware/releases) [![DOI](https://zenodo.org/badge/22634/PX4/Firmware.svg)](https://zenodo.org/badge/latestdoi/22634/PX4/Firmware) [![Build Status](https://travis-ci.org/PX4/Firmware.svg?branch=master)](https://travis-ci.org/PX4/Firmware) [![Coverity Scan](https://scan.coverity.com/projects/3966/badge.svg?flat=1)](https://scan.coverity.com/projects/3966?tab=overview)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PX4/Firmware?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This repository holds the [PX4 Pro](http://px4.io) flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
* Official Website: http://px4.io
* License: BSD 3-clause (see [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
* Supported airframes (more experimental are supported):
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE.md](https://github.com/PX4/Firmware/blob/master/LICENSE.md))
* Supported airframes (more experimental types than listed here are supported):
* [Multicopters](http://px4.io/portfolio_category/multicopter/)
* [Fixed wing](http://px4.io/portfolio_category/plane/)
* [VTOL](http://px4.io/portfolio_category/vtol/)
* Releases
* [Downloads](https://github.com/PX4/Firmware/releases)
* Releases: [Downloads](https://github.com/PX4/Firmware/releases)
### Users ###
Please refer to the [user documentation](http://px4.io) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
Please refer to the [user documentation](http://px4.io/user-guide/) and [user forum](http://discuss.px4.io) for flying drones with the PX4 flight stack.
### Developers ###
* [Developer Forum / Mailing list](http://groups.google.com/group/px4users)
* [Developer Forum](http://discuss.px4.io)
* [Guide for Contributions](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md)
* [Developer guide](http://dev.px4.io)
## Maintenance Team
* Project / Founder - [Lorenz Meier](http://github.com/LorenzMeier)
* Dev Call - [Mark Whitehorn](http://github.com/kd0aij), [Ramon Roche](http://github.com/mrpollo)
* Communication Architecture - [Beat Kueng](http://github.com/bkueng), [Julian Oes](http://github.com/JulianOes)
* UI / UX - [Gus Grubba](http://github.com/dogmaphobic)
* Multicopter Flight Control - [Dennis Mannhart](http://github.com/Stifael), [Matthias Grob](http://github.com/MaEtUgR)
* VTOL Flight Control - [Roman Bapst](http://github.com/tumbili), [Andreas Antener](http://github.com/AndreasAntener), [Sander Smeets](http://github.com/sanderux)
* Fixed Wing Flight Control - [Daniel Agar](http://github.com/dagar), [Paul Riseborough](http://github.com/priseborough)
* Racers - [Mark Whitehorn](http://github.com/kd0aij)
* OS / drivers - [David Sidrane](http://github.com/david_s5)
* UAVCAN / Industrial - [Pavel Kirienko](http://github.com/pavel-kirienko)
* State Estimation - [James Goppert](http://github.com/jgoppert), [Paul Riseborough](http://github.com/priseborough)
* VIO - Christoph Tobler
* Obstacle Avoidance - [Vilhjalmur Vilhjalmsson](http://github.com/vilhjalmur89)
* Snapdragon - [Mark Charlebois](http://github.com/mcharleb)
* Intel Aero - [Lucas de Marchi](http://github.com/lucasdemarchi), [Simone Guscetti](http://github.com/simonegu)
* Raspberry Pi / Navio - [Beat Kueng](http://github.com/bkueng)
* Parrot Bebop - [Michael Schaeuble](http://github.com/eyeam3)
## Supported Hardware
This repository contains code supporting these boards:
* [Snapdragon Flight](http://dev.px4.io/hardware-snapdragon.html)
* Intel Aero
* Raspberry PI with Navio 2
* [Parrot Bebop](http://dev.px4.io/starting-building.html#parrot-bebop)
* FMUv1.x
* FMUv2.x ([Pixhawk](http://dev.px4.io/hardware-pixhawk.html), Pixhawk 2 and [Pixfalcon](http://dev.px4.io/hardware-pixfalcon.html))
* FMUv4.x (Pixhawk X and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
* FMUv2.x ([Pixhawk](http://dev.px4.io/hardware-pixhawk.html) and [Pixfalcon](http://dev.px4.io/hardware-pixfalcon.html))
* FMUv3.x ([Pixhawk 2](http://dev.px4.io/hardware-pixhawk.html))
* FMUv4.x (Pixhawk 3 Pro and [Pixracer](http://dev.px4.io/hardware-pixracer.html))
* FMUv5.x (ARM Cortex M7, future Pixhawk)
* AeroCore (v1 and v2)
* STM32F4Discovery (basic support) [Tutorial](https://pixhawk.org/modules/stm32f4discovery)
* MindPX V2.8 [Tutorial] (http://www.mindpx.net/assets/accessories/UserGuide_MindPX.pdf)
* MindRacer V1.2 [Tutorial] (http://mindpx.net/assets/accessories/mindracer_user_guide_v1.2.pdf)
## Project Milestones
The PX4 software and Pixhawk hardware (which has been designed for it) has been created in 2011 by Lorenz Meier.
@@ -1,39 +0,0 @@
#!nsh
#
# @name HobbyKing SK450 DeadCat modification
#
# @type Quadrotor Wide
#
# @maintainer Anton Matosov <anton.matosov@gmail.com>
#
sh /etc/init.d/rc.mc_defaults
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.0
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.1
param set MC_PITCHRATE_I 0.03
param set MC_PITCHRATE_D 0.0015
param set MC_YAW_P 2.8
param set MC_YAWRATE_P 0.1
param set MC_YAWRATE_I 0.07
param set MC_YAWRATE_D 0.0
fi
set MIXER sk450_deadcat
set PWM_OUT 1234
set PWM_AUX_OUT 1234
# set PWM_AUX_MIN 900
# set PWM_AUX_MAX 2100
set PWM_AUX_RATE 100
gimbal start
+1 -8
View File
@@ -7,7 +7,7 @@
# @maintainer Lorenz Meier <lorenz@px4.io>
#
sh /etc/init.d/rc.mc_defaults
sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
@@ -21,10 +21,3 @@ then
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
+26
View File
@@ -0,0 +1,26 @@
#!nsh
#
# @name H4 680mm with Z1 Tiny2 Gimbal
#
# @type Quadrotor x
#
# @maintainer Leon Mueller <thedevleon>
#
sh /etc/init.d/4002_quad_x_mount
# The Z1 Tiny2 can handle up to 400Hz
# and works with min 1020us, middle 1520us, max 2020us
# see http://www.zhiyun-tech.com/uploadfile/datedown/instruction/Tiny2_English_instructionV1.03.pdf
# under Gimbal Connection Instruction
set PWM_AUX_RATE 400
set PWM_AUX_DISARMED 1520
set PWM_AUX_MIN 1020
set PWM_AUX_MAX 2020
# Start FrSky telemetry on SERIAL4 (ttyS6, designated "SERIAL4/5" on the case)
frsky_telemetry start -d /dev/ttyS6
# GPIO LED
gpio_led start -p 6
@@ -1,14 +0,0 @@
#!nsh
#
# @name HIL Rascal 110 (Flightgear)
#
# @type Simulation
#
# @maintainer Thomas Gubler <thomas@px4.io>
#
sh /etc/init.d/rc.fw_defaults
set HIL yes
set MIXER AERT
@@ -1,41 +0,0 @@
#!nsh
#
# @name HIL Malolo 1 (Flightgear)
#
# @type Simulation
#
# @maintainer Thomas Gubler <thomas@px4.io>
#
sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
param set FW_AIRSPD_MIN 12
param set FW_AIRSPD_TRIM 25
param set FW_AIRSPD_MAX 40
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 15
param set FW_PR_FF 0.8
param set FW_PR_I 0.05
param set FW_PR_IMAX 0.2
param set FW_PR_P 0.1
param set FW_P_ROLLFF 0
param set FW_RR_FF 0.6
param set FW_RR_I 0.02
param set FW_RR_IMAX 0.2
param set FW_RR_P 0.1
param set FW_R_LIM 45
param set FW_R_RMAX 0
param set FW_YR_FF 0.0
param set FW_YR_I 0
param set FW_YR_IMAX 0.2
param set FW_YR_P 0.0
fi
set HIL yes
# Set the AERT mixer for HIL (even if the malolo is a flying wing)
set MIXER AERT
@@ -1,10 +1,17 @@
#!nsh
#
# @name Fun Cub Quad VTOL.
#
# @name Fun Cub Quad VTOL
# @type Standard VTOL
#
# @maintainer Simon Wilks <simon@uaventure.com>
# @output MAIN1 Front right motor: CCW
# @output MAIN2 Back left motor: CCW
# @output MAIN3 Front left motor: CW
# @output MAIN4 Back right motor: CW
# @output AUX1 Aileron 1
# @output AUX2 Aileron 2
# @output AUX3 Elevator
# @output AUX4 Rudder
# @output AUX5 Throttle
#
sh /etc/init.d/rc.vtol_defaults
@@ -33,6 +40,8 @@ then
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set MC_YAWRATE_MAX 40
param set MC_YAWRAUTO_MAX 40
param set FW_PR_FF 0.5
param set FW_PR_I 0.02
@@ -1,10 +1,15 @@
#!nsh
#
# @name Generic quad delta VTOL.
#
# @name Generic quad delta VTOL
# @type Standard VTOL
#
# @maintainer Simon Wilks <simon@uaventure.com>
# @output MAIN1 Front right motor: CCW
# @output MAIN2 Back left motor: CCW
# @output MAIN3 Front left motor: CW
# @output MAIN4 Back right motor: CW
# @output AUX1 Right elevon
# @output AUX2 Left elevon
# @output AUX3 Motor
#
sh /etc/init.d/rc.vtol_defaults
@@ -15,22 +20,28 @@ then
param set VT_MOT_COUNT 4
param set VT_TRANS_THR 0.75
param set MC_ROLL_P 7.0
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.15
param set MC_ROLLRATE_I 0.002
param set MC_ROLLRATE_I 0.01
param set MC_ROLLRATE_D 0.003
param set MC_ROLLRATE_FF 0.0
param set MC_PITCH_P 7.0
param set MC_PITCHRATE_P 0.12
param set MC_PITCHRATE_I 0.002
param set MC_PITCH_P 6.5
param set MC_PITCHRATE_P 0.15
param set MC_PITCHRATE_I 0.01
param set MC_PITCHRATE_D 0.003
param set MC_PITCHRATE_FF 0.0
param set MC_YAW_P 2.8
param set MC_YAW_P 3.5
param set MC_YAW_FF 0.5
param set MC_YAWRATE_P 0.22
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.1
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set MC_YAWRATE_MAX 20
param set MC_YAWRAUTO_MAX 20
param set MPC_XY_P 0.8
param set MPC_XY_VEL_P 0.1
param set MPC_ACC_HOR_MAX 2.0
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
@@ -31,6 +31,8 @@ then
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set MC_YAWRATE_MAX 40
param set MC_YAWRAUTO_MAX 40
param set VT_MOT_COUNT 4
param set VT_IDLE_PWM_MC 1080
@@ -34,6 +34,8 @@ then
param set MC_YAWRATE_I 0.04
param set MC_YAWRATE_D 0.0
param set MC_YAWRATE_FF 0.0
param set MC_YAWRATE_MAX 40.0
param set MC_YAWRAUTO_MAX 40.0
param set MPC_ACC_HOR_MAX 2.0
param set MPC_Z_VEL_MAX 1.5
@@ -45,6 +45,7 @@ then
param set MC_YAWRATE_I 0.02
param set MC_YAWRATE_MAX 40.0
param set MC_YAWRATE_P 0.18
param set MC_YAWRATE_MAX 40.0
param set MC_YAWRAUTO_MAX 40.0
param set MIS_TAKEOFF_ALT 2.5
+37
View File
@@ -0,0 +1,37 @@
#!nsh
#
# @name CruiseAder Claire
#
# @type VTOL Tiltrotor
#
# @maintainer Samay Siga <samay_s@icloud.com>
#
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_TYPE 1
param set VT_TILT_MC 0.08
param set VT_TILT_TRANS 0.5
param set VT_TILT_FW 0.9
param set VT_MOT_COUNT 4
param set VT_FW_MOT_OFFID 13
param set VT_IDLE_PWM_MC 1080
param set VT_TYPE 1
fi
set MIXER claire
set PWM_OUT 1234
set PWM_RATE 400
set PWM_MAX 2000
set MIXER_AUX claire
set PWM_AUX_RATE 50
set PWM_AUX_RATE 123
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
set PWM_AUX_DISARMED 1000
set MAV_TYPE 21
@@ -17,11 +17,6 @@ set MIXER coax
if [ $AUTOCNF == yes ]
then
param set PE_VELNE_NOISE 0.5
param set PE_VELD_NOISE 0.35
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.25
param set NAV_ACC_RAD 2.0
param set RTL_RETURN_ALT 30.0
param set RTL_DESCEND_ALT 10.0
@@ -0,0 +1,50 @@
#!nsh
#
# @name Blade 130X
#
# @type Helicopter
#
# @maintainer Bart Slinger <bartslinger@gmail.com>
#
sh /etc/init.d/rc.mc_defaults
# Configure as helicopter (number 4 defined in commander_helper.cpp)
set MAV_TYPE 4
set MIXER heli_120deg
set PWM_OUT 1234
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 5.0
param set MC_ROLLRATE_P 0.0
param set MC_ROLLRATE_I 0.0
param set MC_ROLLRATE_D 0.0
param set MC_ROLLRATE_FF 0.15
param set MC_PITCH_P 6.5
param set MC_PITCHRATE_P 0.0
param set MC_PITCHRATE_I 0.0
param set MC_PITCHRATE_D 0.0
param set MC_PITCHRATE_FF 0.15
param set MC_YAW_P 3.0
param set MC_YAWRATE_P 0.1
param set MC_YAWRATE_I 0.0
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.0
param set MC_ROLLRATE_MAX 720.0
param set MC_PITCHRATE_MAX 720.0
param set MC_YAWRATE_MAX 400.0
param set MC_ACRO_R_MAX 360.0
param set MC_ACRO_P_MAX 360.0
param set PWM_MIN 1075
param set MPC_THR_MIN 0.06
param set MPC_MANTHR_MIN 0.06
param set ATT_BIAS_MAX 0.0
param set CBRK_IO_SAFETY 22027
fi
+27 -14
View File
@@ -11,31 +11,44 @@ sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
param set FW_AIRSPD_MAX 20
param set FW_AIRSPD_MIN 12
param set FW_AIRSPD_TRIM 16
param set FW_R_TC 0.3
param set FW_P_TC 0.3
param set FW_L1_DAMPING 0.74
param set FW_L1_PERIOD 16
param set FW_AIRSPD_MAX 25
param set FW_AIRSPD_MIN 12.5
param set FW_AIRSPD_TRIM 16.5
param set LNDFW_AIRSPD_MAX 6
param set LNDFW_VELI_MAX 4
param set LNDFW_VEL_XY_MAX 3
param set LNDFW_VEL_Z_MAX 5
param set FW_R_TC 0.4
param set FW_P_TC 0.4
param set FW_THR_CRUISE 0.55
param set FW_L1_DAMPING 0.75
param set FW_L1_PERIOD 15
param set FW_LND_ANG 15
param set FW_LND_FLALT 5
param set FW_LND_FLALT 8
param set FW_LND_HHDIST 15
param set FW_LND_HVIRT 13
param set FW_LND_TLALT 5
param set FW_LND_TLALT 10
param set FW_THR_LND_MAX 0
param set FW_PR_FF 0.35
param set FW_P_LIM_MAX 20
param set FW_P_LIM_MIN -30
param set FW_R_LIM 45
param set FW_PR_FF 0.45
param set FW_PR_IMAX 0.4
param set FW_PR_P 0.08
param set FW_RR_FF 0.6
param set FW_PR_P 0.005
param set FW_RR_FF 0.45
param set FW_RR_IMAX 0.2
param set FW_RR_P 0.04
param set FW_RR_P 0.013
param set FW_P_RMAX_NEG 70
param set FW_P_RMAX_POS 70
param set FW_R_RMAX 70
param set SYS_COMPANION 157600
param set PWM_MAIN_REV0 1
param set PWM_MAIN_REV1 1
param set PWM_MAIN_REV2 1
param set PWM_DISARMED 0
param set PWM_MIN 900
param set PWM_MAX 2100
param set MIS_TAKEOFF_ALT 50
param set NAV_LOITER_RAD 30
fi
set PWM_DISARMED p:PWM_DISARMED
+36
View File
@@ -0,0 +1,36 @@
#!nsh
#
# @name Lumenier QAV-R (raceblade) 5" arms
#
# @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 James Goppert <james.goppert@gmail.com>
#
sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 8.0
param set MC_ROLLRATE_P 0.08
param set MC_ROLLRATE_I 0.16
param set MC_ROLLRATE_D 0.003
param set MC_PITCH_P 8.0
param set MC_PITCHRATE_P 0.1
param set MC_PITCHRATE_I 0.2
param set MC_PITCHRATE_D 0.003
param set MC_YAW_P 2.8
param set MC_YAWRATE_P 0.15
param set MC_YAWRATE_I 0.1
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set MC_TPA_BREAK 0.7
param set MC_TPA_SLOPE 1.0
param set PWM_MIN 1075
param set MPC_THR_MIN 0.06
param set MPC_MANTHR_MIN 0.06
fi
@@ -0,0 +1,21 @@
#!nsh
#
# @name Generic Quadrotor X config with mount (e.g. gimbal)
#
# @type Quadrotor x
#
#
# @maintainer Leon Mueller <thedevleon>
#
sh /etc/init.d/rc.mc_defaults
set MIXER quad_x
set PWM_OUT 1234
set MIXER_AUX mount
set PWM_AUX_OUT 123456
set PWM_AUX_RATE 50
# Start mount driver
vmount start
+1 -1
View File
@@ -29,7 +29,7 @@ then
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.8
param set BAT_V_SCALING 0.00838095238
param set BAT_V_DIV 34.32838
fi
set OUTPUT_MODE ardrone
+8
View File
@@ -4,9 +4,15 @@
#
# @type Quadrotor x
#
# @output MAIN1 motor1 (front right: CCW)
# @output MAIN2 motor2 (back left: CCW)
# @output MAIN3 motor3 (front left: CW)
# @output MAIN4 motor4 (back right: CW)
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
# @output AUX4 feed-through of RC FLAPS channel
#
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
#
@@ -33,4 +39,6 @@ then
param set MPC_MANTHR_MIN 0.06
param set CBRK_IO_SAFETY 22027
param set ATT_BIAS_MAX 0.0
param set MC_TPA_BREAK 0.5
param set MC_TPA_SLOPE 1.0
fi
+35
View File
@@ -0,0 +1,35 @@
#!nsh
#
# @name Parrot Bebop Frame
#
# @type Quadrotor x
#
# @maintainer Michael Schaeuble
#
sh /etc/init.d/rc.mc_defaults
#
# Load default params for this platform
#
if [ $AUTOCNF == yes ]
then
# Set all params here, then disable autoconfig
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.109999999403953552
param set MC_ROLLRATE_I 0.0
param set MC_ROLLRATE_D 0.0006
param set MC_PITCH_P 6.5
param set MC_PITCHRATE_P 0.1
param set MC_PITCHRATE_I 0.0
param set MC_PITCHRATE_D 0.000799999
param set MC_YAW_P 1.049999
param set MC_YAWRATE_P 0.05
param set MC_YAWRATE_I 0.001
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.7
fi
set OUTPUT_MODE bebop
set USE_IO no
set MIXER bebop
+1 -1
View File
@@ -79,7 +79,7 @@ then
param set RC5_TRIM 1500
fi
set MIXER solo
set MIXER quad_x
set PWM_OUT 1234
set MIXER_AUX none
+11 -2
View File
@@ -4,9 +4,15 @@
#
# @type Quadrotor x
#
# @output MAIN1 motor1 (front right: CCW)
# @output MAIN2 motor2 (back left: CCW)
# @output MAIN3 motor3 (front left: CW)
# @output MAIN4 motor4 (back right: CW)
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
# @output AUX4 feed-through of RC FLAPS channel
#
# @maintainer Mark Whitehorn <kd0aij@gmail.com>
#
@@ -20,9 +26,9 @@ then
param set MC_ROLLRATE_I 0.1
param set MC_ROLLRATE_D 0.0055
param set MC_PITCH_P 8.0
param set MC_PITCHRATE_P 0.24
param set MC_PITCHRATE_P 0.19
param set MC_PITCHRATE_I 0.1
param set MC_PITCHRATE_D 0.0065
param set MC_PITCHRATE_D 0.0055
param set MC_YAW_P 4.0
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.1
@@ -33,6 +39,9 @@ then
param set MC_YAWRATE_MAX 400.0
param set MC_ACRO_R_MAX 360.0
param set MC_ACRO_P_MAX 360.0
param set MC_TPA_BREAK 0.5
param set MC_TPA_SLOPE 1.0
param set PWM_MIN 1075
@@ -15,9 +15,17 @@ sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.5
param set MC_ROLLRATE_P 0.05
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.001
param set MC_PITCH_P 6.5
param set MC_PITCHRATE_P 0.05
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.001
param set MC_YAWRATE_P 0.2
param set MC_YAWRATE_I 0.0
param set MC_YAWRATE_D 0.0
param set BAT_N_CELLS 6
param set PWM_MIN 1200
fi
+43
View File
@@ -0,0 +1,43 @@
#!nsh
#
# @name Intel Aero RTF
#
# @type Quadrotor x
sh /etc/init.d/rc.mc_defaults
#
# Load default params for this platform
#
if [ $AUTOCNF == yes ]
then
# Set all params here, then disable autoconfig
param set MC_ROLL_P 8.0000
param set MC_ROLLRATE_P 0.1300
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_D 0.0012
param set MC_ROLLRATE_MAX 360
param set MC_PITCH_P 8.0000
param set MC_PITCHRATE_P 0.1300
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_D 0.0012
param set MC_PITCHRATE_MAX 360
param set MC_YAW_P 4.0
param set MC_YAWRATE_P 0.119999997317790985
param set MC_YAWRATE_I 0.050000000745058060
param set MC_YAWRATE_D 0.0
param set MC_YAW_FF 0.5
param set MPC_XY_CRUISE 8
param set SYS_LOGGER 1
fi
tap_esc start -d /dev/ttyS0 -n 4
usleep 300000
set OUTPUT_MODE tap_esc
set MIXER quad_x
set USE_IO no
param set SYS_COMPANION 1500000
set MAVLINK_COMPANION_DEVICE /dev/ttyS1
+42
View File
@@ -0,0 +1,42 @@
#!nsh
#
# @name Crazyflie 2.0
#
# @type Quadrotor x
#
sh /etc/init.d/4001_quad_x
if [ $AUTOCNF == yes ]
then
param set COM_RC_IN_MODE 2
param set BAT_N_CELLS 1
param set BAT_CAPACITY 240
param set BAT_SOURCE 1
param set PWM_DISARMED 0
param set PWM_MIN 0
param set PWM_MAX 255
param set SYS_COMPANION 20
param set MC_PITCHRATE_D 0.0015
param set MC_PITCHRATE_I 0.05
param set MC_PITCHRATE_P 0.045
param set MC_PITCH_P 6.5
param set MC_ROLLRATE_D 0.0015
param set MC_ROLLRATE_I 0.05
param set MC_ROLLRATE_P 0.045
param set MC_ROLL_P 6.5
param set MC_YAW_P 3.0
param set CBRK_SUPPLY_CHK 894281
param set CBRK_USB_CHK 197848
fi
set PWM_MIN none
set PWM_MAX none
set PWM_DISARMED none
# Will run the motors at 328.125 kHz (recommended)
set PWM_RATE 3921
@@ -4,7 +4,7 @@
# att & pos estimator, rover steering control
#
ekf_att_pos_estimator start
ekf2 start
# disabled the start of steering control app due to use of offboard mode only
# rover_steering_control start
+1 -1
View File
@@ -6,7 +6,7 @@
#
# Start the attitude and position estimator
#
ekf_att_pos_estimator start
ekf2 start
#
# Start attitude controller
+6 -6
View File
@@ -11,12 +11,12 @@ then
param set RTL_DESCEND_ALT 100
param set RTL_LAND_DELAY -1
param set NAV_ACC_RAD 50
param set PE_VELNE_NOISE 0.3
param set PE_VELD_NOISE 0.35
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.0
# FW uses L1 distance for acceptance radius
# set a smaller NAV_ACC_RAD for vertical acceptance distance
param set NAV_ACC_RAD 10
param set MIS_LTRMIN_ALT 25
param set MIS_TAKEOFF_ALT 25
fi
# This is the gimbal pass mixer
+27 -1
View File
@@ -43,6 +43,11 @@ then
set OUTPUT_DEV /dev/uavcan/esc
fi
if [ $OUTPUT_MODE == tap_esc ]
then
set OUTPUT_DEV /dev/tap_esc
fi
if mixer load $OUTPUT_DEV $MIXER_FILE
then
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
@@ -109,6 +114,16 @@ then
set MIXER_AUX none
fi
if ver hwcmp CRAZYFLIE
then
set MIXER_AUX none
fi
if ver hwcmp AEROFC_V1
then
set MIXER_AUX none
fi
if [ $MIXER_AUX != none -a $AUX_MODE != none ]
then
#
@@ -133,7 +148,18 @@ then
then
if fmu mode_$AUX_MODE
then
if [ -e $OUTPUT_AUX_DEV ]
# Append aux mixer to main device
if [ $OUTPUT_MODE == hil ]
then
if mixer append $OUTPUT_DEV $MIXER_AUX_FILE
then
echo "INFO [init] Mixer: $MIXER_AUX_FILE appended to $OUTPUT_DEV"
else
echo "ERROR [init] Error appending mixer: $MIXER_AUX_FILE"
echo "ERROR [init] Could not append mixer: $MIXER_AUX_FILE" >> $LOG_FILE
fi
fi
if [ -e $OUTPUT_AUX_DEV -a $OUTPUT_MODE != hil ]
then
if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
then
+14 -17
View File
@@ -8,18 +8,25 @@
#---------------------------------------
# Estimator group selction
#
# INAV
# INAV (deprecated)
if param compare SYS_MC_EST_GROUP 0
then
attitude_estimator_q start
position_estimator_inav start
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
param set SYS_MC_EST_GROUP 1
param save
fi
# LPE
if param compare SYS_MC_EST_GROUP 1
then
attitude_estimator_q start
local_position_estimator start
# Try to start LPE. If it fails, start EKF2 as a default
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
if attitude_estimator_q start
then
local_position_estimator start
else
ekf2 start
fi
fi
# EKF
@@ -29,19 +36,9 @@ then
fi
#---------------------------------------
if mc_att_control start
then
else
# try the multiplatform version
mc_att_control_m start
fi
mc_att_control start
if mc_pos_control start
then
else
# try the multiplatform version
mc_pos_control_m start
fi
mc_pos_control start
#
# Start Land Detector
+2 -16
View File
@@ -4,24 +4,19 @@ set VEHICLE_TYPE mc
if [ $AUTOCNF == yes ]
then
param set PE_VELNE_NOISE 0.5
param set PE_VELD_NOISE 0.35
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.25
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
param set PWM_RATE 400
param set RTL_LAND_DELAY 0
fi
# set environment variables (!= parameters)
set PWM_RATE 400
# tell the mixer to use parameters for these instead
set PWM_RATE p:PWM_RATE
set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX
@@ -34,15 +29,6 @@ set PWM_AUX_DISARMED 1500
set PWM_AUX_MIN 1000
set PWM_AUX_MAX 2000
# 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
+147 -26
View File
@@ -8,19 +8,47 @@ then
if ms5611 start
then
fi
else
# Configure all I2C buses to 100 KHz as they
# are all external or slow
fmu i2c 1 100000
fmu i2c 2 100000
if ms5611 -s start
if ver hwcmp AEROFC_V1
then
fi
# Aero FC uses separate driver
else
if ver hwcmp CRAZYFLIE
then
# Crazyflie uses separate driver
else
# Configure all I2C buses to 100 KHz as they
# are all external or slow
fmu i2c 1 100000
fmu i2c 2 100000
fi
# Blacksheep telemetry
if bst start
then
if ver hwcmp PX4FMU_V4
then
# We know there are sketchy boards out there
# as chinese companies produce Pixracers without
# fully understanding the critical parts of the
# schematic and BOM, leading to sensor brownouts
# on boot. Original Pixracers following the
# open hardware design do not require this.
fmu sensor_reset 50
fi
# External SPI
if ms5611 -S start
then
fi
# Internal SPI
if ms5611 -s start
then
fi
# Blacksheep telemetry
if bst start
then
fi
fi
fi
@@ -28,6 +56,29 @@ if adc start
then
fi
if ver hwcmp AUAV_X21
then
# I2C bus
if hmc5883 -C -T start
then
fi
# I2C bus
if lis3mdl start
then
fi
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
if mpu6000 -R 2 -T 20608 start
then
fi
# Internal SPI bus mpu9250 is rotated 90 deg yaw
if mpu9250 -R 2 start
then
fi
fi
if ver hwcmp PX4FMU_V2
then
# External I2C bus
@@ -45,16 +96,30 @@ then
then
fi
# Internal SPI bus ICM-20608-G
if mpu6000 -T 20608 start
then
fi
# external MPU6K is rotated 180 degrees yaw
if mpu6000 -X -R 4 start
if mpu6000 -S -R 4 start
then
set BOARD_FMUV3 true
else
set BOARD_FMUV3 false
# Check for Pixhawk 2.1 board
if mpu9250 -S -R 4 start
then
set BOARD_FMUV3 true
else
set BOARD_FMUV3 false
fi
fi
if [ $BOARD_FMUV3 == true ]
then
# sensor heating is available, but we disable it for now
param set SENS_EN_THERMAL 0
# external L3GD20H is rotated 180 degrees yaw
if l3gd20 -X -R 4 start
then
@@ -68,6 +133,10 @@ then
# internal MPU6000 is rotated 180 deg roll, 270 deg yaw
if mpu6000 -R 14 start
then
else
if mpu9250 -R 14 start
then
fi
fi
if hmc5883 -C -T -S -R 8 start
@@ -84,6 +153,10 @@ then
then
fi
if mpu9250 start
then
fi
if l3gd20 start
then
fi
@@ -115,10 +188,19 @@ then
then
fi
# Start either MPU9250 or BMI160. They are both connected to the same SPI bus and use the same
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
# will prevent the incorrect driver from a successful initialization.
# Internal SPI bus mpu9250 is rotated 90 deg yaw
if mpu9250 -R 2 start
then
fi
# Internal SPI bus BMI160
if bmi160 start
then
fi
fi
if ver hwcmp PX4FMU_V1
@@ -156,24 +238,63 @@ fi
if ver hwcmp MINDPX_V2
then
if mpu6500 start
then
fi
if lsm303d start
then
fi
if l3gd20 start
then
fi
# External I2C bus
if hmc5883 -C -T -X start
then
fi
if lis3mdl -R 2 start
# Internal I2C bus
if hmc5883 -C -T -I -R 8 start
then
fi
if mpu6500 -R 8 start
then
fi
if lsm303d -R 10 start
then
fi
if l3gd20 -R 14 start
then
fi
fi
if ver hwcmp CRAZYFLIE
then
# Onboard I2C
if mpu9250 -R 12 start
then
fi
# I2C bypass of mpu
if lps25h start
then
fi
fi
if ver hwcmp AEROFC_V1
then
if ms5611 start
then
fi
if mpu6500 -R 14 start
then
fi
# Internal compass
if hmc5883 -I -R 4 start
then
fi
# Possible external compasses
if hmc5883 -X start
then
fi
if ist8310 -C -b 1 -R 8 start
then
fi
fi
@@ -190,7 +311,7 @@ else
fi
fi
if sf10a start
if sf1xx start
then
fi
-29
View File
@@ -1,29 +0,0 @@
#!nsh
#
# UAVCAN initialization script.
#
#
# Starting stuff according to UAVCAN_ENABLE value
#
if param greater UAVCAN_ENABLE 0
then
if uavcan start
then
echo "[i] UAVCAN started"
else
echo "[i] ERROR: Could not start UAVCAN"
tone_alarm $TUNE_ERR
fi
fi
if param greater UAVCAN_ENABLE 1
then
if uavcan start fw
then
echo "[i] UAVCAN servers started"
else
echo "[i] ERROR: Could not start UAVCAN servers"
tone_alarm $TUNE_ERR
fi
fi
-9
View File
@@ -1,9 +0,0 @@
#!nsh
#
# USB MAVLink start
#
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
# Exit shell to make it available to MAVLink
exit
+12 -5
View File
@@ -9,18 +9,25 @@
#---------------------------------------
# Estimator group selction
#
# INAV
# INAV (deprecated)
if param compare SYS_MC_EST_GROUP 0
then
attitude_estimator_q start
position_estimator_inav start
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
param set SYS_MC_EST_GROUP 1
param save
fi
# LPE
if param compare SYS_MC_EST_GROUP 1
then
attitude_estimator_q start
local_position_estimator start
# Try to start LPE. If it fails, start EKF2 as a default
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
if attitude_estimator_q start
then
local_position_estimator start
else
ekf2 start
fi
fi
# EKF
@@ -8,12 +8,6 @@ then
param set MC_PITCH_P 6.0
param set MC_YAW_P 4
param set PE_VELNE_NOISE 0.5
param set PE_VELD_NOISE 0.3
param set PE_POSNE_NOISE 0.5
param set PE_POSD_NOISE 1.25
param set PE_ABIAS_PNOISE 0.0001
#
# Default parameters for mission and position handling
#
@@ -34,15 +28,6 @@ set PWM_DISARMED p:PWM_DISARMED
set PWM_MIN p:PWM_MIN
set PWM_MAX p:PWM_MAX
# 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
+180 -89
View File
@@ -109,6 +109,16 @@ then
set AUTOCNF yes
else
set AUTOCNF no
#
# Release 1.4.0 transitional support:
# set to old default if unconfigured.
# this preserves the previous behaviour
#
if param compare BAT_N_CELLS 0
then
param set BAT_N_CELLS 3
fi
fi
#
@@ -135,6 +145,7 @@ then
set FMU_MODE pwm
set AUX_MODE pwm
set MAVLINK_F default
set MAVLINK_COMPANION_DEVICE /dev/ttyS2
set EXIT_ON_END no
set MAV_TYPE none
set FAILSAFE none
@@ -154,18 +165,36 @@ then
then
set USE_IO no
fi
if ver hwcmp CRAZYFLIE
then
set USE_IO no
if param compare SYS_AUTOSTART 0
then
param set SYS_AUTOSTART 4900
set AUTOCNF yes
fi
fi
if ver hwcmp AEROFC_V1
then
set USE_IO no
fi
else
set USE_IO no
fi
# should set to 0.8 for mindpx-v2 borad.
if param compare INAV_LIDAR_ERR 0.5
if ver hwcmp AEROFC_V1
then
if ver hwcmp MINDPX_V2
if param compare SYS_AUTOSTART 0
then
param set INAV_LIDAR_ERR 0.8
param save
set AUTOCNF yes
fi
# We don't allow changing AUTOSTART as it doesn't work in
# other configurations
param set SYS_AUTOSTART 4070
fi
#
@@ -173,7 +202,6 @@ then
#
if param compare SYS_AUTOSTART 0
then
echo "INFO [init] No autostart"
else
sh /etc/init.d/rc.autostart
fi
@@ -186,13 +214,18 @@ then
set MIXER_AUX none
fi
if ver hwcmp AEROFC_V1
then
set MIXER_AUX none
fi
#
# Override parameters from user configuration file
#
set FCONFIG /fs/microsd/etc/config.txt
if [ -f $FCONFIG ]
then
echo "INFO [init] Custom: $FCONFIG"
echo "Custom: $FCONFIG"
sh $FCONFIG
fi
unset FCONFIG
@@ -203,7 +236,6 @@ then
if [ $AUTOCNF == yes ]
then
param set SYS_AUTOCONFIG 0
param save
fi
unset AUTOCNF
@@ -223,7 +255,7 @@ then
if px4io checkcrc ${IO_FILE}
then
echo "INFO [init] PX4IO CRC OK" >> $LOG_FILE
echo "[init] PX4IO CRC OK" >> $LOG_FILE
set IO_PRESENT yes
else
@@ -246,16 +278,16 @@ then
usleep 500000
if px4io checkcrc $IO_FILE
then
echo "INFO [init] PX4IO CRC OK after updating" >> $LOG_FILE
echo "PX4IO CRC OK after updating" >> $LOG_FILE
tone_alarm MLL8CDE
set IO_PRESENT yes
else
echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
echo "PX4IO update failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
else
echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
echo "PX4IO update failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@@ -263,7 +295,7 @@ then
if [ $IO_PRESENT == no ]
then
echo "ERROR [init] PX4IO not found" >> $LOG_FILE
echo "PX4IO not found" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@@ -298,6 +330,11 @@ then
set FMU_MODE gpio_serial
fi
if [ $OUTPUT_MODE == tap_esc ]
then
set FMU_MODE rcin
fi
if [ $HIL == yes ]
then
set OUTPUT_MODE hil
@@ -348,6 +385,20 @@ then
set OUTPUT_MODE uavcan_esc
fi
# Sensors on the PWM interface bank
# clear pins 5 and 6
if param compare SENS_EN_LL40LS 1
then
set FMU_MODE pwm4
set AUX_MODE pwm4
fi
if param greater TRIG_MODE 0
then
set FMU_MODE pwm4
set AUX_MODE pwm4
camera_trigger start
fi
# If OUTPUT_MODE == none then something is wrong with setup and we shouldn't try to enable output
if [ $OUTPUT_MODE != none ]
then
@@ -355,8 +406,8 @@ then
then
if param compare UAVCAN_ENABLE 0
then
echo "INFO [init] OVERRIDING UAVCAN_ENABLE = 1" >> $LOG_FILE
param set UAVCAN_ENABLE 1
echo "OVERRIDING UAVCAN_ENABLE = 3" >> $LOG_FILE
param set UAVCAN_ENABLE 3
fi
fi
@@ -366,7 +417,7 @@ then
then
sh /etc/init.d/rc.io
else
echo "INFO [init] PX4IO start failed" >> $LOG_FILE
echo "PX4IO start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@@ -376,7 +427,7 @@ then
if fmu mode_$FMU_MODE
then
else
echo "ERR [init] FMU start failed" >> $LOG_FILE
echo "FMU start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
@@ -408,7 +459,7 @@ then
if mkblctrl $MKBLCTRL_ARG
then
else
echo "ERROR [init] MK start failed" >> $LOG_FILE
echo "MK start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
unset MKBLCTRL_ARG
@@ -417,10 +468,9 @@ then
if [ $OUTPUT_MODE == hil ]
then
if pwm_out_sim mode_port2_pwm8
if pwm_out_sim mode_pwm16
then
else
echo "ERROR [init] PWM SIM start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@@ -436,7 +486,7 @@ then
then
sh /etc/init.d/rc.io
else
echo "ERROR [init] PX4IO start failed" >> $LOG_FILE
echo "PX4IO start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
@@ -446,7 +496,7 @@ then
if fmu mode_$FMU_MODE
then
else
echo "ERROR [init] FMU mode_$FMU_MODE start failed" >> $LOG_FILE
echo "FMU mode_$FMU_MODE start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
@@ -484,10 +534,25 @@ then
# Start MAVLink on Wifi (ESP8266 port)
mavlink start -r 20000 -m config -b 921600 -d /dev/ttyS0
fi
if ver hwcmp AEROFC_V1
then
set MAVLINK_F "-r 1200 -d /dev/ttyS4"
fi
fi
if ver hwcmp CRAZYFLIE
then
# Avoid using either of the two available serials
set MAVLINK_F none
fi
fi
mavlink start $MAVLINK_F
if [ "x$MAVLINK_F" == xnone ]
then
else
mavlink start $MAVLINK_F
fi
unset MAVLINK_F
#
@@ -500,60 +565,57 @@ then
# but this works for now
if param compare SYS_COMPANION 10
then
frsky_telemetry start -d /dev/ttyS2
frsky_telemetry start -d $MAVLINK_COMPANION_DEVICE
fi
if param compare SYS_COMPANION 20
then
syslink start
mavlink start -d /dev/bridge0 -b 57600 -m osd -r 40000
fi
if param compare SYS_COMPANION 921600
then
mavlink start -d /dev/ttyS2 -b 921600 -m onboard -r 80000 -x
mavlink start -d $MAVLINK_COMPANION_DEVICE -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 5000 -x
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m onboard -r 5000 -x
fi
if param compare SYS_COMPANION 157600
then
mavlink start -d /dev/ttyS2 -b 57600 -m osd -r 1000
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m osd -r 1000
fi
if param compare SYS_COMPANION 257600
then
mavlink start -d /dev/ttyS2 -b 57600 -m magic -r 5000 -x
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -m magic -r 5000 -x
fi
if param compare SYS_COMPANION 319200
then
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 19200 -r 1000
fi
if param compare SYS_COMPANION 338400
then
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 38400 -r 1000
fi
if param compare SYS_COMPANION 357600
then
mavlink start -d /dev/ttyS2 -b 57600 -r 1000
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 57600 -r 1000
fi
if param compare SYS_COMPANION 1921600
then
mavlink start -d /dev/ttyS2 -b 921600 -r 20000
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 921600 -r 20000
fi
# Sensors on the PWM interface bank
# clear pins 5 and 6
if param compare SENS_EN_LL40LS 1
if param compare SYS_COMPANION 1500000
then
set AUX_MODE pwm4
fi
if param greater TRIG_MODE 0
then
# Get FMU driver out of the way
set MIXER_AUX none
set AUX_MODE none
camera_trigger start
mavlink start -d $MAVLINK_COMPANION_DEVICE -b 1500000 -m onboard -r 100000 -x
fi
fi
unset MAVLINK_COMPANION_DEVICE
#
# Starting stuff according to UAVCAN_ENABLE value
#
if param greater UAVCAN_ENABLE 0
then
if uavcan start
then
else
tone_alarm $TUNE_ERR
fi
fi
if param greater UAVCAN_ENABLE 1
then
if uavcan start fw
then
@@ -577,38 +639,62 @@ then
fi
fi
# sf0x lidar sensor
if param compare SENS_EN_SF0X 1
# lightware serial lidar sensor
if param compare SENS_EN_SF0X 0
then
else
sf0x start
fi
# lightware i2c lidar sensor
if param compare SENS_EN_SF1XX 0
then
else
sf1xx start
fi
# mb12xx sonar sensor
if param compare SENS_EN_MB12XX 1
then
mb12xx start
fi
# teraranger one tof sensor
if param compare SENS_EN_TRONE 1
then
trone start
fi
if ver hwcmp PX4FMU_V4
then
frsky_telemetry start -d /dev/ttyS6
fi
if ver hwcmp MINDPX_V2
then
frsky_telemetry start -d /dev/ttyS6
fi
if ver hwcmp PX4FMU_V2
then
# Check for flow sensor - as it is a background task, launch it last
px4flow start &
fi
if ver hwcmp MINDPX_V2
if ver hwcmp PX4FMU_V4
then
#mindxp also need flow
# Check for flow sensor - as it is a background task, launch it last
px4flow start &
fi
# Start USB shell if no microSD present, MAVLink else
if [ $LOG_FILE == /dev/null ]
if ver hwcmp MINDPX_V2
then
# Try to get an USB console
nshterm /dev/ttyACM0 &
else
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
px4flow start &
fi
# Start MAVLink
mavlink start -r 800000 -d /dev/ttyACM0 -m config -x
#
# Logging
#
@@ -618,30 +704,34 @@ then
then
fi
else
# check if we should increase logging rate for ekf2 replay message logging
if param greater EKF2_REC_RPL 0
if param compare SYS_LOGGER 0
then
if param compare SYS_LOGGER 0
# check if we should increase logging rate for ekf2 replay message logging
if param greater EKF2_REC_RPL 0
then
if sdlog2 start -r 500 -e -b 18 -t
then
fi
else
if logger start -r 500
if sdlog2 start -r 100 -a -b 9 -t
then
fi
fi
else
if param compare SYS_LOGGER 0
set LOGGER_ARGS ""
if param compare SDLOG_MODE 1
then
if sdlog2 start -r 100 -a -b 9 -t
then
fi
else
if logger start -b 12
then
fi
set LOGGER_ARGS "-e"
fi
if param compare SDLOG_MODE 2
then
set LOGGER_ARGS "-f"
fi
if logger start -b 12 -t $LOGGER_ARGS
then
fi
unset LOGGER_ARGS
fi
fi
@@ -658,8 +748,6 @@ then
#
if [ $VEHICLE_TYPE == fw ]
then
echo "INFO [init] Fixedwing"
if [ $MIXER == none ]
then
# Set default mixer for fixed wing if not defined
@@ -686,11 +774,9 @@ then
#
if [ $VEHICLE_TYPE == mc ]
then
echo "INFO [init] Multicopter"
if [ $MIXER == none ]
then
echo "INFO [init] Mixer undefined"
echo "Mixer undefined"
fi
if [ $MAV_TYPE == none ]
@@ -737,7 +823,7 @@ then
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "WARN [init] Unknown MAV_TYPE"
echo "Unknown MAV_TYPE"
param set MAV_TYPE 2
else
param set MAV_TYPE $MAV_TYPE
@@ -755,11 +841,9 @@ then
#
if [ $VEHICLE_TYPE == vtol ]
then
echo "INFO [init] VTOL"
if [ $MIXER == none ]
then
echo "WARN [init] VTOL mixer undefined"
echo "VTOL mixer undefined"
fi
if [ $MAV_TYPE == none ]
@@ -782,7 +866,7 @@ then
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "WARN [init] Unknown MAV_TYPE"
echo "Unknown MAV_TYPE"
param set MAV_TYPE 19
else
param set MAV_TYPE $MAV_TYPE
@@ -866,23 +950,30 @@ then
#
if [ $VEHICLE_TYPE == none ]
then
echo "WARN [init] No autostart ID found"
echo "No autostart ID found"
fi
# Start any custom addons
set FEXTRAS /fs/microsd/etc/extras.txt
if [ -f $FEXTRAS ]
then
echo "INFO [init] Addons script: $FEXTRAS"
echo "Addons script: $FEXTRAS"
sh $FEXTRAS
fi
unset FEXTRAS
# Run no SD alarm
if [ $LOG_FILE == /dev/null ]
if ver hwcmp CRAZYFLIE
then
# Play SOS
tone_alarm error
# CF2 shouldn't have an sd card
else
# Run no SD alarm
if [ $LOG_FILE == /dev/null ]
then
# Play SOS
tone_alarm error
fi
fi
# End of autostart
@@ -897,7 +988,7 @@ mavlink boot_complete
if [ $EXIT_ON_END == yes ]
then
echo "INFO [init] NSH exit"
echo "NSH exit"
exit
fi
unset EXIT_ON_END
Binary file not shown.
@@ -0,0 +1,7 @@
Multirotor mixer for Parrot Bebop
=================================
This file defines a single mixer for a quadrotor in the x configuration. All controls
are mixed 100%.
R: 4x 10000 10000 -10000 0
+31
View File
@@ -0,0 +1,31 @@
# mixer for the CruiseAder Claire tilt mechansim servo and elevons
=======================================================================
Tilt mechanism servo mixer
---------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 1 4 10000 10000 0 -10000 10000
Elevon mixers
-------------
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 -7500 -7500 0 -10000 10000
S: 1 1 7500 7500 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 -7500 -7500 0 -10000 10000
S: 1 1 -7500 -7500 0 -10000 10000
@@ -0,0 +1,7 @@
# CruiseAder Claire Main Multirotor mixer for PX4FMU
#
#===========================
R: 4x 10000 10000 10000 0
@@ -0,0 +1,54 @@
Helicopter 120 degree Cyclic-Collective-Pitch Mixing (CCPM) for PX4FMU
Blade 130x helicopter has longer servo arms left and right. The front servo arm is shorter.
Therefore it is not required to use the 0.866 factor.
==================================================
Output 0 - Left Servo Mixer
-----------------
Left Servo = Collective (Thurst - 3) - 0.5 * Elevator (Pitch - 1) + Aileron (Roll - 0)
M: 3
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
Output 1 - Front Servo Mixer
----------------
Rear Servo = Collective (Thrust - 3) + Elevator (Pitch - 1)
M: 2
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000
Output 2 - Right Servo Mixer
----------------
Right Servo = Collective (Thurst - 3) - 0.5 * Elevator (Pitch - 1) - Aileron (Roll - 0)
M: 3
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
S: 0 0 -10000 -10000 0 -10000 10000
Output 3 - Tail Servo Mixer
----------------
Tail Servo = Yaw (control index = 2)
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
Output 4 - Motor speed mixer
-----------------
This would be the motor speed control output from governor power demand- not sure what index to use here?
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
@@ -1,3 +1,4 @@
# Hexa X
R: 6x 10000 10000 10000 0
+27
View File
@@ -0,0 +1,27 @@
# Mount Mixer (e.g. Gimbal, servo-controlled gimbal, etc...)
# pitch
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
# roll
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 10000 10000 0 -10000 10000
# yaw
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000
# mode
M: 1
O: 10000 10000 0 -10000 10000
S: 2 3 10000 10000 0 -10000 10000
# retracts
M: 1
O: 10000 10000 0 -10000 10000
S: 2 4 10000 10000 0 -10000 10000
@@ -0,0 +1,27 @@
# Roll channel for mount
M: 1
O: 10000 10000 0 -10000 10000
S: 2 0 10000 10000 0 -10000 10000
# Pitch channel for mount
M: 1
O: 10000 10000 0 -10000 10000
S: 2 1 10000 10000 0 -10000 10000
# Yaw channel for mount
M: 1
O: 10000 10000 0 -10000 10000
S: 2 2 10000 10000 0 -10000 10000
# mixer for left leg
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 0 20000 -10000 -10000 10000
# mixer for right leg
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 0 20000 -10000 -10000 10000
@@ -1,26 +0,0 @@
Mixer for SITL plane, using the VTOL airframe for now
=========================================================
Z:
Z:
Z:
Z:
# mixer for the elevons
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 5000 5000 0 -10000 10000
S: 0 1 -5000 -5000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 5000 5000 0 -10000 10000
S: 0 1 5000 5000 0 -10000 10000
# mixer for the pusher/puller throttle
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
@@ -1,18 +0,0 @@
Multirotor mixer for PX4FMU
===========================
This file defines a single mixer for a quadrotor in the V configuration. All controls
are mixed 100%.
R: 4v 10000 10000 10000 0
Gimbal / payload mixer for last two channels
-----------------------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
@@ -6,13 +6,21 @@ are mixed 100%.
R: 4x 10000 10000 10000 0
#mixer for the elevons
Z:
# left elevon
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 5000 5000 0 -10000 10000
# right elevon
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 -5000 -5000 0 -10000 10000
# mixer for the virtual elevator
M: 1
O: 10000 10000 0 -10000 10000
S: 1 1 10000 10000 0 -10000 10000
-7
View File
@@ -1,7 +0,0 @@
Multirotor mixer for PX4FMU
===========================
This file defines a single mixer for a quadrotor in the X configuration. All controls
are mixed 100%.
R: 4x 10000 10000 10000 0
@@ -19,13 +19,13 @@ input is inverted between the two servos.
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 -6000 -6000 0 -10000 10000
S: 1 1 6500 6500 0 -10000 10000
S: 1 0 -8000 -8000 0 -10000 10000
S: 1 1 8000 8000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 -6000 -6000 0 -10000 10000
S: 1 1 -6500 -6500 0 -10000 10000
S: 1 0 -8000 -8000 0 -10000 10000
S: 1 1 -8000 -8000 0 -10000 10000
Motor speed mixer
-----------------
+1 -1
View File
@@ -190,7 +190,7 @@ else
fi
fi
if sf10a start
if sf1xx start
then
fi
+2 -67
View File
@@ -111,87 +111,22 @@ fi
sh /etc/init.d/rc.sensors
# Check for flow sensor
if px4flow start
then
fi
if ll40ls start
then
fi
ver all
#
# Run unit tests at board boot, reporting failure as needed.
# Add new unit tests using the same pattern as below.
#
echo
echo "--------------------------------------------------------------------------------"
echo "[mavlink_tests] STARTING TEST"
if mavlink_tests
then
echo "[mavlink_tests] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} mavlink_tests"
echo "[mavlink_tests] FAILED"
fi
echo "--------------------------------------------------------------------------------"
echo
echo "--------------------------------------------------------------------------------"
echo "[commander_tests] STARTING TEST"
if commander_tests
then
echo "[commander_tests] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} commander_tests"
echo "[commander_tests] FAILED"
fi
echo "--------------------------------------------------------------------------------"
echo
echo "--------------------------------------------------------------------------------"
echo "[controllib_test] STARTING TEST"
if controllib_test
then
echo "[controllib_test] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} controllib_tests"
echo "[controllib_test] FAILED"
fi
echo "--------------------------------------------------------------------------------"
echo
echo "--------------------------------------------------------------------------------"
echo "[uorb_tests] STARTING TEST"
if uorb_tests
then
echo "[uorb_tests] PASS"
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} uorb_tests"
echo "[uorb_tests] FAILED"
fi
echo "--------------------------------------------------------------------------------"
if tests all
then
else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} system_tests"
fi
if [ $unit_test_failure == 0 ]
then
echo
echo "All Unit Tests PASSED"
rgbled rgb 20 255 20
else
echo
echo "Some Unit Tests FAILED:${unit_test_failure_list}"
echo "Some Unit Tests FAILED"
rgbled rgb 255 20 20
fi
ver all
free
@@ -0,0 +1,38 @@
Mixer for SITL plane
=========================================================
Z:
Z:
# mixer for the rudder
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
# mixer for the flaps
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
# mixer for the pusher/puller throttle
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
# mixer for the left aileron
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 -4000 -4000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000
# mixer for the right aileron
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 4000 4000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000
# mixer for the elevator
M: 1
O: 10000 10000 0 -10000 10000
S: 0 1 -10000 -10000 0 -10000 10000
+36
View File
@@ -0,0 +1,36 @@
Mixer for SITL plane
=========================================================
Z:
Z:
# mixer for the rudder
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
# mixer for the flaps
M: 1
O: 10000 10000 0 -10000 10000
S: 0 4 10000 10000 0 -10000 10000
# mixer for the pusher/puller throttle
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000
# mixer for the left aileron
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 -10000 -10000 0 -10000 10000
# mixer for the right aileron
M: 1
O: 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000
# mixer for the elevator
M: 1
O: 10000 10000 0 -10000 10000
S: 0 1 10000 10000 0 -10000 10000
@@ -1,24 +1,26 @@
Mixer for standard vtol plane (SITL) with motor x configuration
=========================================================
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration.
The plane has two ailerons and one elevator. The ailerons and elevator are treated as elevons
in order to make the standard vtol simulation compatible with the tailsitter simulation.
This file defines a single mixer for a standard vtol plane (SITL gazebo) with motors in X configuration. The plane has two ailerons and one elevator.
R: 4x 10000 10000 10000 0
# mixer for the elevons
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 -5000 -5000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 1 0 5000 5000 0 -10000 10000
S: 1 1 5000 5000 0 -10000 10000
# mixer for the pusher/puller throttle
M: 1
O: 10000 10000 0 -10000 10000
S: 1 3 0 20000 -10000 -10000 10000
# mixer for the left aileron
M: 1
O: 10000 10000 0 -10000 10000
S: 1 0 10000 10000 0 -10000 10000
# mixer for the right aileron
M: 1
O: 10000 10000 0 -10000 10000
S: 1 0 -10000 -10000 0 -10000 10000
# mixer for the elevator
M: 1
O: 10000 10000 0 -10000 10000
S: 1 1 10000 10000 0 -10000 10000
+21
View File
@@ -0,0 +1,21 @@
#!nsh
#
# @name Generic Quadrotor X config
#
# @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
if tap_esc start -d /dev/ttyS4 -n 4
then
fi
set OUTPUT_MODE tap_esc
param set BAT_N_CELLS 4
set MIXER quad_x
+25
View File
@@ -0,0 +1,25 @@
#!nsh
#
# @name Generic Hexarotor x geometry
#
# @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
param set MAV_TYPE 13
param set MC_YAWRATE_P 0.12
param set CAL_MAG0_ROT 6
if tap_esc start -d /dev/ttyS4 -n 6
then
fi
set OUTPUT_MODE tap_esc
set MIXER hexa_x
+20
View File
@@ -0,0 +1,20 @@
#!nsh
#
# Standard apps for fixed wing
#
#
# Start the attitude and position estimator
#
ekf2 start
#
# Start attitude controller
#
fw_att_control start
fw_pos_control_l1 start
#
# Start Land Detector
#
land_detector start fixedwing
+23
View File
@@ -0,0 +1,23 @@
#!nsh
set VEHICLE_TYPE fw
if [ $AUTOCNF == yes ]
then
#
# Default parameters for FW
#
param set RTL_RETURN_ALT 100
param set RTL_DESCEND_ALT 100
param set RTL_LAND_DELAY -1
param set NAV_ACC_RAD 50
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
+83
View File
@@ -0,0 +1,83 @@
#!nsh
#
# Script to configure control interface
#
set SDCARD_MIXERS_PATH /fs/microsd/etc/mixers
if [ $MIXER != none -a $MIXER != skip ]
then
#
# Load main mixer
#
# Use the mixer file
set MIXER_FILE /etc/mixers/$MIXER.main.mix
set OUTPUT_DEV /dev/pwm_output0
if [ $OUTPUT_MODE == tap_esc ]
then
set OUTPUT_DEV /dev/tap_esc
fi
if mixer load $OUTPUT_DEV $MIXER_FILE
then
echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
else
echo "ERROR [init] Error loading mixer: $MIXER_FILE"
echo "ERROR:[init] Could not load mixer: $MIXER_FILE" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
unset MIXER_FILE
else
if [ $MIXER != skip ]
then
echo "ERROR [init] Mixer not defined"
echo "ERROR [init] Mixer not defined" >> $LOG_FILE
tone_alarm $TUNE_ERR
fi
fi
if [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ]
then
if [ $PWM_OUT != none ]
then
#
# Set PWM output frequency
#
if [ $PWM_RATE != none ]
then
pwm rate -c $PWM_OUT -r $PWM_RATE
fi
#
# Set disarmed, min and max PWM values
#
if [ $PWM_DISARMED != none ]
then
pwm disarmed -c $PWM_OUT -p $PWM_DISARMED
fi
if [ $PWM_MIN != none ]
then
pwm min -c $PWM_OUT -p $PWM_MIN
fi
if [ $PWM_MAX != none ]
then
pwm max -c $PWM_OUT -p $PWM_MAX
fi
fi
if [ $FAILSAFE != none ]
then
pwm failsafe -d $OUTPUT_DEV $FAILSAFE
fi
fi
unset PWM_OUT
unset PWM_RATE
unset PWM_MIN
unset PWM_MAX
unset FAILSAFE
unset OUTPUT_DEV
+17
View File
@@ -0,0 +1,17 @@
#!nsh
#
# Standard apps for multirotors:
# att & pos estimator, att & pos control.
#
ekf2 start
mc_att_control start
mc_pos_control start
#
# Start Land Detector
#
land_detector start multicopter
+33
View File
@@ -0,0 +1,33 @@
#!nsh
set VEHICLE_TYPE mc
if [ $AUTOCNF == yes ]
then
param set PWM_DISARMED 900
param set PWM_MIN 1075
param set PWM_MAX 1950
fi
param set NAV_ACC_RAD 2.0
param set MIS_TAKEOFF_ALT 2.5
param set RTL_RETURN_ALT 30.0
param set RTL_DESCEND_ALT 10.0
param set RTL_LAND_DELAY 0
param set MPC_THR_MIN 0.10
param set MPC_MANTHR_MIN 0.04
# set environment variables (!= parameters)
set PWM_RATE 400
# 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
+28
View File
@@ -0,0 +1,28 @@
#!nsh
#
# Standard startup script for TAP v1 onboard sensor drivers.
#
if adc start
then
fi
if ms5611 -T 5607 -I start
then
fi
# External I2C bus
if hmc5883 -C -T -X start
then
fi
# Internal I2C bus
if mpu6000 -I -T 6000 start
then
fi
# Wait 50 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire)
usleep 50000
if sensors start
then
fi
+24
View File
@@ -0,0 +1,24 @@
#!nsh
#
# Standard apps for vtol:
# att & pos estimator, att & pos control.
#
#
#---------------------------------------
# Estimator group selction
#
ekf2 start
vtol_att_control start
mc_att_control start
mc_pos_control start
fw_att_control start
fw_pos_control_l1 start
#
# Start Land Detector
# Multicopter for now until we have something for VTOL
#
land_detector start vtol
+43
View File
@@ -0,0 +1,43 @@
#!nsh
set VEHICLE_TYPE vtol
if [ $AUTOCNF == yes ]
then
param set MC_ROLL_P 6.0
param set MC_PITCH_P 6.0
param set MC_YAW_P 4
#
# Default parameters for mission and position handling
#
param set NAV_ACC_RAD 3
param set MPC_TKO_SPEED 1.0
param set MPC_LAND_SPEED 0.7
param set MPC_Z_VEL_MAX 1.5
param set MPC_XY_VEL_MAX 4.0
param set MIS_YAW_TMT 10
param set MPC_ACC_HOR_MAX 2.0
param set RTL_LAND_DELAY 0
fi
# set environment variables (!= parameters)
set PWM_RATE 400
# 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
# 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
+360
View File
@@ -0,0 +1,360 @@
#!nsh
#
# TAP startup script.
#
# NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS.
#
# Serial map:
# /dev/ttyS0: GPS
# /dev/ttyS1: GB
# /dev/ttyS2: nsh shell / console
# /dev/ttyS3: payload
# /dev/ttyS4: esc bus
# /dev/ttyS5: RC input
#
# Start CDC/ACM serial driver
#
sercon
set TUNE_ERR ML<<CP4CP4CP4CP4CP4
set LOG_FILE /fs/microsd/bootlog.txt
set DATAMAN_OPT -r
#
# Try to mount the microSD card.
#
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
echo "microSD present"
unset DATAMAN_OPT
else
if mkfatfs /dev/mmcsd0
then
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
echo "microSD card formatted"
unset DATAMAN_OPT
else
echo "ERROR [init] Format failed"
tone_alarm MNBG
set LOG_FILE /dev/null
fi
else
set LOG_FILE /dev/null
fi
fi
#
# Start the ORB (first app to start)
#
uorb start
#
# Load parameters
#
set PARAM_FILE /fs/microsd/params
if mtd start
then
set PARAM_FILE /fs/mtd_params
fi
param select $PARAM_FILE
if param load
then
else
if param reset
then
fi
fi
tone_alarm start
#
# Start system state indicator
#
if rgbled start
then
fi
#
# Set parameters and env variables for selected AUTOSTART
#
if param compare SYS_AUTOSTART 0
then
param set SYS_AUTOSTART 6001
param set SYS_AUTOCONFIG 1
fi
#
# Set AUTOCNF flag to use it in AUTOSTART scripts
#
if param compare SYS_AUTOCONFIG 1
then
# Wipe out params except RC*
param reset_nostart RC*
set AUTOCNF yes
else
set AUTOCNF no
fi
#
# Set default values
#
set VEHICLE_TYPE none
set MIXER none
set OUTPUT_MODE none
set PWM_OUT none
set PWM_RATE none
set PWM_DISARMED none
set PWM_MIN none
set PWM_MAX none
set FMU_MODE pwm
set MAV_TYPE none
set FAILSAFE none
# Start canned airframe config
sh /etc/init.d/rc.autostart
#
# If autoconfig parameter was set, reset it and save parameters
#
if [ $AUTOCNF == yes ]
then
param set SYS_AUTOCONFIG 0
param save
fi
unset AUTOCNF
#
# Set default output if not set
#
if [ $OUTPUT_MODE == none ]
then
if [ $USE_IO == yes ]
then
set OUTPUT_MODE io
else
set OUTPUT_MODE fmu
fi
fi
gps start -d /dev/ttyS0
# waypoint storage
# REBOOTWORK this needs to start in parallel
if dataman start $DATAMAN_OPT
then
fi
#
# Sensors System (start before Commander so Preflight checks are properly run)
#
sh /etc/init.d/rc.sensors
commander start
#
# Start CPU load monitor
#
load_mon start
# Start MAVLink on the gimbal port
#mavlink start -r 1200 -d /dev/ttyS1
# Start MAVLink on USB, developers can use the MAVLink shell
mavlink start -r 60000 -d /dev/ttyACM0 -m config
#
# Logging
#
#if logger start -b 2 -t
#then
#fi
#
# Fixed wing setup
#
if [ $VEHICLE_TYPE == fw ]
then
echo "INFO [init] Fixedwing"
if [ $MIXER == none ]
then
# Set default mixer for fixed wing if not defined
set MIXER AERT
fi
if [ $MAV_TYPE == none ]
then
# Use MAV_TYPE = 1 (fixed wing) if not defined
set MAV_TYPE 1
fi
param set MAV_TYPE $MAV_TYPE
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
# Start standard fixedwing apps
sh /etc/init.d/rc.fw_apps
fi
#
# Multicopters setup
#
if [ $VEHICLE_TYPE == mc ]
then
echo "INFO [init] Multicopter"
if [ $MIXER == none ]
then
echo "INFO [init] Mixer undefined"
fi
if [ $MAV_TYPE == none ]
then
# Use mixer to detect vehicle type
if [ $MIXER == quad_x -o $MIXER == quad_+ ]
then
set MAV_TYPE 2
fi
if [ $MIXER == quad_w ]
then
set MAV_TYPE 2
fi
if [ $MIXER == quad_h ]
then
set MAV_TYPE 2
fi
if [ $MIXER == tri_y_yaw- -o $MIXER == tri_y_yaw+ ]
then
set MAV_TYPE 15
fi
if [ $MIXER == hexa_x -o $MIXER == hexa_+ ]
then
set MAV_TYPE 13
fi
if [ $MIXER == hexa_cox ]
then
set MAV_TYPE 13
fi
if [ $MIXER == octo_x -o $MIXER == octo_+ ]
then
set MAV_TYPE 14
fi
fi
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "WARN [init] Unknown MAV_TYPE"
param set MAV_TYPE 2
else
param set MAV_TYPE $MAV_TYPE
fi
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
# Start standard multicopter apps
sh /etc/init.d/rc.mc_apps
fi
#
# VTOL setup
#
if [ $VEHICLE_TYPE == vtol ]
then
echo "INFO [init] VTOL"
if [ $MIXER == none ]
then
echo "WARN [init] VTOL mixer undefined"
fi
if [ $MAV_TYPE == none ]
then
# Use mixer to detect vehicle type
if [ $MIXER == caipirinha_vtol ]
then
set MAV_TYPE 19
fi
if [ $MIXER == firefly6 ]
then
set MAV_TYPE 21
fi
if [ $MIXER == quad_x_pusher_vtol ]
then
set MAV_TYPE 22
fi
fi
# Still no MAV_TYPE found
if [ $MAV_TYPE == none ]
then
echo "WARN [init] Unknown MAV_TYPE"
param set MAV_TYPE 19
else
param set MAV_TYPE $MAV_TYPE
fi
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
# Start standard vtol apps
sh /etc/init.d/rc.vtol_apps
fi
#
# Rover setup
#
if [ $VEHICLE_TYPE == rover ]
then
# 10 is MAV_TYPE_GROUND_ROVER
set MAV_TYPE 10
# Load mixer and configure outputs
sh /etc/init.d/rc.interface
# Start standard rover apps
sh /etc/init.d/rc.axialracing_ax10_apps
param set MAV_TYPE 10
fi
unset MIXER
unset MAV_TYPE
unset OUTPUT_MODE
#
# Start the RC input driver
#
if fmu mode_pwm1
then
fi
#
# Use 400 Hz PWM output for landing gear (frequency also affects RGB LED)
#
pwm rate -c 1 -r 400
#
# Load the gear mixer onto fmu
#
mixer load /dev/px4fmu /etc/mixers/gear.mix
#
# Start the navigator
#
if navigator start
then
fi
# There is no further script processing, so we can free some RAM
# XXX potentially unset all script variables.
unset TUNE_ERR
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running
mavlink boot_complete
+105
View File
@@ -0,0 +1,105 @@
## PX4 mixer definitions ##
Files in this directory implement example mixers that can be used as a basis
for customisation, or for general testing purposes.
For a detailed description of the mixing architecture and examples see:
http://px4.io/dev/mixing
### Syntax ###
Mixer definitions are text files; lines beginning with a single capital letter
followed by a colon are significant. All other lines are ignored, meaning that
explanatory text can be freely mixed with the definitions.
Each file may define more than one mixer; the allocation of mixers to actuators
is specific to the device reading the mixer definition, and the number of
actuator outputs generated by a mixer is specific to the mixer.
For example: each simple or null mixer is assigned to outputs 1 to x
in the order they appear in the mixer file.
A mixer begins with a line of the form
<tag>: <mixer arguments>
The tag selects the mixer type; 'M' for a simple summing mixer, 'R' for a
multirotor mixer, etc.
#### Null Mixer ####
A null mixer consumes no controls and generates a single actuator output whose
value is always zero. Typically a null mixer is used as a placeholder in a
collection of mixers in order to achieve a specific pattern of actuator outputs.
The null mixer definition has the form:
Z:
#### Simple Mixer ####
A simple mixer combines zero or more control inputs into a single actuator
output. Inputs are scaled, and the mixing function sums the result before
applying an output scaler.
A simple mixer definition begins with:
M: <control count>
O: <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
If <control count> is zero, the sum is effectively zero and the mixer will
output a fixed value that is <offset> constrained by <lower limit> and <upper
limit>.
The second line defines the output scaler with scaler parameters as discussed
above. Whilst the calculations are performed as floating-point operations, the
values stored in the definition file are scaled by a factor of 10000; i.e. an
offset of -0.5 is encoded as -5000.
The definition continues with <control count> entries describing the control
inputs and their scaling, in the form:
S: <group> <index> <-ve scale> <+ve scale> <offset> <lower limit> <upper limit>
The <group> value identifies the control group from which the scaler will read,
and the <index> value an offset within that group. These values are specific to
the device reading the mixer definition.
When used to mix vehicle controls, mixer group zero is the vehicle attitude
control group, and index values zero through three are normally roll, pitch,
yaw and thrust respectively.
The remaining fields on the line configure the control scaler with parameters as
discussed above. Whilst the calculations are performed as floating-point
operations, the values stored in the definition file are scaled by a factor of
10000; i.e. an offset of -0.5 is encoded as -5000.
#### Multirotor Mixer ####
The multirotor mixer combines four control inputs (roll, pitch, yaw, thrust)
into a set of actuator outputs intended to drive motor speed controllers.
The mixer definition is a single line of the form:
R: <geometry> <roll scale> <pitch scale> <yaw scale> <deadband>
The supported geometries include:
* 4x - quadrotor in X configuration
* 4+ - quadrotor in + configuration
* 6x - hexcopter in X configuration
* 6+ - hexcopter in + configuration
* 8x - octocopter in X configuration
* 8+ - octocopter in + configuration
Each of the roll, pitch and yaw scale values determine scaling of the roll,
pitch and yaw controls relative to the thrust control. Whilst the calculations
are performed as floating-point operations, the values stored in the definition
file are scaled by a factor of 10000; i.e. an factor of 0.5 is encoded as 5000.
Roll, pitch and yaw inputs are expected to range from -1.0 to 1.0, whilst the
thrust input ranges from 0.0 to 1.0. Output for each actuator is in the
range -1.0 to 1.0.
In the case where an actuator saturates, all actuator values are rescaled so that
the saturating actuator is limited to 1.0.
+7
View File
@@ -0,0 +1,7 @@
#
# This maps actuator_controls_0[7] to the first and only PWM output
#
M: 1
O: 10000 10000 0 -10000 10000
S: 0 7 10000 10000 0 -10000 10000
+3
View File
@@ -0,0 +1,3 @@
# Hexa X
R: 6x 10000 10000 10000 0
+7
View File
@@ -0,0 +1,7 @@
R: 4x 10000 10000 10000 0
M: 1
O: 10000 10000 0 -10000 10000
S: 3 5 10000 10000 0 -10000 10000
M: 1
O: 10000 10000 0 -10000 10000
S: 3 6 10000 10000 0 -10000 10000
-9
View File
@@ -1,9 +0,0 @@
QGC WPL 110
0 1 0 16 0 0 0 0 47.3979949951 8.54559612274 25.0 1
1 0 2 3000 4.0 0.0 0.0 0.0 47.3980331421 8.54578971863 25.0 1
2 0 3 16 0.0 0.0 -0.0 0.0 47.399269104 8.54557228088 25.0 1
3 0 3 16 0.0 0.0 -0.0 0.0 47.3992652893 8.54230213165 25.0 1
4 0 3 16 0.0 0.0 -0.0 0.0 47.3974761963 8.54239082336 25.0 1
5 0 3 16 0.0 0.0 -0.0 0.0 47.3976669312 8.54509449005 25.0 1
6 0 2 3000 3.0 0.0 0.0 0.0 47.3977851868 8.54526233673 25.0 1
7 0 3 21 25.0 0.0 -0.0 0.0 47.3979797363 8.54460906982 25.0 1
+12 -1
View File
@@ -1,6 +1,12 @@
#!/bin/bash
ip=192.168.42.1
if [ -z ${BEBOP_IP+x} ]; then
ip=192.168.42.1
echo "\$BEBOP_IP is not set (use default: $ip)"
else
ip=$BEBOP_IP
echo "\$BEBOP_IP is set to $ip"
fi
port=9050
echo "Connecting to bebop: $ip:$port"
@@ -25,6 +31,11 @@ echo "Connection successfully established"
sleep 1
adb shell mount -o remount,rw /
adb shell touch /home/root/parameters
${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-strip \
-R .comment -R .gnu.version \
../build_posix_bebop_default/src/firmware/posix/px4
../Tools/adb_upload.sh $@
+16 -11
View File
@@ -1,6 +1,7 @@
#!/bin/bash
############################################################################
#
# Copyright (c) 2014 PX4 Development Team. All rights reserved.
# Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -31,18 +32,22 @@
#
############################################################################
#
# Publisher Example Application
#
set -e
MODULE_COMMAND = muorb_test
USER=${AERO_USER:-root}
HOSTNAME=${AERO_HOSTNAME:-intel-aero.local}
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
SRCS = \
muorb_test_start_qurt.cpp \
muorb_test_example.cpp
target=$USER@$HOSTNAME
firmware=$1
px_uploader=${SCRIPT_DIR}/px_uploader.py
INCLUDE_DIRS += $(PX4_BASE)/src/modules/uORB \
$(PX4_BASE)/src/platforms \
$(PX4_BASE)/src/modules
echo "Copying files to Aero board ($target)..."
scp -v $firmware $px_uploader $target:
echo "Running px_uploader.py on Aero to update firmware in AeroFC..."
ssh $target 'PATH=$PATH":/usr/sbin" && /etc/init.d/mavlink_bridge.sh stop'
ssh $target "./px_uploader.py --port /dev/ttyS1 --baud-flightstack 1500000 $(basename $firmware)"
ssh $target 'PATH=$PATH":/usr/sbin" && /etc/init.d/mavlink_bridge.sh start'
echo "Firmware updated"
+17 -10
View File
@@ -1,16 +1,23 @@
#!/usr/bin/env bash
file=$1
FILE=$1
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [ -f "$file" ];
then
${DIR}/fix_code_style.sh --dry-run $file | grep --quiet Formatted
if [[ $? -eq 0 ]]
then
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
exit 1
if [ -f "$FILE" ]; then
${DIR}/fix_code_style.sh --dry-run $FILE | grep --quiet Formatted
if [[ $? -eq 0 ]]; then
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
echo
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty
rm -f $FILE.pretty
echo
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
${DIR}/fix_code_style.sh $FILE
else
echo $FILE 'bad formatting, please run "make format" or "./Tools/fix_code_style.sh' $FILE'"'
exit 1
fi
fi
fi
+47 -45
View File
@@ -1,53 +1,55 @@
#!/usr/bin/env bash
set -eu
failed=0
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ASTYLE_VER_REQUIRED="Artistic Style Version 2.05.1"
astyle_ver() {
echo "PX4 requires ${ASTYLE_VER_REQUIRED}"
echo "You can get the correct version here: https://github.com/PX4/astyle/releases/tag/2.05.1"
}
find \
src/drivers \
src/examples \
src/firmware \
src/include \
src/lib/controllib \
src/lib/conversion \
src/lib/geo \
src/lib/geo_lookup \
src/lib/launchdetection \
src/lib/rc \
src/lib/tailsitter_recovery \
src/lib/terrain_estimation \
src/lib/version \
src/modules/attitude_estimator_q \
src/modules/bottle_drop \
src/modules/controllib_test \
src/modules/dataman \
src/modules/fw_att_control \
src/modules/gpio_led \
src/modules/land_detector \
src/modules/local_position_estimator \
src/modules/logger \
src/modules/mavlink/mavlink_tests \
src/modules/muorb \
src/modules/param \
src/modules/px4iofirmware \
src/modules/segway \
src/modules/sensors \
src/modules/simulator \
src/modules/systemlib \
src/modules/unit_test \
src/modules/uORB \
src/modules/vtol_att_control \
src/platforms \
src/systemcmds \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) \
-not -name '*generated.h' \
-not -name '*uthash.h' \
-not -name '*utstring.h' \
-not -name '*utlist.h' \
-not -name '*utarray.h' \
-print0 | xargs -0 -n 1 -P 8 -I % ${DIR}/check_code_style.sh %
# check if astyle is installed
condition=$(which astyle 2>/dev/null | grep -v "not found" | wc -l)
if [ $condition -eq 0 ]; then
echo "astyle is not installed"
astyle_ver
exit 1
else
ASTYLE_VER=`astyle --version`
if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED" ]; then
echo "Error: you're using ${ASTYLE_VER}"
astyle_ver
exit 1
fi
fi
CI="${CI:-false}"
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
if [[ "$@" == "--fix" ]]
then
export PX4_ASTYLE_FIX=1
fi
# install git pre-commit hook
HOOK_FILE="$DIR/../.git/hooks/pre-commit"
if [ ! -f $HOOK_FILE ] && [ "$CI" != "true" ]; then
echo ""
echo -e "\033[31mNinja tip: add a git pre-commit hook to automatically check code style\033[0m"
echo -e "Would you like to install one now? (\033[94mcp ./Tools/pre-commit .git/hooks/pre-commit\033[0m): [y/\033[1mN\033[0m]"
read user_cmd
if [ "$user_cmd" == "y" ]; then
echo -e "copying ./Tools/pre-commit -> .git/hooks/pre-commit"
cp $DIR/pre-commit $HOOK_FILE
echo -e "\033[94mGreat, hook installed!\033[0m (checking style now)"
else
echo -e "\033[94mOk, I will remind you again later!\033[0m (checking style now)"
fi
fi
${DIR}/files_to_check_code_style.sh | xargs -n 1 -P 8 -I % ${DIR}/check_code_style.sh %
if [ $? -eq 0 ]; then
echo "Format checks passed"
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
while getopts "b:t:" opt; do
case "${opt}" in
b)
builddir=$OPTARG
;;
t)
tool=$OPTARG
;;
esac
done
echo "builddir = ${builddir}, tool = ${tool}"
case "${builddir}" in
"build_posix_rpi_cross")
CXX_INC=$(cd ${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include/c++/*; pwd)
EXTRA_ARG1=-I${CXX_INC}
EXTRA_ARG2=-I${CXX_INC}/arm-linux-gnueabihf
EXTRA_ARG3=-I${CXX_INC}/backward
extra_args="--extra-arg=-I${CXX_INC} --extra-arg=-I${CXX_INC}/arm-linux-gnueabihf --extra-arg=-I${CXX_INC}/backward"
;;
"build_posix_sitl_default")
;;
*)
echo "unknown build dir: ${builddir}"
;;
esac
COMPILE_DB=$(/bin/pwd)/${builddir}
if [[ ! -f ${COMPILE_DB}/compile_commands.json ]]; then
echo "compile_commands.json not found in ${COMPILE_DB}"
exit 1
fi
case "${tool}" in
"clang-check")
command=clang-check;
option=-analyze;
;;
"clang-tidy")
command=clang-tidy
;;
esac
grep file ${COMPILE_DB}/compile_commands.json |
awk '{ print $2; }' |
sed 's/\"//g' |
while read FILE; do
(cd $(dirname ${FILE});
${command} ${option} -p ${COMPILE_DB} ${extra_args} $(basename ${FILE})
);
done
+6 -6
View File
@@ -43,10 +43,10 @@ import subprocess
# If the following lines were pasted into the shell after running decode_backtrace.py
#
# INFO Backtrace: 10
# INFO ./mainapp(px4_backtrace+0x27) [0x42b212]
# INFO ./mainapp() [0x42d608]
# INFO ./mainapp() [0x42d57e]
# INFO ./mainapp() [0x4ba48d]
# INFO ./px4(px4_backtrace+0x27) [0x42b212]
# INFO ./px4() [0x42d608]
# INFO ./px4() [0x42d57e]
# INFO ./px4() [0x4ba48d]
#
# The output would be:
#
@@ -63,7 +63,7 @@ def usage():
msg = """
Usage: Tools/decode_backtrace.py <builddir>
This will load the symbols for <builddir>/src/firmware/posix/mainapp
This will load the symbols for <builddir>/src/firmware/posix/px4
The user just needs to copy and paste the backtrace into the terminal
where decode_backtrace.py is running.
@@ -75,7 +75,7 @@ func = []
# Load the symbols from the binary
def load_symbol_map():
output = subprocess.check_output(["nm", "-p", "-C", os.sys.argv[1]+"/src/firmware/posix/mainapp"])
output = subprocess.check_output(["nm", "-p", "-C", os.sys.argv[1]+"/src/firmware/posix/px4"])
data = output.split("\n")
data.sort()
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -eu
PATTERN="-e ."
if [ $# -gt 0 ]
then
PATTERN="$1"
fi
exec find src \
-path src/examples/attitude_estimator_ekf -prune -o \
-path src/examples/ekf_att_pos_estimator -prune -o \
-path src/lib/DriverFramework -prune -o \
-path src/lib/ecl -prune -o \
-path src/lib/external_lgpl -prune -o \
-path src/lib/mathlib -prune -o \
-path src/lib/matrix -prune -o \
-path src/modules/attitude_estimator_ekf -prune -o \
-path src/modules/commander -prune -o \
-path src/modules/mavlink -prune -o \
-path src/modules/navigator -prune -o \
-path src/modules/sdlog2 -prune -o \
-path src/modules/systemlib/uthash -prune -o \
-path src/modules/uavcan -prune -o \
-path src/modules/uavcan/libuavcan -prune -o \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
-9
View File
@@ -1,14 +1,5 @@
#!/bin/bash
ASTYLE_VER=`astyle --version`
ASTYLE_VER_REQUIRED="Artistic Style Version 2.05.1"
if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED" ]; then
echo "Error: you're using ${ASTYLE_VER}, but PX4 requires ${ASTYLE_VER_REQUIRED}"
echo "You can get the correct version here: https://github.com/PX4/astyle/releases/tag/2.05.1"
exit 1
fi
if [[ $# -eq 0 ]] ; then
exit 0
fi
+901
View File
@@ -0,0 +1,901 @@
#! /bin/bash
# Written by Carlo Wood, September/October 2016.
function fatal
{
echo "$0: ERROR: $*"
exit 1
}
# Make sure we're not having a broken gawk.
AWK_VERSION=$(awk -V | head -n 1)
if [[ $AWK_VERSION =~ ^GNU\ Awk\ 4\.[0-9]+\.[0-9]+ ]]; then
AWK_VERSION=$(echo $AWK_VERSION | sed -e 's/GNU Awk \(4\.[0-9]*\.[0-9]*\).*/\1/')
if [[ $AWK_VERSION =~ ^4\.0*([2-9]+|1\.0*[2-9]+) ]]; then
fatal "Your version of awk ($AWK_VERSION) is broken. Please use version 4.1.1 or lower."
fi
fi
echo "AWK_VERSION=$AWK_VERSION"
# Find out what the base directory is.
BASEDIR="$(dirname $(dirname $(readlink -en "$0")))"
echo "BASEDIR=\"$BASEDIR\""
striplen=$((${#BASEDIR} + 2))
# BASEDIR may not contain a space, that's just too hard to get to work.
expr index "$BASEDIR" " " >/dev/null && fatal "it is not supported that BASEDIR contains a space."
# Make sure that worked.
test -f $BASEDIR/cmake/posix/px4_impl_posix.cmake || fatal "Failed to determine BASEDIR: '\$BASEDIR/cmake/posix/px4_impl_posix.cmake' is not a regular file."
# Parse command line parameters.
debug=0 # Set to non-zero to enable debugging.
force=0 # Set to 1 to force running of script even when there are uncommitted changes.
merge=0 # Set to 1 when merging a branch that didn't run this script into master that did already run this script.
while [[ $# -gt 0 ]]
do
case $1 in
--debug)
debug=1
;;
--force)
force=1
;;
--merge)
force=1
merge=1
fatal "--merge is not implemented yet."
;;
-*)
fatal "Unknown option $1"
;;
--|*)
break
;;
esac
shift
done
non_option_arguments=$#
if [ $non_option_arguments -eq 0 -a $debug -ne 0 ]; then
fatal "--debug screws up the source files with debug output! You must provide a single filename to run on."
fi
# Better not run this script with changes that still need to be committed.
cd "$BASEDIR" || fatal "Could not change directory to \"$BASEDIR\""
if ! git diff-index --quiet HEAD --; then
if [ $non_option_arguments -ne 0 -o $force -eq 1 ]; then
if [ $force -eq 1 ]; then
echo "Uncommitted changes, but running anyway because --force is used."
else
echo -n "WARNING: You have uncommitted changes (use --force to remove this warning). Run anyway? [y/N] "
read answer
if [ "x$answer" != "xy" -a "x$answer" != "xY" ]; then exit 0; fi
fi
else
fatal "Your working directory has uncommitted changes (see 'git status')! Bailing out."
fi
fi
# Find a reasonable tmp directory.
# First make a list of all build directories by looking for a CMakeCache.txt in them. Sort them so the most recent one is first.
CMAKECACHE_FILES=$(find "$BASEDIR" -mindepth 2 -maxdepth 2 -type f -name CMakeCache.txt -wholename "$BASEDIR/build_*/CMakeCache.txt" | xargs /bin/ls -td)
# Make a list of all candidate tmp directories.
TMPDIRS=
for f in $CMAKECACHE_FILES; do
if [ -d $(dirname $f)/tmp ]; then
TMPDIRS+=" $(dirname $f)/tmp"
fi
done
# Put BASEDIR first in case there are no build directories because /tmp is probably on a different file system.
TMPDIRS+=" $BASEDIR /tmp ."
# Pick the first one that is actually writable.
for tmp in $TMPDIRS; do
TMPDIR="$tmp"
if [ -w "$TMPDIR" ]; then
break;
fi
done
test -n "$TMPDIR" || fatal "Can not find a writable tmp directory."
echo "TMPDIR=\"$TMPDIR\""
# Make a list of all source and header files that we need to fix.
# List of directories that we don't want to touch.
EXCLUDE_FOLDERS=".git unittests Tools"
EXCLUDE_PATTERNS="examples matlab/scripts tests test unit_test *_test *_tests test_* apps/test_* UnitTests"
# A regular expression for the exclude patterns.
EXCLUDE_PATTERNS_RE="($(echo $EXCLUDE_PATTERNS | sed -e 's/\*/[^\/]*/g;s/ /|/g'))"
# Extensions of files that we do want to change (leaving out .y and .py for now).
C_EXTENSIONS=".c .c_in .c_shipped"
H_EXTENSIONS=".h .h.in .h_template"
CXX_EXTENSIONS=".cc .cpp .cpp.in .cxx .cpp_template"
HXX_EXTENSIONS=".hh .hpp .hxx"
# The regular expression that we consider to be an #include.
INCLUDE_RE='^[[:space:]]*#[[:space:]]*include[[:space:]]*[<"]'
# Regular expression for empty lines.
EMPTY_LINE_RE='^[[:space:]]*$'
# Regular expression for one-line comments.
COMMENT_LINE_RE='^[[:space:]]*(\/\/.*|\/\*([^*]|\*+[^\/*])*\*+\/[[:space:]]*)$'
# Regular expression for a #define (on one line).
DEFINE_RE='^[[:space:]]*#[[:space:]]*define[[:space:]].*[^\\]$'
# Regular expression for an #if[[n]def].
IF_RE='^[[:space:]]*#[[:space:]]*if(n?def)?[[:space:]]'
# Regular expression for an #endif.
ENDIF_RE='^[[:space:]]*#[[:space:]]*endif($|[^[:alnum:]])'
# Regular expression for header file extension.
HEADER_RE="($(echo $H_EXTENSIONS $HXX_EXTENSIONS | sed -e 's/\./\\./g;s/ /|/g'))"
# Regular expression for C++ source and header files.
CXXSRC_RE="($(echo $CXX_EXTENSIONS $HXX_EXTENSIONS | sed -e 's/\./\\./g;s/ /|/g'))"
# List of standard C header files. Note that cfcntl, cshed and cunistd are NOT standard header files, even though they are in NuttX/nuttx/include/cxx.
REAL_STDC_HEADERS_RE='(cassert|ccomplex|cctype|cerrno|cfenv|cfloat|cinttypes|ciso646|climits|clocale|cmath|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype)'
STDC_HEADERS=$(find "$BASEDIR/NuttX/nuttx/include/cxx" -mindepth 1 -maxdepth 1 -type f | xargs basename -a | grep -E "$REAL_STDC_HEADERS_RE" | xargs echo)
# Regular expression of standard C header files, but with the leading 'c' stripped.
STDC_HEADERS_RE="($(echo $STDC_HEADERS | sed -e 's/^c//;s/ c/|/g'))"
# Actual list of standard C header files.
# List of standard C++ header files.
REAL_STDCXX_HEADERS_RE='(algorithm|any|array|atomic|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|complex|condition_variable|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|limits|list|locale|map|memory|memory_resource|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|system_error|thread|tuple|typeindex|typeinfo|type_traits|unordered_map|unordered_set|utility|valarray|variant|vector)'
STDCXX_HEADERS=$(find "$BASEDIR/NuttX/misc/uClibc++/include/uClibc++" -mindepth 1 -maxdepth 1 -type f | xargs basename -a | grep -E "$REAL_STDCXX_HEADERS_RE" | grep -E -v "$REAL_STDC_HEADERS_RE" | xargs echo)
# Regular expression of C++ header files.
STDCXX_HEADERS_RE="($(echo $STDCXX_HEADERS | sed -e 's/ /|/g'))"
# Regular expression for #pragma once.
PRAGMA_ONCE_RE='^#pragma once'
# Regular expression to recognize the start of a C-comment block.
COMMENT_BEGIN_RE='(^|[^\/])\/\*([^*]|\*+($|[^\/*]))*$'
# Regular expression to recognize the end of a C-comment block.
COMMENT_END_RE='\*\/'
# Regular expression to match C++ unsafe headers. We currently don't have any C++ unsafe headers, do we?
# v2.0/standard/mavlink.h is not unsafe, but this way the script will leave it alone and not
# move it above function declarations that need to be declared before including it.
UNSAFE_HEADERS_RE='(v2\.0\/standard\/mavlink\.h)'
#UNSAFE_HEADERS_RE='(stm32\.h|arch\/board\/board\.h)'
# Find all submodules.
test -f $BASEDIR/.gitmodules || fatal "No such file: $BASEDIR/.gitmodules"
SUBMODULES=$(grep -A 1 '^\[submodule' $BASEDIR/.gitmodules | grep '^[[:space:]]*path = ' | sed -r -e 's/^[[:space:]]*path = //' | xargs echo)
echo "SUBMODULES=\"$SUBMODULES\""
SUBMODULES_RE="($(echo $SUBMODULES | sed -e 's/ /|/g'))"
# Disable path name expansion (otherwise the find patterns will be expanded against the files in the current working directory).
set -f
EXCLUDE_ARGS=
for excl in $EXCLUDE_FOLDERS; do
if [ -z "$EXCLUDE_ARGS" ]; then
EXCLUDE_ARGS="-wholename $BASEDIR/$excl/*"
else
EXCLUDE_ARGS+=" -o -wholename $BASEDIR/$excl/*"
fi
done
for excl in $EXCLUDE_PATTERNS; do
EXCLUDE_ARGS+=" -o -wholename */$excl/*"
done
INCLUDE_H_ARGS=
for ext in $H_EXTENSIONS $HXX_EXTENSIONS; do
if [ -z "$INCLUDE_H_ARGS" ]; then
INCLUDE_H_ARGS="-name *$ext"
else
INCLUDE_H_ARGS+=" -o -name *$ext"
fi
done
INCLUDE_C_ARGS=
for ext in $C_EXTENSIONS $CXX_EXTENSIONS; do
if [ -z "$INCLUDE_C_ARGS" ]; then
INCLUDE_C_ARGS="-name *$ext"
else
INCLUDE_C_ARGS+=" -o -name *$ext"
fi
done
# Also exclude all submodules -- because we don't maintain those (are we?).
for subm in $SUBMODULES; do
if [ -z "$SUBMODULES_ARGS" ]; then
SUBMODULES_ARGS="-wholename $BASEDIR/$subm/*"
else
SUBMODULES_ARGS+=" -o -wholename $BASEDIR/$subm/*"
fi
done
echo -n "Finding all source files with #include's (excluding submodules and build directory)... "
find $BASEDIR -mindepth 2 -type f ! \( -wholename $BASEDIR/build_* -o $EXCLUDE_ARGS -o $SUBMODULES_ARGS \) \( $INCLUDE_C_ARGS -o $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_sources
cat "$TMPDIR/fix_headers_sources" | xargs grep -l "$INCLUDE_RE" > $TMPDIR/fix_headers_sources_with_includes
echo "done"
number_of_files=$(sed -n '$=' "$TMPDIR/fix_headers_sources_with_includes")
count=0
echo -n "Finding all submodule header files (excluding stdc++ headers)... "
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) \( $SUBMODULES_ARGS \) \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_SUBMODULE_HEADERS
echo "done"
echo -n "Finding all header files (excluding stdc++ headers)... "
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) -wholename $BASEDIR/build_* \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_HEADERS
grep -E "$HEADER_RE" $TMPDIR/fix_headers_sources >> $TMPDIR/fix_headers_HEADERS
cat $TMPDIR/fix_headers_SUBMODULE_HEADERS >> $TMPDIR/fix_headers_HEADERS
echo "done"
echo -n "Finding all include paths... "
for f in `cat $TMPDIR/fix_headers_sources_with_includes`; do grep -E "$INCLUDE_RE" $f | sed -r -e "s%$INCLUDE_RE%%"';s/[">].*//'; done | sort -u | grep -E -v "(/|^)$EXCLUDE_PATTERNS_RE/" > $TMPDIR/fix_headers_include_paths
echo "done"
function include_path()
{
# If the include path starts with a '.', then it is a local header.
if [[ $1 =~ ^\. ]]; then return 1; fi
# If the include path starts with 'platforms/' then it is a local header;
# added this exception here because not everyone has all build_ directories for all targets installed.
if [[ $1 =~ platforms/ ]]; then return 1; fi
# apps.h is generated from apps.h.in.
if [ $1 = "apps.h" ]; then return 1; fi
# Treat the following headers from src/platforms/*/include as system header because they replace what is found in nuttx (for posix and qurt).
if [ $1 = "arch/board/board.h" -o $1 = "crc32.h" -o $1 = "i2c.h" -o $1 = "queue.h" -o $1 = "poll.h" -o $1 = "sys/ioctl.h" ]; then return 2; fi
# Escape the path for reg.exp. matching.
PATH_RE=$(echo $1 | sed -e 's/\([+.]\)/\\\1/')
issubmodule=0;
islocal=0;
foo=0
for includedir in $(grep "/$PATH_RE\$" $TMPDIR/fix_headers_HEADERS | cut -c $striplen-); do
# If the include directory is NuttX header that was copied to the build directory, then it's still a system file.
if [[ $includedir/ =~ ^build_.*/NuttX/ ]]; then
issubmodule=1
# If the include directory is a submodule, then treat it as a system file.
elif [[ $includedir/ =~ ^$SUBMODULES_RE/ ]]; then
issubmodule=1;
else
islocal=1
fi
done
if [ $islocal -eq 0 ]; then
if [ $issubmodule -eq 0 ]; then
# If an include path can't be found then usually it will be a real system header,
# however, there are a few (ros related?) files that start with px4... In that
# case just leave the quotes alone ("px4muorb.h" and several <px4/...>).
if [[ $1 =~ ^px4 ]]; then return 0; fi
# While if the include path starts with uORB/topics or topics, and it isn't found,
# then likely we just don't have a build directory. These should be local though.
# Same for the generated files mixer_multirotor.generated.h and build_git_version.h.
if [[ $1 =~ ((/|^)topics/|mixer_multirotor\.generated\.h|build_git_version\.h) ]]; then return 1; fi
fi
return 2;
fi # Submodule or system header.
if [ $issubmodule -eq 0 ]; then return 1; fi # Local.
# Files that are both local and submodule are simply left alone.
# These are (at this moment): "battery.h" "common.h" "Matrix.hpp" "mavlink.h" "protocol.h" "pwm.h" "spi.h" "Vector.hpp".
return 0;
}
# Run the include_path function for each of the files in $TMPDIR/fix_headers_include_paths
echo -n "Determining which headers need to be included with double quotes... "
echo -n > $TMPDIR/fix_headers_quotes
for arg in $(cat "$TMPDIR/fix_headers_include_paths"); do
include_path $arg
localsystem=$?
if [ $localsystem -eq 1 ]; then
echo "$arg \"$arg\"" >> $TMPDIR/fix_headers_quotes
elif [ $localsystem -eq 2 ]; then
echo "$arg <$arg>" >> $TMPDIR/fix_headers_quotes
fi
done
echo "done"
# Truncate the error log.
echo -n > $TMPDIR/fix_headers_ERROR.log
function print_error
{
echo
echo -n " ";
echo "*** $1" | tee -a "$TMPDIR/fix_headers_ERROR.log"
return 1
}
if [ $debug -ne 0 ]; then
# Debug Line.
DL='if (cdbl != NR) { printf "\n%u. \"%s\"", NR, $0; cdbl = NR }'
# Debug Begin.
DB='if (cdbl != NR) { printf "\n%u. \"%s\" ---> ", NR, $0; cdbl = NR } else printf "; "; printf'
# Debug End.
DE=''
else
DL='#'
DB='#'
DE=''
fi
# Error Prefix.
EP='###'
# The main function that is called for each source file.
function fixup_header
{
count=$((count + 1))
echo -n "[$((100 * count / number_of_files))%] Fixing headers of $1... "
# Is this a header?
echo "$1" | sed -e 's/\.in$/;in/;s/.*\././;s/;in$/.in/' | grep -v -E "$HEADER_RE\$" >/dev/null; is_header=$?
if [ $debug -ne 0 ]; then echo "is_header = \"$is_header\""; fi
# Is this C++ source?
echo "$1" | sed -e 's/.*\././' | grep -v -E $CXXSRC_RE >/dev/null; is_cxxsrc=$?
if [ $debug -ne 0 ]; then echo "is_cxxsrc = \"$is_cxxsrc\""; fi
dont_make_cxxsrc=1
if [ $is_cxxsrc -eq 0 -a $is_header -ne 0 ]; then
grep -m 1 -q -E "^[[:space:]]*(#[[:space:]]*include[[:space:]]*<$STDCXX_HEADERS_RE>|(template|namespace|class)(\$|[^[:alnum:]_]))" "$1"
dont_make_cxxsrc=$?
fi
if [ $dont_make_cxxsrc -eq 0 ]; then
is_cxxsrc=1
fi
# Current directory.
curdir=$(dirname "$BASEDIR/$1")
# Parse the file.
#
# Returns an array of line[]'s. The first line is either the first #include, when it is outside
# any #if*...#endif constructs not counting the header guard if the file is a header. For example:
#
# // Anything here except #include lines.
# #include <first_include.h> // <-- first line.
#
# Or, the first #if* that contains the first #include line. For example:
# // Anything here except #include lines.
# #ifndef FOO_H // header guard.
# #define FOO_H
# int global = 1; // Anything unknown.
# #ifdef SOMETHING // <-- first line.
# #if maybe_more
# // anything except #include lines.
# #else
# // anything except #include lines.
# #include <first_include.h>
#
# Subsequent line[]'s mark the beginning of a new block, where we have the following blocks:
# type[] Description
type_include=0 # An #include, outside #if*...#endif constructs except a possible header guard.
type_ifincludeendif=1 # #if*...#endif constructs with #include's.
type_ifendif=2 # #if*...#endif constructs without #include's.
type_decls=3 # __BEGIN_DECLS ... __END_DECLS block.
type_macro=4 # Contiguous #define block.
type_comment=5 #(Multi-line) comments.
type_emptyline=6 # Empty lines.
type_pragmaonce=7 # #pragma once (must be outside any #if*...#endif constructs).
type_end=8 # The first line of the remainder of the file.
#
# However, any block NOT containing one or more #include's (all types > 1) will
# cause subsequent blocks that do not contain #include's to be ignored,
# with as result that those blocks will be treated as contiguous code blocks.
# A comment that is followed by a type that is not to be ignored as such
# is given the type that follows (which itself is then ignored).
# Empty lines are ignored unless they appear directly in front of a type
# that is not to be ignored according to the above rules, where 'previous
# types' then are the types before the empty line.
#
# For example:
#
# > #include <first_header.h> # type_include
# > #include <second_header.h> # type_include
# > # type_emptyline
# > #include <third_header.h> # type_include
# ^ #ifdef FOO # type_ifendif
# | #define BAR 1
# | #endif # (detected here)
# | <-- ignored because:
# v #define BAZ(x) x // Do baz <-- ignored (prev and this type in {type_ifendif, type_macro})
# > # type_emptyline
# ^ // This include is important: # type_comment, but then replaced by type_ifincludeendif
# | <-- ignored because:
# | // more here. <-- ignored same type
# | #ifdef BAR <-- "ignored": type_ifincludeendif, but put 3 lines higher.
# | #include <bar.h>
# v #endif # (detected here)
# > # type_emptyline
# > #include <another.h> # type_include
#
# This script stops parsing at the first not recognized line outside #if*...#endif constructs
# unless no first line was found yet. It does not attempt overly hard to decode rare constructs,
# most notably anything with a leading C comment is not recognized and will thus lead to an abort.
# For example the following lines are not recognized:
#
# /* Some comment */ #include <header.h>
# /* Some comment */ // Another comment.
#
# Lines that have a trailing comment are recognized (by ignoring the comment).
result=$(awk "\
function add(l, t) {
# First add always succeeds.
if (ptr > 0) {
# An empty line is always added, at first, unless the immediate preceding type is an empty line.
if (t == $type_emptyline && type[ptr - 1] == $type_emptyline) {
return; $DB \"ignored because line %d is also empty.\", line[ptr - 1] $DE
}
# A comment is always, added at first, unless the preceding non-empty line type is a comment.
# Same for #include's.
if (t == $type_comment && last_none_type == t) {
$DB \"ignoring because same type as last_none_type (%s)\", type_name[t] $DE
# Gobble up preceding empty lines.
if (type[ptr - 1] == $type_emptyline) {
--ptr; $DB \"ptr = %d; Removed type_emptyline @ line %d\", ptr, line[ptr] $DE
}
return;
}
# {ifendif, macro}'s are collapsed too.
if ((t == $type_ifendif || t == $type_macro) && (last_nonws_type == $type_ifendif || last_nonws_type == $type_macro)) {
# Gobble up preceding comments and empty lines.
while (ptr > 0 && (type[ptr - 1] == $type_emptyline || type[ptr - 1] == $type_comment)) {
--ptr; $DB \"ptr = %d; Removed %s @ line %d\", ptr, type_name[type[ptr]], line[ptr] $DE
}
# ptr > 0 here because the first add is never for an empty line or comment.
last_none_type = type[ptr - 1]; $DB \"last_none_type = %s\", type_name[last_none_type] $DE
return;
}
# type_include and type_pragmaonce and higher are always added.
}
if (t == $type_end) {
# Remove drag.
while(ptr > 0 && line[ptr - 1] >= l) --ptr;
}
# If this type is not an empty line and it was preceded by a comment, then melt it together with that comment.
else if (t != $type_emptyline && last_none_type == $type_comment) {
# In this case t cannot be type_comment.
# Gobble up preceding empty lines.
if (type[ptr - 1] == $type_emptyline) {
--ptr; $DB \"ptr = %d; Removed type_emptyline @ line %d\", ptr, line[ptr] $DE
}
# And replace the comment type.
--ptr; $DB \"ptr = %d; replacing the %s @ line %d\", ptr, type_name[type[ptr]], line[ptr] $DE
l = line[ptr];
}
line[ptr] = l; $DB \"ptr = %d; %s @ line %d\", ptr, type_name[t], l $DE;
type[ptr++] = t;
if (t != $type_emptyline) {
last_none_type = t; $DB \"last_none_type = %s\", type_name[last_none_type] $DE
if (t != $type_comment)
last_nonws_type = t;
}
}
BEGIN {
debug = $debug; # 0: no debug output; non-zero: print debug output.
header = $is_header; # 0: do not look for a header guard; 1: treat first #ifndef as header guard.
in_if = 0; # The number of nested levels inside #if, #ifdef or #ifndef ... #endif constructs.
in_if_base = 0; # 0: no header guard was found (or #pragma once); 1: an #ifndef header guard was found.
in_decl = 0; # 0: not inside a __BEGIN_DECLS ... __END_DECLS block; 1: inside such a block.
found_guard = 0; # 0: no header guard was found; 1: a header guard was found (including #pragma once).
base_if = 0; # The current base-level #if that we are scanning.
drag = 0; # The number of lines since the last certainly relevant line (a base-level #include or a base-level #endif containing one of more #includes).
skipped = 0; # 0: No #include was encountered in the current (base-level) #if block; 1: one or more #include's encountered in the current base-level #if block.
in_comment = 0; # 0: not in a multi-line C comment; 1: in a multi-line C comment.
cdbl = 0; # Current debug line.
error = 0; # 0: no error occured; 1: an error occured.
ptr = 0; # Current pointer into line[] and type[].
found_comment_end = 0; # The last line (possibly the current line) that is/was a multi-line C comment termination.
last_none_type = -1; # The last non-emptyline type that was added.
last_nonws_type = -1; # The last non-whitespace type that was added.
# For debug purposes:
type_name[$type_ifendif] = \"type_ifendif\";
type_name[$type_ifincludeendif] = \"type_ifincludeendif\";
type_name[$type_decls] = \"type_decls\";
type_name[$type_comment] = \"type_comment\";
type_name[$type_emptyline] = \"type_emptyline\";
type_name[$type_include] = \"type_include\";
type_name[$type_macro] = \"type_macro\";
type_name[$type_pragmaonce] = \"type_pragmaonce\";
type_name[$type_end] = \"type_end\";
}
END {
last_line = NR - drag;
add(last_line + 1, $type_end); $DB \"\n\" $DE;
# Print output.
if (error || ptr == 0 || last_line < line[0]) {
print \"error=1\";
exit
}
printf \"lines=\\\"\";
for (i = 0; i < ptr - 1; ++i)
printf \"%d \", line[i];
printf \"%d\\\"; \", line[ptr - 1];
printf \"types=\\\"\";
for (i = 0; i < ptr - 1; ++i)
printf \"%d \", type[i];
printf \"%d\\\"; \", type[ptr - 1];
print \"error=0; first_line=\" line[0] \"; last_line=\" last_line
}
#======================================================================================================
# Handle multi-line C comments.
/$COMMENT_END_RE/ {
if (in_comment) {
in_comment = 0; $DB \"comment end\" $DE;
found_comment_end = NR;
sub(/^([^*]|\*+[^*\/])*\*+\//, \"\") # Remove the tail of the comment.
}
# FALL-THROUGH
}
{
if (in_comment) {
++drag; $DB \"in comment; drag = %d\", drag $DE;
next
}
found_comment_begin = 0;
# FALL-THROUGH
}
/$COMMENT_BEGIN_RE/ {
in_comment = 1; $DB \"comment begin\" $DE;
found_comment_begin = 1;
sub(/\/\*([^*]|\*+($|[^*\/]))*$/, \"\") # Remove the head of the comment so that we'll recognize this as an empty line if it is.
# FALL-THROUGH
}
#======================================================================================================
# Detect and handle header guard.
/$PRAGMA_ONCE_RE/ {
++drag; $DB \"drag = %d\", drag $DE;
if (header && found_guard == 0 && in_if == 0) {
found_guard = NR; $DB \"found_guard = %d\", found_guard $DE;
if (ptr > 0)
add(NR, $type_pragmaonce)
next
}
print \"\\n$EP $1:\" NR \": unexpected #pragma once\";
error = 1;
exit
}
/^#ifndef / {
if (ptr == 0 && header && found_guard == 0 && in_if == 0) {
found_guard = NR; $DB \"found_guard = %d\", found_guard $DE;
in_if = 1; $DB \"in_if = %d\", in_if $DE;
in_if_base = 1; $DB \"in_if_base = %d\", in_if_base $DE;
next
}
# FALL-THROUGH
}
#======================================================================================================
# Detect and handle __BEGIN_DECLS ... __END_DECLS blocks.
/^[[:space:]]*__BEGIN_DECLS/ {
++drag; $DB \"drag = %d\", drag $DE;
if (in_decl == 0) {
in_decl = 1; $DB \"in_decl = 1\" $DE
add(NR, $type_decls);
next
}
print \"\\n$EP $1:\" NR \": Nested __BEGIN_DECLS!\";
error = 1;
exit
}
/^[[:space:]]*__END_DECLS/ {
++drag; $DB \"drag = %d\", drag $DE;
if (in_decl == 1) {
in_decl = 0; $DB \"in_decl = 0\" $DE
if (skipped) {
drag = 0;
} else if (ptr == 1) {
ptr = 0; $DB \"erase DECLS block\" $DE
last_none_type = -1;
}
next
}
print \"\\n$EP $1:\" NR \": __END_DECLS without matching __BEGIN_DECLS!\";
error = 1;
exit
}
#======================================================================================================
# Detect and handle #if ... #endif blocks.
/$IF_RE/ {
++drag; $DB \"drag = %d\", drag $DE;
if (in_if == in_if_base && in_decl == 0) {
skipped = 0; $DB \"skipped = 0\" $DE;
base_if = NR; $DB \"base_if = %d\", NR $DE;
}
++in_if; $DB \"in_if = %d\", in_if $DE;
next
}
/$ENDIF_RE/ {
--in_if; $DB \"in_if = %d\", in_if $DE;
if (in_if < 0) {
print \"\\n$EP $1:\" NR \": #endif without matching #if!\";
error = 1;
exit
}
++drag;
if (in_if == in_if_base && in_decl == 0) {
if (skipped) {
drag = 0;
add(base_if, $type_ifincludeendif);
} else if (ptr > 0)
add(base_if, $type_ifendif);
} $DB \"drag = %d\", drag $DE;
# Left header guard?
if (in_if < in_if_base) { $DB \"left header guard:\" $DE;
# assert(in_if == 0 && in_if_base == 1 && header && found_guard)
exit
}
next
}
#======================================================================================================
# Handle #include lines.
/$INCLUDE_RE/ {
if (!/\"(\.\/)?mavlink_msg/) {
# If we're inside a __BEGIN_DECLS ... __END_DECLS block then only certain headers may be included.
hname = gensub(/^[[:space:]]*#[[:space:]]*include[[:space:]]*[<\"]([^>\"]*)[>\"].*/, \"\\\1\", \"1\");
cpp_safe = !(hname ~ /$UNSAFE_HEADERS_RE/);
$DB \"hname = \\\"\" hname \"\\\"; cpp_safe = \" cpp_safe \"; in_decl = \" in_decl \"; is_cxxsrc = $is_cxxsrc\" $DE
if (in_decl && cpp_safe) {
print \"\\n$EP $1:\" NR \": including \" hname \" inside a __BEGIN_DECLS ... __END_DECLS block.\";
error = 1;
exit
} else if (!in_decl && !cpp_safe && $is_cxxsrc) {
print \"\\n$EP $1:\" NR \": including \" hname \" outside a __BEGIN_DECLS ... __END_DECLS block!\";
error = 1;
exit
}
if (in_if > in_if_base || in_decl) {
skipped = 1; $DB \"skipped = 1\" $DE;
} else {
drag = 0; $DB \"drag = 0\" $DE;
add(NR, $type_include); $DB \"first_line = %d\", NR $DE;
}
next
}
}
#======================================================================================================
# Ignore #define's, empty lines and lines with just comments.
/$DEFINE_RE/ {
++drag; $DB \"drag = %d\", drag $DE;
if (ptr > 0 && in_if == in_if_base && in_decl == 0) {
add(NR, $type_macro);
}
next
}
/$EMPTY_LINE_RE/ {
++drag; $DB \"drag = %d\", drag $DE;
if (ptr > 0 && in_if == in_if_base && in_decl == 0) {
if (found_comment_begin)
add(NR, $type_comment);
else if (found_comment_end != NR)
add(NR, $type_emptyline);
}
next
}
/$COMMENT_LINE_RE/ {
++drag; $DB \"drag = %d\", drag $DE;
if (ptr > 0 && in_if == in_if_base && in_decl == 0 && type[ptr - 1] != $type_comment) {
add(NR, $type_comment);
}
next
}
#======================================================================================================
# Handle everything else (unrecognized lines).
{
++drag; $DB \"unknown; drag = %d\", drag $DE;
if (ptr > 0 && in_if <= in_if_base && in_decl == 0) {
exit
}
}
" "$BASEDIR/$1")
# Decode the result.
vars=$(echo "$result" | tail -n 1)
error_msg=$(echo "$result" | grep "^$EP " | sed -e 's/^....//')
if [ $debug -ne 0 ]; then
len=$(echo "$result" | wc --lines)
echo "$result" | head -n $((len - 1)) | grep -v "^$EP " # Debug messages
echo "vars: $vars"
fi
# Evaluate the last line printed in END.
error=1; eval $vars
test -z "$error_msg" || print_error "$error_msg" || return
test $error -eq 0 -a $first_line -gt 0 || print_error "FAILED to find an #include in $1?!" || return
test $last_line -ge $first_line || print_error "FAILED to find a sensible last line in $1?!" || return
# Calculate the number of lines starting from the current line.
# Use sed to count lines, because wc --lines doesn't report the last line when that doesn't end on a new-line, contrary to the fact that tail treats such lines as lines.
total_lines=$(sed -n '$=' "$BASEDIR/$1")
if [ $debug -ne 0 ]; then echo "total_lines = \"$total_lines\""; fi
# Edit the first_line...last_line block.
# Header files are ordered as follows (lowest value first):
cat_winsock=0; # Winsock2.h
cat_posix_sys=1; # posix_sys.h or one of the px4_ headers that include it.
cat_px4=2; # Other px4_*.h
cat_local=3; # "*.h"
cat_cxx=4; # <std c++ header>, ie <iostream>
cat_c=5; # <c std c++ header>, ie <cstdio>
cat_system=6; # <*.h>
head -n $last_line "$BASEDIR/$1" | tail -n $((last_line - first_line + 1)) | awk "
function sort_by_type_line_header_type_hname(blk2, v2, blk1, v1) {
# Return true if blk1 comes before blk2.
# Move type_include before the rest. Keep the same line order for the rest.
return (type[blk2] != $type_include && (type[blk1] == $type_include || line[blk1] < line[blk2])) ||
(type[blk2] == $type_include && type[blk1] == $type_include &&
# If both are include's then put include with a lower header_type first; sort alphabetically for the same header type.
(header_type[blk1] < header_type[blk2] || (header_type[blk1] == header_type[blk2] && hname[blk1] < hname[blk2])));
}
BEGIN {
first_line = $first_line;
split(\"$lines\", line);
split(\"$types\", type);
i = 0;
do {
line[++i] -= first_line - 1;
} while(type[i] != $type_end)
for(b = 0; b < i; ++b) header_type[b] = 100;
blk = 1;
n = 0;
is_cxxsrc = $is_cxxsrc;
# px4_posix.h includes px4_defines.h includes px4_log.h includes posix_sys.h which must be the first header included.
sys_val[\"px4_posix.h\"] = 1;
sys_val[\"px4_defines.h\"] = 2;
sys_val[\"px4_log.h\"] = 3;
sys_val[\"posix_sys.h\"] = 4;
saw_sys_val = 5; # Didn't see any of the above; otherwise the lowest value of the header seen.
for(b = 0; b < i; ++b) saw_sys[b] = saw_sys_val;
}
END {
l = asorti(txt, k, \"sort_by_type_line_header_type_hname\");
for (b = 1; b <= l; ++b) {
if (type[k[b]] == $type_include && header_type[k[b]] == $cat_posix_sys && saw_sys[k[b]] > saw_sys_val) continue;
len = length(txt[k[b]]);
for (n = 0; n < len; ++n) print txt[k[b]][n];
if (b < l && type[k[b]] == $type_include && type[k[b+1]] != $type_emptyline &&
(type[k[b+1]] != $type_include || (header_type[k[b]] != header_type[k[b+1]] && header_type[k[b+1]] != $cat_px4))) {
printf \"\n\";
}
}
}
{
if (NR == line[blk + 1]) {
++blk;
n = 0;
}
}
/$INCLUDE_RE/ {
# Don't use double quotes around standard header names.
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)\\\"$STDC_HEADERS_RE\\.h\\\"/, \"\\\1<\\\2.h>\", \"1\");
if (is_cxxsrc) {
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)\\\"$STDCXX_HEADERS_RE\\\"/, \"\\\1<\\\2>\", \"1\");
# Change deprecated C header names to standard C++ header names in C++ source files.
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*<)$STDC_HEADERS_RE\\.h>/, \"\\\1c\\\2>\", \"1\");
}
# Don't include \"./foo.h\", that is implied, so just include \"foo.h\".
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*\\\")\.\//, \"\\\1\", \"1\");
# Extract the header filename.
hname[blk] = gensub(/^[[:space:]]*#[[:space:]]*include[[:space:]]*[<\"]([^>\"]*)[>\"].*/, \"\\\1\", \"1\");
# If the header exists in the directory of the including file, then it is a local header.
command = sprintf(\"test -e %s/%s\", \"$curdir\", hname[blk]);
if (system(command) == 0) {
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)[\"<]([^\">]*)[\">]/, \"\\\1\\\"\\\2\\\"\", \"1\");
} else {
# Do we know if this is a local file, or a submodule / system header?
# The grep reg.exp needs \\ (for backslah) and \1 for back reference, thus: \\\1.
# However we print the grep command using sprintf, so each backslash needs to be escaped once more: \\\\\\1.
# Finally, this is a bash string and we need to escape each backslash once more to pass it corrently to awk, hence we need twelve backslahes:
command = sprintf(\"grep '^%s ' '%s' 2>/dev/null\", gensub(/([.+])/, \"\\\\\\\\\\\\1\", \"g\", hname[blk]), \"$TMPDIR/fix_headers_quotes\");
ret = command | getline result;
if (ret != 0) {
result = substr(result, index(result, \" \") + 1);
\$0 = gensub(/^([[:space:]]*#[[:space:]]*include[[:space:]]*)[\"<][^\">]*[\">]/, \"\\\1\" result, \"1\");
}
}
# Categorise the header.
if (hname[blk] == \"Winsock2.h\") {
if (header_type[blk] > $cat_winsock)
header_type[blk] = $cat_winsock;
}
else if (hname[blk] in sys_val) {
if (header_type[blk] > $cat_posix_sys)
header_type[blk] = $cat_posix_sys;
# posix_sys.h is sometimes included within #ifdef __PX4_POSIX ... #endif. The other headers should not be conditional.
if ((hname[blk] == \"posix_sys.h\" || type[blk] == $type_include)) {
type[blk] = $type_include; # Treat #ifdef __PX4_POSIX #include \"posix_sys.h\" #endif as an include for sorting purposes.
saw_sys[blk] = sys_val[hname[blk]]; # There will be only one include (header name) for this block.
if (sys_val[hname[blk]] < saw_sys_val)
saw_sys_val = sys_val[hname[blk]];
}
# Use double quotes for these headers.
\$0 = gensub(/<([[:alnum:]_\/.]*)>/, \"\\\"\\\1\\\"\", \"1\");
}
else if (hname[blk] ~ /^(platforms\/px4_|px4_)/) {
if (header_type[blk] > $cat_px4)
header_type[blk] = $cat_px4;
# Use double quotes for these headers.
\$0 = gensub(/<([[:alnum:]_\/.]*)>/, \"\\\"\\\1\\\"\", \"1\");
}
else if (\$0 ~ /^[[:space:]]*#[[:space:]]*include[[:space:]]*\"/) {
if (header_type[blk] > $cat_local)
header_type[blk] = $cat_local;
}
else if (hname[blk] ~ /^$STDCXX_HEADERS_RE\$/) {
if (header_type[blk] > $cat_cxx)
header_type[blk] = $cat_cxx;
}
else if (hname[blk] ~ /^c$STDC_HEADERS_RE\$/) {
if (header_type[blk] > $cat_c)
header_type[blk] = $cat_c;
}
else if (hname[blk] ~ /^$STDC_HEADERS_RE\.h\$/) {
if (header_type[blk] > $cat_system)
header_type[blk] = $cat_system;
}
}
{
# Remove empty lines before #include's.
if (type[blk] == $type_include) {
for (i = 1; blk > i && type[blk - i] == $type_emptyline; ++i)
delete txt[blk - i]
}
txt[blk][n++] = \$0;
}
" > $TMPDIR/fix_headers_current_block
# Construct a new file in TMPDIR.
head -n $((first_line - 1)) "$BASEDIR/$1" > $TMPDIR/fix_headers_current_file
# Append the editted block.
cat $TMPDIR/fix_headers_current_block >> $TMPDIR/fix_headers_current_file
# Append the rest.
tail -n $((total_lines - last_line)) "$BASEDIR/$1" >> $TMPDIR/fix_headers_current_file
# Compare original with result.
if cmp --quiet "$BASEDIR/$1" $TMPDIR/fix_headers_current_file; then
echo "No change"
else
echo "Fixed lines $first_line-$last_line"
mv $TMPDIR/fix_headers_current_file "$BASEDIR/$1" || fatal "Failed to move $TMPDIR/fix_headers_current_file to $BASEDIR/$1 !?!"
fi
}
if [ $non_option_arguments -ne 0 ]; then
fixup_header $1
exit
fi
# Run the fixup function for each of the files in $TMPDIR/fix_headers_sources_with_includes.
# Strip BASEDIR because we don't know how long that is and it might too much for bash.
for arg in $(cat "$TMPDIR/fix_headers_sources_with_includes" | cut -c $striplen-); do
fixup_header $arg
done
# Clean up.
if [ $debug -eq 0 -o $# -eq 0 ]; then
rm "$TMPDIR/fix_headers_sources" "$TMPDIR/fix_headers_sources_with_includes" "$TMPDIR/fix_headers_SUBMODULE_HEADERS" "$TMPDIR/fix_headers_HEADERS" \
"$TMPDIR/fix_headers_include_paths" "$TMPDIR/fix_headers_quotes" "$TMPDIR/fix_headers_current_block"
fi
# Print all error messages again at the end.
if [ -s "$TMPDIR/fix_headers_ERROR.log" ]; then
echo "$0 finished with errors:"
cat "$TMPDIR/fix_headers_ERROR.log"
else
echo "SUCCESS"
rm "$TMPDIR/fix_headers_ERROR.log"
fi
+34 -32
View File
@@ -3,6 +3,7 @@
import glob
import os
import sys
import re
# This script is run from Build/<target>_default.build/$(PX4_BASE)/Firmware/src/systemcmds/topic_listener
@@ -21,37 +22,39 @@ for index,m in enumerate(raw_messages):
temp_list = []
f = open(m,'r')
for line in f.readlines():
if ('float32[' in line.split(' ')[0]):
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
temp_list.append(("float_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
elif ('float64[' in line.split(' ')[0]):
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
temp_list.append(("double_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
elif ('uint64[' in line.split(' ')[0]):
num_floats = int(line.split(" ")[0].split("[")[1].split("]")[0])
temp_list.append(("uint64_array",line.split(' ')[1].split('\t')[0].split('\n')[0],num_floats))
elif(line.split(' ')[0] == "float32"):
temp_list.append(("float",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "float64"):
temp_list.append(("double",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "uint64") and len(line.split('=')) == 1:
temp_list.append(("uint64",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "uint32") and len(line.split('=')) == 1:
temp_list.append(("uint32",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "uint16") and len(line.split('=')) == 1:
temp_list.append(("uint16",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "int64") and len(line.split('=')) == 1:
temp_list.append(("int64",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "int32") and len(line.split('=')) == 1:
temp_list.append(("int32",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif(line.split(' ')[0] == "int16") and len(line.split('=')) == 1:
temp_list.append(("int16",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif (line.split(' ')[0] == "bool") and len(line.split('=')) == 1:
temp_list.append(("bool",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif (line.split(' ')[0] == "uint8") and len(line.split('=')) == 1:
temp_list.append(("uint8",line.split(' ')[1].split('\t')[0].split('\n')[0]))
elif (line.split(' ')[0] == "int8") and len(line.split('=')) == 1:
temp_list.append(("int8",line.split(' ')[1].split('\t')[0].split('\n')[0]))
items = re.split('\s+', line.strip())
if ('float32[' in items[0]):
num_floats = int(items[0].split("[")[1].split("]")[0])
temp_list.append(("float_array",items[1],num_floats))
elif ('float64[' in items[0]):
num_floats = int(items[0].split("[")[1].split("]")[0])
temp_list.append(("double_array",items[1],num_floats))
elif ('uint64[' in items[0]):
num_floats = int(items[0].split("[")[1].split("]")[0])
temp_list.append(("uint64_array",items[1],num_floats))
elif(items[0] == "float32"):
temp_list.append(("float",items[1]))
elif(items[0] == "float64"):
temp_list.append(("double",items[1]))
elif(items[0] == "uint64") and len(line.split('=')) == 1:
temp_list.append(("uint64",items[1]))
elif(items[0] == "uint32") and len(line.split('=')) == 1:
temp_list.append(("uint32",items[1]))
elif(items[0] == "uint16") and len(line.split('=')) == 1:
temp_list.append(("uint16",items[1]))
elif(items[0] == "int64") and len(line.split('=')) == 1:
temp_list.append(("int64",items[1]))
elif(items[0] == "int32") and len(line.split('=')) == 1:
temp_list.append(("int32",items[1]))
elif(items[0] == "int16") and len(line.split('=')) == 1:
temp_list.append(("int16",items[1]))
elif (items[0] == "bool") and len(line.split('=')) == 1:
temp_list.append(("bool",items[1]))
elif (items[0] == "uint8") and len(line.split('=')) == 1:
temp_list.append(("uint8",items[1]))
elif (items[0] == "int8") and len(line.split('=')) == 1:
temp_list.append(("int8",items[1]))
f.close()
(m_head, m_tail) = os.path.split(m)
@@ -115,7 +118,6 @@ print("""
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#ifndef PRIu64
+39
View File
@@ -0,0 +1,39 @@
#! /bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR/jMAVSim"
udp_port=14560
extra_args=
baudrate=921600
device=
while getopts ":b:d:p:q" opt; do
case $opt in
b)
baudrate=$OPTARG
;;
d)
device="$OPTARG"
;;
p)
udp_port=$OPTARG
;;
q)
extra_args="$extra_args -qgc"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
if [ "$device" == "" ]; then
device="-udp 127.0.0.1:$udp_port"
else
device="-serial $device $baudrate"
fi
ant create_run_jar copy_res
cd out/production
java -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args
+220
View File
@@ -0,0 +1,220 @@
#!/usr/bin/env python
"""
Open a shell over MAVLink.
@author: Beat Kueng (beat-kueng@gmx.net)
"""
from __future__ import print_function
import sys, select
import termios
from timeit import default_timer as timer
try:
from pymavlink import mavutil
import serial
except:
print("Failed to import pymavlink.")
print("You may need to install it with 'pip install pymavlink pyserial'")
print("")
raise
from argparse import ArgumentParser
class MavlinkSerialPort():
'''an object that looks like a serial port, but
transmits using mavlink SERIAL_CONTROL packets'''
def __init__(self, portname, baudrate, devnum=0, debug=0):
self.baudrate = 0
self._debug = debug
self.buf = ''
self.port = devnum
self.debug("Connecting with MAVLink to %s ..." % portname)
self.mav = mavutil.mavlink_connection(portname, autoreconnect=True, baud=baudrate)
self.mav.wait_heartbeat()
self.debug("HEARTBEAT OK\n")
self.debug("Locked serial device\n")
def debug(self, s, level=1):
'''write some debug text'''
if self._debug >= level:
print(s)
def write(self, b):
'''write some bytes'''
self.debug("sending '%s' (0x%02x) of len %u\n" % (b, ord(b[0]), len(b)), 2)
while len(b) > 0:
n = len(b)
if n > 70:
n = 70
buf = [ord(x) for x in b[:n]]
buf.extend([0]*(70-len(buf)))
self.mav.mav.serial_control_send(self.port,
mavutil.mavlink.SERIAL_CONTROL_FLAG_EXCLUSIVE |
mavutil.mavlink.SERIAL_CONTROL_FLAG_RESPOND,
0,
0,
n,
buf)
b = b[n:]
def close(self):
self.mav.mav.serial_control_send(self.port, 0, 0, 0, 0, [0]*70)
def _recv(self):
'''read some bytes into self.buf'''
m = self.mav.recv_match(condition='SERIAL_CONTROL.count!=0',
type='SERIAL_CONTROL', blocking=True,
timeout=0.03)
if m is not None:
if self._debug > 2:
print(m)
data = m.data[:m.count]
self.buf += ''.join(str(chr(x)) for x in data)
def read(self, n):
'''read some bytes'''
if len(self.buf) == 0:
self._recv()
if len(self.buf) > 0:
if n > len(self.buf):
n = len(self.buf)
ret = self.buf[:n]
self.buf = self.buf[n:]
if self._debug >= 2:
for b in ret:
self.debug("read 0x%x" % ord(b), 2)
return ret
return ''
def main():
parser = ArgumentParser(description=__doc__)
parser.add_argument('port', metavar='PORT', nargs='?', default = None,
help='Mavlink port name: serial: DEVICE[,BAUD], udp: IP:PORT, tcp: tcp:IP:PORT. Eg: \
/dev/ttyUSB0 or 0.0.0.0:14550. Auto-detect serial if not given.')
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int,
help="Mavlink port baud rate (default=57600)", default=57600)
args = parser.parse_args()
if args.port == None:
if sys.platform == "darwin":
args.port = "/dev/tty.usbmodem1"
else:
serial_list = mavutil.auto_detect_serial(preferred_list=['*FTDI*',
"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
if len(serial_list) == 0:
print("Error: no serial connection found")
return
if len(serial_list) > 1:
print('Auto-detected serial ports are:')
for port in serial_list:
print(" {:}".format(port))
print('Using port {:}'.format(serial_list[0]))
args.port = serial_list[0].device
print("Connecting to MAVLINK...")
mav_serialport = MavlinkSerialPort(args.port, args.baudrate, devnum=10)
mav_serialport.write('\n') # make sure the shell is started
# setup the console, so we can read one char at a time
fd_in = sys.stdin.fileno()
old_attr = termios.tcgetattr(fd_in)
new_attr = termios.tcgetattr(fd_in)
new_attr[3] = new_attr[3] & ~termios.ECHO # lflags
new_attr[3] = new_attr[3] & ~termios.ICANON
try:
termios.tcsetattr(fd_in, termios.TCSANOW, new_attr)
cur_line = ''
command_history = []
cur_history_index = 0
def erase_last_n_chars(N):
if N == 0: return
CURSOR_BACK_N = '\x1b['+str(N)+'D'
ERASE_END_LINE = '\x1b[K'
sys.stdout.write(CURSOR_BACK_N + ERASE_END_LINE)
next_heartbeat_time = timer()
while True:
while True:
i, o, e = select.select([sys.stdin], [], [], 0)
if not i: break
ch = sys.stdin.read(1)
# provide a simple shell with command history
if ch == '\n':
if len(cur_line) > 0:
# erase current text (mavlink shell will echo it as well)
erase_last_n_chars(len(cur_line))
# add to history
if len(command_history) == 0 or command_history[-1] != cur_line:
command_history.append(cur_line)
if len(command_history) > 50:
del command_history[0]
cur_history_index = len(command_history)
mav_serialport.write(cur_line+'\n')
cur_line = ''
elif ord(ch) == 127: # backslash
if len(cur_line) > 0:
erase_last_n_chars(1)
cur_line = cur_line[:-1]
sys.stdout.write(ch)
elif ord(ch) == 27:
ch = sys.stdin.read(1) # skip one
ch = sys.stdin.read(1)
if ch == 'A': # arrow up
if cur_history_index > 0:
cur_history_index -= 1
elif ch == 'B': # arrow down
if cur_history_index < len(command_history):
cur_history_index += 1
# TODO: else: support line editing
erase_last_n_chars(len(cur_line))
if cur_history_index == len(command_history):
cur_line = ''
else:
cur_line = command_history[cur_history_index]
sys.stdout.write(cur_line)
elif ord(ch) > 3:
cur_line += ch
sys.stdout.write(ch)
sys.stdout.flush()
data = mav_serialport.read(4096)
if data and len(data) > 0:
sys.stdout.write(data)
sys.stdout.flush()
# handle heartbeat sending
heartbeat_time = timer()
if heartbeat_time > next_heartbeat_time:
mav_serialport.mav.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,
mavutil.mavlink.MAV_AUTOPILOT_GENERIC, 0, 0, 0)
next_heartbeat_time = heartbeat_time + 1
except serial.serialutil.SerialException as e:
print(e)
except KeyboardInterrupt:
mav_serialport.close()
finally:
termios.tcsetattr(fd_in, termios.TCSADRAIN, old_attr)
if __name__ == '__main__':
main()
+268
View File
@@ -0,0 +1,268 @@
#!/usr/bin/env python
"""
Stream ULog data over MAVLink.
@author: Beat Kueng (beat-kueng@gmx.net)
"""
from __future__ import print_function
import sys, select, os
import datetime
from timeit import default_timer as timer
os.environ['MAVLINK20'] = '1' # The commands require mavlink 2
try:
from pymavlink import mavutil
except:
print("Failed to import pymavlink.")
print("You may need to install it with 'pip install pymavlink pyserial'")
print("")
raise
from argparse import ArgumentParser
class MavlinkLogStreaming():
'''Streams log data via MAVLink.
Assumptions:
- the sender only sends one acked message at a time
- the data is in the ULog format '''
def __init__(self, portname, baudrate, output_filename, debug=0):
self.baudrate = 0
self._debug = debug
self.buf = ''
self.debug("Connecting with MAVLink to %s ..." % portname)
self.mav = mavutil.mavlink_connection(portname, autoreconnect=True, baud=baudrate)
self.mav.wait_heartbeat()
self.debug("HEARTBEAT OK\n")
self.debug("Locked serial device\n")
self.got_ulog_header = False
self.got_header_section = False
self.ulog_message = []
self.file = open(output_filename,'wb')
self.start_time = timer()
self.last_sequence = -1
self.logging_started = False
self.num_dropouts = 0
self.target_component = 1
def debug(self, s, level=1):
'''write some debug text'''
if self._debug >= level:
print(s)
def start_log(self):
self.mav.mav.command_long_send(self.mav.target_system,
self.target_component,
mavutil.mavlink.MAV_CMD_LOGGING_START, 0,
0, 0, 0, 0, 0, 0, 0)
def stop_log(self):
self.mav.mav.command_long_send(self.mav.target_system,
self.target_component,
mavutil.mavlink.MAV_CMD_LOGGING_STOP, 0,
0, 0, 0, 0, 0, 0, 0)
def read_messages(self):
''' main loop reading messages '''
measure_time_start = timer()
measured_data = 0
next_heartbeat_time = timer()
while True:
# handle heartbeat sending
heartbeat_time = timer()
if heartbeat_time > next_heartbeat_time:
self.debug('sending heartbeat')
self.mav.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,
mavutil.mavlink.MAV_AUTOPILOT_GENERIC, 0, 0, 0)
next_heartbeat_time = heartbeat_time + 1
m, first_msg_start, num_drops = self.read_message()
if m is not None:
self.process_streamed_ulog_data(m, first_msg_start, num_drops)
# status output
if self.logging_started:
measured_data += len(m)
measure_time_cur = timer()
dt = measure_time_cur - measure_time_start
if dt > 1:
sys.stdout.write('\rData Rate: {:0.1f} KB/s Drops: {:} \033[K'.format(
measured_data / dt / 1024, self.num_dropouts))
sys.stdout.flush()
measure_time_start = measure_time_cur
measured_data = 0
if not self.logging_started and timer()-self.start_time > 4:
raise Exception('Start timed out. Is the logger running in MAVLink mode?')
def read_message(self):
''' read a single mavlink message, handle ACK & return a tuple of (data, first
message start, num dropouts) '''
m = self.mav.recv_match(type=['LOGGING_DATA_ACKED',
'LOGGING_DATA', 'COMMAND_ACK'], blocking=True,
timeout=0.05)
if m is not None:
self.debug(m, 3)
if m.get_type() == 'COMMAND_ACK':
if m.command == mavutil.mavlink.MAV_CMD_LOGGING_START and \
not self.got_header_section:
if m.result == 0:
self.logging_started = True
print('Logging started. Waiting for Header...')
else:
raise Exception('Logging start failed', m.result)
return None, 0, 0
# m is either 'LOGGING_DATA_ACKED' or 'LOGGING_DATA':
is_newer, num_drops = self.check_sequence(m.sequence)
# return an ack, even we already sent it for the same sequence,
# because the ack could have been dropped
if m.get_type() == 'LOGGING_DATA_ACKED':
self.mav.mav.logging_ack_send(self.mav.target_system,
self.target_component, m.sequence)
if is_newer:
if num_drops > 0:
self.num_dropouts += num_drops
if m.get_type() == 'LOGGING_DATA':
if not self.got_header_section:
print('Header received in {:0.2f}s'.format(timer()-self.start_time))
self.logging_started = True
self.got_header_section = True
self.last_sequence = m.sequence
return m.data[:m.length], m.first_message_offset, num_drops
else:
self.debug('dup/reordered message '+str(m.sequence))
return None, 0, 0
def check_sequence(self, seq):
''' check if a sequence is newer than the previously received one & if
there were dropped messages between the last and this '''
if self.last_sequence == -1:
return True, 0
if seq == self.last_sequence: # duplicate
return False, 0
if seq > self.last_sequence:
# account for wrap-arounds, sequence is 2 bytes
if seq - self.last_sequence > (1<<15): # assume reordered
return False, 0
return True, seq - self.last_sequence - 1
else:
if self.last_sequence - seq > (1<<15):
return True, (1<<16) - self.last_sequence - 1 + seq
return False, 0
def process_streamed_ulog_data(self, data, first_msg_start, num_drops):
''' write streamed data to a file '''
if not self.got_ulog_header: # the first 16 bytes need special treatment
if len(data) < 16: # that's never the case anyway
raise Exception('first received message too short')
self.file.write(bytearray(data[0:16]))
data = data[16:]
self.got_ulog_header = True
if self.got_header_section and num_drops > 0:
if num_drops > 25: num_drops = 25
# write a dropout message. We don't really know the actual duration,
# so just use the number of drops * 10 ms
self.file.write(bytearray([ 2, 0, 79, num_drops*10, 0 ]))
if num_drops > 0:
self.write_ulog_messages(self.ulog_message)
self.ulog_message = []
if first_msg_start == 255:
return # no useful information in this message: drop it
data = data[first_msg_start:]
first_msg_start = 0
if first_msg_start == 255 and len(self.ulog_message) > 0:
self.ulog_message.extend(data)
return
if len(self.ulog_message) > 0:
self.file.write(bytearray(self.ulog_message + data[:first_msg_start]))
self.ulog_message = []
data = self.write_ulog_messages(data[first_msg_start:])
self.ulog_message = data # store the rest for the next message
def write_ulog_messages(self, data):
''' write ulog data w/o integrity checking, assuming data starts with a
valid ulog message. returns the remaining data at the end. '''
while len(data) > 2:
message_length = data[0] + data[1] * 256 + 3 # 3=ULog msg header
if message_length > len(data):
break
self.file.write(bytearray(data[:message_length]))
data = data[message_length:]
return data
def main():
parser = ArgumentParser(description=__doc__)
parser.add_argument('port', metavar='PORT', nargs='?', default = None,
help='Mavlink port name: serial: DEVICE[,BAUD], udp: IP:PORT, tcp: tcp:IP:PORT. Eg: \
/dev/ttyUSB0 or 0.0.0.0:14550. Auto-detect serial if not given.')
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int,
help="Mavlink port baud rate (default=115200)", default=115200)
parser.add_argument("--output", "-o", dest="output", default = '.',
help="output file or directory (default=CWD)")
args = parser.parse_args()
if os.path.isdir(args.output):
filename = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S.ulg")
filename = os.path.join(args.output, filename)
else:
filename = args.output
print('Output file name: {:}'.format(filename))
if args.port == None:
serial_list = mavutil.auto_detect_serial(preferred_list=['*FTDI*',
"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*'])
if len(serial_list) == 0:
print("Error: no serial connection found")
return
if len(serial_list) > 1:
print('Auto-detected serial ports are:')
for port in serial_list:
print(" {:}".format(port))
print('Using port {:}'.format(serial_list[0]))
args.port = serial_list[0].device
print("Connecting to MAVLINK...")
mav_log_streaming = MavlinkLogStreaming(args.port, args.baudrate, filename)
try:
print('Starting log...')
mav_log_streaming.start_log()
mav_log_streaming.read_messages()
print('Stopping log')
mav_log_streaming.stop_log()
except KeyboardInterrupt:
print('Stopping log')
mav_log_streaming.stop_log()
if __name__ == '__main__':
main()
-148
View File
@@ -1,148 +0,0 @@
#!/usr/bin/env python
############################################################################
#
# Copyright (C) 2015 Mark Charlebois. 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.
#
############################################################################
import glob
builtins = glob.glob("builtin_commands/COMMAND*")
apps = []
for f in builtins:
apps.append(f.split(".")[-1].split("_main")[0])
print("""
#include <string>
#include <map>
#define __EXPORT
#include <px4_tasks.h>
#include <px4_posix.h>
#include <stdlib.h>
using namespace std;
extern void px4_show_devices(void);
extern "C" {
""")
for app in apps:
print("extern int "+app+"_main(int argc, char *argv[]);")
print("""
static int shutdown_main(int argc, char *argv[]);
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[]);
}
static map<string,px4_main_t> app_map(void);
static map<string,px4_main_t> app_map(void)
{
static map<string,px4_main_t> apps;
""")
for app in apps:
print('\tapps["'+app+'"] = '+app+'_main;')
print('\tapps["shutdown"] = shutdown_main;')
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("""
return apps;
}
map<string,px4_main_t> apps = app_map();
static void list_builtins(void)
{
cout << "Builtin Commands:" << endl;
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
cout << '\t' << it->first << endl;
}
static int shutdown_main(int argc, char *argv[])
{
cout.flush();
cout << endl << "Shutting down" << endl;
cout.flush();
exit(0);
}
static int list_tasks_main(int argc, char *argv[])
{
px4_show_tasks();
return 0;
}
static int list_devices_main(int argc, char *argv[])
{
px4_show_devices();
return 0;
}
static int list_topics_main(int argc, char *argv[])
{
px4_show_topics();
return 0;
}
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) {
cout << "Usage: sleep <seconds>" << endl;
return 1;
}
sleep(atoi(argv[1]));
return 0;
}
static int usleep_main(int argc, char *argv[])
{
if (argc != 2) {
cout << "Usage: usleep <microseconds>" << endl;
return 1;
}
usleep(atoi(argv[1]));
return 0;
}
""")
+54 -16
View File
@@ -1,26 +1,64 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# If you want to allow non-ascii filenames set this variable to true.
allownonascii=$(git config hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
CHANGED_FILES=`git diff --cached --name-only --diff-filter=ACM $against | grep '\.c\|\.cpp\|\.h\|\.hpp'`
FAILED=0
if [ ! -z "$CHANGED_FILES" -a "$CHANGED_FILES" != " " ]; then
for FILE in $CHANGED_FILES; do
./Tools/fix_code_style.sh --quiet < $FILE > $FILE.pretty
diff -u $FILE $FILE.pretty || FAILED=1
rm -f $FILE.pretty
if [ $FAILED -ne 0 ]; then
echo "There are code formatting errors. Please fix them by running ./Tools/fix_code_style.sh $FILE"
exit $FAILED
fi
done
# Cross platform projects tend to avoid non-ascii filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
echo "Error: Attempt to add a non-ascii file name."
echo
echo "This can cause problems if you want to work"
echo "with people on other platforms."
echo
echo "To be portable it is advisable to rename the file ..."
echo
echo "If you know what you are doing you can disable this"
echo "check using:"
echo
echo " git config hooks.allownonascii true"
echo
exit 1
fi
exit 0
# If there are whitespace errors, print the offending file names and fail.
git diff-index --check --cached $against --
if [ $? -ne 0 ]
then
exit 1
fi
# Check for code style, only in changed files
for i in `git diff --cached --name-only --diff-filter=ACM`
do
./Tools/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/check_code_style.sh %
if [ $? -ne 0 ]
then
exit 1
fi
done

Some files were not shown because too many files have changed in this diff Show More