optimal & fix file cmake
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*********************************************************************/
|
||||
#include <move_base2/core/state_machine.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
namespace move_base2
|
||||
@@ -23,13 +24,13 @@ bool StateMachineConfig::validate(std::string& error) const
|
||||
// giá trị vô nghĩa: khoảng cách chống quẩn âm, và bật chống quẩn mà không cho khoảng cách nào.
|
||||
if (oscillation_distance < 0.0)
|
||||
{
|
||||
error = "oscillation_distance phải >= 0 [m]";
|
||||
error = "oscillation_distance must be >= 0 [m]";
|
||||
return false;
|
||||
}
|
||||
if (oscillation_timeout > 0.0 && oscillation_distance <= 0.0)
|
||||
{
|
||||
error = "bật oscillation_timeout thì oscillation_distance phải > 0 [m], nếu không mọi cycle "
|
||||
"đều bị coi là quẩn";
|
||||
error = "oscillation_timeout is enabled so oscillation_distance must be > 0 [m], otherwise "
|
||||
"every cycle counts as oscillating";
|
||||
return false;
|
||||
}
|
||||
if (planner_patience <= 0.0 && max_planning_retries < 0)
|
||||
@@ -38,18 +39,36 @@ bool StateMachineConfig::validate(std::string& error) const
|
||||
// treo. Tắt cả hai nghĩa là một plugin không bao giờ trả lời sẽ giữ robot ở PLANNING vĩnh viễn,
|
||||
// im lặng, và state machine tin rằng mọi thứ bình thường. Ở chế độ đồng bộ trước đây điều này
|
||||
// vô hại hơn nhiều vì planner treo làm treo luôn control loop — hỏng thì thấy ngay.
|
||||
error = "planner_patience <= 0 [s] và max_planning_retries < 0 cùng lúc: không có gì phát hiện "
|
||||
"được planner treo; đặt ít nhất một trong hai";
|
||||
error = "planner_patience <= 0 [s] and max_planning_retries < 0 at the same time: nothing can "
|
||||
"detect a hung planner; set at least one of them";
|
||||
return false;
|
||||
}
|
||||
if (recovery_enabled && recovery_behavior_count == 0)
|
||||
{
|
||||
// Không phải lỗi cấu hình chết người, nhưng để im lặng thì lúc chạy sẽ ABORTED ngay ở lỗi đầu
|
||||
// tiên mà không ai hiểu vì sao. Bắt buộc khai báo tường minh recovery_enabled = false.
|
||||
error = "recovery_enabled = true nhưng recovery_behavior_count = 0; đặt recovery_enabled = "
|
||||
"false nếu thực sự không muốn có recovery";
|
||||
error = "recovery_enabled = true but recovery_behavior_count = 0; set recovery_enabled = false "
|
||||
"if you really do not want recovery";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!recovery_routes.empty())
|
||||
{
|
||||
const auto valid_route = [this](const std::vector<std::size_t>& route) {
|
||||
return !route.empty() &&
|
||||
std::all_of(route.begin(), route.end(), [this](std::size_t index) {
|
||||
return index < recovery_behavior_count;
|
||||
});
|
||||
};
|
||||
|
||||
if (!valid_route(recovery_routes.planning_failed) ||
|
||||
!valid_route(recovery_routes.controlling_failed) ||
|
||||
!valid_route(recovery_routes.oscillation))
|
||||
{
|
||||
error = "every configured recovery route must be non-empty and reference a loaded behavior";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,18 +77,28 @@ std::string StateMachineConfig::describe() const
|
||||
std::ostringstream out;
|
||||
out << "StateMachineConfig:\n";
|
||||
out << " planner_patience : " << planner_patience << " s"
|
||||
<< (planner_patience > 0.0 ? "" : " (tắt)") << '\n';
|
||||
<< (planner_patience > 0.0 ? "" : " (off)") << '\n';
|
||||
out << " controller_patience : " << controller_patience << " s"
|
||||
<< (controller_patience > 0.0 ? "" : " (tắt)") << '\n';
|
||||
<< (controller_patience > 0.0 ? "" : " (off)") << '\n';
|
||||
out << " oscillation_timeout : " << oscillation_timeout << " s"
|
||||
<< (oscillation_timeout > 0.0 ? "" : " (tắt)") << '\n';
|
||||
<< (oscillation_timeout > 0.0 ? "" : " (off)") << '\n';
|
||||
out << " action_patience : " << action_patience << " s"
|
||||
<< (action_patience > 0.0 ? "" : " (tắt — handler tự timeout)") << '\n';
|
||||
<< (action_patience > 0.0 ? "" : " (off — handler times out on its own)") << '\n';
|
||||
out << " oscillation_distance : " << oscillation_distance << " m\n";
|
||||
out << " max_planning_retries : " << max_planning_retries
|
||||
<< (max_planning_retries < 0 ? " (không giới hạn)" : "") << '\n';
|
||||
<< (max_planning_retries < 0 ? " (unlimited)" : "") << '\n';
|
||||
out << " recovery_enabled : " << (recovery_enabled ? "true" : "false") << '\n';
|
||||
out << " recovery_behavior_cnt : " << recovery_behavior_count << '\n';
|
||||
if (recovery_routes.empty())
|
||||
{
|
||||
out << " recovery_routes : legacy shared list\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " recovery_routes : planning=" << recovery_routes.planning_failed.size()
|
||||
<< " controlling=" << recovery_routes.controlling_failed.size()
|
||||
<< " oscillation=" << recovery_routes.oscillation.size() << '\n';
|
||||
}
|
||||
return out.str();
|
||||
}
|
||||
|
||||
@@ -79,13 +108,27 @@ std::string StateMachineConfig::describe() const
|
||||
|
||||
bool StateMachine::configure(const StateMachineConfig& config, std::string& error)
|
||||
{
|
||||
if (!config.validate(error))
|
||||
config_ = config;
|
||||
|
||||
// Schema cũ không có `recovery/routes`: giữ nguyên một list chung cho mọi trigger. Normalise ở
|
||||
// đây, sau khi RecoveryRunner đã báo số plugin nạp được thật, để phần còn lại của state machine
|
||||
// chỉ xử lý route đã resolve.
|
||||
if (config_.recovery_routes.empty())
|
||||
{
|
||||
for (std::size_t index = 0; index < config_.recovery_behavior_count; ++index)
|
||||
{
|
||||
config_.recovery_routes.planning_failed.push_back(index);
|
||||
config_.recovery_routes.controlling_failed.push_back(index);
|
||||
config_.recovery_routes.oscillation.push_back(index);
|
||||
}
|
||||
}
|
||||
|
||||
if (!config_.validate(error))
|
||||
{
|
||||
initialized_ = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
config_ = config;
|
||||
initialized_ = true;
|
||||
reset();
|
||||
return true;
|
||||
@@ -100,6 +143,8 @@ void StateMachine::reset()
|
||||
last_valid_control_ = robot::Time();
|
||||
last_oscillation_reset_ = robot::Time();
|
||||
recovery_index_ = 0;
|
||||
active_recovery_trigger_ = RecoveryTrigger::kPlanningFailed;
|
||||
recovery_route_cursors_.fill(0);
|
||||
planning_retries_ = 0;
|
||||
request_has_goal_ = true;
|
||||
action_count_ = 0;
|
||||
@@ -131,16 +176,49 @@ void StateMachine::beginPlanningCycle(const robot::Time& now)
|
||||
planning_retries_ = 0;
|
||||
}
|
||||
|
||||
std::size_t& StateMachine::recoveryRouteCursor(RecoveryTrigger trigger)
|
||||
{
|
||||
switch (trigger)
|
||||
{
|
||||
case RecoveryTrigger::kPlanningFailed:
|
||||
return recovery_route_cursors_[0];
|
||||
case RecoveryTrigger::kControllingFailed:
|
||||
return recovery_route_cursors_[1];
|
||||
case RecoveryTrigger::kOscillation:
|
||||
return recovery_route_cursors_[2];
|
||||
}
|
||||
return recovery_route_cursors_[0];
|
||||
}
|
||||
|
||||
const std::size_t& StateMachine::recoveryRouteCursor(RecoveryTrigger trigger) const
|
||||
{
|
||||
switch (trigger)
|
||||
{
|
||||
case RecoveryTrigger::kPlanningFailed:
|
||||
return recovery_route_cursors_[0];
|
||||
case RecoveryTrigger::kControllingFailed:
|
||||
return recovery_route_cursors_[1];
|
||||
case RecoveryTrigger::kOscillation:
|
||||
return recovery_route_cursors_[2];
|
||||
}
|
||||
return recovery_route_cursors_[0];
|
||||
}
|
||||
|
||||
void StateMachine::escalateToRecovery(RecoveryTrigger trigger, const robot::Time& now,
|
||||
const char* reason, StateMachineOutput& out)
|
||||
{
|
||||
if (!config_.recovery_enabled || recovery_index_ >= config_.recovery_behavior_count)
|
||||
const std::vector<std::size_t>& route = config_.recovery_routes.forTrigger(trigger);
|
||||
const std::size_t cursor = recoveryRouteCursor(trigger);
|
||||
|
||||
if (!config_.recovery_enabled || cursor >= route.size())
|
||||
{
|
||||
finish(NavigationState::kAborted, NavigationOutcome::kFailed, now,
|
||||
"hết recovery behavior khả dụng", out);
|
||||
"no recovery behavior left", out);
|
||||
return;
|
||||
}
|
||||
|
||||
active_recovery_trigger_ = trigger;
|
||||
recovery_index_ = route[cursor];
|
||||
out.start_recovery = true;
|
||||
out.recovery_index = recovery_index_;
|
||||
out.recovery_trigger = trigger;
|
||||
@@ -162,6 +240,8 @@ void StateMachine::acceptPendingRequest(const StateMachineInput& in, StateMachin
|
||||
{
|
||||
out.accept_request = true;
|
||||
recovery_index_ = 0;
|
||||
active_recovery_trigger_ = RecoveryTrigger::kPlanningFailed;
|
||||
recovery_route_cursors_.fill(0);
|
||||
request_has_goal_ = in.pending_request_has_goal;
|
||||
action_count_ = in.pending_request_action_count;
|
||||
action_index_ = 0;
|
||||
@@ -174,13 +254,13 @@ void StateMachine::acceptPendingRequest(const StateMachineInput& in, StateMachin
|
||||
// Không goal lẫn action là vi phạm contract; mission layer đã validate nhưng lõi vẫn phải tự
|
||||
// vệ: kết thúc tường minh thay vì treo ở một state không có đường ra.
|
||||
finish(NavigationState::kAborted, NavigationOutcome::kFailed, in.now,
|
||||
"yêu cầu không có goal lẫn action", out);
|
||||
"request has neither goal nor action", out);
|
||||
return;
|
||||
}
|
||||
out.start_action = true;
|
||||
out.action_index = 0;
|
||||
action_started_at_ = in.now;
|
||||
enter(NavigationState::kExecutingActions, in.now, "yêu cầu chỉ có action", out);
|
||||
enter(NavigationState::kExecutingActions, in.now, "action-only request", out);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -189,7 +269,7 @@ void StateMachine::acceptPendingRequest(const StateMachineInput& in, StateMachin
|
||||
last_valid_control_ = in.now;
|
||||
last_oscillation_reset_ = in.now;
|
||||
out.reset_oscillation_origin = true;
|
||||
enter(NavigationState::kPlanning, in.now, "nhận yêu cầu mới", out);
|
||||
enter(NavigationState::kPlanning, in.now, "new request accepted", out);
|
||||
}
|
||||
|
||||
bool StateMachine::preemptIfRequested(const StateMachineInput& in, StateMachineOutput& out)
|
||||
@@ -231,7 +311,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// Guard bắt buộc: không bao giờ quyết định điều khiển khi chưa configure.
|
||||
out.state = NavigationState::kIdle;
|
||||
out.velocity_source = VelocitySource::kNone;
|
||||
out.reason = "chưa configure";
|
||||
out.reason = "not configured";
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -239,7 +319,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// không phải chờ thêm một vòng.
|
||||
if (isTerminal(state_))
|
||||
{
|
||||
enter(NavigationState::kIdle, in.now, "yêu cầu đã kết thúc", out);
|
||||
enter(NavigationState::kIdle, in.now, "request finished", out);
|
||||
}
|
||||
|
||||
// Mất pose nghĩa là không biết robot ở đâu. Khi đó controller không được chạy, và không nguồn nào
|
||||
@@ -266,14 +346,14 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
if (in.cancel_requested)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
enter(NavigationState::kCancelling, in.now, "huỷ khi đang lập plan", out);
|
||||
enter(NavigationState::kCancelling, in.now, "cancelled while planning", out);
|
||||
break;
|
||||
}
|
||||
if (in.pause_requested)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
state_before_pause_ = NavigationState::kPlanning;
|
||||
enter(NavigationState::kPaused, in.now, "tạm dừng khi đang lập plan", out);
|
||||
enter(NavigationState::kPaused, in.now, "paused while planning", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -294,7 +374,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// CONTROLLING -> PLANNING -> CONTROLLING sẽ làm mới đồng hồ mỗi vòng, và một controller
|
||||
// hỏng vĩnh viễn sẽ không bao giờ chạm controller_patience. Hai đồng hồ đó chỉ được đặt lại
|
||||
// ở ba chỗ: nhận yêu cầu mới, tiếp tục sau tạm dừng, và sau khi recovery chạy xong.
|
||||
enter(NavigationState::kControlling, in.now, "có plan hợp lệ", out);
|
||||
enter(NavigationState::kControlling, in.now, "valid plan available", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -313,7 +393,8 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
escalateToRecovery(RecoveryTrigger::kPlanningFailed, in.now,
|
||||
retries_exhausted ? "hết lượt lập plan" : "quá hạn lập plan", out);
|
||||
retries_exhausted ? "planning retries exhausted" : "planning timed "
|
||||
"out", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -327,14 +408,14 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
if (in.cancel_requested)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
enter(NavigationState::kCancelling, in.now, "huỷ khi đang bám plan", out);
|
||||
enter(NavigationState::kCancelling, in.now, "cancelled while following the plan", out);
|
||||
break;
|
||||
}
|
||||
if (in.pause_requested)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
state_before_pause_ = NavigationState::kControlling;
|
||||
enter(NavigationState::kPaused, in.now, "tạm dừng khi đang bám plan", out);
|
||||
enter(NavigationState::kPaused, in.now, "paused while following the plan", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -369,10 +450,12 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
out.start_action = true;
|
||||
out.action_index = action_index_;
|
||||
action_started_at_ = in.now;
|
||||
enter(NavigationState::kExecutingActions, in.now, "đạt goal, còn action phải chạy", out);
|
||||
enter(NavigationState::kExecutingActions, in.now, "goal reached, actions still to run",
|
||||
out);
|
||||
break;
|
||||
}
|
||||
finish(NavigationState::kSucceeded, NavigationOutcome::kSucceeded, in.now, "đạt goal", out);
|
||||
finish(NavigationState::kSucceeded, NavigationOutcome::kSucceeded, in.now, "goal reached",
|
||||
out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -384,7 +467,8 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
(in.now - last_oscillation_reset_).toSec() > config_.oscillation_timeout)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
escalateToRecovery(RecoveryTrigger::kOscillation, in.now, "quẩn tại chỗ quá lâu", out);
|
||||
escalateToRecovery(RecoveryTrigger::kOscillation, in.now, "oscillating in place too long",
|
||||
out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -398,7 +482,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
{
|
||||
out.stop_planner = true;
|
||||
escalateToRecovery(RecoveryTrigger::kControllingFailed, in.now,
|
||||
"quá hạn sinh lệnh vận tốc", out);
|
||||
"velocity command generation timed out", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -408,7 +492,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// không thì vòng lặp lập-plan-rồi-lại-hỏng sẽ không bao giờ chạm controller_patience.
|
||||
out.start_planner = true;
|
||||
beginPlanningCycle(in.now);
|
||||
enter(NavigationState::kPlanning, in.now, "controller không sinh được lệnh, lập lại plan",
|
||||
enter(NavigationState::kPlanning, in.now, "controller produced no command, replanning",
|
||||
out);
|
||||
break;
|
||||
}
|
||||
@@ -434,7 +518,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
if (in.cancel_requested)
|
||||
{
|
||||
out.cancel_recovery = true;
|
||||
enter(NavigationState::kCancelling, in.now, "huỷ khi đang recovery", out);
|
||||
enter(NavigationState::kCancelling, in.now, "cancelled while recovering", out);
|
||||
break;
|
||||
}
|
||||
if (in.pause_requested)
|
||||
@@ -443,7 +527,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// dài là không an toàn (nó dead-reckon theo thời gian). Resume sẽ lập plan lại từ đầu.
|
||||
out.cancel_recovery = true;
|
||||
state_before_pause_ = NavigationState::kPlanning;
|
||||
enter(NavigationState::kPaused, in.now, "tạm dừng khi đang recovery", out);
|
||||
enter(NavigationState::kPaused, in.now, "paused while recovering", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -451,13 +535,17 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
{
|
||||
// Behavior chạy xong (thành công hay không) thì thử lập plan lại. Lỗi kế tiếp sẽ dùng
|
||||
// behavior kế tiếp; hết behavior thì ABORTED.
|
||||
++recovery_index_;
|
||||
std::size_t& cursor = recoveryRouteCursor(active_recovery_trigger_);
|
||||
++cursor;
|
||||
const std::vector<std::size_t>& route =
|
||||
config_.recovery_routes.forTrigger(active_recovery_trigger_);
|
||||
recovery_index_ = cursor < route.size() ? route[cursor] : config_.recovery_behavior_count;
|
||||
out.start_planner = true;
|
||||
beginPlanningCycle(in.now);
|
||||
last_valid_control_ = in.now;
|
||||
enter(NavigationState::kPlanning, in.now,
|
||||
in.recovery == RecoveryFeedback::kSucceeded ? "recovery xong, lập plan lại"
|
||||
: "recovery thất bại, lập plan lại",
|
||||
in.recovery == RecoveryFeedback::kSucceeded ? "recovery finished, replanning"
|
||||
: "recovery failed, replanning",
|
||||
out);
|
||||
break;
|
||||
}
|
||||
@@ -479,7 +567,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
if (in.cancel_requested)
|
||||
{
|
||||
out.cancel_action = true;
|
||||
enter(NavigationState::kCancelling, in.now, "huỷ khi đang chạy action", out);
|
||||
enter(NavigationState::kCancelling, in.now, "cancelled while running an action", out);
|
||||
break;
|
||||
}
|
||||
if (in.pause_requested)
|
||||
@@ -488,7 +576,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// dead-reckon, còn chạy lại một action thiết bị (nâng/hạ, sạc) từ đầu thì không chắc an
|
||||
// toàn — action không idempotent. Tạm dừng chỉ ngừng tick; resume tick tiếp đúng action đó.
|
||||
state_before_pause_ = NavigationState::kExecutingActions;
|
||||
enter(NavigationState::kPaused, in.now, "tạm dừng khi đang chạy action", out);
|
||||
enter(NavigationState::kPaused, in.now, "paused while running an action", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -497,7 +585,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// Action hỏng không có đường recovery: recovery behavior là công cụ phục hồi NAVIGATION
|
||||
// (dọn costmap, lùi, xoay), không giúp gì được một thiết bị đang hỏng. Kết thúc tường minh
|
||||
// để mission layer quyết định làm gì với phần còn lại của order.
|
||||
finish(NavigationState::kAborted, NavigationOutcome::kFailed, in.now, "action thất bại",
|
||||
finish(NavigationState::kAborted, NavigationOutcome::kFailed, in.now, "action failed",
|
||||
out);
|
||||
break;
|
||||
}
|
||||
@@ -513,7 +601,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
break; // Vẫn ở kExecutingActions, chuyển sang action kế tiếp.
|
||||
}
|
||||
finish(NavigationState::kSucceeded, NavigationOutcome::kSucceeded, in.now,
|
||||
"action cuối đã xong", out);
|
||||
"last action finished", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -524,7 +612,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
{
|
||||
out.cancel_action = true; // Bảo port dừng thiết bị an toàn trước khi kết thúc chặng.
|
||||
finish(NavigationState::kAborted, NavigationOutcome::kFailed, in.now,
|
||||
"action quá hạn action_patience", out);
|
||||
"action exceeded action_patience", out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -546,7 +634,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
|
||||
if (in.cancel_requested)
|
||||
{
|
||||
enter(NavigationState::kCancelling, in.now, "huỷ khi đang tạm dừng", out);
|
||||
enter(NavigationState::kCancelling, in.now, "cancelled while paused", out);
|
||||
break;
|
||||
}
|
||||
if (in.resume_requested)
|
||||
@@ -561,7 +649,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
if (state_before_pause_ == NavigationState::kControlling)
|
||||
{
|
||||
out.run_controller = true;
|
||||
enter(NavigationState::kControlling, in.now, "tiếp tục bám plan", out);
|
||||
enter(NavigationState::kControlling, in.now, "resume following the plan", out);
|
||||
}
|
||||
else if (state_before_pause_ == NavigationState::kExecutingActions)
|
||||
{
|
||||
@@ -570,12 +658,12 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
// gian của action, nếu không resume xong là ABORTED oan ngay lập tức.
|
||||
action_started_at_ = in.now;
|
||||
out.tick_action = true;
|
||||
enter(NavigationState::kExecutingActions, in.now, "tiếp tục chạy action", out);
|
||||
enter(NavigationState::kExecutingActions, in.now, "resume running the action", out);
|
||||
}
|
||||
else
|
||||
{
|
||||
out.start_planner = true;
|
||||
enter(NavigationState::kPlanning, in.now, "tiếp tục lập plan", out);
|
||||
enter(NavigationState::kPlanning, in.now, "resume planning", out);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -589,7 +677,7 @@ StateMachineOutput StateMachine::update(const StateMachineInput& in)
|
||||
if (in.robot_stopped)
|
||||
{
|
||||
finish(NavigationState::kCancelled, NavigationOutcome::kCancelled, in.now,
|
||||
"robot đã dừng hẳn", out);
|
||||
"robot came to a full stop", out);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user