Skip to content

Commit

Permalink
fix: fix pointcloud preprocessor to run tutorial
Browse files Browse the repository at this point in the history
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
  • Loading branch information
YoshiRi committed Mar 8, 2024
1 parent d29075a commit 1a249b9
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions sample_sensor_kit_launch/launch/pointcloud_preprocessor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from launch.conditions import IfCondition
from launch.conditions import UnlessCondition
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import LoadComposableNodes
from launch_ros.actions import LoadComposableNodes, ComposableNodeContainer
from launch_ros.descriptions import ComposableNode


Expand Down Expand Up @@ -103,26 +103,27 @@ def launch_setup(context, *args, **kwargs):
concat_components = [time_sync_component, concat_component]

# set container to run all required components in the same process
container = ComposableNodeContainer(
name=LaunchConfiguration("pointcloud_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")
)
# container = ComposableNodeContainer(
# name=LaunchConfiguration("pointcloud_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_components,
target_container=target_container,
# target_container=target_container,
target_container=LaunchConfiguration("pointcloud_container_name"),
condition=IfCondition(LaunchConfiguration("use_concat_filter")),
)

Expand Down

0 comments on commit 1a249b9

Please sign in to comment.