Skip to content

feat(pointcloud projection converter): add new package, pointcloud projection converter #254

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

YamatoAndo
Copy link
Contributor

Description

This is a tool for converting the coordinate system of a PCD map.
Currently, it only supports converting from the MGRS coordinate system to a Transverse Mercator coordinate system with an arbitrary origin.

How was this PR tested?

  • prepare a single pcd map like the autoware sample map.
    If you are using multiple split pcd maps, you need to merge them into a single pcd map (merge tool).

  • prepare config files containing the parameters before and after the coordinate transformation. Please refer to the files in the config folder as examples for how to write it.

  • Run the conversion using the following command:

    ros2 autoware_pointcloud_projection_converter pointcloud_projection_converter path_to_input_yaml path_to_output_yaml 
    path_to_input_pcd_file path_to_output_pcd_file
    
  • [optional] Divide the output PCD map (divide tool).

  • Launch Autoware using the output pcd map and the config file (after the coordinate transformation) to confirm that works correctly.

Notes for reviewers

None.

Effects on system behavior

None.

Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Copy link

github-actions bot commented May 16, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

pre-commit-ci bot and others added 5 commits May 16, 2025 09:31
Copy link
Contributor

@anhnv3991 anhnv3991 left a comment

Choose a reason for hiding this comment

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

@YamatoAndo According to this guideline
Document structure
Should we add a launch file and a schema, too?

# Find required packages
find_package(autoware_cmake REQUIRED)
autoware_package()

Copy link
Contributor

Choose a reason for hiding this comment

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

@YamatoAndo Do we need to add this?

if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else ()
  set(CMAKE_CXX_STANDARD 17)
endif ()```

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed d40da31

Comment on lines 19 to 37
find_package(PCL REQUIRED)
include_directories(
${PCL_INCLUDE_DIRS}
)

# Add the sub.cpp file as a library
add_library(converter_lib "src/converter_from_llh.cpp" "src/converter_to_llh.cpp")

# Create executables
target_include_directories(converter_lib
SYSTEM PUBLIC
${PCL_INCLUDE_DIRS}
)
ament_auto_add_executable(pointcloud_projection_converter "src/pcd_conversion.cpp")


# Link the libraries
target_link_libraries(converter_lib yaml-cpp ${PCL_LIBRARIES} ${GeographicLib_LIBRARIES})
target_link_libraries(pointcloud_projection_converter converter_lib yaml-cpp ${PCL_LIBRARIES} ${GeographicLib_LIBRARIES})
Copy link
Contributor

Choose a reason for hiding this comment

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

@YamatoAndo I think we can shorten this part a bit.

ament_auto_add_library(converter_lib src/converter_from_llh.cpp src/converter_to_llh.cpp)
target_link_libraries(converter_lib ${GeographicLib_LIBRARIES} ${PCL_LIBRARIES})

ament_auto_add_executable(pointcloud_projection_converter src/pcd_conversion.cpp)
target_link_libraries(pointcloud_projection_converter converter_lib yaml-cpp)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed c5d1ce3, 1db6129

## Usage

```bash
ros2 autoware_pointcloud_projection_converter pointcloud_projection_converter path_to_input_yaml path_to_output_yaml path_to_input_pcd_file path_to_output_pcd_file
Copy link
Contributor

Choose a reason for hiding this comment

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

@YamatoAndo Are you missing a 'run' here?

ros2 run autoware_pointcloud_projection_converter pointcloud_projection_converter path_to_input_yaml path_to_output_yaml path_to_input_pcd_file path_to_output_pcd_file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 1083c5e

longitude: yy
```

## Dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

@YamatoAndo Regarding dependencies, do we have to add GeographicLib and OpenMP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 7c716c6

<depend>geographiclib</depend>
<depend>libpcl-all-dev</depend>
<depend>yaml-cpp</depend>

Copy link
Contributor

Choose a reason for hiding this comment

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

@YamatoAndo If you add

  <depend>pcl_conversions</depend>

You can shorten the CMakefiles.txt as I suggested above.
Besides, should <depend>libomp-dev</depend> be added, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 1db6129, 3faf43e

@@ -0,0 +1,32 @@
// Copyright 2025 Autoware Foundation
Copy link
Contributor

Choose a reason for hiding this comment

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

@YamatoAndo I think .hpp files should be moved to another include/ directory. Something like this
Directory structure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed b82d6c1

YamatoAndo and others added 10 commits June 4, 2025 19:08
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
Signed-off-by: Yamato Ando <yamato.ando@tier4.jp>
@YamatoAndo
Copy link
Contributor Author

@YamatoAndo According to this guideline
Document structure
Should we add a launch file and a schema, too?

@anhnv3991 OK, I will add them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants