21757 Commits

Author SHA1 Message Date
Mark Whitehorn
f7f12759cd Revert "add timer validation call"
This reverts commit 30fe2aa4fb8c099028fd5ca4f50940e88eddbb08.
2017-03-23 08:28:15 +01:00
Mark Whitehorn
bbebf980d8 add timer validation call 2017-03-23 08:28:15 +01:00
Mark Whitehorn
b5169b0c7b uncomment FMU servo readback test 2017-03-23 08:28:15 +01:00
Mark Whitehorn
9e3488af46 don't update servos if mixer_mix_threadsafe() failed to run 2017-03-23 08:28:15 +01:00
Mark Whitehorn
dd25366b86 clean up timer_set_rate and add advice on hacking counter frequency 2017-03-23 08:28:15 +01:00
Mark Whitehorn
2d5588ae02 simplify oneshot mode selection; use zero PWM rate as indicator
cleanup and remove unused (new) params
2017-03-23 08:28:15 +01:00
Mark Whitehorn
aa9fbbedd5 add oneshot mode capability
change fmu to task

increase fmu_servo task priority to max and enable true oneshot

use lowest FMU priority which minimizes jitter

constrain oneshot updates to control group 0 events
2017-03-23 08:28:15 +01:00
David Sidrane
eac72051b8 Backport of stm32f7 add DTCM to heap and use it on F7 (#6865)
* Backport:stm32f7: stm32_allocateheap: allow use DTCM memory for heap

   Back port of upstrem contrib by Jussi Kivilinna <jussi.kivilinna@haltian.com>

   stm32f7: stm32_allocateheap: allow use DTCM memory for heap

   STM32F7 has up to 128KiB of DTCM memory that is currently left unused.

   This patch adds DTCM to main heap if CONFIG_STM32F7_DTCMEXCLUDE is not enabled.

* px4fmu-v5_default:Enable inclusion of the DTCM in the heap

  CONFIG_MM_REGIONS=3 adds the DTCM region to the heap.
2017-03-22 13:52:01 -10:00
Dennis Mannhart
be500723cd mc_pos_control: gradual vel fix for slope 2017-03-22 15:21:34 +01:00
Dennis Mannhart
20a47a1a72 mc_pos_control: limit if just xy distance close to target 2017-03-22 15:21:34 +01:00
Dennis Mannhart
f9551c12de mc_pos_control: param fix and gradual vel fix 2017-03-22 15:21:34 +01:00
Matthias Grob
72fb7a5062 mc_pos_control: added gradual landing speed logic
depending on two altitudes that can get set as parameter
the logic linearly slows down from higher land altitude 1 to slower land altitude 2
2017-03-22 15:21:34 +01:00
Matthias Grob
7434bcc693 mc_pos_control: fixed rebase and refactor errors 2017-03-22 15:21:34 +01:00
Dennis Mannhart
cd8cc1beaa mc_pos_control: use blockparam, change variable name, delete unused variables 2017-03-22 15:21:34 +01:00
Dennis Mannhart
4c4f214ec7 mc_pos_control: target_threshold value change
mc_pos_control: reorder if statement

mc_pos_control:  add get function for cruising speed
2017-03-22 15:21:34 +01:00
Dennis Mannhart
0d6f994145 mc_pos_control: slow down in auto when close to target
mc_pos_control: move limit vel xy after velocity controller
2017-03-22 15:21:34 +01:00
Dennis Mannhart
8e5a573cb3 mc_pos_control: add default only if there is no previous setpoint 2017-03-22 15:21:34 +01:00
Dennis Mannhart
fd3889b5a6 mc pos control: auto handling such that it does not use slewrate when goint to pos 2017-03-22 15:21:34 +01:00
Matthias Grob
5e2f18ebaa mc_pos_control: added separate velocity control setpoint slewrate for deceleration
to improve the smooth user experience while accelerating
but not have any delay when braking
2017-03-22 15:21:34 +01:00
Matthias Grob
b32e5e7ec0 mc_pos_control: fixed all pull request complaints
mainly changing parameters to BlockParams, reorder them and comment
2017-03-22 15:21:34 +01:00
Matthias Grob
bfb4de0e66 startup scripts/mc_pos_control: renamed parameters after refactor 2017-03-22 15:21:34 +01:00
Matthias Grob
470c3fdc06 mc_pos_control: refactoring only in manual velocity setpoint generation 2017-03-22 15:21:34 +01:00
Matthias Grob
713ba45876 mcpos_control: remove duplicate deadzone parameters 2017-03-22 15:21:34 +01:00
Matthias Grob
eec757915c mc_pos_control: switch manual vertical/z velocity curve to expo with deadzone 2017-03-22 15:21:34 +01:00
David Sidrane
eb054a0ea1 priority_restoration_fix:Review feedback
Additional backport of c2c226be1db53dd0c1315e13bbd76ace6538eedf
  sem_holder:Clean up from Review
2017-03-22 09:02:15 +01:00
David Sidrane
a6dcbc3a22 HOTFIX:Fixes improper restoration of base_priority
Backport of upstream:

   7601a27cee348f70bebcac95e8e8372fe0651bbf David Sidrane Thu Mar 16 14:16:18 2017 -1000  sem_holder:The logic for the list version is unchanged
   3cc2a4f7c9bb495da6c59f373f8d0e7672e4ee13 David Sidrane Wed Mar 15 14:02:55 2017 -1000  sem_holder: Fixes improper restoration of base_priority
   caf8bac7fb9452f25a3297147e7b414d46e74c6f David Sidrane Mon Mar 13 22:54:13 2017 +0000  missing semi
   d66fd9f965f27eb0446d6aed24b8758674f98b53 David Sidrane Mon Mar 13 12:34:39 2017 -1000  semaphore:sem_boostholderprio prevent overrun of pend_reprios
   3c00651cfef3a0d90bb9e6522463965ad8989e6c David Sidrane Mon Mar 13 11:56:31 2017 -1000  semaphore:sem_holder sem_findholder missing inintalization of pholder
   4d760c5ea44c5f8d30a1a595800e9fbf4874e705 David Sidrane Mon Mar 13 10:46:26 2017 -1000  semaphore:sem_holder add DEBUGASSERTs
   modified 399f3067441941072664bdbfa1bfec8ff35aa449 Gregory Nutt  Sat Mar 11 08:57:34 2017 -0600  A few cosmetic changes (removed file that had nothing to do with semaphore commit by OA)
   60d8606b19a7e7c1285a0ef5e8addaaedf26b95f David Sidrane Fri Mar 10 06:38:17 2017 -1000  Priority Inversion fixes:Initalization
   6cc8f9100b3c8026e73ca738aaa5120bd78dae74 David Sidrane Fri Mar 10 06:37:46 2017 -1000  Priority Inversion fixes:typo
   360539afacc83132acdb83da8f20c468dbe4c63d Gregory Nutt  Fri Mar 10 09:30:15 2017 -0600  Priority inheritance:  When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a single, hard-allocated holder structure.
                                                                                          This is problem because in sem_wait() the holder is released, but needs to remain in the holder container
   a93e46d00c1bc3447fb290b866ed21d8f9c8e146 Gregory Nutt  Fri Mar 10 08:54:50 2017 -0600  Cosmetic (missleading OA commit message) Using !pholder is now  pholder == NULL

   sem_holder: Fixes improper restoration of base_priority
   in the case of CONFIG_SEM_PREALLOCHOLDERS=0

   Original code did not take into accout that 2 holder are needed
   and failed silently when a slot could not be allocated

   The call to sem_restorebaseprio_task context switches in the
   sem_foreachholder(sem, sem_restoreholderprioB, stcb); call
   prior to releasing the holder. So the running task is left
   as a holder as is the started task. Leaving both slots filled
   Thus failing to perforem the boost/or restoration on the
   correct tcb.

   This PR fixes this by releasing the running task slot prior
   to reprioritization that can lead to the context switch.
   To faclitate this, the interface to sem_restorebaseprio
   needed to take the tcb from the holder prior to the
   holder being freed. In the failure case where sched_verifytcb
   fails it added the overhead of looking up the holder.

   There is also the additional thunking on the foreach to
   get from holer to holder->tcb.
2017-03-22 09:02:15 +01:00
flying-production
aed280fbd4 Make sure that external sitl project will be rebuild in case of sourcve has changed 2017-03-22 08:53:34 +01:00
Henry Zhang
1880ed9758 MindPX: Start send_events handler in MindPX (#6875) 2017-03-22 02:03:14 -04:00
Henry Zhang
6791090fe3 add new config for NanoMind (#6874) 2017-03-22 01:46:13 -04:00
Dennis Mannhart
8f1e851911 Stick to velocity fix (#6825)
* mc_pos_control: use just float for vel and cruise in xy

* mc_pos_control: stick map saturate magnitude to 1

* mc_pos_control: take minimum cruising speed for auto

* mc_pos_control: cruise speed triplet higher than from mc_pos_control

mc_pos_control: fix if for cruise in auto

* mc_pos_control: use PX4_ISFINITE criteria
2017-03-21 07:58:47 +01:00
David Sidrane
7d62aa6a6d HOTFIX:Backport Memory corruption due to stack coloring overreach complete (#6848)
Backport of upstream NuttX

       86400a252dcbe6e4aef3ecca000b469a0fe96b67
       08e92abb0ba744927ed0b32294859b0f47726f82
       4b65817e99cbdf04fefad883eca0e7c8a9add63c

       Improper rounding in redundant stack coloring
       routines could overwriting the TOS+1 and BOS-1
       depending on the value of CONFIG_ARCH_INTERRUPTSTACK

       This applies the compelet upstream set of fixes from
       David Cabecinhas <david.cab+bitbucket@gmail.com>

       Improper rouding in redundant stack coloring
       routines was overwriting the TOS+1 and BOS-1

       The legacy OABI 4 byte stack alingment was removed
       Only the EABI 8 byte alinement is supported
       The redundant interrupt stack coloring. up_initalize
       had the correct implemantation (last verson of patch)
       and the redundant version in the
       arch/arm/src/stmxxx/stmxx_irq.c was calculating the size
       wrong.

       This is fixed by rounding up CONFIG_ARCH_INTERRUPTSTACK
       by 4 bytes when allocated and alining on a 8 byte boundry
2017-03-20 07:32:45 -10:00
David Sidrane
f2164b135d Consolidate the flash patches to fix build (#6850)
nuttx-patches/workarround_for_flash_data_cache_corruption.patch was
   patching a file patched in nuttx-patches/wip_inflight_to_upstream.patch

   The changes in workarround_for_flash_data_cache_corruption.patch
   will be submitted upstream once refactored (upstream coding style
   compliant and moved to correct location)
2017-03-20 06:18:23 -10:00
Dennis Mannhart
c9643cb075 mc_pos_control: delete leftover from transitional changes for vel_max_z (#6822) 2017-03-20 10:06:29 +01:00
Dennis Mannhart
31aff0b6c0 mc_pos_control: change yaw setpoint to yaw (#6854) 2017-03-20 10:05:33 +01:00
Beat Küng
546bd2b4d0 drivers: remove the overflow perf counter
This was used together with the read() interface, but we don't use that
so the counters are wrong.
2017-03-20 09:11:34 +01:00
Beat Küng
f60dfbbb40 perf: remove unused event_overruns, reduce type of delta times to 32bits
32 bits are still enough to measure elapsed times up to 1 hour.

Testing on Pixracer: I counted 73 allocations and 39 frees during bootup,
resulting in 2kB RAM usage after boot. This patch reduce this by ~0.5kB.
2017-03-20 09:11:34 +01:00
David L Sprague
0a02a4c503 Fixed Issue #6596
Fixed the block comments at the top of the source file and the help message for the script (starting at line 279) so that an underscore ("_") character is correctly described as the separator for the first message field name rather than a period character "."
2017-03-20 08:35:39 +01:00
Pavel Kirienko
2b2c307eac Performance audit (intentionally duplicates #6829) (#6847)
* UAVCAN ESC output: removing ESC output channels from published message that are always zero. This allows the UAVCAN stack to always transfer only the minimum number of output values, avoiding redundant zeroes and the associated increase in bus load and CPU time

* Added a separate mixer file for CAN quadrotor

* Sampling profiler improvements

* PMSP: Output more endpoints

* Matrix update

* libc usage workaround

* Removed UAVCAN perfcounters

* Matrix submodule update
2017-03-18 04:16:20 -10:00
David Sidrane
c20b85e6ad Revert "UAVCAN performance audit (#6829)" (#6846)
This reverts commit 21e04c9f7afd56adf21d02b76c89ae06fe1fc5a7.
2017-03-18 04:04:43 -10:00
Pavel Kirienko
21e04c9f7a UAVCAN performance audit (#6829)
* UAVCAN ESC output: removing ESC output channels from published message that are always zero. This allows the UAVCAN stack to always transfer only the minimum number of output values, avoiding redundant zeroes and the associated increase in bus load and CPU time

* Added a separate mixer file for CAN quadrotor

* Sampling profiler improvements

* PMSP: Output more endpoints

* Matrix update

* libc usage workaround

* Removed UAVCAN perfcounters
2017-03-18 03:47:09 -10:00
David Sidrane
4fe29e5246 Fiexs frsky telemetry stack warning
WARN  [load_mon] frsky_telemetry low on stack! (164 bytes left)

Added 168 bytes = 160 needed + 8 bytes for head room
2017-03-18 10:54:49 +01:00
Lorenz Meier
7695b65b7f MAVLink app: Default to MISSION, not MISSION_INT
In order to ensure correct transmission the mission system needs to default to the legacy protocol and switch to the new implementation when these conditions are met:
  * If the GCS sends a MISSION_REQUEST_INT - it will do this based on the AUTOPILOT_VERSION flag indicating int mission support
  * If the autopilot sends a MISSION_REQUEST and has the AUTOPILOT_VERSION flag for 2.0 set, the GCS should NACK it, which will make the autopilot retry a MISSION_REQUEST_INT
  * If the autopilot sends a MISSION_REQUEST_INT and the GCS does not support it, the GCS will ignore and time out. The autopilot could retry now opportunistically with the old protocol, but this is not great for lossy links.
  * If the GCS sends a MISSION_ITEM_INT - this is a fallback
2017-03-16 23:16:39 +01:00
Matthias Grob
bb3b26e00f logger: adjusted log_writer_file stack size
because of messages in the logs
2017-03-16 14:05:15 +01:00
Matthias Grob
ca9393eb97 mc_pos_control: fix parameter description of expo for QGC parsing 2017-03-16 11:42:27 +01:00
ChristophTobler
d5137ed794 set EKF2_AID_MASK and EKF2_HGT_MODE because of iris_opt_flow 2017-03-16 09:18:54 +01:00
Beat Küng
948635c989 LandDetector: call param_notify_changes() instead of param_save_default()
param_save_default() could take something like 0.5s, and because the
LandDetector is running on the HP work queue, this would block other
tasks, like RC handling or drivers.
2017-03-14 21:43:44 +01:00
Beat Küng
f6d9d77f60 param_notify_changes: set unsaved to true
This will make sure that commmander will save the params.
2017-03-14 21:43:30 +01:00
Beat Küng
0e650638e4 param: implement RW locking
This allows concurrent read access, which are much more common; reducing
potential lock contention and increasing concurrency.

Taking a lock is expensive, and the reader lock is now even more expensive.
An RCU synchronization scheme would reduce the overhead of the readers to
increasing/decreasing an atomic counter.
Thus this should only be an intermediate step until we move towards RCU.

Tested on SITL & Pixracer.
2017-03-14 21:30:53 +01:00
Beat Küng
b4290b6b52 params: make param_t uint16_t on NuttX
param_t is only used as an offset and we have <1000 params, so an uint16_t
is enough.
This saves roughly 1KB of RAM. We only do that on NuttX because normal
integers have better performance in general.
Previously on amd64, this was even 64bits because it was an uintptr_t.
2017-03-14 21:30:53 +01:00
Beat Küng
45af77a543 mavlink parameters: try to send 5 params at once on USB & UDP connections
This further speeds up param loading.

On Pixracer via USB, it's possible to send up to 11 at once before the TX
buffer gets full, so there is still enough free bandwidth left.
2017-03-14 21:30:04 +01:00