Commit graph

190 commits

Author SHA1 Message Date
Miaofei Mei
aed236fb26 Stubs for rmw_get_publishers_info_by_topic and rmw_get_subscriptions_info_by_topic (#81)
Signed-off-by: Miaofei <miaofei@amazon.com>
2020-01-14 14:32:10 -03: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
Michael Carroll
ce34664472
0.4.4
Signed-off-by: Michael Carroll <michael@openrobotics.org>
2019-11-19 23:18:14 -06:00
Dan Rose
0686850890 Minor CMakeLists cleanup
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-18 10:28:23 +01:00
Michael Carroll
4089feee81
0.4.3
Signed-off-by: Michael Carroll <michael@openrobotics.org>
2019-11-13 07:50:50 -06: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
eboasson
096d4643c8
Fix dashing breakage (#64)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-07 09:33:17 +01:00
eboasson
c168334087
Support localhost-only communications (#60)
* Support localhost-only communications

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

* Future-proof localhost-only for upcoming Cyclone fix

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-07 08:14:59 +01:00
Scott K Logan
0a1770e1e2 0.4.2 2019-11-01 13:51:51 -07:00
Scott K Logan
bb8570f165
Suppress a syntax error identified by cppcheck 1.89 (#59)
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-25 09:15:25 -07:00
eboasson
3817149010 Make RMW version acceptable to MSVC (#58)
GCC and Clang support the ternary operator in macros, MSVC does not.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-25 09:14:45 -07:00
Karsten Knese
951f5e2e23 skip compilation of rmw_cyclonedds when cyclone dds is not found (#56)
* skip compilation of rmw_cyclonedds when cyclone dds is not found

Signed-off-by: Karsten Knese <karsten@openrobotics.org>

* proper case and company name

Signed-off-by: Karsten Knese <karsten@openrobotics.org>

* linters

Signed-off-by: Karsten Knese <karsten@openrobotics.org>

* change ADLINK to Eclipse

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
2019-10-25 17:45:39 +02:00
Karsten Knese
80bc94e2fa remove executive flags from source code files
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
2019-10-25 10:15:48 +02:00
Michael Carroll
de359efb5f
0.4.1
Signed-off-by: Michael Carroll <michael@openrobotics.org>
2019-10-24 08:31:35 -05:00
Karsten Knese
e959e66f08 rename return functions
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
2019-10-22 16:50:24 +02:00
evshary
6d907ef583 Solve the lint issue.
Signed-off-by: evshary <evshary@gmail.com>
2019-10-21 12:42:12 +02:00
Erik Boasson
7bfd709fe0 Add already obsoleted loaned message interfaces
The rmw_return_loaned_message and rmw_release_loaned_message functions
are still expected by rcl, even if they are scheduled to be replaced.
We need a working build, so add them for now.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-21 12:37:55 +02:00
Karsten Knese
d8cb336f8f zero copy api for cyclonedds
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
2019-10-21 12:37:55 +02:00
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
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
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