Giter Club home page Giter Club logo

Comments (19)

niccovezzi avatar niccovezzi commented on July 19, 2024 1

@ravijo

Sure. I follow this solution:

I had a similar problem and solved it by modifying the cv_bridgeConfig.cmake file.

$ cd /opt/ros/melodic/share/cv_bridge/cmake
$ sudo gedit cv_bridgeConfig.cmake

Replaced line 96

set(_include_dirs "include;/usr/include;/usr/include/opencv2")

and line 119

set(libraries "cv_bridge;/usr/local/lib/libopencv_core.so.4.5.4;/usr/local/lib/libopencv_imgproc.so.4.5.4;/usr/local/lib/libopencv_imgcodecs.so.4.5.4")

Need only to take care of the OpenCV version (in my case, 4.5.5). After that, I return to my ros_ws, I do catkin_make, and that's it.

Thanks again, ravijo!

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024 1

Thank You for your answer!

Looks like the issue really could be related to the OpenCV after all. I am having other problems with other packages which don't allow me to test this issue right know but I'll give you a more concrete answer as soon as they are resolved.

If you find it useful I'll leave it here the corresponding versions:

  • Ubuntu: 20.04
  • ROS: noetic and foxy
  • Note: yes ros_openpose is installed in noetic and I launch the realsense2_camera node in foxy and then I run ros1_bridge which passes the topics correctly to ros_openpose and I can see the output in the visualizer.
  • OpenPose: 1.7.0
  • OpenCV: I installed 4.2.0 but whenever I ran python3 -c "import cv2; print(cv2.__version__)" the output was 4.5.5 that's why the problem should be a mismatch between the versions. I uninstalled all versions and reinstalled 4.2.0 and made sure the previous command now returned 4.2.0.

Once I am able to test if this configuration is now correct I'll post it here.

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024 1

@goncalofurtado1

Thanks for the update. Glad it worked!!!

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@niccovezzi

I am sorry that you couldn't make it work! It is very rare to see that the rosOpenpose process dies. Unfortunately, the logs shared by you are not enough to debug the issue.

  1. Did you execute sudo make install inside OpenPose to install it system-wide?
  2. Are you sure that the package complication went without any errors?
  3. Can you run the code inside a debugger for better understanding?

from ros_openpose.

niccovezzi avatar niccovezzi commented on July 19, 2024

@ravijo
yes, i execute sudo make install.
i run gdb for debug rosOpenposeAsync and this is the output:

Starting program: /home/nicco/Desktop/ros_ws/devel/lib/ros_openpose/rosOpenposeAsync 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffc42ec700 (LWP 14682)]
[New Thread 0x7fffc3aeb700 (LWP 14683)]
[New Thread 0x7fffc32ea700 (LWP 14684)]
[New Thread 0x7fffc2ae9700 (LWP 14685)]
[FATAL] [1652186829.908395134]: Missing 'pub_topic' info in launch file. Please make sure that you have executed 'run.launch' file.
[Thread 0x7fffc2ae9700 (LWP 14685) exited]
[Thread 0x7fffc32ea700 (LWP 14684) exited]
OpenCV Error: Assertion failed (tlsSlots.size() > slotIdx) in releaseSlot, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/system.cpp, line 1092
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/system.cpp:1092: error: (-215) tlsSlots.size() > slotIdx in function releaseSlot


Thread 1 "rosOpenposeAsyn" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Maybe the problem is about the version of OpenCV?
(p.s. the pub_topic missed because was not running run.launch)

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@niccovezzi

Maybe the problem is about the version of OpenCV?

Yes. The problem is reported here.

Please make sure to use the same OpenCV in OpenPose and ROS.

from ros_openpose.

niccovezzi avatar niccovezzi commented on July 19, 2024

@ravijo

Perfect, i modify a .cmake file of cv_bridge and now it works.
Thank you very much for yours help ravijo.

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@niccovezzi

I am glad it worked!

Can you please mention in detail what you did? It will be helpful for users if they get the same error.

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@niccovezzi

Thank you very much. I formatted your response. I am closing this issue now.

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024

Hi @ravijo, I am facing a similar issue.

I had to change the run.launch file slightly because my realsense2_camera is in ROS2 so the file now just waits for the topics to exist and doesnt launch the realsense2_camera since I launch it in ROS2.

What is happening is that whenever I launch my version of the run.launch it shows the visualizer as it is suposed to and as soon as I point the camera to me it shows me this error which seems to be the same as published by @niccovezzi.

... logging to /home/goncalo/.ros/log/dbd3965a-f094-11ec-8bb4-b3552ce940b9/roslaunch-goncalo-GL552VW-22372.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://goncalo-GL552VW:42069/

SUMMARY
========

