Commit Graph

717 Commits

Author SHA1 Message Date
Julian Oes 6b1bcef644 uORBManager: removed printfs 2016-06-07 22:10:56 +02:00
Beat Küng f5310ca51e orb: avoid unnecessary string duplication of objname 2016-06-06 23:27:16 +02:00
Beat Küng 5125fc3a81 uORBDevices::SubscriberData: remove unused member poll_priv 2016-06-06 23:27:16 +02:00
Beat Küng e709048fb8 orb: add orb_get_interval to API 2016-06-06 23:27:16 +02:00
Beat Küng 069dd01cb0 logger: subscribe to mavlink_log messages and write them to the log 2016-06-02 07:32:49 +02:00
Beat Küng 43d734ef43 orb: consistently use unsigned int for queue_size 2016-06-02 07:24:44 +02:00
Beat Küng 392c32d316 uORBTest_UnitTest.cpp: fix style 2016-06-02 07:24:44 +02:00
Beat Küng 79b3766544 orb: add unit tests for queuing, including tests with poll & notify interface
Both succeed under Posix & NuttX (Pixracer)
2016-06-02 07:24:44 +02:00
Beat Küng 5b1273e334 orb: add optional queuing of messages
This adds two uORB API calls:
- orb_advertise_queue
- orb_advertise_multi_queue

Both add a queue_size parameter to define a maximum number of buffered
item. The existing orb calls use all a queue size of one and thus their
behavior is unchanged. If a writer publishes too fast, the oldest elements
from the queue are silently dropped.
The returned timestamp is always the one from the latest message in the
queue.

Queue size can be set via ioctl during advertisement phase. After that it
cannot be changed anymore.
2016-06-02 07:24:44 +02:00
Lorenz Meier 7398164fcc Updated PX4 use / API of low level GPIO and other hardware-centric system facilities 2016-05-28 14:56:17 +02:00
Daniel Agar 1ecdb0f6fb adjust stack sizes 2016-05-19 21:49:34 +02:00
Beat Küng fd0f52bebd orb macros: cleanup some unused code (#4576) 2016-05-19 11:08:37 +02:00
Daniel Agar 3de7fbb0a9 logger and uORBTest_UnitTest astyle 2016-05-14 11:27:07 +02:00
Beat Küng eabc43d78c orb structs: add padding bytes to align the structs where necessary
This is required for the logger, we just manually add the padding bytes
what would otherwise be done by the compiler. Additionally we reorder
the fields by type, so that padding is only necessary for nested types.
2016-05-14 11:27:07 +02:00
Daniel Agar 69c1ce1714 WIP logger serialization 2016-05-14 11:27:07 +02:00
Daniel Agar 9a0e962cbf uorb autogeneration 2016-05-14 11:27:07 +02:00
Daniel Agar eb29b33620 use gcc attributes to align and pack 2016-05-14 11:27:07 +02:00
Daniel Agar 76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
Daniel Agar 008354f935 testing cleanup 2016-05-13 13:01:41 +02:00
Daniel Agar 12165ba5a4 uORB separate tests 2016-05-13 13:01:41 +02:00
Daniel Agar eae726e345 FW add mavlink NAV_CONTROLLER_OUTPUT 2016-05-13 12:56:04 +02:00
Jonathan Challinger 749b598af1 load_mon: initial commit 2016-05-12 08:16:36 +02:00
Daniel Agar 7aa6e85563 enable Wshadow 2016-05-05 13:32:42 +02:00
Lorenz Meier ca3b1478ce Add ADC report
Enable building of ADC topic
2016-05-01 15:48:43 +02:00
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
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
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
Beat Küng 5cf351f585 orb: add gps_inject_data message & publish from mavlink 2016-04-25 09:48:24 +02:00
Beat Küng 80e05dd3a3 orb: fix memory leaks, forgotten unlock & wrong exit condition in advertisement
How can someone just add a FIXME for such a simple case?!
2016-04-19 11:12:36 +02:00
Beat Küng fdc10d212b orb: fix when orb_subscribe_multi is called before orb_advertise_multi
This fixes the previously introduced unit test. It fixes the case where
orb_subscribe_multi is called multiple times with different instances,
and no publisher advertised the topic yet. In this case all subscribers
got the same instance 0.
2016-04-19 11:12:36 +02:00
Beat Küng 8fa18f412a uorb: add unit test that currently fails (simulation of a queue with a single topic)
This fails both on NuttX & Linux
2016-04-19 11:12:36 +02:00
Beat Küng 9041b7e16d fix formatting style for uORB 2016-04-19 11:12:35 +02:00
Beat Küng 934207b518 uORB: merge the files uORBManager_{nuttx,posix}.cpp, largely the same code 2016-04-19 11:12:35 +02:00
Beat Küng c598429547 uORB doc: remove redundant doc & update existing one (describe the _multi methods) 2016-04-19 11:12:35 +02:00
Beat Küng e9019582cc uORB::DeviceMaster::ioctl: avoid operator[], since we already have the iterator
In the existing implementation, the map had to be searched twice.
2016-04-19 11:12:35 +02:00
Beat Küng 9c360e9f88 uORB: fix node_open: *instance is read even though it's an output parameter
This fixes a subtle bug: the instance parameter of orb_advertise is an output
parameter and thus its value can be random. However in node_open this value
is accessed and thus the open(...) call could succeed even though it should
not. This can happen for example if a second advertiser of a topic calls
orb_advertise_multi with *instance=0.

The existing implementation worked only because *instance was initialized
with -1 in most cases.
2016-04-19 11:12:35 +02:00
Lorenz Meier 1da25db617 Add ADSB transponder report 2016-04-17 17:56:39 +02:00
James Goppert d45e5ca50e Added control state subscription. 2016-04-14 17:41:08 -04:00
James Goppert 967e4dd127 Modified cmake to use STACK_MAX and STACK_MAIN 2016-04-14 13:36:36 -04:00
Julian Oes 5ca5af5fcd commander: take main_state out of vehicle_status
This state is only commander internal. Therefore it doesn't need to be
in vehicle_status. Instead it is now in the commander_state message.
2016-04-11 18:01:48 +02:00
Jimmy Johnson bbc8eaefd7 Adding new follow target navigation and main states. New follow target
topic added. New follow fsm added to the navigator
2016-03-27 12:10:57 +02:00