-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Abrar Rahman Protyasha <[email protected]> Going from `SerializedPublisher` to generic Signed-off-by: Abrar Rahman Protyasha <[email protected]> Migrate from rclcpp generic pub/sub With this patch, the package builds successfully in rolling, but there are failing tests to address, and all of this is before having built in foxy at all (and before adding back some of the `create_subscription` code from PR 24). Signed-off-by: Abrar Rahman Protyasha <[email protected]> Add missing compress/decompress logic Signed-off-by: Abrar Rahman Protyasha <[email protected]> Update generic pub sub source Signed-off-by: Abrar Rahman Protyasha <[email protected]> Publish the message rather than its shared ptr Signed-off-by: Abrar Rahman Protyasha <[email protected]> Rename connext foxy package Signed-off-by: Abrar Rahman Protyasha <[email protected]> Address uncrustify error Signed-off-by: Abrar Rahman Protyasha <[email protected]> Migrate back to rosidl_target_interfaces Signed-off-by: Abrar Rahman Protyasha <[email protected]>
- Loading branch information
Showing
7 changed files
with
378 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2018, Bosch Software Innovations GmbH. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// NOTE: This file was directly copied from rosbag2_transport | ||
// TODO(jacobperron): Replace with upstream implementation when available | ||
// https://github.com/ros2/rclcpp/pull/1452 | ||
|
||
#include "generic_publisher.hpp" | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
namespace | ||
{ | ||
rcl_publisher_options_t rosbag2_get_publisher_options(const rclcpp::QoS & qos) | ||
{ | ||
auto options = rcl_publisher_get_default_options(); | ||
options.qos = qos.get_rmw_qos_profile(); | ||
return options; | ||
} | ||
} // unnamed namespace | ||
|
||
namespace domain_bridge | ||
{ | ||
|
||
GenericPublisher::GenericPublisher( | ||
rclcpp::node_interfaces::NodeBaseInterface * node_base, | ||
const rosidl_message_type_support_t & type_support, | ||
const std::string & topic_name, | ||
const rclcpp::QoS & qos) | ||
: rclcpp::PublisherBase(node_base, topic_name, type_support, rosbag2_get_publisher_options(qos)) | ||
{} | ||
|
||
void GenericPublisher::publish(const rmw_serialized_message_t & message) | ||
{ | ||
auto return_code = rcl_publish_serialized_message( | ||
get_publisher_handle().get(), &message, nullptr); | ||
|
||
if (return_code != RCL_RET_OK) { | ||
rclcpp::exceptions::throw_from_rcl_error(return_code, "failed to publish serialized message"); | ||
} | ||
} | ||
|
||
} // namespace domain_bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2018, Bosch Software Innovations GmbH. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// NOTE: This file was directly copied from rosbag2_transport | ||
// TODO(jacobperron): Replace with upstream implementation when available | ||
// https://github.com/ros2/rclcpp/pull/1452 | ||
|
||
#ifndef DOMAIN_BRIDGE__GENERIC_PUBLISHER_HPP_ | ||
#define DOMAIN_BRIDGE__GENERIC_PUBLISHER_HPP_ | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "rclcpp/rclcpp.hpp" | ||
|
||
namespace domain_bridge | ||
{ | ||
|
||
class GenericPublisher : public rclcpp::PublisherBase | ||
{ | ||
public: | ||
GenericPublisher( | ||
rclcpp::node_interfaces::NodeBaseInterface * node_base, | ||
const rosidl_message_type_support_t & type_support, | ||
const std::string & topic_name, | ||
const rclcpp::QoS & qos); | ||
|
||
virtual ~GenericPublisher() = default; | ||
|
||
void publish(const rmw_serialized_message_t & message); | ||
}; | ||
|
||
} // namespace domain_bridge | ||
|
||
#endif // DOMAIN_BRIDGE__GENERIC_PUBLISHER_HPP_ |
Oops, something went wrong.