refactor(custom_robot): 移除与low_controller相关的注释代码
清理不再使用的low_controller相关代码注释,保持代码整洁
This commit is contained in:
0
include/recharge.hpp
Normal file
0
include/recharge.hpp
Normal file
@@ -43,7 +43,6 @@ CustomRobot::~CustomRobot() {
|
|||||||
controller_.reset();
|
controller_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 屏蔽与low_controller_相关的代码
|
|
||||||
// low_controller_ = std::make_unique<LowController>();
|
// low_controller_ = std::make_unique<LowController>();
|
||||||
// low_controller_->initialize();
|
// low_controller_->initialize();
|
||||||
|
|
||||||
@@ -70,7 +69,6 @@ bool CustomRobot::initialize() {
|
|||||||
controller_ = std::make_unique<Controller>();
|
controller_ = std::make_unique<Controller>();
|
||||||
controller_->initialize();
|
controller_->initialize();
|
||||||
|
|
||||||
// 屏蔽与low_controller_相关的代码
|
|
||||||
// low_controller_ = std::make_unique<LowController>();
|
// low_controller_ = std::make_unique<LowController>();
|
||||||
// low_controller_->initialize();
|
// low_controller_->initialize();
|
||||||
|
|
||||||
@@ -124,7 +122,6 @@ bool CustomRobot::start() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 屏蔽与low_controller_相关的代码
|
|
||||||
// if (!low_controller_->start()) {
|
// if (!low_controller_->start()) {
|
||||||
// LOG_ERROR("Failed to start low-level controller");
|
// LOG_ERROR("Failed to start low-level controller");
|
||||||
// return false;
|
// return false;
|
||||||
@@ -296,7 +293,6 @@ void CustomRobot::processCmd(const nlohmann::json& message) {
|
|||||||
|
|
||||||
bool CustomRobot::processLowCmd(const std::string& cmd, const nlohmann::json& message)
|
bool CustomRobot::processLowCmd(const std::string& cmd, const nlohmann::json& message)
|
||||||
{
|
{
|
||||||
// 屏蔽与low_controller_相关的代码
|
|
||||||
// if (!low_controller_)
|
// if (!low_controller_)
|
||||||
// {
|
// {
|
||||||
// LOG_ERROR("LowController not initialized");
|
// LOG_ERROR("LowController not initialized");
|
||||||
@@ -333,7 +329,6 @@ bool CustomRobot::processLowCmd(const std::string& cmd, const nlohmann::json& me
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 临时返回false,直到重新实现功能
|
|
||||||
LOG_WARN("LowController functionality is currently disabled");
|
LOG_WARN("LowController functionality is currently disabled");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -678,7 +673,6 @@ bool CustomRobot::processSportCmd(const std::string& cmd, const nlohmann::json&
|
|||||||
std::string CustomRobot::generateRandomClientId() const {
|
std::string CustomRobot::generateRandomClientId() const {
|
||||||
std::string baseId = config_.mqtt_client_id;
|
std::string baseId = config_.mqtt_client_id;
|
||||||
|
|
||||||
// 确保base ID只包含ASCII字符
|
|
||||||
std::string safeBaseId;
|
std::string safeBaseId;
|
||||||
for (char c : baseId) {
|
for (char c : baseId) {
|
||||||
if (std::isalnum(c) || c == '_' || c == '-') {
|
if (std::isalnum(c) || c == '_' || c == '-') {
|
||||||
|
|||||||
0
src/recharge.cpp
Normal file
0
src/recharge.cpp
Normal file
Reference in New Issue
Block a user