feat: read tape_plateau_min_fraction

This commit is contained in:
2026-10-30 09:43:47 +07:00
parent 1a76e7798f
commit d51f83804d
4 changed files with 44 additions and 4 deletions

View File

@@ -32,6 +32,21 @@ actions_trolley:
leg_shape: box
leg_width: 0.030 # [m]
min_legs: 3
# [-] Tỷ lệ plateau liên tiếp gần nhất trong run sáng bị trải cự ly; 0 tắt, cần bật tape và bloom.
# Tăng giúp loại lõi bloom dốc, nhưng dễ mất chân thật; giảm cứu thêm chân nhưng có thể nhận lõi méo.
# Ngưỡng quá thấp nguy hiểm vì pose sai; phải nhỏ hơn 1. KIT dán băng gương dùng 0.65 để giữ
# chân có dốc ở mép và loại lõi bị bloom; chỉ dùng sau khi kiểm chứng trên scan của lidar.
tape_plateau_min_fraction: 0.0
tci_trolley_plateau:
cart_opening: 0.517 # [m] Khoảng cách chân cạnh vào của xe test.
cart_depth: 0.720 # [m] Khoảng cách chân dọc xe test.
leg_shape: box
leg_width: 0.030 # [m] Bề rộng chân test.
tape_enabled: true
tape_bloom_max_angle: 0.10 # [rad] Góc lọc bloom cho test.
# [-] Ngưỡng plateau: tăng loại nhiều lõi dốc hơn, giảm dễ nhận lõi méo gây sai pose;
# 0 tắt, phải nhỏ hơn 1 và cần tape cùng bloom. KIT băng gương dùng 0.65 để cứu mép dốc.
tape_plateau_min_fraction: 0.65
tci_trolley_prior:
cart_opening: 0.517
cart_depth: 0.720

View File

@@ -508,6 +508,27 @@ TEST(TrolleyDetectionAction, RefusesAnUnknownProfile)
EXPECT_FALSE(h->start(makeAction("DetectTrolley", "khong_co_profile_nay"), robot::Time(10.0)));
}
TEST(TrolleyDetectionAction, LoadsPlateauFromYamlAndRejectsInvalidValue)
{
Rig rig;
ASSERT_TRUE(rig.loaded);
ActionHandler* handler = rig.registry.find("DetectTrolley");
ASSERT_NE(handler, nullptr);
EXPECT_TRUE(handler->start(makeAction("DetectTrolley", "tci_trolley_plateau"), robot::Time(10.0)));
const std::string key = "actions_trolley/detect_trolley/profiles/tci_trolley_plateau/"
"tape_plateau_min_fraction";
double value = 0.0;
ASSERT_TRUE(rig.nh.getParam(key, value));
EXPECT_DOUBLE_EQ(value, 0.65);
rig.nh.setParam(key, 1.0);
ActionRegistry invalid;
invalid.setContext(rig.ctx);
EXPECT_FALSE(invalid.loadFromConfig(rig.nh, kNamespace));
EXPECT_EQ(invalid.find("DetectTrolley"), nullptr);
rig.nh.setParam(key, 0.65);
}
TEST(TrolleyDetectionAction, RefusesToLoadWithoutASensorStore)
{
robot::NodeHandle nh;