Commit graph

108 commits

Author SHA1 Message Date
Michel Hidalgo
7eff1eab55 Ensure compliant init/shutdown API implementations. (#202)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-10-15 15:45:20 +02:00
Michel Hidalgo
f7fcf88bb4 Ensure compliant init options API implementations. (#200)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-10-15 15:45:20 +02:00
Michel Hidalgo
cab4b81278 Finalize context iff shutdown. (#196)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-10-15 15:45:20 +02:00
Jacob Perron
6f9a61474f
rmw_destroy_node must remove node from graph cache (#252)
Signed-off-by: Erik Boasson <eb@ilities.com>

Co-authored-by: Erik Boasson <eb@ilities.com>
2020-10-06 09:49:16 -07:00
Jacob Perron
5333ab6be7
Lost service responses (#183, #74) (#187) (#209)
* 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>
2020-07-21 16:19:35 -07:00
Michel Hidalgo
6598191749
Handle RMW_DEFAULT_DOMAIN_ID. (#194) (#199)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-06-23 12:15:22 -03:00
eboasson
c424bc118f
Restore dashing/eloquent behaviour of "service_is_available" (#190)
* 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>
2020-06-01 16:27:25 -03:00
Ivan Santiago Paunovic
8fafb3ec0a
Remove MANUAL_BY_NODE liveliness API (#178)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-05-12 14:51:41 -03:00
Ivan Santiago Paunovic
40ba599462
Fix how topic name should be when not using ros topic name conventions (#177)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>

Co-authored-by: Shane Loretz <sloretz@osrfoundation.org>
2020-04-30 18:08:55 -07:00
Ivan Santiago Paunovic
f820994aab
Initialize participant on first use. Destroy participant after last node is destroyed. (#176)
* 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>
2020-04-30 16:16:02 -07:00
Sid Faber
8e14104246
Fix error message (#175)
Only generate "Recompile with '-DENABLESECURITY=ON' error when
ROS_SECURITY_STRATEGY="Enforce"

Signed-off-by: Sid Faber <sid.faber@canonical.com>
2020-04-29 18:38:00 -03:00
Michel Hidalgo
3c306d32a6
Cast size_t to uint32_t explicitly. (#171)
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2020-04-28 14:37:00 -03:00
Michael Carroll
03a49c5153
Rename rosidl_message_bounds_t (#166)
* Rename rosidl_message_bounds_t

Signed-off-by: Michael Carroll <michael@openrobotics.org>
2020-04-24 15:56:16 -05:00
Michael Carroll
224d761eca
Add support for taking a sequence of messages (#148)
* 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>
2020-04-24 11:49:15 -05:00
Ingo Lütkebohle
2638f4abe8
implement with_info version of take (#161)
* 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>
2020-04-23 21:31:48 -07:00
Ingo Lütkebohle
27bc8194e7
Fill in message_info timestamps (#163)
* 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>
2020-04-23 14:29:39 -07:00
Ivan Santiago Paunovic
0fc4a3f289
Fix build warnings (#162)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-04-22 19:40:16 -03:00
eboasson
8a1d3fc092
Switch to one participant per context model (#145)
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-04-22 14:01:05 -03:00
Dan Rose
a9e8784c04
Make case fallthrough explicit (#153)
* Make case fallthrough explicit
2020-04-13 21:05:42 -05:00
Dan Rose
5781044edd
Implement rmw_set_log_severity (#149) 2020-04-13 16:08:25 -05:00
Mikael Arguedas
0450e2d840
security-context -> enclave (#146)
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
2020-04-13 10:29:31 -03:00
Sid Faber
16134dcaba Merge remote-tracking branch 'origin/master' into dds-security 2020-04-07 19:41:33 +00:00
Ivan Santiago Paunovic
216211efe3
API changes to sync with one Participant per Context change in rmw_fastrtps (#106)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-04-03 10:13:21 -03:00
Sid Faber
581ba384f8
Merge branch 'master' into dds-security 2020-04-02 12:41:44 -04:00
Sid Faber
1ca2269e66
Improve security logic and memory management
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.
2020-04-02 12:36:31 -04:00
Erik Boasson
12f977f3df Include incompatible_qos_events_statuses.h only if rmw >= 0.8.2
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-03-29 17:00:14 +02:00
Sid Faber
5e934200ce
Fix memory leaks
Also remove superfluous include and blank line.

Signed-off-by: Sid Faber <sid.faber@canonical.com>
2020-03-27 08:54:55 -07:00
Miaofei Mei
c481c10f5d
Support for ON_REQUESTED_INCOMPATIBLE_QOS and ON_OFFERED_INCOMPATIBLE_QOS events (#125)
Signed-off-by: Miaofei <miaofei@amazon.com>
2020-03-27 09:24:27 -03:00
Sid Faber
bca0852f50 Update conditional compile logic
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>
2020-03-26 18:04:57 +00:00
Sid Faber
99d2738a84 Enable use of Cyclone DDS security features
Add utility function to insert security settings to the cyclone QOS
object used to create nodes.  Include a utility to find security
files and properly format their location to use with DDS.

Signed-off-by: Sid Faber <sid.faber@canonical.com>
2020-03-20 20:54:03 +00:00
Miaofei Mei
025762ac4f
Add rmw_*_event_init() functions (#115)
Signed-off-by: Miaofei <miaofei@amazon.com>
2020-03-19 17:15:07 -03:00
Emerson Knapp
8e8b1ff044 Use a list instead of a set for node names list
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
2020-03-11 09:44:10 +01:00
Erik Boasson
b4c0620b5b Fix leak in client/service topic error handling
And refactor to reduce the amount of code duplication.

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-03-05 15:18:28 +01:00
Dennis Potman
6162be51f9 Fix sertopic referencing
Use the function dds_create_topic_generic for creating topic, so that
the sertopic that is actually used is referenced in the publisher.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:18:28 +01:00
Ivan Santiago Paunovic
49d4a51abf
Update usage of rmw_topic_endpoint_info_array (#101)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2020-02-20 14:11:35 -03:00
evshary
275d3dd42a Correct the coding style to pass CI test.
Signed-off-by: evshary <evshary@gmail.com>
2020-02-12 10:08:31 +01:00
Dennis Potman
18317eff6c Add #if version >= 0.8.2 to fix ros2 dashing builds
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-02-11 10:44:09 +01:00
Dennis Potman
d70fad6c46
Implementation for rmw_get_pub/sub_info_by_topic (#97)
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-02-10 14:59:04 -03:00
Dirk Thomas
1c500379ae
code style only: wrap after open parenthesis if not in one line (#95)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-02-04 11:41:49 -08:00
Erik Boasson
0bc1281978 Fix uncrustify error
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-01-31 15:38:41 +01:00
Dennis Potman
a771f917f8
Support for deadline, lifespan and liveliness qos (#88)
* Events and liveliness/lifespan/deadline qos support

This commit adds support for liveliness, lifespan and deadline missed
qos in rmw, and it adds event support in rmw_wait that is required for
these qos policies to work correctly.

* Removed redundant empty check in rmw_wait, fix duration 0 vs infinity for qos getter and setter

* Disabled auto-dispose so that deadline-missed on reader is still triggered when a writer becomes not-alive and unregisters itself
2020-01-31 14:53:20 +01:00
eboasson
ee35a6c41a
rmw_get_topic_endpoint_info doesn't exist on Dashing (#91)
* rmw_get_topic_endpoint_info doesn't exist on Dashing

Signed-off-by: Erik Boasson <eb@ilities.com>

* get_topic_endpoint_info got added in RMW 0.8.2

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-01-31 13:37:49 +01:00
Dan Rose
2876b80a7d dds_time_t instead of dds_duration_t for absolute time
Signed-off-by: Dan Rose <dan@digilabs.io>
2020-01-23 10:53:38 +01:00
Dan Rose
c0af9d898b
Cache serialization info when CDRWriter is constructed (#80)
1. Make CDRWriter remember its top level struct value type
2. Populate the trivially serializable cache when CDRWriter is created instead of waiting until the first time a message is sent.
3. Speed up arrays/sequences of trivially serializable structs

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-12-13 11:05:58 -05:00
Dan Rose
c25f22e565
Mark code that should be unreachable (#77)
Introduce a new [[noreturn]] unreachable() function that marks code as unreachable and throws a logic error if it is executed.
Fix build error due to Windows min/max macros.
Fix linker errors from referring to a non-constexpr extern from a constexpr.
Fix warnings about narrowing conversions.

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-12-08 16:03:30 -06:00
Dan Rose
9b264c6480
Clean up topic namespace prefixes (#76)
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-12-06 11:23:47 -06:00
Dan Rose
b322f478de
Serialize into initialized memory, not vector (#75)
Make serdata a private header
Serialize into uninitialize data, not a vector.
2019-12-06 10:21:18 -06:00
Dan Rose
88e74c322f
Rework serialization (#42)
* Rework serialization and typesupport

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-12-05 14:42:11 -06:00
eboasson
3e7d33ba2b
Use rcutils_get_env() instead of getenv() (#71) (#73)
* Use rcutils_get_env() instead of getenv() (#71)

Signed-off-by: Erik Boasson <eb@ilities.com>

* Keep includes in alphabetical order

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-25 20:19:14 +01:00
eboasson
0ca71446a9 Address "Precondition not met" on rmw_create_node (#65) (#66)
Cyclone's original code for dds_create_domain() appears to create a
domain entity that is automatically deleted when the last attached
participant disappears.  In reality, it leaks a reference while
returning DDS_RETCODE_OK, making it appear as-if it is a regular entity
that remains into existence until explicitly deleted.

The RMW code assumed that it would be automatically deleted when the
last node was destroyed and that a subsequent call to rmw_create_node
could create the domain anew.  This then fails with "precondition not
met".

In an upcoming fixed version of dds_create_domain() the domain entities
will behave normally (return a handle, require an explicit delete).

This commit provides a workaround for the bug in the original
implementation: by recovering the handle from the first participant the
preceding commits that were intended to future-proof the code will
ensure that the entity now gets deleted explicitly.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-11 15:28:53 -05:00