I’m trying to change some PX4 parameters from a launch file. I did a script (inside a ROS pkg) which I can execute from the launch file, and it works fine. It’s something like this:
rosparam load config.yml /mavros/param/ rosservice call /mavros/param/push
As I said, it works fine but not always. The problem is that if I execute this script before PX4 is ready, I get the following error:
Unknown rosparam: XXXXXX.
I fixed this by adding at the top of the script
sleep 15.0, what is more or less the time needed for PX4 to start-up.
My question is about how to improve this and make it more robust. It will probably take longer (or less) on a different computer than mine.
So, is there any flag to check when PX4 is ready? It would be great if I can check it through a ROS topic or similar.
Thanks in advance,