feat: load v_shape from the profile YAML, add the dock measuring guide
Read v_shape per profile and fail loud on an unknown value. The start log now prints the loaded v_shape so it can be checked without opening the YAML on the robot. Add doc/MEASURE_AND_CONFIGURE.md with figures and link it from the README.
This commit is contained in:
@@ -242,9 +242,13 @@ public:
|
||||
filter_.reset();
|
||||
filter_.setLabels(scan_topic_, ctx_.global_frame);
|
||||
|
||||
robot::log_info("[dock_pattern] '%s': detecting pattern '%s' (profile '%s') on '%s' -> '%s'.",
|
||||
// v_shape in kèm: khoá này loại cả trạm thật khi đặt sai hướng, và dòng này là chỗ duy nhất
|
||||
// xác nhận được giá trị đã nạp mà không cần mở YAML trên robot.
|
||||
robot::log_info("[dock_pattern] '%s': detecting pattern '%s' (profile '%s', v_shape=%s) on "
|
||||
"'%s' -> '%s'.",
|
||||
name_.c_str(), dock_pattern_detector::toString(found->second.pattern),
|
||||
profile_name.c_str(), scan_topic_.c_str(), output_frame_.c_str());
|
||||
profile_name.c_str(), dock_pattern_detector::toString(found->second.v_shape),
|
||||
scan_topic_.c_str(), output_frame_.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -377,6 +381,16 @@ private:
|
||||
nh_param(p_nh, "angle_tolerance", profile.angle_tolerance);
|
||||
nh_param(p_nh, "length_tolerance", profile.length_tolerance);
|
||||
nh_param(p_nh, "vertex_gap", profile.vertex_gap);
|
||||
|
||||
std::string v_shape_name = dock_pattern_detector::toString(profile.v_shape);
|
||||
nh_param(p_nh, "v_shape", v_shape_name);
|
||||
if (!dock_pattern_detector::vShapeFromString(v_shape_name, profile.v_shape, error))
|
||||
{
|
||||
robot::log_error("[dock_pattern] '%s': profile '%s': %s", name_.c_str(),
|
||||
profile_name.c_str(), error.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
nh_param(p_nh, "search_radius", profile.search_radius);
|
||||
nh_param(p_nh, "search_fov", profile.search_fov);
|
||||
nh_param(p_nh, "offset_x", profile.offset_x);
|
||||
|
||||
Reference in New Issue
Block a user