PlotJuggler/plotjuggler-ros-plugins

colcon build, code compilation failed(Ubuntu20.04+ros rolling)

yonglvera opened this issue · 2 comments

/home/user/ws_plotjuggler/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS2/generic_publisher.h:28:119: error: no matching function for call to ‘rclcpp::PublisherBase::PublisherBase(rclcpp::node_interfaces::NodeBaseInterface*&, const string&, const rosidl_message_type_support_t&, rcl_publisher_options_t, rclcpp::PublisherEventCallbacks&, bool)’
28 | : rclcpp::PublisherBase(node_base, topic_name, type_support, rcl_publisher_get_default_options(), callbacks_, true)
| ^
In file included from /opt/ros/rolling/include/rclcpp/callback_group.hpp:24,
from /opt/ros/rolling/include/rclcpp/any_executable.hpp:20,
from /opt/ros/rolling/include/rclcpp/memory_strategy.hpp:25,
from /opt/ros/rolling/include/rclcpp/memory_strategies.hpp:18,
from /opt/ros/rolling/include/rclcpp/executor_options.hpp:20,
from /opt/ros/rolling/include/rclcpp/executor.hpp:37,
from /opt/ros/rolling/include/rclcpp/executors/multi_threaded_executor.hpp:25,
from /opt/ros/rolling/include/rclcpp/executors.hpp:21,
from /opt/ros/rolling/include/rclcpp/rclcpp.hpp:155,
from /home/user/ws_plotjuggler/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS2/publisher_ros2.h:9,
from /home/user/ws_plotjuggler/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS2/publisher_ros2.cpp:1:
/opt/ros/rolling/include/rclcpp/publisher_base.hpp:75:3: note: candidate: ‘rclcpp::PublisherBase::PublisherBase(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rosidl_message_type_support_t&, const rcl_publisher_options_t&)’
75 | PublisherBase(
| ^~~~~~~~~~~~~
/opt/ros/rolling/include/rclcpp/publisher_base.hpp:75:3: note: candidate expects 4 arguments, 6 provided
/opt/ros/rolling/include/rclcpp/publisher_base.hpp:58:7: note: candidate: ‘rclcpp::PublisherBase::PublisherBase(const rclcpp::PublisherBase&)’
58 | class PublisherBase : public std::enable_shared_from_this
| ^~~~~~~~~~~~~
/opt/ros/rolling/include/rclcpp/publisher_base.hpp:58:7: note: candidate expects 1 argument, 6 provided
In file included from /home/user/ws_plotjuggler/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS2/publisher_ros2.h:18,
from /home/user/ws_plotjuggler/src/build/plotjuggler_ros/plugins/TopicPublisherROS2_autogen/TH6L5D5FXO/moc_publisher_ros2.cpp:9,
from /home/user/ws_plotjuggler/src/build/plotjuggler_ros/plugins/TopicPublisherROS2_autogen/mocs_compilation.cpp:2:
/home/user/ws_plotjuggler/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS2/generic_publisher.h: In constructor ‘GenericPublisher::GenericPublisher(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rosidl_message_type_support_t&)’:
/home/user/ws_plotjuggler/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS2/generic_publisher.h:28:119: error: no matching function for call to ‘rclcpp::PublisherBase::PublisherBase(rclcpp::node_interfaces::NodeBaseInterface*&, const string&, const rosidl_message_type_support_t&, rcl_publisher_options_t, rclcpp::PublisherEventCallbacks&, bool)’
28 | : rclcpp::PublisherBase(node_base, topic_name, type_support, rcl_publisher_get_default_options(), callbacks_, true)

Getting the same error in humble

Got it solved by replacing
rclcpp::PublisherBase(node_base, topic_name, type_support, rcl_publisher_get_default_options(), callbacks_, true)

to

rclcpp::PublisherBase(node_base, topic_name, type_support, rcl_publisher_get_default_options())

Reference:
https://docs.ros2.org/dashing/api/rclcpp/classrclcpp_1_1PublisherBase.html#a66fb8913861f0d01fab99f73a956b7de

you are using Humble branch. Use Rolling branch instead. Anyway I will release soon version 2.0 that will simplify this