StarlingUAS / ProjectStarling

BRL Flight Arena Infrastructure 2.0
Other
16 stars 3 forks source link

Inconsistent reading of parameter bridge config yaml #124

Open mhl787156 opened 2 years ago

mhl787156 commented 2 years ago

There have been many instances when bringing up the mavros container where the parameter bridge fails to read the parameter bridge configuration file. The logs show often show the following printouts:

mavros_1   | [parameter_bridge-2] The parameter '/vehicle_1/topics' either doesn't exist or isn't an array
mavros_1   | [parameter_bridge-2] The parameter '/vehicle_1/services_1to2' either doesn't exist or isn't an array
mavros_1   | [parameter_bridge-2] The parameter '/vehicle_1/services_2to1' either doesn't exist or isn't an array

This has been observed in both simulation and on the real drones. However re-running the container a few times almost always eventually fixes the issue.

I am unsure as to the cause, but best guess is some race between the configuration file been read in and parsed as a ros param, and the parameter bridge attempting to read the ros2 params. Unsure how to solve.

mhl787156 commented 2 years ago

After some thought, I think this is due to the ROS2 discovery destroying the network such that the parameter server is no longer accessible to the parameter bridge somehow. Therefore it cannot read the specified parameters.

Possible fix right now is to stagger the starts of each node so that each individual discovery broadcast does not bottleneck everything else.