Skip to content

SyncParametersClient creation for a class inheriting from rclcpp::Node #599

Description

@alsora

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • from binary
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

#include "rclcpp/rclcpp.hpp"

class MyNode : public rclcpp::Node {

public:

    MyNode() : Node("my_node")
    {
        _async_param_client = std::make_shared<rclcpp::AsyncParametersClient>(this, "other_node");
        _sync_param_client = std::make_shared<rclcpp::SyncParametersClient>(this, "other_node");
    }

private:

    rclcpp::SyncParametersClient::SharedPtr _sync_param_client;
    rclcpp::AsyncParametersClient::SharedPtr _async_param_client;
};


Expected behavior

I create a new class which inherits from rclcpp::Node and I want to create synchronous and asynchronous parameter clients.

Actual behavior

The syncrhonous parameter client creation fails due to

/usr/include/c++/7/ext/new_allocator.h:136:4: error: no matching function for call to ‘rclcpp::SyncParametersClient::SyncParametersClient(MyNode*, const char [11])’
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }

On the other hand the asynchronous parameter client works.

It still do not work if I pass as argument this->get_node_base_interface()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions