roslaunch, gazebo wait option?
I am running a simulation with gazebo with several nodes that interact with it. Unfortunatly gazebo dies every round every 4 try or something. This is probably due that gazebo isn't fully loaded yet but the other nodes already try to interact. Is it possible to wait in a launch file? I know that you can check for spawning of a model in C++ but I don't want to change the code of other peoples nodes.
For instance:
[INFO] [WallTime: 1362474942.941701] [0.000000] waiting for service /gazebo/spawn_gazebo_model
[ INFO] [1362474942.959366049]: Starting ArSinglePublisher
[ INFO] [1362474942.960436786]: Publish transforms: 1
[ INFO] [1362474942.961100138]: Publish visual markers: 1
[ INFO] [1362474942.961786398]: Threshold: 100
[ INFO] [1362474942.962510092]: Marker Width: 80.0
[ INFO] [1362474942.963164854]: Reverse Transform: 0
[ INFO] [1362474942.963834981]: Marker frame: ar_marker
[ INFO] [1362474942.964532556]: Use history: 1
[ INFO] [1362474942.968002829]: Marker Center: (0.0,0.0)
[ INFO] [1362474942.968078677]: Subscribing to info topic
Service call failed: unable to connect to service: [Errno 104] Connection reset by peer
Service call failed: unable to connect to service: [Errno 104] Connection reset by peer
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[rviz_marker-10]: started with pid [3694]
Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details
Aborted (core dumped)
[gazebo-2] process has died [pid 3518, exit code 134, cmd /home/lm/fuerte_workspace/simulator_gazebo/gazebo/scripts/gazebo /home/lm/fuerte_workspace/sandbox/ar_joint_controller/model/empty_throttled.world __name:=gazebo __log:=/home/lm/.ros/log/3f24e8ca-8575-11e2-8c2d-00216a4e286a/gazebo-2.log].
log file: /home/lm/.ros/log/3f24e8ca-8575-11e2-8c2d-00216a4e286a/gazebo-2*.log
Or:
[INFO] [WallTime: 1362475473.343128] [0.000000] waiting for service /gazebo/spawn_gazebo_model
[ INFO] [1362475473.566625127]: joint trajectory plugin missing <updateRate>, defaults to 0.0 (as fast as possible)
gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr<T>::operator->() const [with T = gazebo::transport::Publisher]: Assertion `px != 0' failed.
Service call failed: unable to connect to service: [Errno 104] Connection reset by peer
Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details
Aborted (core dumped)