Logic for Raf-3 robot