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

chore: sync upstream #1

Merged
merged 19 commits into from
Jan 24, 2022
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3e27b12
fix(behavior_path): add minus and comments (#246)
h-ohta Jan 12, 2022
244268b
fix: use transient_local qos for route (#149)
1222-takeshi Jan 13, 2022
045009c
fix: ring outlier filter bug (#253)
satoshi-ota Jan 14, 2022
2b1c1b3
fix(behavior velocity planner): occlusion spot slice (#237)
taikitanaka3 Jan 17, 2022
1225511
fix(behavior_path_planner): add transformation to polygon, obj frame …
h-ohta Jan 17, 2022
31decd3
fix(ndt_scan_matcher): fix compiler flags and Eigen aligned allocator…
harihitode Jan 17, 2022
cd5b5e3
fix(lanelet2_extension): add guard for inner product (#256)
kyoichi-sugahara Jan 18, 2022
9843b8e
fix(system_monitor): fix build error on aarch64 (#263)
KeisukeShima Jan 18, 2022
fe14a99
feat(diagnostics_aggregator): remove map_version diagnostic from conf…
0x126 Jan 19, 2022
c143557
fix(lanelet2_extension): fix getAngleDifference (#264)
taikitanaka3 Jan 20, 2022
dd3b946
test(behavior velocity): fix unstable gtest (#273)
taikitanaka3 Jan 20, 2022
96215b8
fix(vehicle_cmd_gate): fix topic name (#274)
1222-takeshi Jan 20, 2022
1ad7818
feat: port pure_pursuit (#271)
rej55 Jan 21, 2022
02d1c39
fix(behavior_velocity_planner): fix inversion of object orientation i…
tkimura4 Jan 21, 2022
baeca25
feat: add covariance param (#281)
YamatoAndo Jan 21, 2022
a91d3f1
fix: typo in localization util.launch.py (#277)
YamatoAndo Jan 21, 2022
6d27a37
feat: add pose_initializer params (#279)
YamatoAndo Jan 21, 2022
7ecbd72
fix: particle distribution of initial pose estimatation (#278)
YamatoAndo Jan 21, 2022
10bd1c0
feat(route_handler): better avoidance drivable areas extension in beh…
zulfaqar-azmi-t4 Jan 24, 2022
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
Prev Previous commit
Next Next commit
fix: ring outlier filter bug (#253)
* fix: cast field individually

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* chore: cleanup

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored Jan 14, 2022
commit 045009c4834f9c0ae9c2a0513e6f6c12ee88e86a
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void RingOutlierFilterComponent::filter(
PointCloud2 & output)
{
boost::mutex::scoped_lock lock(mutex_);
output.header = input->header;
if (input->row_step < 1) {
return;
}
Expand All @@ -53,38 +54,47 @@ void RingOutlierFilterComponent::filter(
.emplace_back(idx);
}

output.header = input->header;
PointCloud2Modifier<PointXYZI> output_modifier{output, input->header.frame_id};
output_modifier.reserve(input->width);

std::vector<std::size_t> tmp_indices;
tmp_indices.reserve(input->width);

const auto azimuth_offset =
input->fields.at(static_cast<size_t>(autoware_point_types::PointIndex::Azimuth)).offset;
const auto distance_offset =
input->fields.at(static_cast<size_t>(autoware_point_types::PointIndex::Distance)).offset;
for (const auto & ring_indices : input_ring_array) {
if (ring_indices.size() < 2) {
continue;
}

for (size_t idx = 0; idx < ring_indices.size() - 1; ++idx) {
const auto current_idx = ring_indices.at(idx);
const auto next_idx = ring_indices.at(idx + 1);
PointXYZIRADRT * current_pt =
reinterpret_cast<PointXYZIRADRT *>(&input_ptr->data[current_idx]);
PointXYZIRADRT * next_pt = reinterpret_cast<PointXYZIRADRT *>(&input_ptr->data[next_idx]);
for (size_t idx = 0U; idx < ring_indices.size() - 1; ++idx) {
const auto & current_idx = ring_indices.at(idx);
const auto & next_idx = ring_indices.at(idx + 1);
tmp_indices.emplace_back(current_idx);

// if(std::abs(iter->distance - (iter+1)->distance) <= std::sqrt(iter->distance) * 0.08)
float azimuth_diff = next_pt->azimuth - current_pt->azimuth;
const auto current_pt_azimuth =
*reinterpret_cast<float *>(&input_ptr->data[current_idx + azimuth_offset]);
const auto next_pt_azimuth =
*reinterpret_cast<float *>(&input_ptr->data[next_idx + azimuth_offset]);
float azimuth_diff = next_pt_azimuth - current_pt_azimuth;
azimuth_diff = azimuth_diff < 0.f ? azimuth_diff + 36000.f : azimuth_diff;

const auto current_pt_distance =
*reinterpret_cast<float *>(&input_ptr->data[current_idx + distance_offset]);
const auto next_pt_distance =
*reinterpret_cast<float *>(&input_ptr->data[next_idx + distance_offset]);

if (
std::max(current_pt->distance, next_pt->distance) <
std::min(current_pt->distance, next_pt->distance) * distance_ratio_ &&
std::max(current_pt_distance, next_pt_distance) <
std::min(current_pt_distance, next_pt_distance) * distance_ratio_ &&
azimuth_diff < 100.f) {
continue;
}
if (isCluster(input_ptr, tmp_indices)) {
for (const auto tmp_idx : tmp_indices) {
for (const auto & tmp_idx : tmp_indices) {
output_modifier.push_back(
std::move(*reinterpret_cast<PointXYZI *>(&input_ptr->data[tmp_idx])));
}
Expand All @@ -95,7 +105,7 @@ void RingOutlierFilterComponent::filter(
continue;
}
if (isCluster(input_ptr, tmp_indices)) {
for (const auto tmp_idx : tmp_indices) {
for (const auto & tmp_idx : tmp_indices) {
output_modifier.push_back(
std::move(*reinterpret_cast<PointXYZI *>(&input_ptr->data[tmp_idx])));
}
Expand Down