* Block rmw_send_response if response reader unknown
The client checks using rmw_service_server_is_available whether the
request it sends will be delivered to service, but that does not imply
that the (independent, as far as DDS is concerned) response reader of
the client has been discovered by the service. Usually that will be the
case, but there is no guarantee.
Ideally DDS would offer an interface that allows checking the reverse
discovery, but that does not yet exist in either the specification or in
Cyclone. This commit works around that by delaying publishing the
response until the number of request writers matches the number of
response readers.
Signed-off-by: Erik Boasson <eb@ilities.com>
* Change request headers to use rmw_request_id_t on the wire
Signed-off-by: Erik Boasson <eb@ilities.com>
* Precise check for matched client/service
Assign a unique identifier to each client/service on creation, add it
to the USER_DATA QoS of the reader and writer and use it for the request
ids. This allows:
* rmw_service_server_is_available to only return true once it has
discovered a reader/writer pair of a single service (rather than a
reader from some service and a writer from some service); and
* rmw_send_response to block until it has discovered the requesting
client's response reader and to abandon the operation when the client
has disappeared.
The USER_DATA is formatted in the same manner as the participant
USER_DATA, this uses the keys "serviceid" and "clientid".
This is still but a workaround for having a mechanism in DDS to ensure
that the response reader has been discovered prior by the request writer
prior to sending the request.
Signed-off-by: Erik Boasson <eb@ilities.com>
* Address review comments
Signed-off-by: Erik Boasson <eb@ilities.com>
* Backwards compatibility
* Revert commit fb040c5db6c05be7698f05969f9bb48b8740f0fe to retain the
old wire representation;
* Embed the publication_handle of the request inside rmw_request_id_t,
possible because reverting to the old wire representation frees up
enough space, and use this in rmw_send_response to check for the
presence of the client's reader;
* Clients and services without a client/service id in the reader/writer
user data are treated as fully matched at all times.
* Replace ERROR by FAILURE to because of windows.h
Signed-off-by: Erik Boasson <eb@ilities.com>
* Timeout rmw_send_response after waiting 100ms for discovery
The discovery will eventually result in the client's reader being known
or its writer no longer being known, so a timeout is not necessary for
correctness. However, if it ever were to block for a longish
time (which is possible in the face of network failures), returning a
timeout to the caller is expected to result in less confusion.
Signed-off-by: Erik Boasson <eb@ilities.com>
* Make iterators "const auto &"
Signed-off-by: Erik Boasson <eb@ilities.com>
* Add TODO for eliminating rmw_send_response blocking
Signed-off-by: Erik Boasson <eb@ilities.com>
Co-authored-by: eboasson <eb@ilities.com>
* Delete superfluous/erroneous/misleading comment
Signed-off-by: Erik Boasson <eb@ilities.com>
* Check for matched endpoints in server_is_available
Signed-off-by: Erik Boasson <eb@ilities.com>
* Initialize participant on first use. Destroy participant after last node is destroyed
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Please linters
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Solve problems with guard conditions
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Address peer review comments
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Address peer review comments
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Used DDS_CYCLONEDDS_HANDLE to create all guard conditions
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Increase ref count always
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Add support for taking a sequence of messages
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Reorder valid messages to front of sequence
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Initialize taken value
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* implement with_info version of take
Signed-off-by: Luetkebohle Ingo (CR/AEX3) <ingo.luetkebohle@de.bosch.com>
* Fix function names and signatures.
Signed-off-by: Luetkebohle Ingo (CR/AEX3) <ingo.luetkebohle@de.bosch.com>
* Return 0 on received for responses as well
Signed-off-by: Luetkebohle Ingo (CR/AEX3) <ingo.luetkebohle@de.bosch.com>
* Fill in message_info timestamps
Signed-off-by: Luetkebohle Ingo (CR/AEX3) <ingo.luetkebohle@de.bosch.com>
* Report error when timestamp cannot be obtained.
Signed-off-by: Luetkebohle Ingo (CR/AEX3) <ingo.luetkebohle@de.bosch.com>
* return 0 for received timestamp to signify lack of support
Signed-off-by: Luetkebohle Ingo (CR/AEX3) <ingo.luetkebohle@de.bosch.com>
Delete cyclonedds_cmake_module package and remove dependencies on it.
This is not needed, since Eclipse Cyclone DDS already provides a package configuration file (CycloneDDSConfig.cmake)
Properly handle downstream effects of ROS_SECURITY_STRATEGY and ROS_SECURITY_ENABLE environment variables through security_options. Improve memory management and make sure to only set security qos properties when all files are sure to exist.
Add in conditional compile based on ENABLE_SECURITY make flag
and Cyclone DDS feature availability. Also addressed review
comments.
Signed-off-by: Sid Faber <sid.faber@canonical.com>