From 4be6d049be415eb0f0c8e9b1f64faea00f0f77fb Mon Sep 17 00:00:00 2001 From: kmetykog Date: Tue, 31 Jan 2012 08:00:59 +0000 Subject: [PATCH] Re #183: Kilo robot headlight handling git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4465 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 1b0bf1b93ccf7b967925ab967641ae240a09b44f Former-commit-id: 6b3269ee7455ca39d0ce8799172fcb50f7850199 --- src/drivers/kilo2008/kdriver.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/kilo2008/kdriver.cpp b/src/drivers/kilo2008/kdriver.cpp index f7cde7728..3ed610d0c 100644 --- a/src/drivers/kilo2008/kdriver.cpp +++ b/src/drivers/kilo2008/kdriver.cpp @@ -1697,10 +1697,13 @@ void KDriver::SetMode(int newmode) { current_light = RM_LIGHT_HEAD2; break; case AVOIDING: - current_light = RM_LIGHT_HEAD1; + if (static_cast(current_sim_time_ * 2.0) % 2 == 0) + current_light = RM_LIGHT_HEAD1 | RM_LIGHT_HEAD2; + else + current_light = RM_LIGHT_HEAD1; break; default: - current_light = RM_LIGHT_HEAD1 | RM_LIGHT_HEAD2; + current_light = RM_LIGHT_HEAD1; break; } } // mode_ != newmode