Commit Graph

44 Commits

Author SHA1 Message Date
Eric Katzfey f4ebfa6130
parameters: support for an optional remote parameter database (#22836)
The voxl2 has a split architecture. PX4 runs on a posix platform and a Qurt platform. The two communicate uorb topics back and forth with the muorb module. But each has it's own parameters database and they need to stay in sync with each other. This PR adds support to keep the 2 parameter databases in sync. The main parameters database running on Linux has file system support while the Qurt one does not. The Linux side is considered the primary and the Qurt side is considered the remote.
2024-03-11 13:52:22 -04:00
Eric Katzfey 57df7e35b2
uORB: make queue size (ORB_QUEUE_LENGTH) completely static (#22815)
Previously uORB queue size was an awkward mix of runtime configurable (at advertise or IOCTL before allocate), but effectively static with all queue size settings (outside of test code) actually coming from the topic declaration (presently ORB_QUEUE_LENGTH in the .msg). This change finally resolves the inconsistency making the queue size fully static.

Additionally there were some corner cases that the muorb and orb communicator implementation were not correctly handling. This PR provides fixes for those issues. Also correctly sets remote queue lengths now based on the topic definitions.

* Made setting of uORB topic queue size in based on topic definition only
* Fixes to the ModalAI muorb implementation
* Removed libfc sensor from format checks
* msg/TransponderReport.msg ORB_QUEUE_LENGTH 8->16 (was set to higher in AdsbConflict.h

---------

Co-authored-by: Eric Katzfey <eric.katzfey@modalai.com>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2024-03-08 16:28:24 -05:00
Beat Küng c5101c70b3 uorb: enure message definitions don't exceed buffer lengths & increase test buffer
There were already checks at runtime, but this ensures the format is not
too long at built-time.
2023-12-05 10:42:23 +01:00
Beat Küng 22acb08406 uorb: add message format compatibility check
This can be used by DDS/ROS 2 to check for matching message definitions.
2023-11-15 13:18:58 +01:00
Beat Küng 1ad5a9de08 uorb: compress format definitions
Reduces flash usage by ~16KB.

- compress formats at build-time into a single string with all formats
- then at runtime iteratively decompress using
  https://github.com/atomicobject/heatshrink
2023-11-08 00:31:26 -05:00
Robbie Drage 68bc90bab5 uorb: fix Subscription::ChangeInstance() bug 2023-10-18 20:56:25 -04:00
Peter van der Perk 019d232911 Add Zenoh pico support 2023-10-18 15:30:36 -04:00
Niklas Hauser ad1d72df6f
uORB: fix hardfault in uORB calloc implementation
When running out-of-memory, the malloc returns NULL and the memset then tries to write to address 0 which results in a hardfault.
2023-09-07 14:22:58 -04:00
hskrieg 64c21ad428 uorb: allow for more than 255 uORB messages
Increased size for ORB_ID from uint8_t to uint16_t

Created a type: orb_id_size_t = uint16_t.
There are still a couple of places where the size
of the ORB_ID is assumed to be less than 16-bits.
The places that I have found are commented regarding
this and can be found with a search on orb_id_size_t.
2023-08-08 10:59:34 +02:00
Patrick José Pereira 643d89f54b uORB: Use snprintf over sprintf
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2023-05-22 07:46:54 +02:00
Silvan Fuhrer d5e1f0fdaa uorb_graph: remove handling for actuator_controls topic
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-16 11:55:45 +01:00
Daniel Agar 435c799f57 uORB: print more decimal places for float32 and float64 2023-03-10 07:39:34 +01:00
Eric Katzfey 89180ac0f9 Fixed Kconfig and px4board files for voxl2 2023-01-11 09:53:18 -05:00
Peter van der Perk 4c2c06060d PX4Board kconfig add dependency chain for QURT & POSIX modules 2023-01-04 09:40:17 -05:00
Zachary Lowell 91acd494a3
Qurt uORB communicator fixes (#20705)
- there was an issue sending a message from slpi to apps. Seems the code was stuck in an loop and crashed when the message was sent from slpi to apps
2022-12-06 10:33:19 -05:00
Daniel Agar 2cb4ef0629
NuttX 10.3+ upgrade (#20190)
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
Co-authored-by: David Sidrane <David.Sidrane@NscDg.com>
Co-authored-by: alexklimaj <alex@arkelectron.com>
2022-11-20 20:28:07 -05:00
Zachary Lowell 52b16d062c
uORB Remote Manager Update (#20623) 2022-11-17 13:51:01 -08:00
Daniel Agar cea185268e
msg ROS2 compatibility, microdds_client improvements (timesync, reduced code size, added topics, etc), fastrtps purge
- update all msgs to be directly compatible with ROS2
 - microdds_client improvements
   - timesync
   - reduced code size
   - add to most default builds if we can afford it
   - lots of other little changes
 - purge fastrtps (I tried to save this multiple times, but kept hitting roadblocks)
2022-10-19 19:36:47 -04:00
Daniel Agar 462d0af384 uORB: fix static orb_exists call for protected build
- unify ORBSet to maximum code coverage
2022-09-26 12:38:58 -04:00
Eric Katzfey d30ccb2b1d
initial board and platform support for the ModalAI VOXL 2 (POSIX + QuRT) 2022-09-23 12:03:05 -04:00
Beat Küng c95192d050 orb_print_message_internal: handle 64 bit bitsets 2022-08-25 22:02:15 -04:00
Beat Küng 04f7df3848 SubscriptionMultiArray: use Subscription instead of SubscriptionInterval
Saves ~3KB RAM on fmu-v5.
2022-08-25 22:02:15 -04:00
Jacob Schloss 5ae4cae073
orb_advertise_multi: might return nullptr (#19387) 2022-03-24 07:47:48 +01:00
Jukka Laitinen caaa13ddc0 uORB performance updates
Move some logic from Subscriber into uORBManager. This reduces calls from the
modules to the uORB manager, improving performance in protected build.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-24 11:50:05 -05:00
Jukka Laitinen 6071b87afc platforms/common/uORB: Separate IOCTLs going through boardctl interface from the original ones
It was a mistake to mix these two together, it is simpler to implement the boardctl interface
for the protected build, if the boardctl ioctls are different

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-18 07:53:13 +01:00
Jukka Laitinen 36d440f895 Add IOCTL interface to uORBManager for nuttx protected/kernel build split
When building uORB for NuttX flat build, or for some other target, everything
works as before.

When building uORB for NuttX protected or kernel build, this does the following:
- The kernel side uORB library reigsters a boardctl handler for calls from userspace
  and services the boardctl_ioctls by calling the actual uORB functions
- For user mode binaries, the uORBManager acts as a proxy, making boardctl_ioctl calls to the
  kernel side

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-02-14 09:10:49 +01:00
Daniel Agar be3da5089c uORB: uORBDeviceNode use px4_cache_aligned_alloc 2022-02-08 10:20:50 -05:00
Beat Küng bcd057ac3e uORB: fix copy-paste mistake in orb_print_message_internal
Could have led to invalid memory access.
2022-01-20 12:58:20 -05:00
Jukka Laitinen ce6147f570 uORB: Remove transfer of memory allocation ownership to CDev
- Allocate and free the node name in uORBDeviceNode.
- Add protected build support by de-allocating the name with kmm_free, when
  running in kernel side. strdup allocates from the kernel heap in NuttX kernel
  space.
- Remove the CDev::unregister_driver_and_memory(), it is no longer used

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-12-13 22:52:36 -05:00
Jukka Laitinen b66270f8a8 Inline uORBDeviceNode::copy for performance improvement
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-24 09:11:45 +01:00
Jukka Laitinen 3f884c5d24 Inline deviceNodeExists and getDeviceNode in uORB DeviceMaster
This gives a small performance improvement

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-24 09:11:45 +01:00
Jukka Laitinen bb307cd462 Fix comparing orb_metadata in uORB::DeviceNode::publish
Don't compare pointers to metadata, but the metadata contents.

In protected/kernel build there are two sets of metadata, on on kernel
side and another in user side. Thus the comparison of pointers would just
always fail. Compare orb_id instead

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-24 09:11:45 +01:00
Jukka Laitinen 0b9505453d Clean up interfaces towards uORB
Proxy all calls to the DeviceNode through Manager;
- This hides the DeviceNode from publishers and subscribers
- Manager can be made an interface class between user and kernel spaces in protected build
- This doesn't increase code size or harm the performance on flat build

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-24 09:11:45 +01:00
Beat Küng 8a2b310b83 topic_listener: avoid code generation, use existing metadata at runtime
This reduces flash size for v5 by ~110KB, the topic listener now only adds
about 1.2KB.
2021-10-20 08:10:05 +02:00
Beat Küng 4c73ac3805 uorb: use single byte for internal types in o_fields metadata
Reduces flash usage by ~9KB.
2021-10-20 08:10:05 +02:00
Daniel Agar 9a3fa6199b uorb top report total publication rate 2021-09-26 12:29:11 -04:00
Beat Küng e73172b537 hrt: remove hrt_elapsed_time_atomic
There's no protection on posix
2021-09-23 09:23:08 +02:00
Daniel Agar 65b1a9648d Tools/HIL/run_nsh_cmd.py: fail if ERROR printed in output 2021-09-01 15:16:00 -04:00
Beat Küng f88f224fe6 logger: avoid data bursts by distributing slow subscription updates over time
There's an increasing amount of slow logged topics at 1-2Hz, which were all
updated in the same logger iteration, leading to data bursts. For log
streaming this started to exceed uart buffer sizes. By distributing updates
more equal over time those bursts are removed, reducing buffer size
requirements.

Tests showed during steady state a reduction of maximum topic updates per
iteration from 40 down to 17.
Also the SD log buffer fill level is more constant.
2021-08-12 10:09:11 -04:00
Daniel Agar 500c45e798 uORB: Subscription check if uORB::Manager instance is valid
- this is necessary if uORB::Subscription is used with static storage
duration
2021-06-17 08:07:24 +02:00
Beat Küng 0a98c5a7f4 Subscription: fix ChangeInstance 2021-04-27 10:29:09 -04:00
Daniel Agar 385512aead uORB: test multi timestamp requirement only applies per topic instance 2021-03-17 12:35:53 -04:00
Daniel Agar f1f396e338 uORB: PublicationMulti get_instance() advertise if not already advertised
- fixes UAVCANv0 sensor bridge uORB usage, but also a reason thing to do in general
2021-02-26 17:55:30 -05:00
Daniel Agar ab0d0fd0be
uORB move to PX4 platform layer 2021-02-17 11:25:56 -05:00