Commit Graph

20583 Commits

Author SHA1 Message Date
Andrew Tridgell d150b4b084 px4iofirmware: fixed a bug with override handling
this fixes a race condition between the DMA completion handler
updating registers in px4io and the mixer used for handling the
override state. The register set code could set r_page_servos[]
between the time when pwm_limit_calc() is called and the servos are
actually output.
2016-12-26 16:32:33 +01:00
Lucas De Marchi 72d8a4f932 aerofc: improve upload script
- Run in a single ssh command
  - Allow to update firmware when mavlink-routerd had already been
    stopped
  - Be resilient to another daemon interfering the communication by
    reading/writting to the UART
  - Print OS, BIOS nad FPGA version
2016-12-26 16:11:33 +01:00
Lucas De Marchi d26b406a04 aerofc: update script to upload firmware
mavlink_bridge.py script was removed in favor of new mavlink-router
project (https://github.com/01org/mavlink-router).
2016-12-26 16:11:33 +01:00
Lucas De Marchi 1fafa2069c sensors: aerofc: set default voltage divider 2016-12-26 16:11:33 +01:00
Lucas De Marchi 0341af4858 aerofc: add some fixes to adc driver
- Other channels are irrelevant since they aren't physically
    connected. Avoid the I2C transaction to get invalid data
  - Port the driver to use only one address, as it should be
  - Minor changes here and there
  - Add test() method to read the latest value - helpful during
    debugging.
2016-12-26 16:11:33 +01:00
José Roberto de Souza 53f2c1eb19 aerofc: Implement ADC
Measure the battery voltage of Aero RTF kit will be done by FPGA
and read by AeroFC using I2C bus.

The protocol is a little bit odd, it have different I2C slave
address for each "register", in future the FPGA RTL will
have a protocol more similar to other I2C sensors.

Also Aero RTF don't have a ADC line to measure current consumption.
2016-12-26 16:11:33 +01:00
Michael Schaeuble 71e48c937e Restructure posix cmake configuration
We check if the target is SITL and do not build it with all other
posix targets.
2016-12-26 15:38:25 +01:00
Anton Matosov 6d3116e30b Implement the way to run posix simulator directly from IDE without the need to reconfigure command lines, but use runner created via CMake
Steps to debug:
 * Run gazebo (or any other sim) server and client viewers via the terminal: `make posix_sitl_default gazebo_none_ide`
 * In your IDE select `px4_<mode>` target you want to debug (e.g. `px4_iris`)
 * Start debug session directly from IDE

This approach significantly reduces the debug cycle time because simulator (e.g. gazebo) is always running in background and you only re-run px4 process which is very light.
2016-12-26 15:38:25 +01:00
Matthias Grob b79e4ab506 land detector: reverted scientific notation unwanted doubles 2016-12-26 15:36:43 +01:00
Matthias Grob 03d7b65299 land detector: refactoring ff to freefall 2016-12-26 15:36:43 +01:00
Matthias Grob 808dedf441 land detector: small refactor while studying 2016-12-26 15:36:43 +01:00
Lorenz Meier 494d2c9ecf ROMFS: Enable robust PWM command mode during startup 2016-12-26 15:34:53 +01:00
Lorenz Meier ca096c1257 PWM command: Allow robust error code returns 2016-12-26 15:34:53 +01:00
Lorenz Meier fff35fe34b Commander: Improve preflight check experience
* Loosen thresholds for gyro consistency check until temperature compensated units are the norm
  * Cut down string lengths so they make it through the MAVLink transport as a whole
2016-12-26 14:04:30 +01:00
Lorenz Meier 4dc96e3ea1 MAVLink app: Remove flow control warning to clean up the boot log 2016-12-26 13:55:04 +01:00
Lorenz Meier 074e666b95 PX4IO: Robustify firmware for mixer load operation
This change makes the mixer load and reset operation closer to thread-safe. It was guarded one-way before and in only one location. This change ensures that its being locked out from both directions. The accesses to the locking variables still need work because they are non-atomic.
2016-12-26 13:41:36 +01:00
Lorenz Meier 5b70522541 Mixer: Make reset operation more robust
This change makes the operation more robust as it flags the whole group invalid in the first step. This should not be confused with being thread-safe - to be thread-safe, all accesses to _first and the following linked list need to be guarded by a mutex. This should be done outside of the mixer in the driver though, as the method depends on the board architecture.
2016-12-26 13:41:36 +01:00
Lorenz Meier 66b9ee2d24 UAVCAN: Make GPS module use the multi-topic facility so that a normal GPS and an UAVCAN GPS can co-exist and do not write on top of each other. 2016-12-26 12:12:44 +01:00
Lorenz Meier da198a40c5 Code style check: Remove stale folder location 2016-12-26 12:12:44 +01:00
Lorenz Meier 8a58cf0daa Fix usage of CRTSCTS define from termios.h
NuttX had the CRTSCTS define incorrectly set for only output flow control, which broke our flow control logic. This commit patches NuttX and puts in addition a guard in place to prevent any future issue with the non-POSIX define being incorrect.

This has been debugged and identified by @ecmnet, which was the main contribution for this patch.
2016-12-26 12:08:05 +01:00
Lorenz Meier 72eafe7e72 Fix DSM debug statement. From @firwar 2016-12-25 21:55:23 +01:00
Lorenz Meier 0b6e0c020e MAVLink stream: Guard against an interval value of zero 2016-12-25 21:34:19 +01:00
Lorenz Meier 48f1ae31dd Iris: use correct mixer for frame 2016-12-25 21:31:32 +01:00
Lorenz Meier cbd237a58a Integration test: Robustify against 0 home altitude 2016-12-25 21:30:31 +01:00
Lorenz Meier 9b97e0358b MAVLink: Send correct home heading 2016-12-25 21:30:31 +01:00
Lorenz Meier 6444988392 MAVLink app: Send messages on average at a more correct rate and send on first call
This patch fixes two issues:
  * It sends the message on the first call, making sure that the first update gets sent out.
  * It improves the rate scheduling. In an experiment with 0.5, 50 and 250 Hz all rates were correct within 0.3% of the intended rate.
2016-12-25 21:30:31 +01:00
Lorenz Meier d6ef137e59 VTOL att control: Fix status reporting
The transition state reporting was inverted because of a typo. Code analysis suggests this will only have an effect in manual transition.
2016-12-25 18:15:51 +01:00
Lorenz Meier 1141079a3b Fix Simulator: Set correct rotor count for standard VTOL
The rotor count was incorrect which meant that control surfaces like elevons were scaled incorrectly. This was the main reason for really bad SITL performance
2016-12-25 18:15:51 +01:00
Lorenz Meier b7f5a33c90 EKF2: Code style and efficiency
Its sufficient to use sqrtf() with floating point resolution and its better to use the Matrix library call for local and global position yaw
2016-12-25 18:15:51 +01:00
Lorenz Meier 737e18dccb MAVLink app: Fix VTOL reporting and prevent mission reached spam
The VTOL status reporting and the mission status reporting were both suboptimal. VTOL was too slow, mission reporting too fast
2016-12-25 18:15:51 +01:00
Lorenz Meier 171ccd1203 POSIX SITL configs: Update default parameters to improve simulation behaviour
The main changes include:
 * Better attitude tuning for airframes (more realistic models, the models had previously not as much thrust as the real vehicles)
 * Better waypoint and navigation default parameters which match the on-hardware parameters
 * More suitable minimum and trim airspeeds for VTOL and fixed wing which prevents stalls that happened in SITL previously (the new airspeeds match the real vehicles nicely)
2016-12-25 18:15:51 +01:00
Lorenz Meier 0ae85e8a17 VTOL vehicle status: Adjust defines to match VTOL controller enum 2016-12-25 18:15:51 +01:00
Lorenz Meier 8165ef7d95 SITL: Move back to LPE as its more robust to host timing 2016-12-25 18:15:51 +01:00
Lorenz Meier 79fbcf8a1c Tuning to integration testing for better reporting 2016-12-25 18:15:51 +01:00
Lorenz Meier fa84d104b2 Update SITL Gazebo to include model fixes 2016-12-25 18:15:51 +01:00
Lorenz Meier 42101671f4 Drop rate gains for H480 2016-12-24 16:14:52 +01:00
Lorenz Meier 07fecaa9d5 Re-tune the H480 config as we increased its simulated motor power recently. 2016-12-24 16:14:52 +01:00
Lorenz Meier f56bb95bdd Default SITL to the same estimator as the physical vehicle 2016-12-24 16:14:52 +01:00
Lorenz Meier 349e3f6309 Update SITL Gazebo to include baro noise 2016-12-24 16:14:52 +01:00
Lorenz Meier 8418be5fa5 Slowdown message: More descriptive and less often 2016-12-24 16:14:52 +01:00
David Sidrane 5607df8a44 Added missing IFLOWCONTROL_WATERMARK settings.
This was the cause of the CI failure on the hot fix
2016-12-24 09:42:48 +01:00
David Sidrane e15b67ff70 HOTFIX:For Data loss on Nuttx serial w/ DMA & GPIO Flow Control
This hot fix essentialy revert commit 265af481209d60033f7cd4c4216048b1ce3eb435
   in NuttX/nuttx. The commit STM32 serial: Make input hardware flow-control work with RX DMA.
   From Jussi Kivilinna has broken the DMA on an STM32F4 in a yet TBD way.
   The symptoms are lost data on RX, the DMA count decrements but
   the data ia not written to memory. This looks to be introduced but the
   non circular DMA settings.
2016-12-24 09:42:48 +01:00
Lorenz Meier 2bf7a53d55 FMUv5: Ensure enough IRQ stack 2016-12-23 23:24:52 +01:00
Lorenz Meier 88a4b5ba07 FMUv4: Ensure enough IRQ stack 2016-12-23 23:24:52 +01:00
Lorenz Meier 0924d8ddcf FMUv3: Ensure enough IRQ stack 2016-12-23 23:24:52 +01:00
Lorenz Meier b6e4b63b0d FMUv2: Ensure enough IRQ stack 2016-12-23 23:24:52 +01:00
Lorenz Meier bdeabbd02c FMUv1: Ensure enough IRQ stack 2016-12-23 23:24:52 +01:00
Lorenz Meier cbe04d5f9b FMUv5: Not supporting AUX yet 2016-12-23 23:24:52 +01:00
James Goppert c28cd76e5f LPE fault relaxation and sitl fix (#6146)
* Set LPE FUSE for standard iris sitl config.

* Relax fault detection handling.

* Always correct lidar.
2016-12-23 15:08:37 -05:00
Lorenz Meier 661fda2b2a MAVLink app: Acknowledge all commands that are not sent off to other components 2016-12-23 17:40:11 +01:00