-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Feature Request
Current Approach:
I'm running zephyr native sim on lockstep with a robotics simulator "Gazebo". Currently I'm just disabling the realtime feature and then polling on on ringbuf is_empty using nanosleep to sleep the thread every millisecond.
- (zephyr thread) https://github.com/CogniPilot/cerebri/blob/5150dcf37bf034be86ee9e04445e2eb34d023bd8/lib/dream/sil/zephyr_main.c#L70
- (native thread) https://github.com/CogniPilot/cerebri/blob/5150dcf37bf034be86ee9e04445e2eb34d023bd8/lib/dream/sil/native_main.c#L316
Requested Feature:
It would be great if there was an external clock api where the zephyr cpu could be paused until I tell it to run until it reaches a given timestamp. Something like:
#ifdef CLOCK_EXTERNAL
nsi_run_until(struct timespec tv) {
...
}
#endif
Usecase:
- simulator sends current clock time and data via UDP to zephyr (zephyr model cpu is paused)
- posix native thread receives clock and data and buffers data to send to zephyr thread (ring buf, msg queue)
- (zephyr model cpu is unpaused) posix native thread runs scheduler until the boot time matches the sim time
- process repeats when next external clock message from UDP is received
nylnx
Metadata
Metadata
Assignees
Labels
No labels