Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ndt_scan_matcher): detect loss PCD #6735

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6a6ac7d
Initial commit
anhnv3991 Apr 3, 2024
9d125e0
style(pre-commit): autofix
pre-commit-ci[bot] Apr 3, 2024
a181ab9
Keep timeout only
anhnv3991 Apr 5, 2024
e579421
docs(lane_change): update documentation (#6544)
zulfaqar-azmi-t4 Apr 1, 2024
59f702f
feat(perception_online_evaluator): unify debug markers instead of sep…
kosuke55 Apr 1, 2024
d926427
feat(perception_online_evaluator): extract moving object for deviatio…
kosuke55 Apr 1, 2024
2fd07d1
feat(start_planner): add validation check to prevent over cropped pat…
danielsanchezaran Apr 1, 2024
5f9444d
feat(obstacle_avoidance_planner): sanitize reference points (#6704)
danielsanchezaran Apr 1, 2024
3da976c
fix(pose_initializer): added "user_defined_initial_pose" to dummy loc…
SakodaShintaro Apr 2, 2024
faeee27
feat(static_centerline_optimizer): static centerline optimizer with G…
takayuki5168 Apr 2, 2024
a8de91f
feat(multi_object_tracker): debug timer to work with reduced replay r…
technolojin Apr 2, 2024
ac1cd43
fix(object_recognition_utils): check polygon area on iou calculation …
technolojin Apr 2, 2024
0bd9a99
fix(predicted_path_checker): check if trajectory size (#6730)
beyzanurkaya Apr 2, 2024
faf4abd
fix(static_centerline_optimizer): fix latlon values of generated LL2 …
takayuki5168 Apr 2, 2024
5d14585
fix(lane_change): check prepare phase in intersection (#6561)
zulfaqar-azmi-t4 Apr 3, 2024
16c4713
fix(lane_change): fix terminal path not working in some case (#6722)
zulfaqar-azmi-t4 Apr 3, 2024
0d0069d
chore(goal_planner): delete unnecessary comments (#6729)
kosuke55 Apr 3, 2024
fcf0529
feat(global_parameter_loader): add gtest to global parameter loader (…
cyn-liu Apr 3, 2024
45f77be
feat(time_synchronizer_nodelet): set input_offsets zero if it was not…
brkay54 Apr 3, 2024
21c4eb0
refactor(object_range_splitter): rework parameters (#6705)
oguzkaganozt Apr 3, 2024
951b902
feat(tier4_autoware_utils, obstacle_cruise): change to read topic by …
yuki-takagi-66 Apr 3, 2024
47e7215
docs(perception_online_evaluator): add description about yaw rate eva…
kyoichi-sugahara Apr 4, 2024
c4546e2
fix(hazard_status_converter): check current operation mode (#6733)
isamu-takagi Apr 4, 2024
718bd0b
fix(lane_change): limit prepare and lane changing length (#6734)
zulfaqar-azmi-t4 Apr 4, 2024
5d0922d
feat(perception_online_evaluator): ignore reversal of orientation fro…
kosuke55 Apr 4, 2024
a6b29aa
feat(obstacle_pointcloud_based_validator_node): skip validation when …
YoshiRi Apr 5, 2024
c0f09e1
feat(lane_change): check prepare phase in turn direction lanes (#6726)
zulfaqar-azmi-t4 Apr 5, 2024
392a83c
Keep timeout only
anhnv3991 Apr 5, 2024
a46eee4
Merge branch 'autowarefoundation:feature/detect_loss_pcd' into featur…
anhnv3991 Apr 5, 2024
5e9e544
Merge branch 'autowarefoundation:main' into feature/detect_loss_pcd
anhnv3991 Apr 5, 2024
1a852f2
style(pre-commit): autofix
pre-commit-ci[bot] Apr 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ class MapUpdateModule

std::optional<geometry_msgs::msg::Point> last_update_position_ = std::nullopt;

// Metadata of segmented PCDs
std::unordered_set<std::string> all_pcds_;
std::unordered_set<std::string> cur_pcds_;
double pcd_res_x_, pcd_res_y_;
double pcd_lower_x_, pcd_lower_y_;
std::string pcd_tag_;

HyperParameters::DynamicMapLoading param_;

// Indicate if there is a prefetch thread waiting for being collected
Expand Down
15 changes: 15 additions & 0 deletions localization/ndt_scan_matcher/src/map_update_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,33 @@
request,
[](rclcpp::Client<autoware_map_msgs::srv::GetDifferentialPointCloudMap>::SharedFuture) {})};

// Wait for maximum 10 milliseconds
std::chrono::milliseconds timeout(10);
auto start = std::chrono::system_clock::now();

std::future_status status = result.wait_for(std::chrono::seconds(0));
while (status != std::future_status::ready) {
RCLCPP_INFO(logger_, "waiting response");
if (!rclcpp::ok()) {
return false; // No update
}

auto cur = std::chrono::system_clock::now();

// Report an error if wait for too long
if (cur - start >= timeout) {
RCLCPP_ERROR_STREAM_THROTTLE(
logger_, *clock_, 1000, "Waited for incoming PCDs for too long. Abandon NDT update.");
return false;
}

status = result.wait_for(std::chrono::seconds(1));
}

auto & maps_to_add = result.get()->new_pointcloud_with_ids;
auto & map_ids_to_remove = result.get()->ids_to_remove;

// Check

Check notice on line 175 in localization/ndt_scan_matcher/src/map_update_module.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Complex Method

MapUpdateModule::update_ndt increases in cyclomatic complexity from 9 to 10, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
RCLCPP_INFO(
logger_, "Update map (Add: %lu, Remove: %lu)", maps_to_add.size(), map_ids_to_remove.size());
if (maps_to_add.empty() && map_ids_to_remove.empty()) {
Expand Down
Loading