how to make two calls parallel?
in my code, i need to call two services. they are independent
client1.call(service1);
client2.call(service2);
do something after both of them get responses
with the above pseudo code, it seems that the two calls are executed sequentially, i.e., client2 will not execute until client1 gives a response. since the two services are provided by two nodes, i hope that there is a kind of non-blocking mode. i.e., after client1 calls the service, it goes directly to the next line to let client2 call service2. how can i fulfill this?
thanks.
I don't know if there is any non-blocking service call in ROS, but in case there is not... how about launching the service calls in separate threads?
thanks man. multi-threads makes me headache :-( maybe i could give openmp a try