PARAMETERS
 * /echo/pub_topic: /frame
 * /rosOpenpose/cam_info_topic: /camera/color/cam...
 * /rosOpenpose/color_topic: /camera/color/ima...
 * /rosOpenpose/depth_topic: /camera/aligned_d...
 * /rosOpenpose/frame_id: camera_color_opti...
 * /rosOpenpose/no_depth: False
 * /rosOpenpose/pub_topic: /frame
 * /rosdistro: noetic
 * /rosversion: 1.15.14
 * /visualizer/frame_id: camera_color_opti...
 * /visualizer/id_text_offset: -0.05
 * /visualizer/id_text_size: 0.2
 * /visualizer/pub_topic: /frame
 * /visualizer/skeleton_hands: False
 * /visualizer/skeleton_line_width: 0.01

NODES
  /
    echo (ros_openpose/echo.py)
    rosOpenpose (ros_openpose/rosOpenposeAsync)
    visualizer (ros_openpose/visualizer.py)

auto-starting new master
process[master]: started with pid [22387]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to dbd3965a-f094-11ec-8bb4-b3552ce940b9
process[rosout-1]: started with pid [22405]
started core service [/rosout]
process[rosOpenpose-2]: started with pid [22412]
process[visualizer-3]: started with pid [22413]
process[echo-4]: started with pid [22414]
[ INFO] [1655728268.348597539]: Starting ros_openpose...
Auto-detecting all available GPUs... Detected 1 GPU(s), using 1 of them starting at GPU 0.
[ WARN] [1655728268.382687147]: Waiting for color image frame...
[ WARN] [1655728268.382963156]: Waiting for datum...
[INFO] [1655728269.581108]: []

[INFO] [1655728269.693738]: []

[INFO] [1655728269.806744]: []

[INFO] [1655728269.929786]: []

================================================================================REQUIRED process [rosOpenpose-2] has died!
process has died [pid 22412, exit code -11, cmd /home/goncalo/catkin_ws/devel/lib/ros_openpose/rosOpenposeAsync --model_folder /home/goncalo/openpose/models/ --net_resolution -1x192 __name:=rosOpenpose __log:=/home/goncalo/.ros/log/dbd3965a-f094-11ec-8bb4-b3552ce940b9/rosOpenpose-2.log].
log file: /home/goncalo/.ros/log/dbd3965a-f094-11ec-8bb4-b3552ce940b9/rosOpenpose-2*.log
Initiating shutdown!
================================================================================
[echo-4] killing on exit
[visualizer-3] killing on exit
[rosOpenpose-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I don't believe it comes from a bad configuration of the launch file since the only thing I did was to remove the launch of the realsense2_camera. As I mentioned, this error happens as soon as it tries to compute the human pose.

When I run OpenPose with the same resolution I input here (-1x192) it is slow but works correctly. So no problem there. I had to uncheck USE_CUDNN because OpenPose was not working with it but it works fine without it.

I also dont believe it comes from the cv_bridgeConfig configuration as mentioned in this issue since I already tested it by following the steps mentioned in the issue but maybe I am missing something.

EDIT: I have traced the error. It happens when it executes line 119 from cameraReader.hpp so I guess it has something to do with openCV after all. I am running opencv4 but the file has #include <opencv2/core/core.hpp>.

line 119: auto depth = mDepthImageUsed.at(static_cast(pixelY), static_cast(pixelX));

What are your suggestions?

I hope I made my problem understandable, Thank You for any answer!

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@goncalofurtado1

Can you please share necessary information such as the version of OpenPose, OpenCV, ROS, Ubuntu, etc?

You said that you are using ROS2 for realsense camera. Where is your ros_openpose running?

ros_openpose currently designed only for ROS 1. So If you want to integrate it with ROS 2, please check out ros1_bridge package.

The logs shared by you shows that ros_openpose somehow could not receive a frame from the camera. It could be related to OpenCV. For example, the OpenCV should be installed by ROS (apt install blah blah) automatically. But if you are using a custom OpenCV, then you need to build ROS on that OpenCV.

I am opening this issues, for now.

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024

UPDATE: The problem still persists... 😢

The cv_bridgeConfig.cmake file is like so (from line 92 to line 119):

set(cv_bridge_FOUND_CATKIN_PROJECT TRUE)

if(NOT "include;/usr/include/opencv4" STREQUAL " ")
  set(cv_bridge_INCLUDE_DIRS "")
  set(_include_dirs "include;/usr/include/opencv4")
  if(NOT "https://github.com/ros-perception/vision_opencv/issues " STREQUAL " ")
    set(_report "Check the issue tracker 'https://github.com/ros-perception/vision_opencv/issues' and consider creating a ticket if the problem has not been reported yet.")
  elseif(NOT "http://www.ros.org/wiki/cv_bridge " STREQUAL " ")
    set(_report "Check the website 'http://www.ros.org/wiki/cv_bridge' for information and consider reporting the problem.")
  else()
    set(_report "Report the problem to the maintainer 'Vincent Rabaud <[email protected]>' and request to fix the problem.")
  endif()
  foreach(idir ${_include_dirs})
    if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir})
      set(include ${idir})
    elseif("${idir} " STREQUAL "include ")
      get_filename_component(include "${cv_bridge_DIR}/../../../include" ABSOLUTE)
      if(NOT IS_DIRECTORY ${include})
        message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found.  It does not exist in '${include}'.  ${_report}")
      endif()
    else()
      message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found.  It does neither exist as an absolute directory nor in '\${prefix}/${idir}'.  ${_report}")
    endif()
    _list_append_unique(cv_bridge_INCLUDE_DIRS ${include})
  endforeach()
