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

HAL_Linux: fixed time function to use integer maths #26104

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Jan 31, 2024

avoid floating point rounding errors after long uptimes.

thanks to Richard (RSAXVC) for finding this

avoid floating point rounding errors after long uptimes.

thanks to Richard (RSAXVC) for finding this
@tridge tridge force-pushed the pr-linux-time-integer branch from 9044f8e to f7726b7 Compare January 31, 2024 05:27
@Williangalvani
Copy link
Contributor

Williangalvani commented Feb 1, 2024

Started testing:
root@blueos:/# uptime
19:28:10 up 4:07, 1 user, load average: 4.59, 3.92, 3.12
root@blueos:/#

I'll edit this and attach a log in 1h

https://drive.google.com/file/d/1dEm8MidI1MUHxzNZCH7egOP7eRSDZh1j/view?usp=drive_link

@rsaxvc
Copy link
Contributor

rsaxvc commented Feb 4, 2024

Without this patch I saw the same sort of issues running the Scheduler_test, so I ran it under a few different conditions:

32-bit float conversion, 3-week OS uptime, after about a minute of ardupilot uptime, without this patch the scheduler is running the one_hz at around 2Hz :

five_seconds: t=53375 ins_counter=3750
one_hz: t=54000
one_hz: t=54500
one_hz: t=55000
one_hz: t=55500
one_hz: t=56000
five_seconds: t=56000 ins_counter=4000

Same as above, with this patch(uint64_t nanoseconds), good scheduling is restored:

five_seconds: t=55907 ins_counter=2750
one_hz: t=56907
one_hz: t=57907
one_hz: t=58907
one_hz: t=59907
one_hz: t=60907
five_seconds: t=60907 ins_counter=3000

@tridge
Copy link
Contributor Author

tridge commented Feb 5, 2024

@Williangalvani looks good

@tridge tridge merged commit 1f2b9df into ArduPilot:master Feb 5, 2024
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.5.0-beta2
Development

Successfully merging this pull request may close these issues.

3 participants