refactor: host EnvMonitor from env_monitor_core, route per detector
EnvMonitor and its detectors now live in env_monitor_core. NavigationRuntime owns the monitor; StateMachine runs each detector's own route (step or sequence, lock or abort on exhaustion) with a cursor per detector. RecoveryRunner accepts named routes for detectors outside the six built-in triggers.
This commit is contained in:
@@ -207,6 +207,17 @@ BackUpRecovery:
|
||||
|
||||
# GhostRecovery cố ý KHÔNG khai library_path.
|
||||
|
||||
# --- Detector của EnvMonitor (gói env_monitor_core) -------------------------------------------
|
||||
# File này không có khối `env_monitor`: lõi dùng tham số mặc định và nạp 3 detector có sẵn, như trước khi tách gói.
|
||||
ContactDetector:
|
||||
library_path: libenv_monitor_core_contact_detector
|
||||
|
||||
StallDetector:
|
||||
library_path: libenv_monitor_core_stall_detector
|
||||
|
||||
UnreachableDetector:
|
||||
library_path: libenv_monitor_core_unreachable_detector
|
||||
|
||||
# --- Action handler cho action_runner_test -----------------------------------------------------
|
||||
actions:
|
||||
handlers:
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <move_base2/control_loop.h>
|
||||
|
||||
#include "env_monitor_fixture.h"
|
||||
#include "fake_ports.h"
|
||||
|
||||
using move_base2::ControlLoop;
|
||||
@@ -99,8 +100,11 @@ public:
|
||||
deps_.action = &action_;
|
||||
deps_.costmap_status = &costmap_status_;
|
||||
deps_.environment = &environment_;
|
||||
deps_.env_monitor = &env_monitor_;
|
||||
|
||||
std::string error;
|
||||
EXPECT_TRUE(move_base2::testing::initEnvMonitor(env_monitor_, env_monitor_core::EnvMonitorConfig(), error))
|
||||
<< error;
|
||||
EXPECT_TRUE(loop_.configure(baseConfig(), deps_, error)) << error;
|
||||
}
|
||||
|
||||
@@ -145,6 +149,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
env_monitor_core::EnvMonitor env_monitor_; ///< trước loop_: loop_ giữ con trỏ tới nó
|
||||
ControlLoop loop_;
|
||||
ControlLoopDeps deps_;
|
||||
FakeClockPort clock_;
|
||||
|
||||
57
test/env_monitor_fixture.h
Normal file
57
test/env_monitor_fixture.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*********************************************************************
|
||||
*
|
||||
* Software License Agreement (BSD License)
|
||||
*
|
||||
* move_base2 tests — an EnvMonitor (env_monitor_core) built from an EnvMonitorConfig through the real YAML path:
|
||||
* the struct becomes the `env_monitor` block under a fresh namespace, the three built-in detectors are loaded as
|
||||
* .so from devel/lib, exactly as NavigationRuntime does.
|
||||
*
|
||||
* Author: DuongTD
|
||||
*********************************************************************/
|
||||
#ifndef MOVE_BASE2_TEST_ENV_MONITOR_FIXTURE_H_
|
||||
#define MOVE_BASE2_TEST_ENV_MONITOR_FIXTURE_H_
|
||||
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include <robot/node_handle.h>
|
||||
|
||||
#include <env_monitor_core/env_monitor.h>
|
||||
|
||||
#ifndef MOVE_BASE2_TEST_LIBRARY_DIR
|
||||
#error "MOVE_BASE2_TEST_LIBRARY_DIR must be defined by CMake"
|
||||
#endif
|
||||
|
||||
namespace move_base2
|
||||
{
|
||||
namespace testing
|
||||
{
|
||||
|
||||
inline bool initEnvMonitor(env_monitor_core::EnvMonitor& monitor, const env_monitor_core::EnvMonitorConfig& config,
|
||||
std::string& error)
|
||||
{
|
||||
static int counter = 0;
|
||||
// devel/lib must win over a PNKX_NAV_CORE_LIBRARY_PATH left in the user's shell.
|
||||
setenv("PNKX_NAV_CORE_LIBRARY_PATH", MOVE_BASE2_TEST_LIBRARY_DIR, 1);
|
||||
robot::NodeHandle nh("move_base2_env_monitor_test_" + std::to_string(++counter));
|
||||
const char* const kLibraries[][2] = {
|
||||
{ "ContactDetector", "libenv_monitor_core_contact_detector" },
|
||||
{ "StallDetector", "libenv_monitor_core_stall_detector" },
|
||||
{ "UnreachableDetector", "libenv_monitor_core_unreachable_detector" },
|
||||
};
|
||||
for (const auto& lib : kLibraries)
|
||||
{
|
||||
YAML::Node node;
|
||||
node["library_path"] = lib[1];
|
||||
nh.setParam(lib[0], node);
|
||||
}
|
||||
nh.setParam("env_monitor", env_monitor_core::toYaml(config));
|
||||
return monitor.initialize(nh, error);
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
} // namespace move_base2
|
||||
|
||||
#endif // MOVE_BASE2_TEST_ENV_MONITOR_FIXTURE_H_
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,8 @@
|
||||
*********************************************************************/
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <move_base2/core/state_machine.h>
|
||||
@@ -32,6 +34,38 @@ using move_base2::VelocitySource;
|
||||
namespace
|
||||
{
|
||||
|
||||
/// Bit của bốn detector mà các test dưới dùng, cùng nghĩa với bốn cờ cố định trước 26/11.
|
||||
enum LegacyDetector : std::uint32_t
|
||||
{
|
||||
kCollisionBit = 1u << 0, ///< contact -> route collision, khoá
|
||||
kBlockedBit = 1u << 1, ///< unreachable -> route path_blocked, khoá
|
||||
kOffPathBit = 1u << 2, ///< off_path -> route off_path, khoá
|
||||
kNoProgressBit = 1u << 3, ///< stall -> route oscillation, ABORT
|
||||
};
|
||||
|
||||
/// Bốn detector theo đúng thứ tự ưu tiên cũ (collision > path_blocked > off_path; stall riêng nhánh controller).
|
||||
void addLegacyDetectors(move_base2::StateMachineConfig& config)
|
||||
{
|
||||
if (config.recovery_routes.empty())
|
||||
{
|
||||
config.recovery_routes.fillLegacy(config.recovery_behavior_count);
|
||||
}
|
||||
const auto route = [](const char* name, const std::vector<std::size_t>& indices, bool lock, RecoveryTrigger trigger) {
|
||||
move_base2::DetectorRoute r;
|
||||
r.name = name;
|
||||
r.route = indices;
|
||||
r.lock_on_exhausted = lock;
|
||||
r.trigger = trigger;
|
||||
return r;
|
||||
};
|
||||
config.detector_routes = {
|
||||
route("contact", config.recovery_routes.collision, true, RecoveryTrigger::kCollision),
|
||||
route("unreachable", config.recovery_routes.path_blocked, true, RecoveryTrigger::kPathBlocked),
|
||||
route("off_path", config.recovery_routes.off_path, true, RecoveryTrigger::kOffPath),
|
||||
route("stall", config.recovery_routes.oscillation, false, RecoveryTrigger::kOscillation),
|
||||
};
|
||||
}
|
||||
|
||||
/// @brief Cấu hình cơ sở cho test: ngưỡng ngắn để không phải tua thời gian dài.
|
||||
StateMachineConfig baseConfig()
|
||||
{
|
||||
@@ -53,9 +87,13 @@ StateMachineConfig baseConfig()
|
||||
class Driver
|
||||
{
|
||||
public:
|
||||
explicit Driver(const StateMachineConfig& config = baseConfig())
|
||||
explicit Driver(StateMachineConfig config = baseConfig())
|
||||
{
|
||||
std::string error;
|
||||
if (config.detector_routes.empty())
|
||||
{
|
||||
addLegacyDetectors(config);
|
||||
}
|
||||
configured_ = machine_.configure(config, error);
|
||||
EXPECT_TRUE(configured_) << error;
|
||||
now_ = 1000.0;
|
||||
@@ -884,7 +922,7 @@ TEST(StateMachineControlling, NoProgressFlagEscalatesToOscillationRecovery)
|
||||
driver.driveToControlling();
|
||||
|
||||
StateMachineInput input = controller(ControllerFeedback::kCommandValid);
|
||||
input.no_progress = true;
|
||||
input.detector_fired |= kNoProgressBit;
|
||||
const StateMachineOutput out = driver.tick(input);
|
||||
|
||||
EXPECT_EQ(out.state, NavigationState::kRecovering);
|
||||
@@ -2197,7 +2235,7 @@ StateMachineInput collisionInput()
|
||||
{
|
||||
StateMachineInput input;
|
||||
input.controller = ControllerFeedback::kCommandValid;
|
||||
input.collision = true;
|
||||
input.detector_fired |= kCollisionBit;
|
||||
input.active_recovery_output = RecoveryOutputKind::kPath;
|
||||
return input;
|
||||
}
|
||||
@@ -2206,7 +2244,7 @@ StateMachineInput blockedInput()
|
||||
{
|
||||
StateMachineInput input;
|
||||
input.controller = ControllerFeedback::kCommandValid;
|
||||
input.path_blocked = true;
|
||||
input.detector_fired |= kBlockedBit;
|
||||
// Cả hai route giám sát tuyến đều trỏ vào detour, họ kPath: nó KHÔNG lái robot, chỉ trả đường đi
|
||||
// mới. Khai đúng họ ở đây để test kiểm được bất biến "robot đứng yên suốt lúc detour".
|
||||
input.active_recovery_output = RecoveryOutputKind::kPath;
|
||||
@@ -2217,7 +2255,7 @@ StateMachineInput offPathInput()
|
||||
{
|
||||
StateMachineInput input;
|
||||
input.controller = ControllerFeedback::kCommandValid;
|
||||
input.off_path = true;
|
||||
input.detector_fired |= kOffPathBit;
|
||||
input.active_recovery_output = RecoveryOutputKind::kPath;
|
||||
return input;
|
||||
}
|
||||
@@ -2260,8 +2298,8 @@ TEST(StateMachinePathMonitor, BlockedPathWinsWhenBothFire)
|
||||
|
||||
StateMachineInput both;
|
||||
both.controller = ControllerFeedback::kCommandValid;
|
||||
both.path_blocked = true;
|
||||
both.off_path = true;
|
||||
both.detector_fired |= kBlockedBit;
|
||||
both.detector_fired |= kOffPathBit;
|
||||
|
||||
EXPECT_EQ(driver.tick(both).recovery_trigger, RecoveryTrigger::kPathBlocked);
|
||||
}
|
||||
@@ -2303,8 +2341,8 @@ TEST(StateMachineCollisionTrigger, WinsOverPathBlockedAndOffPath)
|
||||
driver.driveToControlling();
|
||||
|
||||
StateMachineInput all = collisionInput();
|
||||
all.path_blocked = true;
|
||||
all.off_path = true;
|
||||
all.detector_fired |= kBlockedBit;
|
||||
all.detector_fired |= kOffPathBit;
|
||||
const StateMachineOutput out = driver.tick(all);
|
||||
EXPECT_EQ(out.state, NavigationState::kRecovering);
|
||||
EXPECT_EQ(out.recovery_trigger, RecoveryTrigger::kCollision);
|
||||
@@ -3038,6 +3076,134 @@ TEST(StateMachineEmergency, IsNotTerminalAndMustBeStopped)
|
||||
EXPECT_STREQ(move_base2::toString(NavigationState::kEmergency), "EMERGENCY");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// route_mode: sequence (chốt 26/11, Test/docs/move_base2/ENV_DETECTOR_PLUGINS_PROMPT.md §4.5)
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace
|
||||
{
|
||||
/// Một detector `contact` chạy route [0, 1, 2] kiểu sequence, cạn thì khoá.
|
||||
StateMachineConfig sequenceConfig()
|
||||
{
|
||||
StateMachineConfig config = baseConfig();
|
||||
config.recovery_behavior_count = 3;
|
||||
config.recovery_routes.planning_failed = { 0 };
|
||||
config.recovery_routes.controlling_failed = { 0 };
|
||||
config.recovery_routes.oscillation = { 0 };
|
||||
move_base2::DetectorRoute contact;
|
||||
contact.name = "contact";
|
||||
contact.route = { 0, 1, 2 };
|
||||
contact.lock_on_exhausted = true;
|
||||
contact.sequence = true;
|
||||
contact.trigger = RecoveryTrigger::kCollision;
|
||||
config.detector_routes = { contact };
|
||||
return config;
|
||||
}
|
||||
|
||||
StateMachineInput sequenceFire()
|
||||
{
|
||||
StateMachineInput input;
|
||||
input.controller = ControllerFeedback::kCommandValid;
|
||||
input.detector_fired = 1u;
|
||||
input.active_recovery_output = RecoveryOutputKind::kPath;
|
||||
return input;
|
||||
}
|
||||
|
||||
StateMachineInput behaviorDone(RecoveryFeedback result, bool with_path = false)
|
||||
{
|
||||
StateMachineInput input;
|
||||
input.recovery = result;
|
||||
input.planner = with_path ? PlannerFeedback::kPlanReady : PlannerFeedback::kIdle;
|
||||
input.active_recovery_output = RecoveryOutputKind::kPath;
|
||||
return input;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST(StateMachineSequence, OneFiringRunsTheWholeRouteEvenWhenABehaviorFails)
|
||||
{
|
||||
Driver driver(sequenceConfig());
|
||||
driver.driveToControlling();
|
||||
|
||||
StateMachineOutput out = driver.tick(sequenceFire());
|
||||
ASSERT_EQ(out.state, NavigationState::kRecovering);
|
||||
EXPECT_TRUE(out.start_recovery);
|
||||
EXPECT_EQ(out.recovery_index, 0u);
|
||||
EXPECT_FALSE(out.recovery_chain_continues);
|
||||
EXPECT_EQ(out.recovery_detector, 0);
|
||||
|
||||
out = driver.tick(behaviorDone(RecoveryFeedback::kFailed));
|
||||
EXPECT_EQ(out.state, NavigationState::kRecovering) << "a failed behavior does not end a sequence";
|
||||
EXPECT_TRUE(out.start_recovery);
|
||||
EXPECT_TRUE(out.recovery_chain_continues);
|
||||
EXPECT_EQ(out.recovery_index, 1u);
|
||||
|
||||
out = driver.tick(behaviorDone(RecoveryFeedback::kSucceeded));
|
||||
EXPECT_TRUE(out.recovery_chain_continues);
|
||||
EXPECT_EQ(out.recovery_index, 2u);
|
||||
|
||||
out = driver.tick(behaviorDone(RecoveryFeedback::kSucceeded));
|
||||
EXPECT_TRUE(out.recovery_chain_finished);
|
||||
EXPECT_FALSE(out.recovery_chain_has_path);
|
||||
EXPECT_FALSE(out.recovery_chain_last_failed);
|
||||
EXPECT_FALSE(out.apply_plan);
|
||||
EXPECT_EQ(out.state, NavigationState::kControlling);
|
||||
|
||||
// Cả chuỗi là MỘT lượt: lần nổ sau route đã cạn -> khoá (lock), robot bám tiếp plan.
|
||||
out = driver.tick(sequenceFire());
|
||||
EXPECT_TRUE(out.monitor_trigger_suppressed);
|
||||
EXPECT_FALSE(out.start_recovery);
|
||||
EXPECT_EQ(out.state, NavigationState::kControlling);
|
||||
}
|
||||
|
||||
TEST(StateMachineSequence, APathInTheMiddleIsHeldAppliedAtTheEndAndRefillsTheRoute)
|
||||
{
|
||||
Driver driver(sequenceConfig());
|
||||
driver.driveToControlling();
|
||||
driver.tick(sequenceFire());
|
||||
|
||||
StateMachineOutput out = driver.tick(behaviorDone(RecoveryFeedback::kSucceeded, true));
|
||||
EXPECT_TRUE(out.recovery_chain_continues) << "a new path does not end a sequence";
|
||||
EXPECT_FALSE(out.apply_plan) << "the path waits for the end of the chain";
|
||||
EXPECT_EQ(out.state, NavigationState::kRecovering);
|
||||
|
||||
driver.tick(behaviorDone(RecoveryFeedback::kSucceeded));
|
||||
out = driver.tick(behaviorDone(RecoveryFeedback::kFailed));
|
||||
EXPECT_TRUE(out.recovery_chain_finished);
|
||||
EXPECT_TRUE(out.recovery_chain_has_path);
|
||||
EXPECT_TRUE(out.recovery_chain_last_failed);
|
||||
EXPECT_TRUE(out.apply_plan);
|
||||
EXPECT_EQ(out.state, NavigationState::kControlling);
|
||||
EXPECT_STREQ(out.reason, "recovery produced a detour path");
|
||||
|
||||
// Chuỗi có path mới và đây là lần nạp đầu: route nạp lại, lần nổ sau chạy lại cả chuỗi.
|
||||
out = driver.tick(sequenceFire());
|
||||
EXPECT_FALSE(out.monitor_trigger_suppressed);
|
||||
EXPECT_TRUE(out.start_recovery);
|
||||
EXPECT_EQ(out.recovery_index, 0u);
|
||||
}
|
||||
|
||||
TEST(StateMachineSequence, ANewPathWithoutTravelDoesNotRefillTheRoute)
|
||||
{
|
||||
StateMachineConfig config = sequenceConfig();
|
||||
config.recovery_reset_min_travel = 0.10; // [m]
|
||||
Driver driver(config);
|
||||
driver.driveToControlling();
|
||||
|
||||
// Lượt 1: có path -> nạp lại (lần đầu luôn được), mốc quãng đường đặt ở 0.
|
||||
driver.tick(sequenceFire());
|
||||
driver.tick(behaviorDone(RecoveryFeedback::kSucceeded, true));
|
||||
driver.tick(behaviorDone(RecoveryFeedback::kSucceeded));
|
||||
ASSERT_TRUE(driver.tick(behaviorDone(RecoveryFeedback::kSucceeded)).recovery_chain_finished);
|
||||
|
||||
// Lượt 2: lại có path nhưng robot chưa đi được 0.10 m -> tính như một lượt, route cạn.
|
||||
driver.tick(sequenceFire());
|
||||
driver.tick(behaviorDone(RecoveryFeedback::kSucceeded, true));
|
||||
driver.tick(behaviorDone(RecoveryFeedback::kSucceeded));
|
||||
const StateMachineOutput end = driver.tick(behaviorDone(RecoveryFeedback::kSucceeded));
|
||||
ASSERT_TRUE(end.recovery_chain_finished);
|
||||
EXPECT_TRUE(end.recovery_reset_denied);
|
||||
EXPECT_TRUE(driver.tick(sequenceFire()).monitor_trigger_suppressed);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <move_base2/control_loop.h>
|
||||
|
||||
#include "env_monitor_fixture.h"
|
||||
#include "fake_ports.h"
|
||||
|
||||
using move_base2::ControlLoop;
|
||||
@@ -117,7 +118,9 @@ NavigationRequest makeActionOnlyRequest(std::size_t count, std::uint64_t sequenc
|
||||
class Fixture
|
||||
{
|
||||
public:
|
||||
explicit Fixture(const ControlLoopConfig& config = baseConfig()) : recovery_(2)
|
||||
explicit Fixture(const ControlLoopConfig& config = baseConfig(),
|
||||
const env_monitor_core::EnvMonitorConfig& env = env_monitor_core::EnvMonitorConfig())
|
||||
: recovery_(2)
|
||||
{
|
||||
pose_.setPosition(0.0, 0.0);
|
||||
|
||||
@@ -130,12 +133,14 @@ public:
|
||||
deps_.action = &action_;
|
||||
deps_.costmap_status = &costmap_status_;
|
||||
deps_.environment = &environment_;
|
||||
deps_.env_monitor = &env_monitor_;
|
||||
deps_.components = &components_;
|
||||
planner_.attachStatusBoard(&components_);
|
||||
recovery_.attachStatusBoard(&components_);
|
||||
action_.attachStatusBoard(&components_);
|
||||
|
||||
std::string error;
|
||||
EXPECT_TRUE(move_base2::testing::initEnvMonitor(env_monitor_, env, error)) << error;
|
||||
EXPECT_TRUE(loop_.configure(config, deps_, error)) << error;
|
||||
}
|
||||
|
||||
@@ -173,6 +178,7 @@ public:
|
||||
return hit_limit_;
|
||||
}
|
||||
|
||||
env_monitor_core::EnvMonitor env_monitor_; ///< trước loop_: loop_ giữ con trỏ tới nó
|
||||
ControlLoop loop_;
|
||||
FakeClockPort clock_;
|
||||
FakePosePort pose_;
|
||||
@@ -2122,22 +2128,29 @@ ControlLoopConfig envContactConfig()
|
||||
config.state_machine.recovery_routes.oscillation = { 0 };
|
||||
config.state_machine.recovery_routes.path_blocked = { 1 };
|
||||
config.state_machine.recovery_routes.collision = { 1 };
|
||||
config.env_monitor.enabled = true;
|
||||
config.env_monitor.stall.action = "log";
|
||||
config.env_monitor.unreachable.action = "log";
|
||||
config.env_monitor.contact.action = "recover";
|
||||
config.env_monitor.contact.apply_command = true;
|
||||
config.env_monitor.contact.confirm_cycles = 2;
|
||||
config.env_monitor.contact.trigger_static_time = 0.3; // [s] = 6 cycle, đủ ngắn cho test
|
||||
config.env_monitor.contact.clean_start_margin = 0.2; // [m]
|
||||
config.env_sampling.check_period = 0.01; // [s] < chu kỳ 0.05 -> tick nặng mỗi cycle
|
||||
return config;
|
||||
}
|
||||
|
||||
/// Tham số lõi EnvMonitor của bộ test kContact (nạp qua YAML như runtime).
|
||||
env_monitor_core::EnvMonitorConfig envContactMonitor()
|
||||
{
|
||||
env_monitor_core::EnvMonitorConfig env;
|
||||
env.enabled = true;
|
||||
env.stall.action = "log";
|
||||
env.unreachable.action = "log";
|
||||
env.contact.action = "recover";
|
||||
env.contact.apply_command = true;
|
||||
env.contact.confirm_cycles = 2;
|
||||
env.contact.trigger_static_time = 0.3; // [s] = 6 cycle, đủ ngắn cho test
|
||||
env.contact.clean_start_margin = 0.2; // [m]
|
||||
return env;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST(WalkingSkeletonEnvContact, BrakesAfterConfirmThenRaisesCollisionAfterStaticTime)
|
||||
{
|
||||
Fixture fixture(envContactConfig());
|
||||
Fixture fixture(envContactConfig(), envContactMonitor());
|
||||
driveToControlling(fixture);
|
||||
|
||||
// Tiếp xúc 0.10 m trên quỹ đạo, trong clean_start_margin: cycle 1 đếm, cycle 2 phanh -> lệnh 0.
|
||||
@@ -2166,7 +2179,7 @@ TEST(WalkingSkeletonEnvContact, HeldWithTheRouteSpentEscalatesToControllingFaile
|
||||
// Cùng chuỗi bắt buộc như guard cũ: cạn route collision -> khoá -> brake giữ 0 nhưng controller
|
||||
// phải bị báo no_valid_command -> controller_patience -> controlling_failed. Không có bước này
|
||||
// robot đứng chết vô hạn với controller "ổn".
|
||||
Fixture fixture(envContactConfig());
|
||||
Fixture fixture(envContactConfig(), envContactMonitor());
|
||||
driveToControlling(fixture);
|
||||
fixture.recovery_.setScript({ RecoveryScript::kFailed });
|
||||
|
||||
@@ -2207,7 +2220,7 @@ TEST(WalkingSkeletonEnvContact, DetourFromContactThatDidNotMoveTheRobotArmsTheSt
|
||||
// Run 6/9 16:30 (đám đông): người đứng 7 cm trước mũi -> cờ collision -> detour -> chạm lại ngay -> cờ -> detour ...
|
||||
// 4 lần rồi ABORT, vì stand-down không được vũ trang (trigger đọc ở cycle tick là mặc định). Chuỗi đúng: sau
|
||||
// detour do cờ collision mà robot không dịch, chạm lại thì kContact ĐỨNG RA — không phanh, không cờ thứ hai.
|
||||
Fixture fixture(envContactConfig());
|
||||
Fixture fixture(envContactConfig(), envContactMonitor());
|
||||
driveToControlling(fixture);
|
||||
std::vector<robot_geometry_msgs::PoseStamped> detour{ makeRequest(0.0).goal, makeRequest(3.0).goal };
|
||||
fixture.recovery_.setScript({ RecoveryScript::kSucceeded });
|
||||
@@ -2245,7 +2258,7 @@ TEST(WalkingSkeletonEnvContact, DetourFromContactThatDidNotMoveTheRobotArmsTheSt
|
||||
|
||||
TEST(WalkingSkeletonEnvContact, ContactBeyondTheStoppingDistanceCapsSpeedWithoutBraking)
|
||||
{
|
||||
Fixture fixture(envContactConfig());
|
||||
Fixture fixture(envContactConfig(), envContactMonitor());
|
||||
driveToControlling(fixture);
|
||||
const double v_free = fixture.loop_.lastCommand().linear.x;
|
||||
ASSERT_GT(v_free, 0.27);
|
||||
|
||||
Reference in New Issue
Block a user