Skip to content

Namespace nebula::agnocast_wrapper

Namespace List > nebula > agnocast_wrapper

Namespaces

Type Name
namespace detail
namespace diagnostic_updater
namespace message_filters

Classes

Type Name
class AsyncParametersClient
class Client <typename ServiceT>
class Node
Node class for the non-Agnocast build.
class ROS2Client <typename ServiceT>
class ROS2Service <typename ServiceT>
class Service <typename ServiceT>
class StaticTransformBroadcaster
class TransformBroadcaster
class TransformListener

Public Types

Type Name
typedef tf2_ros::Buffer Buffer
typedef std::function< void(std::shared_ptr< const rclcpp::SerializedMessage >)> GenericSubscriptionCallback
typedef rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType OnSetParametersCallbackType

Public Attributes

Type Name
constexpr bool is_message_ptr_service_callback_v = /* multi line expression */
constexpr bool is_shared_ptr_service_callback_v = /* multi line expression */

Public Functions

Type Name
create_client (rclcpp::Node * node, const std::string & service_name, const rclcpp::QoS & qos=rclcpp::ServicesQoS(), rclcpp::CallbackGroup::SharedPtr group=nullptr)
rclcpp::GenericPublisher::SharedPtr create_generic_publisher (rclcpp::Node * node, const std::string & topic_name, const std::string & topic_type, const rclcpp::QoS & qos, const rclcpp::PublisherOptions & options=rclcpp::PublisherOptions{})
rclcpp::GenericPublisher::SharedPtr create_generic_publisher (rclcpp::Node * node, const std::string & topic_name, const std::string & topic_type, const size_t qos_history_depth)
rclcpp::GenericSubscription::SharedPtr create_generic_subscription (rclcpp::Node * node, const std::string & topic_name, const std::string & topic_type, const rclcpp::QoS & qos, GenericSubscriptionCallback callback, const rclcpp::SubscriptionOptions & options=rclcpp::SubscriptionOptions{})
rclcpp::GenericSubscription::SharedPtr create_generic_subscription (rclcpp::Node * node, const std::string & topic_name, const std::string & topic_type, const size_t qos_history_depth, GenericSubscriptionCallback callback)
create_service (rclcpp::Node * node, const std::string & service_name, Func && callback, const rclcpp::QoS & qos=rclcpp::ServicesQoS(), rclcpp::CallbackGroup::SharedPtr group=nullptr)
rclcpp::TimerBase::SharedPtr create_timer (Node * node, rclcpp::Clock::SharedPtr clock, rclcpp::Duration period, CallbackT && callback, rclcpp::CallbackGroup::SharedPtr group=nullptr)
Create a timer driven by an explicit clock (non-Agnocast build).
std::vector< std::string > init (int argc, char const *const * argv, bool agnocast_only=false)
Mode-agnostic replacement for rclcpp::init(). Brings up the context ok() reports on: the agnocast one for an AgnocastOnly executable, the rclcpp one for every other.
bool ok ()
Mode-agnostic replacement for rclcpp::ok().
void set_period (const rclcpp::TimerBase::SharedPtr & timer, std::chrono::nanoseconds period)
Set the timer period (non-Agnocast build).
void shutdown ()
Mode-agnostic replacement for rclcpp::shutdown(). Tears down whichever context init() brought up.
std::shared_ptr< rclcpp::Node > to_rclcpp_node (const std::shared_ptr< T > & node)
Get the underlying rclcpp::Node from an agnocast_wrapper::Node .
bool use_agnocast ()
Whether this process runs on Agnocast, from the ENABLE_AGNOCAST environment variable. Read once and fixed for the lifetime of the process; always false in a non-Agnocast build.

Public Types Documentation

typedef Buffer

using nebula::agnocast_wrapper::Buffer = typedef tf2_ros::Buffer;

typedef GenericSubscriptionCallback

using nebula::agnocast_wrapper::GenericSubscriptionCallback = typedef std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>;

Callback shape accepted by create_generic_subscription(): the intersection of what rclcpp::GenericSubscription and agnocast::GenericSubscription both support, and what autoware_topic_relay_controller (the motivating caller) already uses. Declared unconditionally (unlike the classes below) so it is available in both the Agnocast and non-Agnocast builds — the non-Agnocast Node::create_generic_subscription() (see node.hpp) needs it too.

