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(behavior_velocity): add object to occupancy grid #7

Closed
wants to merge 21 commits into from

Conversation

taikitanaka3
Copy link
Owner

@taikitanaka3 taikitanaka3 commented Mar 18, 2022

Draft

worst case time is millisec
image

image

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/2)

@@ -81,7 +83,7 @@ void toQuantizedImage(
const nav_msgs::msg::OccupancyGrid & occupancy_grid, cv::Mat * cv_image, const GridParam & param);
void denoiseOccupancyGridCV(
nav_msgs::msg::OccupancyGrid & occupancy_grid, grid_map::GridMap & grid_map,
const GridParam & param);
const GridParam & param, const bool is_show_debug_window);
} // namespace grid_utils

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
} // namespace grid_utils
}

@@ -197,16 +206,21 @@ void toQuantizedImage(
}
void denoiseOccupancyGridCV(
nav_msgs::msg::OccupancyGrid & occupancy_grid, grid_map::GridMap & grid_map,
const GridParam & param)
const GridParam & param, const bool is_show_debug_window)
{
cv::Mat cv_image(
occupancy_grid.info.width, occupancy_grid.info.height, CV_8UC1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ hicpp-signed-bitwise ⚠️
use of a signed integer operand with a binary bitwise operator

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (2/2)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

{
cv::Mat cv_image(
occupancy_grid.info.width, occupancy_grid.info.height, CV_8UC1,
cv::Scalar(grid_utils::occlusion_cost_value::OCCUPIED));
cv::Mat cv_canny(
occupancy_grid.info.width, occupancy_grid.info.height, CV_8UC1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ hicpp-signed-bitwise ⚠️
use of a signed integer operand with a binary bitwise operator

@@ -168,7 +168,16 @@ void imageToOccupancyGrid(const cv::Mat & cv_image, nav_msgs::msg::OccupancyGrid
for (int x = width - 1; x >= 0; x--) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interation 200*200

@taikitanaka3 taikitanaka3 force-pushed the 258-feat-behavior-velocity-update-occ-grid branch from 5e1136a to c959745 Compare March 20, 2022 16:28
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
…sion judgement

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
@taikitanaka3 taikitanaka3 changed the title 258 feat behavior velocity update occ grid feat(behavior_velocity): add object to occupancy grid Mar 22, 2022
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
@taikitanaka3 taikitanaka3 force-pushed the 258-feat-behavior-velocity-update-occ-grid branch from c959745 to 675f532 Compare March 22, 2022 10:26
intensity = grid_utils::occlusion_cost_value::FREE_SPACE;
unsigned char intensity = occupancy_grid.data.at(idx);
if (intensity <= param.free_space_max) {
intensity = grid_utils::occlusion_cost_value::FREE_SPACE_IMAGE;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for apply morphologyEx(dilate and erode) more accurately

@@ -453,16 +453,16 @@ boost::optional<PossibleCollisionInfo> generateOneNotableCollisionFromOcclusionS
bool collision_free_at_intersection =
grid_utils::isCollisionFree(grid, occlusion_spot_position, grid_map::Position(ip.x, ip.y));
bool obstacle_not_blocked_by_partition = true;
if (!collision_free_at_intersection) continue;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

early continue

@@ -218,13 +218,31 @@ target_link_libraries(scene_module_virtual_traffic_light scene_module_lib)


# SceneModule OcclusionSpot
ament_auto_add_library(scene_module_occlusion_spot SHARED
# Util
ament_auto_add_library(occlusion_spot_lib SHARED
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for faster compiling

@@ -112,8 +112,12 @@ struct PlannerParam
{
DETECTION_METHOD detection_method;
PASS_JUDGE pass_judge;
bool debug; // [-]
bool use_partition_lanelet; // [-]
bool is_show_occlusion; // [-]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readability

@@ -23,6 +23,44 @@ namespace behavior_velocity_planner
{
namespace grid_utils
{

Polygon2d pointsToPoly(const Point2d p0, const Point2d p1, const double thickness)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feature polygon judgement

…er data

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
…iment

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

const auto & obj_label = obj.classification.at(0).label;
using autoware_auto_perception_msgs::msg::ObjectClassification;
if (
obj_label != ObjectClassification::CAR || obj_label != ObjectClassification::TRUCK ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ misc-redundant-expression ⚠️
logical expression is always true

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

return line_poly;
}

TEST(compareTime, polygon_vs_line_iterator)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ cppcoreguidelines-special-member-functions ⚠️
class compareTime_polygon_vs_line_iterator_Test defines a copy constructor and a copy assignment operator but does not define a destructor, a move constructor or a move assignment operator

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
@taikitanaka3 taikitanaka3 force-pushed the 258-feat-behavior-velocity-update-occ-grid branch from 6a54f33 to 38e805f Compare March 25, 2022 07:33
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

close_partition.emplace_back(p);
}
}
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-redundant-control-flow ⚠️
redundant return statement at the end of a function with a void return type

Suggested change
return;

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

}

std::vector<std::pair<grid_map::Position, grid_map::Position>> pointsToRays(
const grid_map::Position p0, const grid_map::Position p1, const double radius)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the const qualified parameter p0 is copied for each invocation; consider making it a reference

Suggested change
const grid_map::Position p0, const grid_map::Position p1, const double radius)
const grid_map::Position& p0, const grid_map::Position p1, const double radius)

}

std::vector<std::pair<grid_map::Position, grid_map::Position>> pointsToRays(
const grid_map::Position p0, const grid_map::Position p1, const double radius)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the const qualified parameter p1 is copied for each invocation; consider making it a reference

Suggested change
const grid_map::Position p0, const grid_map::Position p1, const double radius)
const grid_map::Position p0, const grid_map::Position& p1, const double radius)

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
@taikitanaka3 taikitanaka3 deleted the 258-feat-behavior-velocity-update-occ-grid branch April 13, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant