Commit graph

72 commits

Author SHA1 Message Date
Dan Rose
d47de860aa Use right event info for RMW_EVENT_LIVELINESS_LOST
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-20 03:17:46 -07:00
Dan Rose
79e7046784 unbreak Dashing build after #50
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-20 03:08:00 -07:00
Dan Rose
c51c884413 Add compilation guards for RMW compatibility
Use CMake rmw_VERSION for conditional compilation

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-20 02:41:30 -07:00
Erik Boasson
94e53ce83f update signature for added pub/sub options
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-20 02:41:30 -07:00
Brian Marchi
33fed3a65c Add localhost boolean parameter to create node function (#50)
* Add localhost boolean parameter to create node function

Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>

* Cast to void to avoid compilation warning

Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
2019-10-18 19:30:06 -03:00
Dan Rose
1205ab5ea2 Remove dead string serialization code (#41)
* Remove dead string serialization code code

* Remove more dead cstring code
2019-09-27 10:05:55 +02:00
Erik Boasson
a55c9cb605 Use RMW_RET_NODE_NAME_NON_EXISTENT only if defined
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-25 07:51:17 +02:00
dennis-adlink
c2c69ac032 Code improvements in ser/deser code wrt passing data size (#39)
* Some code improvements in ser/deser code wrt passing data size
to cycdeserbase class.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Move adjusting deserialisation limit in cycdeserbase to line where
data pointer is moved.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-09-24 16:13:34 +02:00
evshary
a61a014a11 Return NODE_NAME_NON_EXISTENT instead of ERROR.
Signed-off-by: evshary <evshary@gmail.com>
2019-09-24 15:11:51 +02:00
Dirk Thomas
af5fa3c468
update repo URL with changed org unit (#38) 2019-09-19 08:18:42 -07:00
Erik Boasson
29f4b76d3d Update known limitations in README
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-19 13:18:54 +02:00
Erik Boasson
828ae14558 Address uncrustify linter violation
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-19 13:18:54 +02:00
dennis-adlink
0e6fd30a8c Validation in deserializer (#36)
* Validation in Deserializer

Added validation in CDR deserialization: max buffer length is checked
when deserializing fields and strings are checked for null-terminator
(except for wstrings, which are serialized without null-terminator).

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Catch exceptions in serdata functions

In serdata functions rmw_print, rmw_to_sample and rmw_from_sample
catch exceptions so that correct return code is given when functions
are called from ddsi.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Improve deserialisation validation

Refactored the deserialisation validation functions so that sequence
length is checked more properly and protection against overflows.
Renamed source files for exceptions so that it conforms to ros2 /
google c++ style guide.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-09-19 11:56:26 +02:00
Dan Rose
b39efafd62 make cyclonedds vender package play nice with colcon (#34)
* Un-vendor cyclonedds

Upstream changes in https://github.com/eclipse-cyclonedds/cyclonedds/pull/256 should make this unnecessary and allow you to clone the package into your ROS workspace.

* Remove obsolete gitignore

* Recommend cloning eclipse-cyclonedds/cyclonedds
2019-09-18 19:49:39 +02:00
Scott K Logan
e849c71122 Address CMake and uncrustify linter violations 2019-09-18 10:26:39 +02:00
eboasson
44e61e20e0
Fix "type punning" warning in printing floats (#33)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-13 12:12:16 +02:00
Dan Rose
3edf332573 Use rosdep (#32)
* Add Cyclone DDS build dependencies for rosdep

* Update README.md

Change apt install commands to rosdep install.

* build_depend -> buildtool_depend for maven and java

* Add vendor package to build cyclonedds from source

Remove maven and java dependency (thanks, @eboasson)

* remove --symlink-build flag

this obscures the intention of the code and sophisticated users can choose whether to use it or not.

* add rosdep to readme
2019-09-13 11:54:06 +02:00
dennis-adlink
883ef01105 Implemented byte-swapping in deserializer (#31)
* Implemented byte-swapping in deserializer

Set the correct endianness flag when serializing ROS messages to CDR
and added support for byte-swapping in CDR deserializer when in a
mixed-endian network.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Fix float deser byte-swap and add byte-swap in cycprint

Fixed the byte-swapping in float/double deserialization and added byte-
swapping in cycprint by creating a cycdeserbase that is shared with
cycdeser.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-09-12 15:31:03 +02:00
Erik Boasson
60a87ab4ab Optional reporting of late messages
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-11 10:00:46 +02:00
Erik Boasson
a63cc8b84d Multi-domain support
Depends on some improvements to Cyclone, source compatible with versions
that lack those improvements.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-11 10:00:46 +02:00
Erik Boasson
fb8c08bd7f Add support for printing messages to DDSI trace
NOTE: not tested against versions of Cyclone that don't have the feature

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-11 10:00:46 +02:00
Scott K Logan
888235e96e Revert "Replace cyclonedds by CycloneDDS for colcon"
This reverts commit 9ba2508bca.

The CycloneDDS package name should conform to the ROS package name
recommendations, and contain no upper-case letters.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-08-30 11:26:42 +02:00
Scott K Logan
428072358e Ensure all packages in the repository have the same version
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-08-30 11:26:42 +02:00
Erik Boasson
9ba2508bca Replace cyclonedds by CycloneDDS for colcon
Commit 1200bfd109e4e21ff572ce0c6205cb6c2e247edc in Cyclone DDS changed
the setting of the project name to use a string literal.  That change
affects the capitalization of the name under which colcon looks for
Cyclone, and this commit changes the dependency specification to match.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-26 11:47:59 +02:00
Erik Boasson
43f70ed2eb Use NO_KEY GUID variant if Cyclone DDS supports it
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-22 10:14:49 +02:00
Erik Boasson
8844880edd Implement no_demangle in various get_... functions
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-22 10:14:49 +02:00
Erik Boasson
eb2d17c066 Set encoding to CDR rather than parameterised-CDR
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-22 10:14:49 +02:00
Erik Boasson
81c597027f Code formatting fix
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-22 10:14:49 +02:00
Erik Boasson
d5af8dcb9a Implement rmw_take_event
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-19 20:46:51 +02:00
Erik Boasson
e4fa799090 Use dummy guardcond to block on empty waitset
Cyclone DDS always returns immediately from ``dds_waitset_wait`` when
there are no entities in the waitset, but the rcl timer test implies
that the expectation is that blocks.  By adding a guard condition that
is never triggered this expectation is met.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-19 20:46:51 +02:00
Erik Boasson
d06953bd91 Handle RMW_QOS_POLICY_DEPTH_SYSTEM_DEFAULT
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-19 20:46:51 +02:00
Erik Boasson
10f18f0525 Add wstring support
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-19 11:13:13 +02:00
Erik Boasson
021910e565 Support creating a waitset without creating a node
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-18 21:03:51 +02:00
Erik Boasson
5e137205f2 Uncrustify and fix issues reported by cpplint
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-17 15:23:21 +02:00
Erik Boasson
130d6ea10e Fix retrieving client/server topic names
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
0765e5696d Return error when querying a non-existent node
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
edab551520 Add get_client_names_and_types_by_node
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
cb0ed6a1df Start request sequence numbers at 1
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
a47cd2c412 Create topics in the right node's participant
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
f1f1b7bdaf Update get_actual_qos based on test results
* Return history depth even when KEEP_ALL is selected

* Return deadline, lifespan, liveliness

This doesn't fix it completely: the latter three are not actually
supported and are still ignored when creating an publisher or subscriber
node; and moreover it is not clear how to map infinity.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
0f25192bcb Return error for invalid name nodes
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
b49dd0eb62 Fix serialization of bool sequence/array
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-16 15:30:50 +02:00
Erik Boasson
874ac51aff Add build instructions to README
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-13 18:16:09 +02:00
Erik Boasson
5299a83916 Create one DDS publisher, subscriber per node
Otherwise each writer/reader gets its own, and at approximately 1kB
each, with hundreds of endpoints that starts adding up to a meaningful
amount of memory.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-06-24 11:28:41 +02:00
Erik Boasson
3e9a56a36b Share built-in readers across nodes
If each node has its own set of built-in topic readers there is quite a
bit of memory use for no benefit.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-06-24 11:28:41 +02:00
Erik Boasson
3a4b10421d Don't retain all data in builtin-topics readers
The built-in topics readers in the RMW node are currently not used for
anything other than triggering the guard condition.  All the query
functions just get their own data set from Cyclone.  Taking all samples
instead of just the not-alive ones reduces memory usage.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-06-21 16:26:01 +02:00
Erik Boasson
572d272ebf Initialize common ddsi_sertopic with memset
struct ddsi_sertopic will shortly change a little bit by the removal of
two members that should never have been in it in the first place and
that had to be initialized to 0.  Relying on memset makes the source
code independent of this difference.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-06-20 18:37:59 +02:00
Erik Boasson
870854b7ba Fix return of rmw_wait
Misuse of std::vector resize as if it would leave any reserved entries
unchanged caused a misinterpretation of entries whenever the number of
triggering entities was larger than the number of triggering entities in
the preceding call to rmw_wait: these would all be mapped to the first
entity in the set.

If the waitset is reused from call to call and spurious events are
handled gracefully, this is recoverable; otherwise, no such luck.

Moreover, not accounting for a sentinel entry added to the list of
triggered entities means it would never return RMW_RET_TIMEOUT.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-06-20 19:53:13 +08:00
Hunter L. Allen
eb4aec84ca Replace __attribute__((unused)) with static_cast<void>
Signed-off-by: Hunter L. Allen <hunterlallen@protonmail.com>
2019-06-18 22:04:34 +08:00
Juan Oxoby
7acc5f3222 Check for nullptr.
Sometimes dds_qget_userdata() returns true with a nullptr. It might be a good idea
to revise its implementation.
2019-06-15 04:44:24 +02:00