play service call doesn't return until play finished
KenYN opened this issue · 2 comments
KenYN commented
Description
When using the service interface to pull request #1419 (I'm not sure how to set up the same situation for ros2 bag play
) with the command:
$ rosservice call /bag_player/play rosbag2_interfaces/srv/Play "{start_offset: {sec: 0, nanosec: 0}, playback_duration: {sec: 0, nanosec: 0}, playback_until_timestamp: {sec: 0, nanosec: 0}}" requester: making request: rosbag2_interfaces.srv.Play_Request(start_offset=builtin_interfaces.msg.Time(sec=0, nanosec=0), playback_duration=builtin_interfaces.msg.Duration(sec=0, nanosec=0), playback_until_timestamp=builtin_interfaces.msg.Time(sec=0, nanosec=0))
Expected Behavior
According to this page I would expect it to return quickly after starting the playback:
Services
- Should be used for remote procedure calls that terminate quickly, e.g. for querying the state of a node or doing a quick calculation such as IK. They should never be used for longer running processes
Actual Behavior
The service call does not return until play completes, and if looping is on, then it never returns until CTRL+C.
System (please complete the following information)
Ubuntu 22.04 + Rolling
roncapat commented
Very stupid question: does this happens only with my branch? I'm looking at the service callback code:
rosbag2/rosbag2_transport/src/rosbag2_transport/player.cpp
Lines 1080 to 1092 in 7fcb703
and it seems to me also upstream rosbag2 waits for the end of .play()
method.
MichaelOrlov commented