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

Remove empty launch args default_value #622

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

FelipeGdM
Copy link
Contributor

@FelipeGdM FelipeGdM commented Jun 27, 2022

This PR fixes a bug found in foxy and newer distros that crashes the ROS 2 launch system when an argument with default_value='' is not overwritten. For some reason the empty string is internally converted to None, which raises the following error

File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 95, in evaluate_parameter_dict
    raise TypeError(
TypeError: Allowed value types are bytes, bool, int, float, str, Sequence[bool], Sequence[int], 
Sequence[float], Sequence[str]. Got <class 'NoneType'>. If the parameter is meant to be a string, 
try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)

Similar problems can be found introlab/rtabmap_ros#725, LORD-MicroStrain/ntrip_client#16 and microsoft/Azure_Kinect_ROS_Driver#246

The easiest solution is to replace the empty string with a non-empty string. When an invalid spawn-point is passed, the node issues the following warning and then informs that a random spawn point was chosen

[WARN] [carla_spawn_objects]: Invalid spawnpoint 'None'
[INFO] [carla_spawn_objects]: Spawn point selected at random

If a spawn point is specified in the object description, the system issues the warnings

[WARN] [carla_spawn_objects]: Invalid spawnpoint 'None'
[WARN] [carla_spawn_objects]: ego_vehicle: Could not use spawn point from parameters, the spawn point from config file will be used.

After this messages, the launch system proceeds normally

This PR solves the problem described in #603, even without explicit goal of Carla 0.9.13 support. I believe that it is highly likely that people trying to run the newest Carla version are also running the newest version of ROS 2, thus facing the error described here. Personally, I was able to run ros bridge with Carla 0.9.13 smoothly after this fix.


This change is Reviewable

Copy link
Contributor

@berndgassmann berndgassmann left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @FelipeGdM)

@berndgassmann berndgassmann merged commit fd35a57 into carla-simulator:master Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants