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

Fill CarlaEgoVehicleControl message header #624

Open
wants to merge 6 commits into
base: 0.9.11-compat
Choose a base branch
from

Conversation

berndgassmann
Copy link
Contributor

@berndgassmann berndgassmann commented Jul 8, 2022

Fill the message header of CarlaEgoVehicleControl messages with header
received from odometry

Some robustness increases:

  • make vehicle_pid_controller robust against missing speed/pose input

This change is Reviewable

Fill the message header of CarlaEgoVehicleControl messages with header
received from odometry

Some robustness increases:
- make vehicle_pid_controller robust against missing speed/pose input
- make ROS2 launch.py files robust against empty spawn points
@FelipeGdM
Copy link
Contributor

FelipeGdM commented Jul 8, 2022

Hi @berndgassmann!

I believe there is a small issue in how the parameters are handled inside the launch file. To prevent the error described here #603 (as you pointed out, it isn't related to Carla version at all) you changed the lines

'spawn_point': launch.substitutions.LaunchConfiguration('spawn_point')

To

'spawn_point': str(launch.substitutions.LaunchConfiguration('spawn_point')) 

The problem is that the python interpreter tries to convert the object launch.substitutions.LaunchConfiguration to string, instead of trying to convert the passed parameter to string. So, when I try to execute one of the launch files (e.g. carla_ros_bridge_with_example_ego_vehicle.launch.py), the following warning log appears (it appears along a lot of other info level log messages)

[carla_spawn_objects-2] [WARN] [1657302416.515107942] [carla_spawn_objects]: Invalid spawnpoint '<launch.substitutions.launch_configuration.LaunchConfiguration object at 0x7effb0922cd0>'
[carla_spawn_objects-2] [WARN] [1657302416.515544664] [carla_spawn_objects]: ego_vehicle: Could not use spawn point from parameters, the spawn point from config file will be used.

The value received is the python string description of a generic object <launch.substitutions.launch_configuration.LaunchConfiguration object at 0x7effb0922cd0>, instead of being the desired value passed to the parameter.

Taking a step behind, this issue is related on how ROS 2 python launch files are built. By the time the python interpreter is running this piece of code, the information of the actual parameter is not available. To treat its value in run time, the use of an OpaqueFunction is needed (more info on this here)

The test I made was using ROS 2 Foxy

berndgassmann and others added 2 commits July 11, 2022 08:45
Copy link
Contributor Author

@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.

Hi @FelipeGdM

You are totally right. My changes only worked at my end, because I am providing the spawnpoint in my scenarios via configuration file. So the start-up didn't explode anymore, but the spawn_point from launch file didn't work. So definitely have to use your solution in this regards, which works fine for me.

Thanks.

Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on @joel-mb)

Don't execute planner step if no odometry message was received
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