Commit Graph

7352 Commits

Author SHA1 Message Date
Beat Küng 825d754036 orb nuttx: add irqsave() guard around 64bit timestamp readout 2016-04-29 11:15:16 +02:00
Beat Küng 1ce5d795be orb: move SmartLock into global space and use it also for NuttX 2016-04-29 11:15:16 +02:00
Beat Küng 843e54f554 orb DeviceMaster posix: make destructor virtual 2016-04-29 11:15:15 +02:00
Beat Küng c6da90ac63 orb nuttx: fix threadding issue in uORB::DeviceNode::write
same issue as in posix code: 64bit values are not atomic in general.
2016-04-29 11:15:15 +02:00
Beat Küng 44012be8b6 orb posix: fix multi-threading issues
in detail:
- in the write method: the following are not necessarily atomic operations:
 	_last_update = hrt_absolute_time();
 	_generation++;
- appears_updated() was called with a lock held in some cases, but not
  in ioctl
- use the SmartLock class, so that unlock() is not needed before every
  return call. Makes it less error prone
2016-04-29 11:15:15 +02:00
Beat Küng aacfd8d553 orb: add some comments about locking 2016-04-29 11:15:15 +02:00
Beat Küng 5cf78da7d7 orb uORB::DeviceMaster::_flavor: make it const, it's never changed 2016-04-29 11:15:15 +02:00
Beat Küng c61a5acd59 orb DeviceNode::filp_to_sd: make this method static
Makes it easier to see that no class members are accessed
2016-04-29 11:15:15 +02:00
Beat Küng 1a57488ac6 orb: add a separate uORB::Manager::initialize() method
This fixes a race condition: uORB::Manager::get_instance() is used in a
multi-thread context, but the singleton initialization was not thread-safe.
Further, this avoids having to check for nullptr every time the singleton
is accessed.

uORB::Manager::initialize() is called when uorb is started. No one else
accesses the singleton before that point, because it is only used in the
orb_* methods, and in muorb. Both require uorb to be started already when
they are used.
2016-04-29 11:15:15 +02:00
Lorenz Meier 1b133931a6 Battery charge estimation: Refactor the filtering strategy and move it to the backend, doing integration before and filtering the resulting charge estimate 2016-04-29 11:05:44 +02:00
Lorenz Meier 343b8fb50f Sensors app: Send proper throttle setting to battery charge level estimator 2016-04-29 11:02:51 +02:00
Julian Oes 08f88d006f sensors: use the empty sensor init for RPi as well
The RPi build is based on the same DriverFramework base like the QURT
build, therefore it should use the same empty sensor init function.
2016-04-29 10:02:53 +02:00
Beat Küng 1827f78ab7 orb unit tests: use orb_unadvertise & create a separate test for it
Now 'uorb test' can be called multiple times.
2016-04-29 09:31:08 +02:00
Beat Küng 9da537c092 uorb: add uorb_unadvertise method
This is necessary when using multiple instances of a topic. However it does
not free the underlying resources, as it is assumed they will be used again
at a later point.
2016-04-29 09:31:08 +02:00
Andreas Antener f1d86a9064 removed not needed memsets 2016-04-28 13:39:02 +02:00
Andreas Antener a6878fb653 initialize offboard structs 2016-04-28 13:39:01 +02:00
Lorenz Meier 3345a586d2 Battery: Initialize lowpass value properly 2016-04-28 13:24:53 +02:00
Lorenz Meier 4441b74020 sensors: Default battery to a 50% setting 2016-04-28 13:06:02 +02:00
Lorenz Meier a676af3d42 Battery: Deal with symmetric throttle 2016-04-28 13:05:44 +02:00
Lorenz Meier d67ff7564f Fix sdlog2 race between copy and store 2016-04-28 12:20:16 +02:00
Lorenz Meier e42b1dc948 Revert "fix bug in the logging app:"
This reverts commit 29c5c25f47.
2016-04-28 12:14:29 +02:00
Roman 29c5c25f47 fix bug in the logging app:
- either sensor combined or the replay topic where copied into
the union buffer but at times the memory was overwritten by other
topics which updated below
- this change makes sure that the two topics are copied into the union
buffer at the correct location in the code
2016-04-27 21:40:07 +02:00
Lorenz Meier 65d0d1f9e3 Commander: Allow better battery failsafe warning / actions 2016-04-27 14:40:56 +02:00
Julian Oes 99286cf1bd ekf2: replace !isnan with PX4_ISFINITE (#4374) 2016-04-26 22:15:30 +02:00
Julian Oes e3c9135ac2 param_shmem: fix bug where params didn't stick
There was the case where a param was changed on the Linux side but the
change did not get saved on the DSP side because the param was not in
the local list of changed params on the DSP side. On save, the param
index is now refreshed, and param_get is called on all params that have
changed. This is a hacky workaround but resolves the problem for now.
2016-04-26 10:21:01 +02:00
Lorenz Meier 2fff2d4eac Robustify single mode selection. Fixes #4364 2016-04-26 09:11:35 +02:00
Mark Whitehorn 1a5040b9d2 only call fsync in NUTTX builds 2016-04-25 21:51:09 +02:00
Mark Whitehorn 6f20b9e1df fix unused variable error 2016-04-25 21:51:09 +02:00
Mark Whitehorn 4cf427510e fix problem with log_file_path and add msg timestamps 2016-04-25 21:51:09 +02:00
Julian Oes f454d74a51 mavlink: fix Snapdragon build 2016-04-25 15:35:22 +02:00
Lorenz Meier 14a20e3112 MAVLink streams: Better log file handling 2016-04-25 14:46:15 +02:00
Beat Küng acc40c8217 orb unittest: increase waiting time so that test does not fail on slow devices
This test failed on the pixracer because the subscriber thread was too slow
and thus orb messages got lost. This behavior is expected, but the test
should not fail because of that, so we increase the sleeping time.
2016-04-25 13:35:41 +02:00
Julian Oes 1cf7de8fdb perf_counter: perf_print_counter now works on QURT 2016-04-25 12:48:48 +02:00
Julian Oes 944acfaf75 simulator: change after perf_counter API change 2016-04-25 12:48:48 +02:00
Julian Oes 662c097803 perf_counter: add function to set a count
This needed the set function which sets elapsed to change the name to
avoid ambiguities.
2016-04-25 12:48:48 +02:00
Beat Küng f62324c8a6 mavlink_receiver.cpp: use sizeof(gps_inject_data_topic.data) instead of hardcoded size 2016-04-25 09:48:24 +02:00
Beat Küng 6029551c63 gps & mavlink receiver: use C arrays instead of std::array<> 2016-04-25 09:48:24 +02:00
Beat Küng b427f5c90d mavlink_receiver.cpp: fix coding style 2016-04-25 09:48:24 +02:00
Beat Küng 5b684a77f4 mavlink_receiver.cpp: remove __BEGIN_DECLS, __END_DECLS
This is the wrong usage of the macros and not needed at this place
2016-04-25 09:48:24 +02:00
Beat Küng 5cf351f585 orb: add gps_inject_data message & publish from mavlink 2016-04-25 09:48:24 +02:00
Lorenz Meier faa85a2eba Battery: Add proper units 2016-04-25 09:36:28 +02:00
Lorenz Meier 388d29baec MC pos control: Show normalized units properly 2016-04-25 09:35:58 +02:00
Lorenz Meier 9b71379ea6 FW pos control: Show normalized units properly 2016-04-25 09:35:41 +02:00
Lorenz Meier aa6168963a Land detectorr: Fix units, complete meta data for decent user representation 2016-04-25 09:35:23 +02:00
Lorenz Meier 3598d1e291 Fix typo in param meta 2016-04-25 08:44:51 +02:00
Lorenz Meier c7df99030a Commander: Limit data link loss params to save ranges 2016-04-25 08:44:51 +02:00
Lorenz Meier dc635b460c Update FIirmware param meta 2016-04-25 08:44:51 +02:00
Lorenz Meier fd9978c805 Battery: Trigger RTL a little later 2016-04-25 08:44:51 +02:00
Lorenz Meier 163b5afc73 Navigator: Fix style 2016-04-25 08:44:51 +02:00
Lorenz Meier 35180e1d10 Hide OBC failsafe actions for normal users 2016-04-25 08:44:51 +02:00