Takes the message by shared_ptr<const SerializedMessage> rather than shared_ptr< SerializedMessage>: rclcpp deprecated the non-const form (AnySubscriptionCallback's SharedPtrSerializedMessageCallback) in favor of this one on both Humble and Jazzy, and Agnocast's GenericSubscription accepts it as well, so this stays forward-compatible without a per-distribution branch.


typedef OnSetParametersCallbackType

using nebula::agnocast_wrapper::OnSetParametersCallbackType = typedef rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType;

Public Attributes Documentation

variable is_message_ptr_service_callback_v

constexpr bool nebula::agnocast_wrapper::is_message_ptr_service_callback_v;

variable is_shared_ptr_service_callback_v

constexpr bool nebula::agnocast_wrapper::is_shared_ptr_service_callback_v;

Public Functions Documentation

function create_client

template<typename ServiceT>
nebula::agnocast_wrapper::create_client (
    rclcpp::Node * node,
    const std::string & service_name,
    const rclcpp::QoS & qos=rclcpp::ServicesQoS(),
    rclcpp::CallbackGroup::SharedPtr group=nullptr
) 

function create_generic_publisher

inline rclcpp::GenericPublisher::SharedPtr nebula::agnocast_wrapper::create_generic_publisher (
    rclcpp::Node * node,
    const std::string & topic_name,
    const std::string & topic_type,
    const rclcpp::QoS & qos,
    const rclcpp::PublisherOptions & options=rclcpp::PublisherOptions{}
) 

Free-function form for incremental adoption on a node that stays an ordinary rclcpp::Node. This is the Method 1 (macro + free function) entry point; reach it through NEBULA_CREATE_GENERIC_PUBLISHER3/4(_ON_NODE) rather than calling it directly, so the same call site also compiles under ENABLE_AGNOCAST=1, where this overload does not exist and the macro instead forwards to the AgnocastGenericPublisher/ROS2GenericPublisher-backed free function above.

Wraps rclcpp::Node::create_generic_publisher() rather than just calling it directly (unlike the typed NEBULA_CREATE_PUBLISHER2/3, where rclcpp's own create_publisher() is already exactly what is wanted): rclcpp's create_generic_publisher() silently drops qos_overriding_options, while the Agnocast-enabled build's counterpart above rejects it, so Method 1 needs the same check here for the two builds to behave the same way — see detail::check_generic_publisher_qos_overriding_options().

Exception:

  • std::runtime_error if topic_type is unknown or its typesupport library cannot be loaded (rclcpp::create_generic_publisher() documents the same behavior).

function create_generic_publisher

inline rclcpp::GenericPublisher::SharedPtr nebula::agnocast_wrapper::create_generic_publisher (
    rclcpp::Node * node,
    const std::string & topic_name,
    const std::string & topic_type,
    const size_t qos_history_depth
) 

function create_generic_subscription

inline rclcpp::GenericSubscription::SharedPtr nebula::agnocast_wrapper::create_generic_subscription (
    rclcpp::Node * node,
    const std::string & topic_name,
    const std::string & topic_type,
    const rclcpp::QoS & qos,
    GenericSubscriptionCallback callback,
    const rclcpp::SubscriptionOptions & options=rclcpp::SubscriptionOptions{}
) 

Free-function form for incremental adoption on a node that stays an ordinary rclcpp::Node. This is the Method 1 (macro + free function) entry point; reach it through NEBULA_CREATE_GENERIC_SUBSCRIPTION(_ON_NODE) rather than calling it directly, so the same call site also compiles under ENABLE_AGNOCAST=1, where this overload does not exist and the macro instead forwards to the AgnocastGenericSubscription/ROS2GenericSubscription-backed free function above.

Wraps rclcpp::Node::create_generic_subscription() rather than just calling it directly (unlike the typed NEBULA_CREATE_SUBSCRIPTION, where rclcpp's own create_subscription() is already exactly what is wanted): rclcpp's create_generic_subscription() silently drops qos_overriding_options, while the Agnocast-enabled build's counterpart above rejects it, so Method 1 needs the same check here for the two builds to behave the same way — see detail::check_generic_subscription_qos_overriding_options().

Exception:

  • std::runtime_error if topic_type is unknown or its typesupport library cannot be loaded (rclcpp::create_generic_subscription() documents the same behavior).

function create_generic_subscription

inline rclcpp::GenericSubscription::SharedPtr nebula::agnocast_wrapper::create_generic_subscription (
    rclcpp::Node * node,
    const std::string & topic_name,
    const std::string & topic_type,
    const size_t qos_history_depth,
    GenericSubscriptionCallback callback
) 

function create_service

template<typename ServiceT, typename Func>
nebula::agnocast_wrapper::create_service (
    rclcpp::Node * node,
    const std::string & service_name,
    Func && callback,
    const rclcpp::QoS & qos=rclcpp::ServicesQoS(),
    rclcpp::CallbackGroup::SharedPtr group=nullptr
) 

function create_timer

Create a timer driven by an explicit clock (non-Agnocast build).

template<typename CallbackT>
rclcpp::TimerBase::SharedPtr nebula::agnocast_wrapper::create_timer (
    Node * node,
    rclcpp::Clock::SharedPtr clock,
    rclcpp::Duration period,
    CallbackT && callback,
    rclcpp::CallbackGroup::SharedPtr group=nullptr
) 

Provided as a free function rather than a Node member because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble; the free rclcpp::create_timer() is available on both.


function init

Mode-agnostic replacement for rclcpp::init(). Brings up the context ok() reports on: the agnocast one for an AgnocastOnly executable, the rclcpp one for every other.

std::vector< std::string > nebula::agnocast_wrapper::init (
    int argc,
    char const *const * argv,
    bool agnocast_only=false
) 

Parameters:

  • agnocast_only True if and only if this executable spins one of agnocast's AgnocastOnly* executors. It selects the agnocast context only when ENABLE_AGNOCAST is 1, so such an executable needs an rclcpp executor to fall back to otherwise; autoware_agnocast_wrapper_register_node() fills the flag in and generates that fallback.

Returns:

The arguments left once the ROS ones are removed, to hand to rclcpp::NodeOptions::arguments(). Empty when the agnocast context is the one brought up, which parses the command line itself and carries no arguments over.


function ok

Mode-agnostic replacement for rclcpp::ok().

bool nebula::agnocast_wrapper::ok () 

An executable spinning an AgnocastOnly* executor brings up only the agnocast context; every other executable brings up the rclcpp one. Reports whichever is alive.


function set_period

Set the timer period (non-Agnocast build).

inline void nebula::agnocast_wrapper::set_period (
    const rclcpp::TimerBase::SharedPtr & timer,
    std::chrono::nanoseconds period
) 

rclcpp::TimerBase has no set_period member, so we provide a free overload that falls back to the rcl C API. Mirrors the Agnocast-build overload on Timer::SharedPtr so the same call site works in both builds.

Exception:

  • std::invalid_argument if period is negative or equal to std::chrono::nanoseconds::max() (mirrors rclcpp::create_wall_timer's precondition 0 <= period < nanoseconds::max()).
  • rclcpp::exceptions::RCLError on rcl-level failure.

function shutdown

Mode-agnostic replacement for rclcpp::shutdown(). Tears down whichever context init() brought up.

void nebula::agnocast_wrapper::shutdown () 


function to_rclcpp_node

Get the underlying rclcpp::Node from an agnocast_wrapper::Node .

template<typename T>
std::shared_ptr< rclcpp::Node > nebula::agnocast_wrapper::to_rclcpp_node (
    const std::shared_ptr< T > & node
) 


function use_agnocast

Whether this process runs on Agnocast, from the ENABLE_AGNOCAST environment variable. Read once and fixed for the lifetime of the process; always false in a non-Agnocast build.

bool nebula::agnocast_wrapper::use_agnocast () 



The documentation for this class was generated from the following file src/nebula_core/nebula_core_ros/include/nebula_core_ros/agnocast_wrapper/client.hpp