Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribing with a ConstSharedPtr in the callback signature/publishing a ConstSharedPtr #118

Closed
jacquelinekay opened this issue Oct 9, 2015 · 1 comment
Assignees

Comments

@jacquelinekay
Copy link
Contributor

Nowhere on the master branches of ROS 2 repositories do we subscribe to a topic with a callback signature receiving a MessageT::ConstSharedPtr (shared_ptr<const MessageT>, or publish a ConstSharedPtr.

I tried to do this and there two problems:

  1. AnySubscriptionCallback doesn't have definitions for the ConstSharedPtr type. This is easy to fix and I have an upcoming pull request for it.
  2. The IntraProcessManager receives the published message as a void* in its store_intra_process callback. The compile error is because the publisher template tries to copy the const message into a unique pointer of a const message and pass that to store_intra_proces, but const message cannot be cast to void. Fixing this requires a bit more work to ensure the copy of the message is not const.
@jacquelinekay jacquelinekay self-assigned this Oct 13, 2015
@jacquelinekay jacquelinekay added the in progress Actively being worked on (Kanban column) label Oct 13, 2015
@jacquelinekay
Copy link
Contributor Author

TODO for me: investigate if 2 is still a problem (maybe add a test for publishing a ConstSharedPtr)

@jacquelinekay jacquelinekay added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Oct 13, 2015
@jacquelinekay jacquelinekay removed the in review Waiting for review (Kanban column) label Oct 13, 2015
nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
* use c_utilities package

* add doc for get_node_names

* fix typo

* fixup docs

* fix tests to handle return value of destroy function
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* ros2GH-118 Rename rosbag2_storage::TopicMetadata to TopicInformation and rosbag2_storage::TopicwithType to TopicMetadata

- The former TopicWithTye struct will be enlarged to contain also the rmw serialization format relative to the topic. This is why the name 'TopicMetadata' is now better suited for it.

* ros2GH-17 Rename timestamp to time_stamp for consistency in types

* Fix renaming of TopicWithType to TopicMetadata

* formatting

* pass by const ref
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* ros2GH-118 Make rosbag2::Writer use converters

- Use converters in Writer::write() when input rmw serialization format is different from desired storage serialization format
- Add new field in rosbag2::StorageOptions to keep track of the rmw format given by the user to store the message in

* ros2GH-118 Add --encoding option to ros2 bag record

* ros2GH-118 Associate to each topic its rmw_serialization_format

- Add 'serialization_format' field to TopicMetadata
- Add 'serialization_forat' column in 'topics' table in sqlite storage
- Remove 'storage_format' from BagMetadata and use the TopicMetadata field directly, instead
- the field 'rmw_serialization_format' has been moved from rosbag2::StorageOptions to rosbag2_transport::RecordOptions, because it's a topic property rather than a storage one.
- Currently all topics in a bag file must have the same serialization format
- The tests have been updated accordingly

* ros2GH-118 Fix tests after rebase

* ros2GH-118 Fix MockMetadataIO and use it in test_writer

* ros2GH-118 Fix Windows build and minor refactoring

* ros2GH-118 Add test for writer to check that error is thrown if converter plugin does not exist

* ros2GH-118 Add test to check that metadat_io_ writes metadata file in writer's destructor

* ros2GH-118 Build Converter before opening the database in Writer::open()

- This assures that if one of the converter plugins does not exist, the database is not created

* ros2GH-118 Add end-to-end tests to check graceful failure if converter plugins do not exists

- Both a test for record and play has been added

* ros2GH-118 Rename 'encoding' CLI option to 'serialization_format'

* ros2GH-127 Write serialization format in database also when it's not specified at CLI level

- Tests to check that the serialization format is written in the database have also been added.

* ros2GH-17 Add leak sanitizer to test

- one of the main test goals can only be ssen by valgrind or sanitizers
- enable leak sanitizer for gcc builds only (for now)

* ros2GH-137: Fix cdr converter plugin

- update pluginlib descriptions file after several renames
- fix export of missing includes folder

* ros2GH-137 Add integration test for cdr converter

* ros2GH-137 Fix superfluous printf

* ros2GH-137 It suffices to have only one converter test

* ros2GH-137 Minor refactoring for better readability of test

N.B. This exposes an pre-existing memory leak (not fixed here).

* ros2GH-137 Fix memory leak of topic_name

- topic_name member needs to be freed
- provide a setter for convenience
- Directly assigning a string literal in the test is not sufficient as
  this would be static memory that does not need to be freed.

* ros2GH-17 Allow disabling the usage of sanitizers

This allows manual usage of valgrind.

* ros2GH-17 Fix renaming after rebase

* ros2GH-17 Small cleanups (addressing review comments)
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* clean up test dependencies for rosbag2_test_common

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

* use build and exec depend

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
mauropasse pushed a commit to mauropasse/rclcpp that referenced this issue Oct 10, 2023
Do not crash Executor when send_response fails due to client failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant