Commit graph

28 commits

Author SHA1 Message Date
dodsonmg
21dd7c4570
implement safer align_ function (#141)
avoids unnecessary casts to pointer and pointer manipulation by reference
2020-04-14 00:53:38 -05:00
Dirk Thomas
5c6b187fa9
rename rosidl_generator_c namespace to rosidl_runtime_c (#150)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-04-10 22:14:29 -07: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
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
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
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
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
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
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
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
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
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
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
10f18f0525 Add wstring support
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-08-19 11:13:13 +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
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
2090d067c1 Specialize deserializer for strings (#3)
As std::string is not a basic type, "new" must sometimes be called to
initialze the memory before passing it as a reference.
2019-06-07 11:21:22 +02:00
Erik Boasson
f1602da3be add type names, some more introspection functions
Almost there! Known issues:
* mangling/demangling is still wrong
* it necessarily has to run in the Cyclone default domain id: (1)
  Cyclone is today still limited to a single domain at a time; and (2)
  there is the "extra" participant that pops up here and there for
  creating guard conditions and waitsets without a node existing
* almost all query operations create a reader for a builtin topic and
  throw it away afterward, that might be a little excessive (on the other
  hand, those readers are pretty cheap, so using them as a throwaway
  reader is not so bad).

Still missing:
* get_service_names_and_types
* get_service_names_and_types_by_node

I haven't been able to actually try everything yet, so bugs are probably
lurking here-and-there.
2019-05-21 16:05:52 +02:00
Erik Boasson
24726b4685 update to match ROS2 Dashing interface
passes a decent subset of the tests ...

fixes:
* sequences of simple types: remove accidental alignment
* trigger graph guard on any built-in topic
* create a participant for each node, with node name/namespace in user data

It is still only a proof-of-concept, but it might now actually be usable ...
2019-05-12 13:52:26 +02:00
Erik Boasson
925b6e09b3 add write/take of serialized messages 2019-05-05 12:36:58 +08:00
Erik Boasson
d298359822 fix string serialization, vector deserialization 2019-05-05 12:31:49 +08:00
YuSheng T
f7de5522d7 remove compile error when gcc 7 2019-05-03 18:28:10 +08:00
Erik Boasson
315d39a2ec update to allow talker/listener demos to run
This commit adds stubs for the missing functions and fixes a few bugs in
the serialisation code and topic creation.  With these changes, the
talker and listener demos of ROS2 Crystal Clemmys work.
2019-05-03 17:12:51 +08:00
Erik Boasson
c9a23a9b8a update for Cyclone DDS changes and ROS2 changes
The changes in this commit make it compile with ROS2 Crystal Clemmys and
current Cyclone DDS.  The RMW interface of ROS2 was modified in some
ways and extended in some other ways since Bouncy Bolson; and similarly,
Cyclone now has a somewhat reasonable interface for custom sample
representations and serialization, but the code in this commit probably
contains mistakes in using it.

Therefore, the expectation should be that this doesn't actually work
just yet, though it probably is quite close.  As the old state wouldn't
build at all with any version of Cyclone DDS except the early commits,
this is significant progress already.
2019-04-29 10:08:59 +02:00
Erik Boasson
40a042c6dc replace FastCDR and serialise straight into a serdata to avoid an extra copy 2018-07-19 16:37:12 +02:00
Erik Boasson
01ef31359a initial commit 2018-07-09 13:22:25 +02:00