Skip to content

Support for External ClockΒ #4

@jgoppert

Description

@jgoppert

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.

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:

  1. simulator sends current clock time and data via UDP to zephyr (zephyr model cpu is paused)
  2. posix native thread receives clock and data and buffers data to send to zephyr thread (ring buf, msg queue)
  3. (zephyr model cpu is unpaused) posix native thread runs scheduler until the boot time matches the sim time
  4. process repeats when next external clock message from UDP is received

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions