Add router node.

This commit is contained in:
jimmy committed 2026-07-23 13:15:00 -04:00
1 parent 21f8c2b7c4
commit 9c30904008
6 files changed
+120 -4

No files matched your search

+29
View File
@@ -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)