Skip to content

Commit

Permalink
fix: fix container name handling
Browse files Browse the repository at this point in the history
Signed-off-by: kminoda <[email protected]>
  • Loading branch information
kminoda committed Jan 22, 2024
1 parent db9ffae commit fabacdc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
5 changes: 3 additions & 2 deletions awsim_sensor_kit_launch/launch/lidar.launch.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<launch>
<arg name="use_concat_filter" default="true"/>
<arg name="vehicle_mirror_param_file"/>
<arg name="use_pointcloud_container" default="false" description="launch pointcloud container"/>
<arg name="pointcloud_container_name" default="pointcloud_container"/>
<arg name="use_distortion_corrector" default="true"/>

Expand All @@ -13,6 +12,7 @@
<include file="$(find-pkg-share common_awsim_sensor_launch)/launch/velodyne_lidar.launch.xml">
<arg name="vehicle_mirror_param_file" value="$(var vehicle_mirror_param_file)"/>
<arg name="use_distortion_corrector" value="$(var use_distortion_corrector)"/>
<arg name="container_name" value="pointcloud_container"/>
</include>
</group>

Expand All @@ -21,6 +21,7 @@
<include file="$(find-pkg-share common_awsim_sensor_launch)/launch/velodyne_lidar.launch.xml">
<arg name="vehicle_mirror_param_file" value="$(var vehicle_mirror_param_file)"/>
<arg name="use_distortion_corrector" value="$(var use_distortion_corrector)"/>
<arg name="container_name" value="pointcloud_container"/>
</include>
</group>

Expand All @@ -29,14 +30,14 @@
<include file="$(find-pkg-share common_awsim_sensor_launch)/launch/velodyne_lidar.launch.xml">
<arg name="vehicle_mirror_param_file" value="$(var vehicle_mirror_param_file)"/>
<arg name="use_distortion_corrector" value="$(var use_distortion_corrector)"/>
<arg name="container_name" value="pointcloud_container"/>
</include>
</group>

<include file="$(find-pkg-share awsim_sensor_kit_launch)/launch/pointcloud_preprocessor.launch.py">
<arg name="base_frame" value="base_link"/>
<arg name="use_intra_process" value="true"/>
<arg name="use_multithread" value="true"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
</group>
Expand Down
23 changes: 2 additions & 21 deletions awsim_sensor_kit_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,14 @@ def launch_setup(context, *args, **kwargs):
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("individual_container_name"),
namespace="",
package="rclcpp_components",
executable=LaunchConfiguration("container_executable"),
composable_node_descriptions=[],
condition=UnlessCondition(LaunchConfiguration("use_pointcloud_container")),
output="screen",
)

target_container = (
container
if UnlessCondition(LaunchConfiguration("use_pointcloud_container")).evaluate(context)
else LaunchConfiguration("pointcloud_container_name")
)

# load concat or passthrough filter
concat_loader = LoadComposableNodes(
composable_node_descriptions=[concat_component],
target_container=target_container,
target_container=LaunchConfiguration("pointcloud_container_name"),
condition=IfCondition(LaunchConfiguration("use_concat_filter")),
)

return [container, concat_loader]
return [concat_loader]


def generate_launch_description():
Expand All @@ -88,9 +71,7 @@ def add_launch_arg(name: str, default_value=None):
add_launch_arg("base_frame", "base_link")
add_launch_arg("use_multithread", "False")
add_launch_arg("use_intra_process", "False")
add_launch_arg("use_pointcloud_container", "False")
add_launch_arg("pointcloud_container_name", "pointcloud_container")
add_launch_arg("individual_container_name", "concatenate_container")

set_container_executable = SetLaunchConfiguration(
"container_executable",
Expand Down
2 changes: 0 additions & 2 deletions awsim_sensor_kit_launch/launch/sensing.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
<!-- Launch driver argument is not used since the AWSIM doesn't need any hardware drivers. -->
<!-- <arg name="launch_driver" default="true" description="do launch driver"/> -->
<arg name="vehicle_mirror_param_file" description="path to the file of vehicle mirror position yaml"/>
<arg name="use_pointcloud_container" default="false" description="launch pointcloud container"/>
<arg name="pointcloud_container_name" default="pointcloud_container"/>
<arg name="use_distortion_corrector" default="false" description="compensate the point cloud distortion caused by vehicle movement"/>

<group>
<!-- LiDAR Driver -->
<include file="$(find-pkg-share awsim_sensor_kit_launch)/launch/lidar.launch.xml">
<arg name="vehicle_mirror_param_file" value="$(var vehicle_mirror_param_file)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
<arg name="use_distortion_corrector" value="$(var use_distortion_corrector)"/>
</include>
Expand Down
2 changes: 2 additions & 0 deletions common_awsim_sensor_launch/launch/velodyne_lidar.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<!-- Params -->
<arg name="vehicle_mirror_param_file"/>
<arg name="use_distortion_corrector" default="true"/>
<arg name="container_name" default="velodyne_node_container"/>

<include file="$(find-pkg-share common_awsim_sensor_launch)/launch/velodyne_node_container.launch.py">
<arg name="vehicle_mirror_param_file" value="$(var vehicle_mirror_param_file)"/>
<arg name="use_intra_process" value="true"/>
<arg name="use_multithread" value="false"/>
<arg name="use_distortion_corrector" value="$(var use_distortion_corrector)"/>
<arg name="container_name" value="pointcloud_container"/>
</include>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def create_parameter_dict(*args):
# set container to run all required components in the same process
container = ComposableNodeContainer(
# need unique name, otherwise all processes in same container and the node names then clash
name="velodyne_node_container",
name=LaunchConfiguration("container_name"),
namespace="pointcloud_preprocessor",
package="rclcpp_components",
executable=LaunchConfiguration("container_executable"),
Expand Down

0 comments on commit fabacdc

Please sign in to comment.