Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS2 foxy build fails #105

Open
nplan opened this issue Jun 29, 2020 · 4 comments
Open

ROS2 foxy build fails #105

nplan opened this issue Jun 29, 2020 · 4 comments

Comments

@nplan
Copy link

nplan commented Jun 29, 2020

Building for ros2 foxy (branch ros2) fails with error:

/home/pi/dev_ws/src/web_video_server/src/ros_compressed_streamer.cpp:22:103: error: no matching function for call to ‘rclcpp::Node::create_subscription<sensor_msgs::msg::CompressedImage>(std::__cxx11::string&, std::_Bind_helper<false, void (web_video_server::RosCompressedStreamer::*)(std::shared_ptr<const sensor_msgs::msg::CompressedImage_<std::allocator<void> > >), web_video_server::RosCompressedStreamer*, const std::_Placeholder<1>&>::type, int)’
     compressed_topic, std::bind(&RosCompressedStreamer::imageCallback, this, std::placeholders::_1), 1);
                                                                                                       ^
In file included from /home/pi/ros2_foxy/install/rclcpp/include/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /home/pi/ros2_foxy/install/rclcpp/include/rclcpp/executors.hpp:22,
                 from /home/pi/ros2_foxy/install/rclcpp/include/rclcpp/rclcpp.hpp:146,
                 from /home/pi/dev_ws/src/web_video_server/include/web_video_server/image_streamer.h:4,
                 from /home/pi/dev_ws/src/web_video_server/include/web_video_server/ros_compressed_streamer.h:5,
                 from /home/pi/dev_ws/src/web_video_server/src/ros_compressed_streamer.cpp:1:
/home/pi/ros2_foxy/install/rclcpp/include/rclcpp/node.hpp:211: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)’
   create_subscription(
   ^~~~~~~~~~~~~~~~~~~
/home/pi/ros2_foxy/install/rclcpp/include/rclcpp/node.hpp:211:3: note:   template argument deduction/substitution failed:
/home/pi/dev_ws/src/web_video_server/src/ros_compressed_streamer.cpp:22:32: note:   cannot convert ‘std::bind(_Func&&, _BoundArgs&& ...) [with _Func = void (web_video_server::RosCompressedStreamer::*)(std::shared_ptr<const sensor_msgs::msg::CompressedImage_<std::allocator<void> > >); _BoundArgs = {web_video_server::RosCompressedStreamer*, const std::_Placeholder<1>&}; typename std::_Bind_helper<std::__is_socketlike<_Func>::value, _Func, _BoundArgs ...>::type = std::_Bind<void (web_video_server::RosCompressedStreamer::*(web_video_server::RosCompressedStreamer*, std::_Placeholder<1>))(std::shared_ptr<const sensor_msgs::msg::CompressedImage_<std::allocator<void> > >)>](((web_video_server::RosCompressedStreamer*)this), std::placeholders::_1)’ (type ‘std::_Bind_helper<false, void (web_video_server::RosCompressedStreamer::*)(std::shared_ptr<const sensor_msgs::msg::CompressedImage_<std::allocator<void> > >), web_video_server::RosCompressedStreamer*, const std::_Placeholder<1>&>::type’ {aka ‘std::_Bind<void (web_video_server::RosCompressedStreamer::*(web_video_server::RosCompressedStreamer*, std::_Placeholder<1>))(std::shared_ptr<const sensor_msgs::msg::CompressedImage_<std::allocator<void> > >)>’}) to type ‘const rclcpp::QoS&’
     compressed_topic, std::bind(&RosCompressedStreamer::imageCallback, this, std::placeholders::_1), 1);

Platform: Rasbperry Pi 4 with Raspbian Buster

@AviKenz
Copy link

AviKenz commented Aug 1, 2020

i have the same issue. any solution or tip ?
i checkout the ros2 branch and build with async_web_server
my configuration:

  • ubuntu 18.04
  • ROS: dashing

Thanks in advance.

@nplan
Copy link
Author

nplan commented Aug 2, 2020

I opened a pull request #107 that fixes the build. There are still some issues though:

  • web_video_server package does not become available to ros2 run after running source dev_ws/install/setup.bash. I must run source dev_ws/install/web_video_server/share/web_video_server/local_setup.bash instead
  • mjpeg and png are the only stream types that work

@DomenicP
Copy link
Contributor

I tried #107 a few days ago and while that solved some of the build issues under Foxy, new ones seem to have popped up in the meantime. I opened #111 with the full set of changes I needed to get the package to work under Foxy. I also fixed some deprecation warnings along the way. I confirmed that at least the mjpeg and ros_compressed stream types are working.

@jgvictores
Copy link

Currently able to compile (minimal warnings) from source (sorry if the issue looks stale, but Foxy itself is not so old ^^).

Compiled via (use sudo for apt commands as applicable, not my case because in a docker with root; also adapt your workspace (*_ws) path):

apt update
apt install ros-foxy-async-web-server-cpp ros-foxy-cv-bridge ros-foxy-image-transport
cd /demo_ws/src
git clone --branch ros2 https://github.com/RobotWebTools/web_video_server
cd /demo_ws
colcon build --packages-select web_video_server

The above was done with:

Run via (again, also adapt your workspace (*_ws) path):

source /demo_ws/install/setup.sh
ros2 run web_video_server web_video_server

PS: This is just some minimal documentation of working versions. Thanks a lot to all the effort of the developers @DomenicP and a long "et al" at #111

This was referenced Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants