Creating custom ROS2 Message in Simulink using ROS2 Foxy
15 views (last 30 days)
Show older comments
Harun Teper
on 5 Aug 2021
Commented: Cam Salzberger
on 18 Feb 2022
Hello,
I am currently working on implementing a CACC-controller in ROS2 and I would like to use custom messages. However I run into some errors when I try to execute the ros2genmsg command.
I am using ROS2 Foxy on Ubuntu 20.04 and Matlab Release 2021a. I managed to make the DDS connection work by using Cyclone DDS and setting everything up with Python3.7 and cmake.
The current project code I am working on can be found here: https://github.com/HarunTeper/CMRCE
The message I want to generate can be found in the /src/ros_its_msgs/msg folder.
First before I start matlab, I execute the following command in terminal to have cmake support:
export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libcurl.so"
To generate the message, I use the following code, after I moved the ros_its_msgs folder to a "custom" folder on my drive:
clc; clear all;
pyenv('Version','/usr/bin/python3.7');
setenv('PATH', strcat('/usr/bin', pathsep, getenv('PATH')));
ros2genmsg("/home/harun/custom")
Then I get the following output and error:
ans =
PythonEnvironment with properties:
Version: "3.7"
Executable: "/usr/bin/python3.7"
Library: "libpython3.7m.so.1.0"
Home: "/usr"
Status: NotLoaded
ExecutionMode: InProcess
Identifying message files in folder '/home/harun/custom'..Done.
Validating message files in folder '/home/harun/custom'..Done.
[1/1] Generating MATLAB interfaces for custom message packages... Done.
Running colcon build in folder '/home/harun/custom/matlab_msg_gen/glnxa64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage (line 534)
Error building package: build log.
Error in ros2genmsg (line 241)
buildPackage(builder, [], ' --merge-install', colconMakeArgs); %other messages might need to be present in the same directory
Error in ros_cacc (line 25)
ros2genmsg("/home/harun/custom")
After looking at some other threads, I also took a look at the stderr.log file for further information:
In file included from /opt/ros/foxy/include/rclcpp/node_interfaces/node_topics_interface.hpp:32,
from /opt/ros/foxy/include/rclcpp/node.hpp:55,
from /opt/ros/foxy/include/rclcpp/executors/single_threaded_executor.hpp:28,
from /opt/ros/foxy/include/rclcpp/executors.hpp:22,
from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
from /home/harun/custom/matlab_msg_gen/glnxa64/src/ros_its_msgs/src/ros_its_msgs_PlatoonDist_message.cpp:22:
/opt/ros/foxy/include/rclcpp/subscription_factory.hpp: In instantiation of ‘rclcpp::SubscriptionFactory rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >]’:
/opt/ros/foxy/include/rclcpp/create_subscription.hpp:144:63: required from ‘std::shared_ptr<SubscriptionT> rclcpp::create_subscription(NodeT&&, const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >; NodeT = rclcpp::Node&; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >]’
/opt/ros/foxy/include/rclcpp/node_impl.hpp:98:47: required from ‘std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >]’
/usr/local/MATLAB/R2021a/toolbox/ros/include/ros2/ROS2PubSubTemplates.hpp:81:14: required from ‘intptr_t ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]’
/usr/local/MATLAB/R2021a/toolbox/ros/include/ros2/ROS2PubSubTemplates.hpp:61:22: required from here
/opt/ros/foxy/include/rclcpp/subscription_factory.hpp:97:3: error: no matching function for call to ‘rclcpp::AnySubscriptionCallback<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >::set(ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&)’
97 | any_subscription_callback.set(std::forward<CallbackT>(callback));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/foxy/include/rclcpp/subscription_base.hpp:29,
from /opt/ros/foxy/include/rclcpp/callback_group.hpp:26,
from /opt/ros/foxy/include/rclcpp/any_executable.hpp:20,
from /opt/ros/foxy/include/rclcpp/memory_strategy.hpp:24,
from /opt/ros/foxy/include/rclcpp/memory_strategies.hpp:18,
from /opt/ros/foxy/include/rclcpp/executor_options.hpp:20,
from /opt/ros/foxy/include/rclcpp/executor.hpp:33,
from /opt/ros/foxy/include/rclcpp/executors/multi_threaded_executor.hpp:25,
from /opt/ros/foxy/include/rclcpp/executors.hpp:21,
from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
from /home/harun/custom/matlab_msg_gen/glnxa64/src/ros_its_msgs/src/ros_its_msgs_PlatoonDist_message.cpp:22:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:83:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; Alloc = std::allocator<void>]’
83 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:83:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:81:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
81 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:97:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rclcpp::MessageInfo&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>, const rclcpp::MessageInfo&)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; Alloc = std::allocator<void>]’
97 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:97:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:95:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
95 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:111:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; Alloc = std::allocator<void>]’
111 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:111:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:109:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
109 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:125:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rclcpp::MessageInfo&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>, const rclcpp::MessageInfo&)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; Alloc = std::allocator<void>]’
125 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:125:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:123:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
123 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:139:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::default_delete<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; Alloc = std::allocator<void>]’
139 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:139:8: note: template argument deduction/substitution failed:
In file included from /opt/ros/foxy/include/rclcpp/node_interfaces/node_topics_interface.hpp:32,
from /opt/ros/foxy/include/rclcpp/node.hpp:55,
from /opt/ros/foxy/include/rclcpp/executors/single_threaded_executor.hpp:28,
from /opt/ros/foxy/include/rclcpp/executors.hpp:22,
from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
from /home/harun/custom/matlab_msg_gen/glnxa64/src/ros_its_msgs/src/ros_its_msgs_CAMMessage_message.cpp:22:
/opt/ros/foxy/include/rclcpp/subscription_factory.hpp: In instantiation of ‘rclcpp::SubscriptionFactory rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >]’:
/opt/ros/foxy/include/rclcpp/create_subscription.hpp:144:63: required from ‘std::shared_ptr<SubscriptionT> rclcpp::create_subscription(NodeT&&, const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> >; NodeT = rclcpp::Node&; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >]’
/opt/ros/foxy/include/rclcpp/node_impl.hpp:98:47: required from ‘std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> >; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >]’
/usr/local/MATLAB/R2021a/toolbox/ros/include/ros2/ROS2PubSubTemplates.hpp:81:14: required from ‘intptr_t ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]’
/usr/local/MATLAB/R2021a/toolbox/ros/include/ros2/ROS2PubSubTemplates.hpp:61:22: required from here
/opt/ros/foxy/include/rclcpp/subscription_factory.hpp:97:3: error: no matching function for call to ‘rclcpp::AnySubscriptionCallback<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> >::set(ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rmw_message_info_t&)>&)’
97 | any_subscription_callback.set(std::forward<CallbackT>(callback));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:137:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
137 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:153:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::default_delete<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > > >, const rclcpp::MessageInfo&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>, const rclcpp::MessageInfo&)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; Alloc = std::allocator<void>]’
153 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:153:8: note: template argument deduction/substitution failed:
In file included from /opt/ros/foxy/include/rclcpp/subscription_base.hpp:29,
from /opt/ros/foxy/include/rclcpp/callback_group.hpp:26,
from /opt/ros/foxy/include/rclcpp/any_executable.hpp:20,
from /opt/ros/foxy/include/rclcpp/memory_strategy.hpp:24,
from /opt/ros/foxy/include/rclcpp/memory_strategies.hpp:18,
from /opt/ros/foxy/include/rclcpp/executor_options.hpp:20,
from /opt/ros/foxy/include/rclcpp/executor.hpp:33,
from /opt/ros/foxy/include/rclcpp/executors/multi_threaded_executor.hpp:25,
from /opt/ros/foxy/include/rclcpp/executors.hpp:21,
from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
from /home/harun/custom/matlab_msg_gen/glnxa64/src/ros_its_msgs/src/ros_its_msgs_CAMMessage_message.cpp:22:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:83:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; Alloc = std::allocator<void>]’
83 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:151:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
151 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:83:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:81:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
81 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:97:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rclcpp::MessageInfo&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>, const rclcpp::MessageInfo&)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; Alloc = std::allocator<void>]’
97 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:97:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:95:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
95 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:111:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; Alloc = std::allocator<void>]’
111 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:111:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:109:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
109 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:125:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rclcpp::MessageInfo&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>, const rclcpp::MessageInfo&)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; Alloc = std::allocator<void>]’
125 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:125:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:123:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
123 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:139:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::default_delete<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; Alloc = std::allocator<void>]’
139 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:139:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:137:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
137 | >::type * = nullptr
| ^~~~~~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:153:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::default_delete<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > > >, const rclcpp::MessageInfo&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>, const rclcpp::MessageInfo&)> >::value>::type* <anonymous> = <enumerator>; MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; Alloc = std::allocator<void>]’
153 | void set(CallbackT callback)
| ^~~
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:153:8: note: template argument deduction/substitution failed:
/opt/ros/foxy/include/rclcpp/any_subscription_callback.hpp:151:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
151 | >::type * = nullptr
| ^~~~~~~
In file included from /usr/include/c++/9/future:48,
from /opt/ros/foxy/include/rclcpp/executors.hpp:18,
from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
from /home/harun/custom/matlab_msg_gen/glnxa64/src/ros_its_msgs/src/ros_its_msgs_PlatoonDist_message.cpp:22:
/usr/include/c++/9/bits/std_function.h:667:7: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = std::shared_ptr<rclcpp::SubscriptionBase>; _ArgTypes = {rclcpp::node_interfaces::NodeBaseInterface*, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&}]’, declared using local type ‘rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>’, is used but never defined [-fpermissive]
667 | function<_Res(_ArgTypes...)>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/future:48,
from /opt/ros/foxy/include/rclcpp/executors.hpp:18,
from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
from /home/harun/custom/matlab_msg_gen/glnxa64/src/ros_its_msgs/src/ros_its_msgs_CAMMessage_message.cpp:22:
/usr/include/c++/9/bits/std_function.h:667:7: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = std::shared_ptr<rclcpp::SubscriptionBase>; _ArgTypes = {rclcpp::node_interfaces::NodeBaseInterface*, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&}]’, declared using local type ‘rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT> >) [with MessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CallbackT = ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; CommonType = ros_its_msgs_msg_CAMMessage_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::CAMMessage_<std::allocator<void> > >, const rmw_message_info_t&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = ros_its_msgs::msg::CAMMessage_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ros_its_msgs::msg::CAMMessage_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>’, is used but never defined [-fpermissive]
667 | function<_Res(_ArgTypes...)>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ros_its_msgs_matlab.dir/build.make:76: CMakeFiles/ros_its_msgs_matlab.dir/src/ros_its_msgs_PlatoonDist_message.cpp.o] Fehler 1
make[2]: *** Auf noch nicht beendete Prozesse wird gewartet …
make[2]: *** [CMakeFiles/ros_its_msgs_matlab.dir/build.make:63: CMakeFiles/ros_its_msgs_matlab.dir/src/ros_its_msgs_CAMMessage_message.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:124: CMakeFiles/ros_its_msgs_matlab.dir/all] Fehler 2
make: *** [Makefile:141: all] Fehler 2
However at this point I don't know how to fix the issue. Does anyone have any ideas on how to proceed?
Best Regards
Harun Teper
2 Comments
Cam Salzberger
on 5 Aug 2021
Hello Harun,
First of all, thanks for all that detail. Seems like you've done everything right in terms of tracking down the issue.
Based on these kinds of errors:
error: no matching function for call to ‘rclcpp::AnySubscriptionCallback<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >, std::allocator<void> >::set(ROS2SubscriberImpl<RosMessageType, CommonType>::createSubscription(const string&, const rclcpp::QoS&, rclcpp::Node::SharedPtr, void*, SendDataToMATLABFunc_T, bool) [with RosMessageType = ros_its_msgs::msg::PlatoonDist_<std::allocator<void> >; CommonType = ros_its_msgs_msg_PlatoonDist_common; intptr_t = long int; std::string = std::__cxx11::basic_string<char>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; SendDataToMATLABFunc_T = bool (*)(void*, const std::vector<matlab::data::Array>&)]::<lambda(std::shared_ptr<ros_its_msgs::msg::PlatoonDist_<std::allocator<void> > >, const rmw_message_info_t&)>&)’
97 | any_subscription_callback.set(std::forward<CallbackT>(callback));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/foxy/include/rclcpp/subscription_base.hpp:29,
it seems that the ROS installation files that are being included from the generated custom message code are being taken from your native ROS 2 Foxy installation, rather than the Dashing installation that ships with MATLAB. There are some API changes between Dashing and Foxy, so some of the methods called in the custom message code seem to use deprecated or changed APIs that aren't in Foxy.
I've seen similar issues with the linker attempting to link to Foxy libraries due to them being higher on LD_LIBRARY_PATH (or just PATH) for Windows, but this is the first time I've seen include errors. Can you show a printout of all your environment variables, or at least anything with the "foxy" path in it. It'd probably most helpful to see it within MATLAB, and from a standard terminal. I'm not certain which variable it would be that could be causing this issue.
-Cam
Accepted Answer
Cam Salzberger
on 9 Aug 2021
Hello Harun,
My money would be on this specific issue being cause by AMENT_PREFIX_PATH being checked for include files during the colcon build process. Unsetting that within MATLAB before running ros2genmsg would probably at least resolve this set of errors.
RMW_IMPLEMENTATION may cause an issue when it actually starts building, as it may try to link to rmw packages for Cyclone DDS, which aren't shipped with MATLAB's Dashing. To try to eliminate all problems from the get-go, it'd probably be easiest to start MATLAB from a terminal that hasn't sourced the Foxy setup script. Or temporarily remove it from your .bashrc file if it's in there, and see if that resolves the issue in one go.
-Cam
18 Comments
Jovin Dsa
on 18 Feb 2022
Edited: Jovin Dsa
on 18 Feb 2022
Hi Cam,
Thanks for the quick response.
I actually tried the pre-release of R2022a with Python 3.9, cmake 3.20 and visual studio 2017 on a windows 10 machine (I accidentally wrote R2021a in my previous message so i apologize for the confusion).
As a side note - I was able to generate a standalone rosnode using the ' Feedback Control of a ROS-Enabled Robot Over ROS 2' example. I was also able to build this rosnode inside the ros2 foxy workspace on a separate machine running ubunutu and foxy and was able to see the messages being displayed with ros2 echo so it seems to be working fine with standard messages.
I also couldnt find any other similar issues reported for ros2genmsg on the pre-release of 2022a so I thought I'd check in with you.
Thanks!
Cam Salzberger
on 18 Feb 2022
Understood. Thanks for clarifying the release.
You would still need to look at the build log of the custom messages to see what is going wrong. It could be as simple as a path length issue (if you have long message/package names, or a long folder path to the location where you are building the messages).
-Cam
More Answers (0)
See Also
Categories
Find more on Deploy to C++ Applications Using MATLAB Data API (C++11) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!