StarlingUAS / ProjectStarling

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

Add User Configurable Mavros Bridge Launch Delay #160

Closed mhl787156 closed 2 years ago

mhl787156 commented 2 years ago

This PR Addresses #124

It is thought that #124 is caused by a race condition between ros1 starting and the ros2 bridge starting. Ros1 must start before ros2 bridge and the bridge reads ros1 parameters. If ros1 takes a long time to start, especially due to computer resource constraints or high load, the ros2 bridge will fail silently.

This PR introduces a environment variable BRIDGE_LAUNCH_DELAY (defaults to 2 seconds) to allow the user to set the delay without needing to recompile mavros. Especially on kubernetes systems, setting this to a value such as 10.0 seconds will provide more reliability.