From 02d5a9ed542817350b7ad29ad79163245427e6f0 Mon Sep 17 00:00:00 2001 From: Ruixiang Du Date: Tue, 15 Sep 2020 11:03:49 +0800 Subject: [PATCH] saved work on timeout --- apps/scout_demo/scout_demo.cpp | 2 +- src/platforms/mobile_base.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/scout_demo/scout_demo.cpp b/apps/scout_demo/scout_demo.cpp index 2c96f8c..38a1c5f 100644 --- a/apps/scout_demo/scout_demo.cpp +++ b/apps/scout_demo/scout_demo.cpp @@ -98,7 +98,7 @@ int main(int argc, char **argv) { // scout.SetLightCommand({ScoutLightCmd::LightMode::BREATH, 0, // ScoutLightCmd::LightMode::BREATH, 0}); // } - if (count < 250) { + if (count < 100) { std::cout << "Motor: 0.2, 0" << std::endl; scout.SetMotionCommand(0.2, 0.0); } diff --git a/src/platforms/mobile_base.cpp b/src/platforms/mobile_base.cpp index c484b87..9cca69e 100644 --- a/src/platforms/mobile_base.cpp +++ b/src/platforms/mobile_base.cpp @@ -74,7 +74,7 @@ void MobileBase::ControlLoop(int32_t period_ms) { timeout_iter_num = static_cast(timeout_ms_ / period_ms); std::cout << "Timeout iteration number: " << timeout_iter_num << std::endl; } - + while (true) { ctrl_sw.tic(); if (enable_timeout_) { @@ -82,7 +82,7 @@ void MobileBase::ControlLoop(int32_t period_ms) { SendRobotCmd(); ++watchdog_counter_; } else { - std::cout << "Warning: cmd timeout, not sent to robot" << std::endl; + std::cout << "Warning: cmd timeout, old cmd not sent to robot" << std::endl; } } else { SendRobotCmd();