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(autoware_scene_to_image_projector): init package #7951

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

palas21
Copy link

@palas21 palas21 commented Jul 10, 2024

Description

The autoware_scene_to_image_projector package facilitates visualizing 3D data such as bounding boxes of detected objects, ego vehicle trajectory, and road boundaries onto the 2D camera image plane. It uses transformations and projection algorithms to achieve this visualization, ensuring accurate placement of elements relative to the camera's perspective.

projector1

projector2

Related links

Parent Issue:

How was this PR tested?

  • Tested functionality using a sample rosbag containing necessary topics:
    • Camera image
    • Camera information
    • Detected objects
    • Trajectory
    • Path
  • Utilized rviz2 for visualizing the processed camera image data.

Notes for Reviewers

  • You can use this rosbag for testing.
  • Note that the camera image topic is in compressed format. Ensure to decompress it before processing within the package.

Interface changes

None.

Effects on system behavior

None.

@palas21 palas21 requested a review from kaancolak July 10, 2024 14:55
@palas21 palas21 self-assigned this Jul 10, 2024
@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:common Common packages from the autoware-common repository. (auto-assigned) labels Jul 10, 2024
Copy link

github-actions bot commented Jul 10, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@palas21 palas21 marked this pull request as draft July 10, 2024 14:58
@palas21 palas21 force-pushed the feat/visualize-3d-objects-and-useful-informations-onto-the-2d-image branch from 3667345 to 99c909a Compare July 12, 2024 08:27
@github-actions github-actions bot added component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) component:localization Vehicle's position determination in its environment. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) component:control Vehicle control algorithms and mechanisms. (auto-assigned) component:system System design and integration. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) type:ci Continuous Integration (CI) processes and testing. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) component:simulation Virtual environment setups and simulations. (auto-assigned) component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) labels Jul 12, 2024
@palas21 palas21 force-pushed the feat/visualize-3d-objects-and-useful-informations-onto-the-2d-image branch from 99c909a to 1c0b7b9 Compare July 12, 2024 09:41
@github-actions github-actions bot removed component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) component:localization Vehicle's position determination in its environment. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) component:control Vehicle control algorithms and mechanisms. (auto-assigned) component:system System design and integration. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) type:ci Continuous Integration (CI) processes and testing. (auto-assigned) labels Jul 12, 2024
palas21 and others added 6 commits July 16, 2024 13:31
…autoware_auto.

Signed-off-by: palas21 <palas21@itu.edu.tr>
… are fixed.

Signed-off-by: palas21 <palas21@itu.edu.tr>
Signed-off-by: palas21 <palas21@itu.edu.tr>
…according to reviewer suggestions.

Signed-off-by: palas21 <palas21@itu.edu.tr>
@palas21 palas21 force-pushed the feat/visualize-3d-objects-and-useful-informations-onto-the-2d-image branch from acc05f3 to 2c8c45d Compare July 16, 2024 10:32
@xmfcx xmfcx added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 24, 2024
Copy link

codecov bot commented Jul 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 254 lines in your changes missing coverage. Please review.

Project coverage is 29.18%. Comparing base (95aef0d) to head (9100ba1).
Report is 1119 commits behind head on main.

Files with missing lines Patch % Lines
...tor/src/autoware_scene_to_image_projector_node.cpp 0.00% 215 Missing ⚠️
...ils/include/object_recognition_utils/transform.hpp 0.00% 39 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7951      +/-   ##
==========================================
- Coverage   29.25%   29.18%   -0.08%     
==========================================
  Files        1601     1607       +6     
  Lines      117738   118024     +286     
  Branches    50709    50766      +57     
==========================================
+ Hits        34450    34451       +1     
- Misses      74060    74345     +285     
  Partials     9228     9228              
Flag Coverage Δ *Carryforward flag
differential 18.55% <0.00%> (?)
total 29.25% <ø> (ø) Carriedforward from 95aef0d

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@a-maumau
Copy link
Contributor

a-maumau commented Aug 5, 2024

@palas21 Hi, I am checking your package.
Your implementation is visually more synchronized than the one with the RViz camera plugin, looks good.

Is it possible to combine the visualization of the plugin versions?

In my opinion, the plugin version better shows the visualization which lines have transparency in their color and the line (polygons) get disappear in the distance.
For example:
visualization_sample_small

Additionally, the plugin version can indicate the path information based on the planning by changing the color of the path.

image_pub_ = this->create_publisher<sensor_msgs::msg::Image>("~/output/image", 10);

image_sub_ = this->create_subscription<sensor_msgs::msg::Image>(
"~/input/image", 10,
Copy link
Contributor

@a-maumau a-maumau Aug 5, 2024

Choose a reason for hiding this comment

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

I need to change the QoS to rclcpp::QoS{10}.best_effort() for the ~/input/image.
Can you check this?

std::vector<std::vector<cv::Point2f>> previous_polygons;

for (const auto & object : objects) {
if (should_skip_object(object.classification.front().label)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sometimes object does not have classification, so I needed to check object.classification.empty().
This happens when I was checking a local rosbag with logging simulator.
Could you check this too?

latest_trajectory_->header.stamp);

if (!self_transform) {
RCLCPP_WARN(this->get_logger(), "Transform is not possible!");
Copy link
Contributor

Choose a reason for hiding this comment

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

@palas21

Thank you for your PR!
Can you use RCLCPP_WARN_THROTTLE ?


## Future extensions / Unimplemented parts

- The algorithm works for syncronized data but if the data is unsyncronized another method should be obtained.
Copy link
Contributor

Choose a reason for hiding this comment

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

@palas21

Please fix typos.

@knzo25
Copy link
Contributor

knzo25 commented Aug 19, 2024

@Shin-kyoto @palas21
Since this package is for visualization purposes, would it not be more suited for https://github.com/autowarefoundation/autoware_tools ?

(shamelessly attempting to avoid compiling packages that we do not always use)

@Shin-kyoto
Copy link
Contributor

Shin-kyoto commented Aug 19, 2024

@Shin-kyoto @palas21

Since this package is for visualization purposes, would it not be more suited for https://github.com/autowarefoundation/autoware_tools ?

Thank you for your comment!!
@knzo25, I agree with you. This package is more suited for autoware_tools.

@palas21
What do you think about creating the PR to autoware_tools?

@Shin-kyoto
Copy link
Contributor

@palas21

friendly ping

@palas21
Copy link
Author

palas21 commented Aug 30, 2024

@Shin-kyoto sorry for the late response. I will move this PR to autoware_tools. I will open the PR after i make the suggested changes. Thanks all for the reviews.

@palas21 palas21 closed this Aug 30, 2024
@xmfcx xmfcx reopened this Oct 4, 2024
@xmfcx xmfcx marked this pull request as draft October 4, 2024 14:16
Copy link

stale bot commented Dec 4, 2024

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:common Common packages from the autoware-common repository. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) status:stale Inactive or outdated issues. (auto-assigned) type:documentation Creating or refining documentation. (auto-assigned)
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

6 participants