-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record service requests #773
Comments
Given that this is a feature request - I would appreciate if you could reformat using the feature request template instead of the bug report template - it will be easier to understand. |
@kunaltyagi while it's a valid feature request, it actually goes beyond the scope of rosbag2. For this to happen, we actually need support in ROS2 for serialized service (and action) calls. Unfortunately, up to today, we only have serialized messages. |
Are ROS 2 Services implemented under the hood using Topics? If so, these don't appear in the |
Correct, assuming a DDS RMW. All three of our in-tree RMWs use a pair of topics (prefixed with
Yes, That said, I don't think that any of this is a requirement imposed by ROS 2, more of a convention. The DDS RMWs all do it since the DDS spec does not have a definition for an RPC-like call (as far as I understand). You can imagine a different RMW that does have support for true RPC doing something different. |
@emersonknapp Updated the format of issue.
Aren't services and actions a superset of the message format? If a message can be (de)serialized, why is doing the same with service request/response and actions an issue (provided they are visible)? Is this a constraint? @clalancette Are the prefixes exposed by some mechanism? Or should it be requested at a rclcpp/rclpy level? |
Yes - but the definition format and the network mechanism / format are not necessarily the same thing. The more important point, I think is, per @clalancette comment - Services are not necessarily a Topic under the hood by definition of the ROS 2 specification. Though, in the case of all DDS RMW implementations, they are implemented using DDS topics, and could theoretically then be exposed in a way that DDS could record. This might be worth figuring out - given that we understand that we couldn't guarantee the mechanism would work for all possible RMW implementations. |
well, DDS topics yes or no but I think this doesn't really solve the task at hand here. The functionality has to be exposed through an RMW interface and at this point it's RMW agnostic. We can't just have a big "if DDS, then record services by hacking topics" within rosbag2 :D What @clalancette said is certainly correct, but I believe there's more to it. On the ROS2 core stack we prefix all services with |
I am considering the requirement of recorded data and the feasibility of realization. Service/Client
Action
|
being off possibility or feasibility, we would want to support the following use cases? (at least i would do as application engineer.)
|
If this feature isn't supported out-of-the-box, the community would have to create message based services and actions. Wouldn't that kind of defeat the purpose of the design process of ROS2? The community based solutions might not have the same level of guarantees that the core ros2 libraries come with. This is a very important feature for systems actually in deployment, and I can't stress this enough: debugging, replay, simulation, etc. use this very heavily. In fact, some people and entities I know have stopped using services and only use messages to ensure the presence of record and replay features There is neither an alternative nor steps taken to mitigate this and in absence of these, it doesn't motivate the effort required tor migrating to ros2 (assuming creating custom srv and action interface is more complicated than staying on ros1) |
I think we need to consider how to record service/action beyond the limitations of the current implementation of rosbag2. This needs to further consider. |
I think having a mechanism to introspect services makes sense to support as a core feature in ROS 2, i.e. having a way to see what requests and responses being sent. Since the implementation of services are specific to the RMW, I think we should add support for service introspection at the rcl layer (or above). This means not relying on the RMW to provide topics for requests and responses (or some other mechanism). After discussing this with some people offline, here are some ideas for what we could do:
I think we can make a design proposal in the form of a PR (either on design.ros2.org or under concepts?). cc/ @ihasdapie @deepanshubansal01 @adityapande-1995 @wjwwood |
Is there any updates on this? What is the current recommended way for recording & playing back service calls? Change them to topics? |
@Alqio Current progress is being tracked on ros2/ros2#1285 & more information can be found ros-infrastructure/rep#360. I was hoping to iterate on it more (but good progress has been made without me) over the last few weeks but have been busier than expected...but in any case it should be included in next year's Iron release :) |
@ihasdapie are you already working on this? or anybody else? CC: @MichaelOrlov |
As far as I know, nobody is working on this. However, much service introspection features went into the Iron release, so some more features may be possible to implement now. This would be a good topic for the Rosbag2 Working Group meeting. I don't think I have any development time to dedicate to the project, but I'd be happy to discuss design. |
I was originally planning on helping wrap up the service introspection work last september but school ended up being a lot more work than anticipated. I may have some bandwidth to help out a bit in a couple of weeks in my spare time, but probably not anything significant like last year. There is an old PR (#1063) up for adding syntactic sugar for recording service events but it likely needs to be updated since there appears to have been a number of changes to the feature since I was last active. Playback is a whole different discussion and in my opinion there is no good answer to the problem and instead some sensible default that isn't "we won't support this" should be converged upon. I'm not sure if that discussion should take place here or in REP2012. I think that there is value in offering a playback option that sends requests or responses as recorded, despite the problem of "does replaying service responses and client requests at the same timing as a prior run really make sense?". Just because it would gives the most utility and options to the user. Anything more complex gets, well, more complex really fast and may be better resolved by the user writing up something custom for their specific use case. Or we will hear about it in the issue boards and can resolve it later :) |
@emersonknapp @ihasdapie |
Rough DesignHow to save record service messageRecord service event topic (e.g. /add_two_ints/_service_event) is recorded. So the recording process is the same as for regular topics. How to distinguish service event topic and hidden topic.While reading recorded topic information, topic for service should have different process from other topics. So it's important to distinguish between them. Expand the 'record' command
Change output of 'Info' commandTopic for service should be listed distinctively, as below example.
Expand the 'play' commandAdd 2 parameters.
|
@Barry-Xu-2018 thanks for volunteering! I have a request - could you open a PR with a document in the https://github.com/ros2/rosbag2/blob/rolling/docs/design/ directory so that we can make comments on it? It does not need to be very long or detailed, the above looks good - it just provides us a place to give feedback and make revisions. An issue comment is not an easy way to do that. |
Okay. I will create a PR in https://github.com/ros2/rosbag2/blob/rolling/docs/design/. |
I created a PR #1359 Let's discuss the design in this PR. @emersonknapp @ihasdapie |
|
Description
In ROS1, recording services was not implemented. However, actions were implemented on top of messages.
This made it possible to debug/enhance/test a system by recording just messages and replaying them. In ROS2, server client handshake is done over services. Would it be possible to implement a rosbag record of the sent goals?
Related Issues
ROS1: ros/ros_comm#250
Completion Criteria
Successful trigger of action by following this sequence:
This sequence with ROS1 works if the goal messages are recorded. If this also works with ROS2, we can consider this feature as "ready"
Implementation Notes / Suggestions
On the interface, we can have 3 different behaviors, all of which make sense from a certain perspective:
ros2 bag record --include-actions
orros2 bag record --include-services
to allow replaying of service requests (most sensible, keeps concerns separate)ros2 bag record --include-hidden-topics
(better if not done this way)Since the services and topics are implemented similarly at a RMW level, it should be possible to record the data sent via services.
On the other hand, just because all current RMW implementations use the same mechanism for topic and service communication, this might not hold true in future.
Testing Notes / Suggestions
The integrated testing for this would be quite simple:
I don't know how it'd be unit tested
The text was updated successfully, but these errors were encountered: