Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] LMC: Mavlink ULog rate control support #612

Draft
wants to merge 345 commits into
base: main
Choose a base branch
from

Conversation

jnippula
Copy link

Introduce parameter MAV_ULOG_MAX_RT to tune mavlink logging upload message rate (default value: 0.2f).
This makes possible to reduce mavlink data rate in LMC device where CPU load is already very high.

jnippula and others added 30 commits October 26, 2023 12:48
This would prevent client to stop working if agent restarts in
middle of connection initiation. If entity creation fails the
client stop connecting and waiting for next ping response
from agent before next connection attempt.
Mavlink start supports '-i <x>' flag to read IP address
from MAV_<x>_REMOTE_IPn params.
-T is the command line argument for LD, it should not be in the script name
The type of main (entry point) is now relevant, as the entry point is
no longer explicitly casted to main_t
For some reason, the type of the linker defined symbols was changed.
The reasoning was "they typically represent pointers" which is absolutely
not true at all. They typically define memory locations, but they can
be whatever. It is just a way to provide symbols from the linker to
the executable, which is done via relocation symbols.
- Allocate a separate wait semaphore for each process (one in PROTECTED_BUILD). Allocate the semaphore
  in "REGISTER" ioctl, free it in "UNREGISTER" if process exits
- Duplicate the user side call events to kernel memory to make them accessible by kernel
  at all times. Keep track of the allocated items in "freelist" queue
- Replace fixed size callout queue with an "inflight" queue

Signed-off-by: Jukka Laitinen <[email protected]>
…versions

These give errors on some compilers

Signed-off-by: Jukka Laitinen <[email protected]>
microdds_client dds topic generator to support CamelCase topic names
Mavlink msg generator (pymavlink) does not handle mavlink2 message
extensions properly. Receiver does not zero-fill the receiver buffer,
so due to the extension zero suppression featyure the last "suppressed"
fields may contain garbage data. HITL_SENSOR message last field is
sensor_id, so it is explicitely set zero to avoid issues.
dds_topics.yaml has support for adding optional rate parameter for
each publication topics
e.g. Limit SensorCombined topic pub rate to 10 Hz:

  - topic: /fmu/out/sensor_combined
    type: px4_msgs::msg::SensorCombined
    rate: 10
The ioctl parameter type was wrong, need to give the handle as well.
The shutdown hook is run when the system is shut down, what we want
is to call hrt_stop() when the process exits -> use atexit().
- Pop the entry from any queue when fiddling around with it, this prevents
  two threads accessing the same data via the queue
- When looking for any item in any queue, the search should be performed
  with BOTH user entry, and the handle provided. This is because user
  entries are ambiquous (user virtual addresses) and thus the kernel
  handle (which is unique) is needed
- Fix HRT_CANCEL on the kernel side
- Fix HRT_UNREGISTER on the kernel side
  - Remove potential double booking in callout_queue and callout_inflight.
  - Do not free items from the freelist, as they do not belong to any
    thread specifically (as they have been freed)
- Remove kernel_entry from the hrt_call structure, the same information
  can be done by comparing user entry + handle
The only thing needed from there was the definition of struct builtin_s.
The builtin functions are not meant to be used this way anyhow, it is
supposed to be a way to inject user-space code into the kernel (the
builtin list is _copied_ into kernel memory). The board_ioctl module is
is kernel-space only.

Also, remove the usage of the "FAR" keyword, we use processors from this
millennium that do not use memory segmentation into 64K chunks...

The real reason for this change is that CONFIG_BUILD_KERNEL does not
allow setting CONFIG_BUILTIN (makes sense, injecting user code into the
kernel is not feasible _at all_ with address environments).
Allow starting a process with its full path i.e. strip the path
from argv[0] and use the base name to find the entry point.
Do not link the soft float math library, it is not needed for anything and
it confuses the linker which does relocations to the FP instructions
Signed-off-by: Jukka Laitinen <[email protected]>
…gnal

Sigaction lets us specify that only the wanted signal is handled with the callback

Signed-off-by: Jukka Laitinen <[email protected]>
mehmetkillioglu and others added 20 commits December 21, 2023 10:32
CA_ROTOR and PWM_MAIN_FUNC params added to init.d-posix/4400 airframe
to make actuator outputs working for sitl
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Pull latest changes + get rid of merge commits
…ates not set

If update not called, it may lead to infinite loop in case check_for_updates
not set and there are new messages in ulog_stream_acked uorb.
An EEPROM behind and i2c media is not 100% failure proof. But any errors
in e.g. mtd_params reading can cause catastrophic failures in flight.

Mitigate any possible errors in px4 mtd_params reading by adding crc code
to every page on EEPROM

In addition:
- Read every block into a temporary buffer before copying to clients buffer;
  this fixes some issues with memory protected builds when writing directly
  to user buffers from i2c driver interrupt handler
- If a read request fails, don't return any partially filled buffer to user

Signed-off-by: Jukka Laitinen <[email protected]>
Like __dso_handle, this symbol must NOT be pulled from the user libc.
The __cxa_atexitatexit() functions in kernel are no-ops as we don't
support shared library destructors.
…_for_updates not set"

This reverts commit f3a8744.

Updating and sometimes ignoring ulog_stream_acked reduces the load, but may cause log to
be corrupted due to missing definition data. Need to revert the patch to avoid
broken log files.
@jnippula jnippula force-pushed the DP-8103-ulog-rate-control branch from a72b210 to e17c4cb Compare January 30, 2024 05:57
@jnippula jnippula marked this pull request as draft February 1, 2024 09:36
@jnippula jnippula changed the title LMC: Mavlink ULog rate control support [DO NOT MERGE] LMC: Mavlink ULog rate control support Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.