Add router node.
This commit is contained in:
1 parent
21f8c2b7c4
commit
9c30904008
6 files changed
+120
-4
No files matched your search
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright 2026 James Pace
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
//
|
||||
// This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
// defined by the Mozilla Public License, v. 2.0.
|
||||
//
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <j7s_zenoh_bridge/ZenohRouter.hpp>
|
||||
|
||||
namespace j7s
|
||||
{
|
||||
|
||||
ZenohRouter::ZenohRouter(const rclcpp::NodeOptions & options) : Node("zenoh_bridge", options)
|
||||
{
|
||||
const auto zenohConfigPath = this->declare_parameter<std::string>("zenoh_config_path");
|
||||
auto config = zenoh::Config::from_file(zenohConfigPath);
|
||||
m_zenohSession = std::make_shared<zenoh::Session>(std::move(config));
|
||||
}
|
||||
|
||||
}; // namespace j7s
|
||||
|
||||
#include <rclcpp_components/register_node_macro.hpp>
|
||||
RCLCPP_COMPONENTS_REGISTER_NODE(j7s::ZenohRouter)
|
||||
Reference in new issue
Block a user