endif()

set(libraries "cv_bridge;/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dnn.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_features2d.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_flann.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_ml.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_objdetect.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_photo.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_stitching.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_video.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_videoio.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_aruco.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_bgsegm.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_bioinspired.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_ccalib.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_datasets.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dnn_objdetect.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dnn_superres.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dpm.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_face.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_freetype.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_fuzzy.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_hdf.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_hfs.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_img_hash.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_line_descriptor.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_optflow.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_phase_unwrapping.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_plot.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_quality.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_reg.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_rgbd.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_saliency.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_shape.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_stereo.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_structured_light.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_superres.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_surface_matching.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_text.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_tracking.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_viz.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_ximgproc.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_xobjdetect.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_xphoto.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_core.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0")

I don't know what else to try.

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@goncalofurtado1

Sorry for the trouble. OpenPose 1.7.0 on Ubuntu 20.04 using ROS Noetic should work without issues. I remember checking it (compilation only) here.

I suspect some configuration or dependencies mismatch issue on your side, though.

How about trying a fresh install to confirm my guess?

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024

Ok I'll reinstall OpenPose and ros_openpose again and report back once it's done.

Thank You for your suggestion.

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024

@ravijo

I reinstalled both packages and remain with the same issue but I believe your are right about having some sort of bad configuration on my machine.

Do you have any suggestion on best practices to debug this issue?

Also I don't know if OpenPose is compatible with OpenCV version 4.2.0 maybe that's the error that I'm getting?

I say this because before installing OpenPose as per the instructions I install the prerequsites and step 5 is like so:
openpose_pre_req

And once I run sudo bash ./scripts/ubuntu/install_deps.sh it installs OpenCV version 4.6.0 but the sudo apt-get install libopencv-dev command only installs for version 4.2.0. In the meantime I will try to configure cv_bridge to run with the 4.6.0 version just like @niccovezzi did for version 4.5.4 and see if that solves it.

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@goncalofurtado1

Thanks for the update.

Do you have any suggestion on best practices to debug this issue?

Basically, in this situation, it is better to check the followings things:

  1. Make sure that OpenPose is installed correctly by running the openpose.bin demo file.
  2. Make sure that ROS is appropriately installed.
    • Specifically, ros_openpose depends on ROS to get images. Internally, ROS is using OpenCV by making use of cv_bridge. Therefore, the cv_bridge must be compatible with ROS and OpenCV too.
    • When we install ROS from binaries, the compatible cv_bridge and OpenCV are installed automatically.
    • Unfortunately, when using a custom OpenCV, the ROS must be built from the source!
  3. Ensure the camera driver and corresponding ROS package (say Intel RealSense) are well installed.
    • To verify this, run the ROS package of your camera and use RViz to visualize input images from the camera.

If you feel this is too much to do, go for a fresh install of Ubuntu, then things should work smoothly.

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024

@ravijo

I did all the previous checks and everything is alright but I discovered something that is quite embarrassing... I forgot to set the aligned_depth option of the Intel RealSense camera to True. I think this might be the root of the problem.

As soon as I can I'll test this hypotheses and report back.

from ros_openpose.

ravijo avatar ravijo commented on July 19, 2024

@goncalofurtado1

Yeah, please make sure that depth is aligned to the color frame. This is why ros_openpose provides config_realsense.launch as shown below:

<!-- rostopic to subscribe for depth images -->
<arg name="depth_topic" default="/camera/aligned_depth_to_color/image_raw" />

Furthermore, please check the depth encoding. If the depth is in millimeters, we must convert it to meters. See below how it is implemented:

self.mm_to_m = 0.001 if encoding == "16UC1" else 1.

// in case of '16UC1' encoding (depth values are in millimeter),
// a manually conversion from millimeter to meter is required.
if (depthMsg->encoding == sensor_msgs::image_encodings::TYPE_16UC1)
// -1 represents no change in datatype
// src: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#adf88c60c5b4980e05bb556080916978b
depthPtr->image.convertTo(mDepthImage, -1, 0.001f);

from ros_openpose.

goncalofurtado1 avatar goncalofurtado1 commented on July 19, 2024

@ravijo

It's solved! Thank you for your help.

In fact it was because of a mismatch between two versions of OpenCV but towards the end I just forgot to activate the aligned_depth feature.

from ros_openpose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.