error: no matching function for call to create_subscription
Hello,
I'm trying to run orbslam2 on a tello drone using ros 2 (foxy distro, ubuntu 20.04). For the purpose, I am trying to use this repository:
https://github.com/tentone/tello-ros2
What I managed to do successfully so far is:
- Install all dependencies, running scripts/install.sh
Build the 3 packages of the repository (tello/tello_control/tello_msg) running scripts/build.sh, which is basically running colcon build on the 3 packages:
colcon build --symlink-install --packages-select tello tello_control tello_msg
Build the ORBSLAM-2 package, through the instructions in the scripts/orbslam.sh script
Now I am trying to compile the nodes in the slam/src/orbslam2 folder. However when I run colcon build in that folder, I get the following error:
/home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp: In constructor ‘MonocularSlamNode::MonocularSlamNode(ORB_SLAM2::System*, const string&, const string&)’:
/home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:20:141: error: no matching function for call to ‘MonocularSlamNode::create_subscription<ImageMsg>(const char [7], std::_Bind_helper<false, void (MonocularSlamNode::*)(std::shared_ptr<sensor_msgs::msg::Image_<std::allocator<void> > >), MonocularSlamNode*, const std::_Placeholder<1>&>::type)’
20 | m_image_subscriber = this->create_subscription<ImageMsg>("camera", std::bind(&MonocularSlamNode::GrabImage, this, std::placeholders::_1));
| ^
In file included 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/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp:10,
from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:1:
/opt/ros/foxy/include/rclcpp/node.hpp:213:3: note: candidate: ‘template<class MessageT, class CallbackT, class AllocatorT, class CallbackMessageT, class SubscriptionT, class MessageMemoryStrategyT> std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr)’
213 | create_subscription(
| ^~~~~~~~~~~~~~~~~~~
/opt/ros/foxy/include/rclcpp/node.hpp:213:3: note: template argument deduction/substitution failed:
/home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:20:141: note: candidate expects 5 arguments, 2 provided
20 | m_image_subscriber = this->create_subscription<ImageMsg>("camera", std::bind(&MonocularSlamNode::GrabImage, this, std::placeholders::_1));
| ^
/home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:22:85: error: no matching function for call to ‘MonocularSlamNode::create_publisher<ImageMsg>(const char [16])’
22 | m_annotated_image_publisher = this->create_publisher<ImageMsg>("annotated_frame");
| ^
In file included 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/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp:10,
from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:1:
/opt/ros/foxy/include/rclcpp/node.hpp:184:3: note: candidate: ‘template<class MessageT, class AllocatorT, class PublisherT> std::shared_ptr<PublisherT> rclcpp::Node::create_publisher(const string&, const rclcpp::QoS&, const rclcpp::PublisherOptionsWithAllocator<AllocatorT>&)’
184 | create_publisher(
| ^~~~~~~~~~~~~~~~
/opt/ros/foxy/include/rclcpp/node.hpp:184:3: note: template argument deduction/substitution failed:
/home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:22:85: note: candidate expects 3 arguments, 1 provided
22 | m_annotated_image_publisher = this->create_publisher<ImageMsg>("annotated_frame");
| ^
/home ...