Realtime Controls

Realtime Controls

  • IHMC Home
  • All IHMC Docs
  • About IHMC

›Writing Real Time Control Code

Writing Real Time Control Code

  • Introduction
  • Preallocate everything
  • Do not use iterators
  • Do not change collections at runtime
  • Do not use the object versions of primitives (Double, Integer, Boolean, Long, Character, Byte, Float, Short)
  • Do not use locks

Preallocate everything

The first rule is that you want to preallocate all your objects and memory. The best way to guarantee that is to make all your class fields "final".

Avoid garbage generation at all costs

Exception: Objects send irregulary over the network.

Our Realtime hacks do not extend to the garbage collector. A garbage collection cycle will crash the robot, possibly ruining it.

Writing garbage free code is easier when doing it immediately than refactoring later on. Even when testing things out, do not generate garbage, it is not that hard.

← IntroductionDo not use iterators →
Realtime Controls
Docs
Quick StartSoftware Documentation
Community
GitHubFacebookTwitterYouTube
Copyright © 2018 IHMC Robotics