Geek Culture
Published in

Geek Culture

EXCERPT

Robots as Software

An excerpt from Robotics for Programmers by Andreas Bihlmaier

Robots as Embedded Real-Time Systems

iterations = 100000000  # 10 million
sum = 0
for i in range(iterations):
sum += i
print(sum)
  • ROM (non-volatile memory)
  • RAM
  • CPU
  • Worst-case execution time (WCET)
  • Stochastic hardware performance
  • Schedulers, task priorities, and preemption
  • Synchronization primitives and inter-process communication (IPC)
  • Interrupts and timers
Figure 1. Histogram of execution times for worst-case execution time (WCET) analysis.
Figure 2. Example of preemptive scheduling for two tasks with fixed priorities.
while input.status() != True:  # wait for input signal to become true
pass
do_something() # then run do_something()
input.on_change(True, do_something)  # run do_something() when input changes to True
Figure 3. Illustration of interrupts their latency and jitter.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manning Publications

Follow Manning Publications on Medium for free content and exclusive discounts.