Ask Your Question
0

ros2 minimal_subscriber - member function

asked 2019-08-09 13:08:53 -0500

femust gravatar image

Hey, so I'm using ros2 dashing and I am trying to run the example from ros2/examples link text and I am getting this error:

Blockquote In file included from /opt/ros/dashing/include/rclcpp/client.hpp:31:0, from /opt/ros/dashing/include/rclcpp/callback_group.hpp:23, from /opt/ros/dashing/include/rclcpp/any_executable.hpp:20, from /opt/ros/dashing/include/rclcpp/memory_strategy.hpp:24, from /opt/ros/dashing/include/rclcpp/memory_strategies.hpp:18, from /opt/ros/dashing/include/rclcpp/executor.hpp:32, from /opt/ros/dashing/include/rclcpp/executors/multi_threaded_executor.hpp:24, from /opt/ros/dashing/include/rclcpp/executors.hpp:21, from /opt/ros/dashing/include/rclcpp/rclcpp.hpp:144, from /home/andrzej/ros_workspaces/ros2_tutorial/src/test/src/member_function_sub.cpp:3: /opt/ros/dashing/include/rclcpp/function_traits.hpp: In instantiation of ‘struct rclcpp::function_traits::function_traits<std::_bind<void (minimalsubscriber::*(minimalsubscriber*,="" std::_placeholder&lt;1="">))(std::shared_ptr<std_msgs::msg::string_<std::allocator<void> > >) const> >’: /opt/ros/dashing/include/rclcpp/subscription_traits.hpp:90:8: required from ‘struct rclcpp::subscription_traits::has_message_type<std::_bind<void (minimalsubscriber::*(minimalsubscriber*,="" std::_placeholder&lt;1="">))(std::shared_ptr<std_msgs::msg::string_<std::allocator<void> > >) const>, void, void, void>’ /opt/ros/dashing/include/rclcpp/node.hpp:239:5: required by substitution of ‘template<class messaget,="" class="" callbackt,="" class="" allocatort,="" class="" subscriptiont=""> std::shared_ptr<subscriptiont> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<allocatort>&, typename rclcpp::message_memory_strategy::MessageMemoryStrategy<typename rclcpp::subscription_traits::has_message_type<callbackt="">::type, AllocatorT>::SharedPtr) [with MessageT = std_msgs::msg::String_<std::allocator<void> >; CallbackT = std::_Bind<void (minimalsubscriber::*(minimalsubscriber*,="" std::_placeholder&lt;1="">))(std::shared_ptr<std_msgs::msg::string_<std::allocator<void> > >) const>; AllocatorT = std::allocator<void>; SubscriptionT = <missing>]’ /home/andrzej/ros_workspaces/ros2_tutorial/src/test/src/member_function_sub.cpp:14:75: required from here /opt/ros/dashing/include/rclcpp/function_traits.hpp:52:82: error: decltype cannot resolve address of overloaded function typename function_traits<decltype( &amp;functiont::operator())&gt;::arguments="">::type; ^ /opt/ros/dashing/include/rclcpp/function_traits.hpp:57:72: error: decltype cannot resolve address of overloaded function using argument_type = typename std::tuple_element<n, arguments="">::type; ^ /opt/ros/dashing/include/rclcpp/function_traits.hpp:59:95: error: decltype cannot resolve address of overloaded function using return_type = typename function_traits<decltype( &amp;functiont::operator())&gt;::return_type;="" ^="" home="" andrzej="" ros_workspaces="" ros2_tutorial="" src="" test="" src="" member_function_sub.cpp:="" in="" constructor="" ‘minimalsubscriber::minimalsubscriber()’:="" home="" andrzej="" ros_workspaces="" ros2_tutorial="" src="" test="" src="" member_function_sub.cpp:14:75:="" error:="" no="" matching="" function="" for="" call="" to="" ‘minimalsubscriber::create_subscription<std_msgs::msg::string="">(const char [6], int, std::_Bind_helper<false, void="" (minimalsubscriber::*)(std::shared_ptr<std_msgs::msg::string_<std::allocator<void=""> > >) const, MinimalSubscriber, const std::_Placeholder<1>&>::type)’ "topic", 10, std::bind(&MinimalSubscriber::topic_callback, this, _1)); ^ In file included from /opt/ros/dashing/include/rclcpp/executors/single_threaded_executor.hpp:28:0, from /opt/ros/dashing/include/rclcpp/executors.hpp:22, from /opt/ros/dashing/include/rclcpp/rclcpp.hpp:144, from /home/andrzej/ros_workspaces/ros2_tutorial/src/test/src/member_function_sub.cpp:3: /opt/ros/dashing/include/rclcpp/node.hpp:242:3: note: candidate: template<class messaget,="" class="" callbackt,="" class="" allocatort,="" class="" subscriptiont=""> std::shared_ptr<subscriptiont> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<allocatort>&, typename rclcpp::message_memory_strategy ...

(more)
edit retag flag offensive close merge delete

Comments

How did you go about the installation?

zmk5 gravatar imagezmk5 ( 2019-08-09 14:02:27 -0500 )edit

https://index.ros.org//doc/ros2/Insta...

I followed this tutorial and install ros 2 packages via apt-get install ...

femust gravatar imagefemust ( 2019-08-10 06:09:19 -0500 )edit

So you have a binary installation installed and how did you attempt to install this package?

When you downloaded the example how did you go about putting them in a ros2 workspace? It says the C++ file is: /home/andrzej/ros_workspaces/ros2_tutorial/src/test/src/member_function_sub.cpp. Did you build using colcon? Did you source the new build with source install/setup.bash from base workspace directory?

zmk5 gravatar imagezmk5 ( 2019-08-10 11:45:21 -0500 )edit

nah I didn't follow any your advice and it starts magically working, but I did have a similar problem the other day when I was playing with other repo, I will be looking at it, for the time being, the problem is solved. Thank you for your effort.

femust gravatar imagefemust ( 2019-08-11 02:25:31 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-08-15 01:24:49 -0500

I met the same error. After setting up the local as below, the error disappeared.

sudo locale-gen en_US en_US.UTF-8

sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

export LANG=en_US.UTF-8

But I'm not sure how the local can influence in this error.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-08-09 13:08:53 -0500

Seen: 29 times

Last updated: Aug 09