Init commit.
This commit is contained in:
commit
c38407bbd8
8 files changed
+279
No files matched your search
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
#pragma once
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "zenoh.hxx"
|
||||
|
||||
namespace j7s
|
||||
{
|
||||
|
||||
class Config
|
||||
{
|
||||
public:
|
||||
Config(rclcpp::Node & node, const std::string & prefix);
|
||||
|
||||
// TODO: Should we specify QoS here?
|
||||
std::string m_rosTopic;
|
||||
std::string m_zenohKeyExpr;
|
||||
std::string m_rosType;
|
||||
};
|
||||
|
||||
class ZenohSource
|
||||
{
|
||||
public:
|
||||
ZenohSource(
|
||||
rclcpp::Node & node, const std::shared_ptr<zenoh::Session> session, const Config & config);
|
||||
|
||||
private:
|
||||
std::shared_ptr<rclcpp::GenericPublisher> m_publisher;
|
||||
std::shared_ptr<zenoh::Subscriber<void>> m_subscriber;
|
||||
};
|
||||
|
||||
class RosSource
|
||||
{
|
||||
public:
|
||||
RosSource(
|
||||
rclcpp::Node & node, const std::shared_ptr<zenoh::Session> session, const Config & config);
|
||||
|
||||
private:
|
||||
std::shared_ptr<zenoh::Publisher> m_publisher;
|
||||
std::shared_ptr<rclcpp::GenericSubscription> m_subscriber;
|
||||
};
|
||||
|
||||
class ZenohBridge : public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
ZenohBridge(const rclcpp::NodeOptions & options);
|
||||
|
||||
private:
|
||||
std::vector<ZenohSource> m_zenohSources;
|
||||
std::vector<RosSource> m_rosSources;
|
||||
|
||||
std::shared_ptr<zenoh::Session> m_zenohSession;
|
||||
};
|
||||
|
||||
} // namespace j7s
|
||||
Reference in new issue
Block a user