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

Add rclcpp_generic, a publisher and subscription for serialized messages #1452

Merged
merged 43 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
06e9272
Copying files from rosbag2
nnmm Nov 11, 2020
93fc497
Rebrand into rclcpp_generic
nnmm Nov 11, 2020
83be9dc
Review feedback
nnmm Nov 26, 2020
513c1b8
Move rclpp_generic into rclcpp
nnmm Dec 17, 2020
1481f81
Rename namespace rclcpp_generic to rclcpp::generic
nnmm Jan 5, 2021
4a8bfbc
Free 'create' functions instead of static functions in class
nnmm Jan 7, 2021
8e923ee
Remove 'generic' subdirectory and namespace hierarchy
nnmm Feb 22, 2021
4b82f3a
Order includes according to style guide
nnmm Feb 22, 2021
aa9f827
Remove extra README.md
nnmm Mar 1, 2021
f41f738
Also add brief to class docs
nnmm Mar 1, 2021
ff8c8ef
Make ament_index_cpp a build_depend
nnmm Mar 1, 2021
9a2607e
Add to rclcpp.hpp
nnmm Mar 1, 2021
d02fd9d
Remove memory_management, use rclcpp::SerializedMessage in GenericPub…
nnmm Mar 1, 2021
be8eea8
Clean up the typesupport_helpers
nnmm Mar 1, 2021
b7c8a26
Use make_shared, add UnimplementedError
nnmm Mar 1, 2021
fb39f2e
Add more comments, make member variable private, remove unnecessary i…
nnmm Mar 8, 2021
66cca2a
Apply suggestions from code review
nnmm Mar 8, 2021
e338ceb
Rename test
nnmm Mar 8, 2021
221efa6
Update copyright and remove ament_target_dependencies for test
nnmm Mar 12, 2021
6d816a2
Accept PublisherOptions and SubscriptionOptions
nnmm Mar 12, 2021
ee68c11
Remove target_include_directories
nnmm Mar 15, 2021
78b2fc2
Add explanatory comment to SubscriptionBase
nnmm Mar 17, 2021
1fabb9a
Use kSolibPrefix and kSolibExtension from rcpputils
nnmm Mar 17, 2021
eb3c70e
Fix downstream build failure by making ament_index_cpp a build_export…
nnmm Mar 22, 2021
3a2ee61
Use path_for_library(), fix documentation nitpicks
nnmm Mar 25, 2021
a90c915
Improve error handling in get_typesupport_handle
nnmm Mar 29, 2021
3a6aad4
Accept SubscriptionOptions in GenericSubscription
nnmm Mar 29, 2021
fb5af58
Make use of PublisherOptions in GenericPublisher
nnmm Mar 29, 2021
4f26f36
Document typesupport_helpers
nnmm Mar 29, 2021
9450c3d
Improve documentation
nnmm Mar 29, 2021
2ec829b
Use std::function instead of function pointer
nnmm Mar 29, 2021
7c18bdc
Minimize vertical whitespace
nnmm Mar 29, 2021
9c6f0ed
Add TODO for callback with message info
nnmm Mar 29, 2021
dc4ddbb
Link issue in TODO
nnmm Mar 29, 2021
dc347c9
Add missing include for functional
nnmm Mar 31, 2021
34d7316
Fix compilation
jacobperron Apr 1, 2021
f5d8d14
Fix lint
jacobperron Apr 1, 2021
f585d66
Address review comments (#1)
Karsten1987 Apr 2, 2021
be5453c
Refactor typesupport helpers
jacobperron Apr 2, 2021
66468bf
Remove note about ament from classes
jacobperron Apr 2, 2021
e584230
Fix formatting
jacobperron Apr 2, 2021
3541fe6
Fix warning
jacobperron Apr 2, 2021
5742f7d
Add missing visibility macros
jacobperron Apr 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rclcpp/include/rclcpp/generic_publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "rclcpp/qos.hpp"
#include "rclcpp/serialized_message.hpp"
#include "rclcpp/typesupport_helpers.hpp"
#include "rclcpp/visibility_control.hpp"

namespace rclcpp
{
Expand Down Expand Up @@ -109,9 +110,11 @@ class GenericPublisher : public rclcpp::PublisherBase
}
}

RCLCPP_PUBLIC
Karsten1987 marked this conversation as resolved.
Show resolved Hide resolved
virtual ~GenericPublisher() = default;

/// Publish a rclcpp::SerializedMessage.
RCLCPP_PUBLIC
void publish(const rclcpp::SerializedMessage & message);

private:
Expand Down
8 changes: 8 additions & 0 deletions rclcpp/include/rclcpp/generic_subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "rclcpp/serialized_message.hpp"
#include "rclcpp/subscription_base.hpp"
#include "rclcpp/typesupport_helpers.hpp"
#include "rclcpp/visibility_control.hpp"

namespace rclcpp
{
Expand Down Expand Up @@ -120,24 +121,31 @@ class GenericSubscription : public rclcpp::SubscriptionBase
}
}

RCLCPP_PUBLIC
virtual ~GenericSubscription() = default;

// Same as create_serialized_message() as the subscription is to serialized_messages only
RCLCPP_PUBLIC
std::shared_ptr<void> create_message() override;

RCLCPP_PUBLIC
std::shared_ptr<rclcpp::SerializedMessage> create_serialized_message() override;

/// Cast the message to a rclcpp::SerializedMessage and call the callback.
RCLCPP_PUBLIC
void handle_message(
nnmm marked this conversation as resolved.
Show resolved Hide resolved
std::shared_ptr<void> & message, const rclcpp::MessageInfo & message_info) override;
nnmm marked this conversation as resolved.
Show resolved Hide resolved

/// This function is currently not implemented.
RCLCPP_PUBLIC
void handle_loaned_message(
void * loaned_message, const rclcpp::MessageInfo & message_info) override;

// Same as return_serialized_message() as the subscription is to serialized_messages only
RCLCPP_PUBLIC
void return_message(std::shared_ptr<void> & message) override;

RCLCPP_PUBLIC
void return_serialized_message(std::shared_ptr<rclcpp::SerializedMessage> & message) override;

private:
Expand Down