ros-misc-utilities / ffmpeg_image_transport

ROS2 image transport plugin for encoding/decoding with h264 codec
Apache License 2.0
65 stars 22 forks source link

Compiling issue on ROS iron and Ubuntu 22.04 #17

Closed msha3421 closed 10 months ago

msha3421 commented 10 months ago

Hi, I am having an issue when compiling the code on ROS iron and Ubuntu 22.04. Can you advise what this issue can be related to? Thanks.

--- stderr: ffmpeg_image_transport
In file included from /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_subscriber.cpp:16: /root/ros_ws/src/ffmpeg_image_transport/include/ffmpeg_image_transport/ffmpeg_subscriber.hpp:39:8: error: ‘void ffmpeg_image_transport::FFMPEGSubscriber::subscribeImpl(rclcpp::Node, const string&, const Callback&, rmw_qos_profile_t)’ marked ‘override’, but does not override 39 | void subscribeImpl( | ^~~~~ /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_subscriber.cpp: In member function ‘void ffmpeg_image_transport::FFMPEGSubscriber::subscribeImpl(rclcpp::Node, const string&, const Callback&, rmw_qos_profile_t)’: /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_subscriber.cpp:47:40: error: no matching function for call to ‘ffmpeg_image_transport::FFMPEGSubscriber::subscribeImpl(rclcpp::Node&, const string&, const Callback&, rmw_qos_profile_t&)’ 47 | FFMPEGSubscriberPlugin::subscribeImpl(node, base_topic, callback, custom_qos); | ~~~~~~~^~~~~~~~~~ In file included from /root/ros_ws/src/ffmpeg_image_transport/include/ffmpeg_image_transport/ffmpeg_subscriber.hpp:19, from /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_subscriber.cpp:16: /opt/ros/iron/include/image_transport/image_transport/simple_subscriber_plugin.hpp:111:8: note: candidate: ‘void image_transport::SimpleSubscriberPlugin::subscribeImpl(rclcpp::Node, const string&, const Callback&, rmw_qos_profile_t, rclcpp::SubscriptionOptions) [with M = ffmpeg_image_transportmsgs::msg::FFMPEGPacket<std::allocator >; std::string = std::cxx11::basic_string; image_transport::SubscriberPlugin::Callback = std::function<void(const std::shared_ptr<const sensormsgs::msg::Image<std::allocator > >&)>; rmw_qos_profile_t = rmw_qos_profile_s; rclcpp::SubscriptionOptions = rclcpp::SubscriptionOptionsWithAllocator<std::allocator >]’ 111 | void subscribeImpl( | ^~~~~ /opt/ros/iron/include/image_transport/image_transport/simple_subscriber_plugin.hpp:111:8: note: candidate expects 5 arguments, 4 provided In file included from /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_publisher.cpp:16: /root/ros_ws/src/ffmpeg_image_transport/include/ffmpeg_image_transport/ffmpeg_publisher.hpp:37:8: error: ‘void ffmpeg_image_transport::FFMPEGPublisher::advertiseImpl(rclcpp::Node, const string&, rmw_qos_profile_t)’ marked ‘override’, but does not override 37 | void advertiseImpl( | ^~~~~ /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_publisher.cpp: In member function ‘void ffmpeg_image_transport::FFMPEGPublisher::advertiseImpl(rclcpp::Node, const string&, rmw_qos_profile_t)’: /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_publisher.cpp:42:39: error: no matching function for call to ‘ffmpeg_image_transport::FFMPEGPublisher::advertiseImpl(rclcpp::Node&, const string&, rmw_qos_profile_t&)’ 42 | FFMPEGPublisherPlugin::advertiseImpl(node, base_topic, custom_qos); | ~~~~~~~~^~~~~~~~~~ In file included from /root/ros_ws/src/ffmpeg_image_transport/include/ffmpeg_image_transport/ffmpeg_publisher.hpp:19, from /root/ros_ws/src/ffmpeg_image_transport/src/ffmpeg_publisher.cpp:16: /opt/ros/iron/include/image_transport/image_transport/simple_publisher_plugin.hpp:101:8: note: candidate: ‘void image_transport::SimplePublisherPlugin::advertiseImpl(rclcpp::Node, const string&, rmw_qos_profile_t, rclcpp::PublisherOptions) [with M = ffmpeg_image_transportmsgs::msg::FFMPEGPacket<std::allocator >; std::string = std::cxx11::basic_string; rmw_qos_profile_t = rmw_qos_profile_s; rclcpp::PublisherOptions = rclcpp::PublisherOptionsWithAllocator<std::allocator >]’ 101 | void advertiseImpl( | ^~~~~ /opt/ros/iron/include/image_transport/image_transport/simple_publisher_plugin.hpp:101:8: note: candidate expects 4 arguments, 3 provided In file included from /root/ros_ws/src/ffmpeg_image_transport/src/manifest.cpp:18: /root/ros_ws/src/ffmpeg_image_transport/include/ffmpeg_image_transport/ffmpeg_publisher.hpp:37:8: error: ‘void ffmpeg_image_transport::FFMPEGPublisher::advertiseImpl(rclcpp::Node, const string&, rmw_qos_profile_t)’ marked ‘override’, but does not override 37 | void advertiseImpl( | ^~~~~ In file included from /root/ros_ws/src/ffmpeg_image_transport/src/manifest.cpp:19: /root/ros_ws/src/ffmpeg_image_transport/include/ffmpeg_image_transport/ffmpeg_subscriber.hpp:39:8: error: ‘void ffmpeg_image_transport::FFMPEGSubscriber::subscribeImpl(rclcpp::Node, const string&, const Callback&, rmw_qos_profile_t)’ marked ‘override’, but does not override 39 | void subscribeImpl( | ^~~~~ gmake[2]: [CMakeFiles/ffmpeg_image_transport_component.dir/build.make:160: CMakeFiles/ffmpeg_image_transport_component.dir/src/manifest.cpp.o] Error 1 gmake[2]: Waiting for unfinished jobs.... gmake[2]: [CMakeFiles/ffmpeg_image_transport_component.dir/build.make:76: CMakeFiles/ffmpeg_image_transport_component.dir/src/ffmpeg_publisher.cpp.o] Error 1 gmake[2]: [CMakeFiles/ffmpeg_image_transport_component.dir/build.make:90: CMakeFiles/ffmpeg_image_transport_component.dir/src/ffmpeg_subscriber.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:139: CMakeFiles/ffmpeg_image_transport_component.dir/all] Error 2 gmake: [Makefile:146: all] Error 2

Failed <<< ffmpeg_image_transport [4.13s, exited with code 2]

berndpfrommer commented 10 months ago

Can you hack "iron" into this conditional and let me know if it helps? https://github.com/berndpfrommer/ffmpeg_image_transport/blob/master/CMakeLists.txt#L16

berndpfrommer commented 10 months ago

Hold off. The API has changed again between humble and iron. I'm working on it.

msha3421 commented 10 months ago

Thanks for the quick response. I thought it was API issue too. I eventually made it work with iron with some dirty changes to the subscribeImpl() and advertiseImpl(). Given that the image_transport API changes from foxy/galactic, to humble, and now to rolling/iron, will you be considering creating different branches for these ROS distros?

berndpfrommer commented 10 months ago

Just thought about that and decided not to. I'll hack it with #defines and detecting ROS_DISTRO. Otherwise I'll have to backport any fixes or new features.

msha3421 commented 10 months ago

No problem. I will be happy to try out the code on iron once you push the fix.

berndpfrommer commented 10 months ago

Done. Would be great if you could test that it works (not just compiles)!

msha3421 commented 10 months ago

Hi @berndpfrommer, I just tested it and it builds and works on iron now. Thanks so much for the fix.