class NRPROSProxy

Overview

#include <nrp_ros_proxy.h>

class NRPROSProxy {
public:
    // construction

    NRPROSProxy(const NRPROSProxy&);
    NRPROSProxy(NRPROSProxy&&);

    // methods

    NRPROSProxy& operator = (const NRPROSProxy&);
    NRPROSProxy& operator = (NRPROSProxy&&);

    template <class MSG_TYPE>
    void subscribe(
        const std::string& address,
        const boost::function<void(const boost::shared_ptr<MSG_TYPE const>&)>& callback,
        size_t queueSize = 10
    );

    template <class MSG_TYPE>
    void publish(
        const std::string& address,
        const MSG_TYPE& msg,
        size_t queueSize = 10
    );

    static NRPROSProxy& getInstance();
    static NRPROSProxy& resetInstance();
};

Detailed Documentation

Methods

template <class MSG_TYPE>
void subscribe(
    const std::string& address,
    const boost::function<void(const boost::shared_ptr<MSG_TYPE const>&)>& callback,
    size_t queueSize = 10
)

Subscribe to ROS topic ‘address’ with callback function ‘callback’.

template <class MSG_TYPE>
void publish(
    const std::string& address,
    const MSG_TYPE& msg,
    size_t queueSize = 10
)

Publishes ‘msg’ to ROS topic ‘address’.

static NRPROSProxy& getInstance()

Get singleton instance of NRPROSProxy.

static NRPROSProxy& resetInstance()

Reset singleton instance.