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

fix: add downsample_after concat #175

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 21 additions & 2 deletions aip_x2_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def launch_setup(context, *args, **kwargs):
name="concatenate_data",
remappings=[
("~/input/twist", "/sensing/vehicle_velocity_converter/twist_with_covariance"),
("output", "concatenated/pointcloud"),
("output", "concatenated/pointcloud_raw"),
Copy link
Contributor

Choose a reason for hiding this comment

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

concatenated/pointcloud_raw sounds very weird.
The topic name should represent its status, I think. So, it should be something like concatenated/pointcloud -> concatenated/downsampled/pointcloud.

Copy link
Contributor Author

@badai-nguyen badai-nguyen Oct 1, 2023

Choose a reason for hiding this comment

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

@miursh thank you for your comment. My intention is want to keep using concatenated/pointcloud input for perception including centerpoint, ground_segmentation, etc.
Currently we have 2 options:

  1. Keep output of pointcloud_preprocessor as concatenated/pointcloud and change concatenated/pointcloud_raw -> some more understandable name. For example concatenated/before_downsampled/pointcloud?
  2. Change output of pointcloud_preprocessor and all input perception module to concatenated/downsampled/pointcloud
    I currently prefer to 1) but of course I can change as 2) as your opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer another option.
Since I don't want to change the interface between sensing and perception, the output of sensing module should be concatenated/pointcloud.
And if you want to apply donwsampling before perception, you should add a donwsampling node in /perception namespace.
BTW, if you change the input point of centerpoint, I want to know that this change does not have much effects on the perception result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@miursh Thank you for your comment, Since I am going to add the downsampling before common_ground_filter in perception (tier4/autoware.universe@bc48f9e) , it will not affect on centerpoint input and this PR is unnecessary. I will close this.

],
parameters=[
{
Expand All @@ -55,6 +55,24 @@ def launch_setup(context, *args, **kwargs):
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)

concat_downsample = ComposableNode(
package="pointcloud_preprocessor",
plugin="pointcloud_preprocessor::VoxelGridDownsampleFilterComponent",
name="voxel_grid_downsample_filter",
remappings=[
("input", "concatenated/pointcloud_raw"),
("output", "concatenated/pointcloud"),
],
parameters=[
{
"voxel_size_x": LaunchConfiguration("voxel_size"),
"voxel_size_y": LaunchConfiguration("voxel_size"),
"voxel_size_z": LaunchConfiguration("voxel_size"),
}
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)

# set container to run all required components in the same process
container = ComposableNodeContainer(
name=LaunchConfiguration("container_name"),
Expand All @@ -74,7 +92,7 @@ def launch_setup(context, *args, **kwargs):

# load concat or passthrough filter
concat_loader = LoadComposableNodes(
composable_node_descriptions=[concat_component],
composable_node_descriptions=[concat_component, concat_downsample],
target_container=target_container,
condition=IfCondition(LaunchConfiguration("use_concat_filter")),
)
Expand All @@ -93,6 +111,7 @@ def add_launch_arg(name: str, default_value=None):
add_launch_arg("use_intra_process", "True")
add_launch_arg("use_pointcloud_container", "False")
add_launch_arg("container_name", "pointcloud_preprocessor_container")
add_launch_arg("voxel_size", "0.1")

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down
23 changes: 21 additions & 2 deletions aip_xx1_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def launch_setup(context, *args, **kwargs):
name="concatenate_data",
remappings=[
("~/input/twist", "/sensing/vehicle_velocity_converter/twist_with_covariance"),
("output", "concatenated/pointcloud"),
("output", "concatenated/pointcloud_raw"),
],
parameters=[
{
Expand All @@ -56,6 +56,24 @@ def launch_setup(context, *args, **kwargs):
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)

concat_downsample = ComposableNode(
package="pointcloud_preprocessor",
plugin="pointcloud_preprocessor::VoxelGridDownsampleFilterComponent",
name="voxel_grid_downsample_filter",
remappings=[
("input", "concatenated/pointcloud_raw"),
("output", "concatenated/pointcloud"),
],
parameters=[
{
"voxel_size_x": LaunchConfiguration("voxel_size"),
"voxel_size_y": LaunchConfiguration("voxel_size"),
"voxel_size_z": LaunchConfiguration("voxel_size"),
}
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)

# set container to run all required components in the same process
container = ComposableNodeContainer(
name=LaunchConfiguration("container_name"),
Expand All @@ -75,7 +93,7 @@ def launch_setup(context, *args, **kwargs):

# load concat or passthrough filter
concat_loader = LoadComposableNodes(
composable_node_descriptions=[concat_component],
composable_node_descriptions=[concat_component, concat_downsample],
target_container=target_container,
condition=IfCondition(LaunchConfiguration("use_concat_filter")),
)
Expand All @@ -94,6 +112,7 @@ def add_launch_arg(name: str, default_value=None):
add_launch_arg("use_intra_process", "False")
add_launch_arg("use_pointcloud_container", "False")
add_launch_arg("container_name", "pointcloud_preprocessor_container")
add_launch_arg("voxel_size", "0.1")

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down