swri-robotics / mapviz

Modular ROS visualization tool for 2D data.
BSD 3-Clause "New" or "Revised" License
396 stars 152 forks source link

mapviz.launch.py has incorrect parameter usage #829

Closed DangitBen closed 2 months ago

DangitBen commented 2 months ago

At least the python launch file incorrectly specifies launch file parameters.

https://github.com/swri-robotics/mapviz/blob/ros2-devel/mapviz/launch/mapviz.launch.py#L18

The launch file looks like:

launch_ros.actions.Node(
            package="swri_transform_util",
            executable="initialize_origin.py",
            name="initialize_origin",
            parameters=[
                {"name": "local_xy_frame", "value": "map"},
                {"name": "local_xy_origin", "value": "swri"},
                {"name": "local_xy_origins", "value": """[
                    {"name": "swri",
                        "latitude": 29.45196669,
                        "longitude": -98.61370577,
                        "altitude": 233.719,
                        "heading": 0.0},
                    {"name": "back_40",
                        "latitude": 29.447507,
                        "longitude": -98.629367,
                        "altitude": 200.0,
                        "heading": 0.0}
                ]"""}
            ]
        ),

With parameters specified as:

{"name": "parameter_name", "value": "parameter_value"},

But should be specified as:

parameters=[
    {"parameter_name": "parameter_value"},
    {"parameter_name2": "parameter_value2"},
]
# or
parameters=[{
    "parameter_name": "parameter_value",
    "parameter_name2": "parameter_value2",
}]

Related: https://github.com/swri-robotics/marti_common/issues/747

DangitBen commented 2 months ago

Correction:

The tuple specification doesn't work for string value parameters. Prefer the dict option

{"parameter_name": "parameter_value"},