-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
[Bug] Modules do not react on parameter updates anymore #23378
Comments
Starnge that no one else found it before or did I just overlook it 👀 Could have to do with the timing at boot e.g. when modules subscribe to the parameter_update topic, no idea, just a guess. |
I narrowed it down and the problem is "Added check to make sure hrt_elapsed_time can never be negative" here: I'm not sure why this was added nor why this should happen but I realized it happens all the time and the check changes the behavior significantly 👀 |
I did some more tests and at least in SITL some timestamps passed as Still would be interesting to see why some timestamps are before the timer starts counting 👀 . Would it be an option to allow negative time differences again? |
Here would be that suggestion: #23380 |
The reason that was added was that on VOXL 2 platform there are two time domains in PX4 which shift with respect to each other. So one side periodically gets a correction and it's timestamp will move. So it is possible that we get a negative value after such a shift and then that subtraction results in a huge positive value returned from hrt_elapsed_time. That causes things to run too early when it happens. |
If you want to represent "600ms before the start of time" then I would suggest making the input parameter a signed integer. Then you can do the math properly if it is in fact a negative number. If it is a positive number then return 0 if the "then" is greater than "now". |
|
Describe the bug
After 4a55393 from #22881 the part that's called when the
parameter_update
topic gets updated does not get called anymore. This can be worked around by stopping a module and rerunning it, after doing so it works as expected again.I tested that with two instances:
px4io
module onfmu-v5x
hardware. I needed to changePWM_MAIN_DIS1
and it did not apply anymore until I restarted the driver.mc_pos_control
module in SITL SIH (make px4_sitl sihsim_quadx
) and just added a printf here:PX4-Autopilot/src/modules/mc_pos_control/MulticopterPositionControl.cpp
Lines 77 to 80 in 419652b
It only got called once at boot and not anymore until I restarted the module using
pxh> mc_pos_control stop pxh> mc_pos_control start
.To Reproduce
make px4_sitl sihsim_quadx
Expected behavior
Modules should update their parameters during runtime.
Screenshot / Media
No response
Flight Log
Software Version
Latest main, everything after 4a55393
Flight controller
v5x, SITL
Vehicle type
Multicopter
How are the different components wired up (including port information)
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: