ros2 / openrobotics_darknet_ros

ROS 2 interface to darknet, an open source neural network library.
Apache License 2.0
19 stars 13 forks source link

Build does not success #9

Open wangzizhe opened 1 year ago

wangzizhe commented 1 year ago

Hi,

build of this package does not success for me, when I run

colcon build --packages-select openrobotics_darknet_ros

I got these error messages:

Starting >>> openrobotics_darknet_ros
--- stderr: openrobotics_darknet_ros                             
/home/wang/6g-life/apriltag_autonomous_detection/openrobotics_darknet_ros/src/detector_network.cpp: In member function ‘size_t openrobotics::darknet_ros::DetectorNetwork::detect(const Image&, double, double, vision_msgs::msg::Detection2DArray*)’:
/home/wang/6g-life/apriltag_autonomous_detection/openrobotics_darknet_ros/src/detector_network.cpp:154:20: error: ‘struct vision_msgs::msg::ObjectHypothesisWithPose_<std::allocator<void> >’ has no member named ‘id’
  154 |         hypothesis.id = impl_->class_names_.at(cls);
      |                    ^~
/home/wang/6g-life/apriltag_autonomous_detection/openrobotics_darknet_ros/src/detector_network.cpp:155:20: error: ‘struct vision_msgs::msg::ObjectHypothesisWithPose_<std::allocator<void> >’ has no member named ‘score’
  155 |         hypothesis.score = detection.prob[cls];
      |                    ^~~~~
/home/wang/6g-life/apriltag_autonomous_detection/openrobotics_darknet_ros/src/detector_network.cpp:166:31: error: ‘using _center_type = struct vision_msgs::msg::Pose2D_<std::allocator<void> >’ {aka ‘struct vision_msgs::msg::Pose2D_<std::allocator<void> >’} has no member named ‘x’
  166 |     detection_ros.bbox.center.x = detection.bbox.x;
      |                               ^
/home/wang/6g-life/apriltag_autonomous_detection/openrobotics_darknet_ros/src/detector_network.cpp:167:31: error: ‘using _center_type = struct vision_msgs::msg::Pose2D_<std::allocator<void> >’ {aka ‘struct vision_msgs::msg::Pose2D_<std::allocator<void> >’} has no member named ‘y’
  167 |     detection_ros.bbox.center.y = detection.bbox.y;
      |                               ^
gmake[2]: *** [CMakeFiles/openrobotics_darknet_ros.dir/build.make:76:CMakeFiles/openrobotics_darknet_ros.dir/src/detector_network.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:163:CMakeFiles/openrobotics_darknet_ros.dir/all] Error 2

gmake: *** [Makefile:146:all] Error 2
---

Failed   <<< openrobotics_darknet_ros [1.38s, exited with code 2]

Summary: 0 packages finished [1.62s]
  1 package failed: openrobotics_darknet_ros
  1 package had stderr output: openrobotics_darknet_ros

Could you please give me a hint how could I build it without error?

Thanks a lot in advance!

sloretz commented 1 year ago

It looks like vision_msgs has changed. bbox.center.y would now be bbox.center.position.y etc.

https://github.com/ros-perception/vision_msgs/blob/ros2/vision_msgs/msg/Pose2D.msg

You'll need to modify the source code of this package to match the vision_msgs changes. A PR would be welcome if you're willing.