IntelligentRoboticsLabs / gb_visual_detection_3d

86 stars 31 forks source link

error: no matching function for call to ‘tf2_ros::Buffer::lookupTransform(std::cxx11::string&, std_msgs::msg::Header<std::allocator >::frame_id_type&, std_msgs::msg::Header<std::allocator >::stamp_type&, tf2::Duration)’ point_cloud.header.stamp, tf2::durationFromSec(2.0)); #62

Open miga94 opened 1 year ago

miga94 commented 1 year ago

Hello, I am obtaining following error i have ros-dashing ubuntu18.04 in Roscube-X. I have installed ros-dashing-tf2-ros. /home/robolab/ros2_ws/gb_visual_detection_3d/darknet_ros_3d/src/darknet_ros_3d/Darknet3D.cpp:216:61: error: no matching function for call to ‘tf2_ros::Buffer::lookupTransform(std::cxx11::string&, std_msgs::msg::Header::frame_id_type&, std_msgs::msg::Header::stamp_type&, tf2::Duration)’ point_cloud.header.stamp, tf2::durationFromSec(2.0)); ^ In file included from /home/robolab/ros2_ws/gb_visual_detection_3d/darknet_ros_3d/include/darknet_ros_3d/Darknet3D.hpp:22:0, from /home/robolab/ros2_ws/gb_visual_detection_3d/darknet_ros_3d/src/darknet_ros_3d/Darknet3D.cpp:18: /opt/ros/dashing/include/tf2_ros/buffer.h:79:5: note: candidate: virtual geometry_msgs::msg::TransformStamped tf2_ros::Buffer::lookupTransform(const string&, const string&, const TimePoint&, tf2::Duration) const lookupTransform(const std::string& target_frame, const std::string& source_frame, ^~~~~~~ /opt/ros/dashing/include/tf2_ros/buffer.h:79:5: note: no known conversion for argument 3 from ‘std_msgs::msg::Header::stamp_type {aka builtin_interfaces::msg::Time}’ to ‘const TimePoint& {aka const std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&}’ /opt/ros/dashing/include/tf2_ros/buffer.h:96:5: note: candidate: virtual geometry_msgs::msg::TransformStamped tf2_ros::Buffer::lookupTransform(const string&, const TimePoint&, const string&, const TimePoint&, const string&, tf2::Duration) const lookupTransform(const std::string& target_frame, const tf2::TimePoint& target_time, ^~~~~~~ /opt/ros/dashing/include/tf2_ros/buffer.h:96:5: note: candidate expects 6 arguments, 4 provided In file included from /opt/ros/dashing/include/tf2_ros/buffer_interface.h:37:0, from /opt/ros/dashing/include/tf2_ros/buffer.h:35, from /home/robolab/ros2_ws/gb_visual_detection_3d/darknet_ros_3d/include/darknet_ros_3d/Darknet3D.hpp:22, from /home/robolab/ros2_ws/gb_visual_detection_3d/darknet_ros_3d/src/darknet_ros_3d/Darknet3D.cpp:18: /opt/ros/dashing/include/tf2/buffer_core.h:152:5: note: candidate: geometry_msgs::msg::TransformStamped tf2::BufferCore::lookupTransform(const string&, const TimePoint&, const string&, const TimePoint&, const string&) const lookupTransform(const std::string& target_frame, const TimePoint& target_time, ^~~~~~~ /opt/ros/dashing/include/tf2/buffer_core.h:152:5: note: candidate expects 5 arguments, 4 provided /opt/ros/dashing/include/tf2/buffer_core.h:135:5: note: candidate: geometry_msgs::msg::TransformStamped tf2::BufferCore::lookupTransform(const string&, const string&, const TimePoint&) const lookupTransform(const std::string& target_frame, const std::string& source_frame, ^~~~~~~ /opt/ros/dashing/include/tf2/buffer_core.h:135:5: note: candidate expects 3 arguments, 4 provided make[2]: [CMakeFiles/darknet_ros_3d.dir/src/darknet_ros_3d/Darknet3D.cpp.o] Error 1 make[1]: [CMakeFiles/darknet_ros_3d.dir/all] Error 2 make: *** [all] Error 2 Failed <<< darknet_ros_3d [22.0s, exited with code 2]

fmrico commented 1 year ago

Maybe Dashing is not supported. I think it's too old...

miga94 commented 1 year ago

Hello @fmrico , Thank you for your reply. I am now testing with ros-eloquent and latest intelrealsense2 ros-development branch. I have detection with darknet ros but get following error when launched darknet_ros_3d. [ERROR] [darknet3d_node-1]: process has died [pid 4197, exit code -11, cmd '/home/robolab/ros2_ws/install/darknet_ros_3d/lib/darknet_ros_3d/darknet3d_node --ros-args -r __node:=darknet3d_node --params-file /home/robolab/ros2_ws/install/darknet_ros_3d/share/darknet_ros_3d/config/darknet_3d.yaml'].

I have given correct topics in the darknet3D.yaml files. Screenshot from 2022-12-01 09-36-35

fmrico commented 1 year ago

Hi @miga94

You are obtaining a segmentation fault that does not give you much information.

Build with CMAKE_BUILD_TYPE to Debug or RelWithDebInfo and launch the node with prefix='xterm -e gdb -ex run --args'

Best

miga94 commented 1 year ago

Hello @fmrico , If I understood you I ran the following command while running the node: xterm -e gdb -ex run --args ros2 launch darknet_ros_3d darknet_ros_3d.launch.py

Is this formulation correct? Attached is the screenshot what I got from this. obtained_picture

fmrico commented 1 year ago

Hi!!

No. These are more detailed instructions to use gdb to debug a segmentation fault:

  1. Clean up the workspace by deleting build install and log.

  2. Open another terminal and compile with: colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug

  3. Modify the launcher so that node is launched with gdb in a separate terminal (you must have xterm installed): darknet3d_node = Node( package='darknet_ros_3d', node_executable='darknet3d_node', prefix='xterm -e gdb -ex run --args', node_name='darknet3d_node', output='screen', parameters=[config_file_path] )

  4. Launch it

  5. When it fails, it will tell you the line. Use 'bt' and other gdb commands to see what happened. If you want, send me the output.

Good luck!!