Skip to content

Commit

Permalink
fix parameter designation
Browse files Browse the repository at this point in the history
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 committed Mar 15, 2023
1 parent eab33e5 commit 79fc95a
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,11 @@
import yaml


def str2bool(s):
return s.lower() in ["true", "True"]


def launch_setup(context, *args, **kwargs):
# load parameter files
param_file = LaunchConfiguration("param_file").perform(context)
with open(param_file, "r") as f:
laserscan_based_occupancy_grid_map_node_params = yaml.safe_load(f)["/**"]["ros__parameters"]
laserscan_based_occupancy_grid_map_node_params["input_obstacle_pointcloud"] = str2bool(
LaunchConfiguration("input_obstacle_pointcloud").perform(context)
)
laserscan_based_occupancy_grid_map_node_params["input_obstacle_and_raw_pointcloud"] = str2bool(
LaunchConfiguration("input_obstacle_and_raw_pointcloud").perform(context)
)

composable_nodes = [
ComposableNode(
Expand Down Expand Up @@ -90,7 +80,15 @@ def launch_setup(context, *args, **kwargs):
("~/input/raw_pointcloud", LaunchConfiguration("input/raw_pointcloud")),
("~/output/occupancy_grid_map", LaunchConfiguration("output")),
],
parameters=[laserscan_based_occupancy_grid_map_node_params],
parameters=[
laserscan_based_occupancy_grid_map_node_params,
{
"input_obstacle_pointcloud": LaunchConfiguration("input_obstacle_pointcloud"),
"input_obstacle_and_raw_pointcloud": LaunchConfiguration(
"input_obstacle_and_raw_pointcloud"
),
},
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
),
]
Expand Down

0 comments on commit 79fc95a

Please sign in to comment.