diff --git a/src/custom_robot.cpp b/src/custom_robot.cpp index 7616922..fa205a4 100644 --- a/src/custom_robot.cpp +++ b/src/custom_robot.cpp @@ -271,7 +271,8 @@ bool CustomRobot::processOacCmd(const std::string& cmd, const nlohmann::json& me } LOG_INFO("Current switch state: " + std::string(currentEnable ? "true" : "false")); // switch to opposite state - return controller_->SwitchSet(!currentEnable); + bool enable = !currentEnable; + return controller_->SwitchSet(enable); } else if (cmd == "SwitchGet") { bool enable = false;