Commit graph

19 commits

Author SHA1 Message Date
Emerson Knapp
4209d7654b Fix MSBuild warnings C4146 and C4267
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
2020-02-11 22:36:39 +01: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
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
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
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
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
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
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
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
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
e520cb4d63 remove use of C99-style designated initializers 2019-05-05 13:29:17 +08:00
Erik Boasson
925b6e09b3 add write/take of serialized messages 2019-05-05 12:36:58 +08:00
Erik Boasson
b925d5591c update for fixes in Cyclone sertopic interface 2019-05-05 12:34:02 +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