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
cleanup of fixedwing main using new sys_time timers #123
Conversation
Why not leaving the ap tasks in main_ap (same for fbw) ? |
What do you mean by leaving them in main_ap? If we use the timers, they should be checked from the main loop. We could check them from the ap/fbw event loops though (which would amount to the same thing). It would probably be nicer to read?
Correct. But I'm not convinced this is an issue with this firmware. By default sensors runs at 60Hz (for IMU most run it a lot higher), navigation was only run at 4Hz (can easily up that to something higher now if you have a faster gps), control was run at 20Hz by default so far. I started this, since it is easier to discuss these things if you can take a look at the code instead of only talking about it... |
I think main.c should stay like it was, and call specific code in main_ap or main_fbw |
If I understand you correctly I probably agree: |
Having no periodic calls in main could be an option here, I agree. |
Yes, exactly. I just didn't start re-factoring the nav stuff out yet, that needs a lot more cleanup. Same goes for the attitude loop. For the reporting_task it would be easy. I know this all raises a lot of questions about the overall design and on how to restructure things now and we could go on: But since we need to do this step by step, I just started and the basic question I see here now (and for the future) is whether separating sensors and control like this would lead to any problems (delay too high?). I also forgot that while control defaults to 20Hz it is normally run at 60Hz (defined in most airframe files). I also "rewrote" the rotorcraft main with the timers (see cbe56b9 in systime branch). But there we don't have an ap/fbw split and sensors/control are run together at the highest rate. |
… timers for periodic tasks from there also some cosmetics for main_ap.c
* removed obsolete/unused: fatal_error_nb, ac_ident and INIT_MSG_NB * moved rc_settings_mode, slider_1_val and slider_2_val to rc_settings * cosmetics
…HROTTLE_SLEW_LIMITER
@gautierhattenberger @dewagter If this principle is acceptable to you, I will merge this into dev. We can then start further cleaning up stuff like the reporting_task, nav, etc. Regarding the sequence of sensors/navigation/control, IMHO this is currently a non-issue:
So if this wasn't an issue so far, it won't be an issue now... |
As you said, it needs more cleaning, but for me looks good enough to go to dev |
cleanup of fixedwing main using new sys_time timers
@gautierhattenberger @dewagter
I started cleaning up main using the new sys_time timers to get rid of the all the prescaling for the different periodic functions.
What do you think about this?