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

Jetson OpenCV issue #9

Closed
trentatsa opened this issue Jul 21, 2022 · 5 comments
Closed

Jetson OpenCV issue #9

trentatsa opened this issue Jul 21, 2022 · 5 comments

Comments

@trentatsa
Copy link

trentatsa commented Jul 21, 2022

Hi There, I am currently going around in circles. I am trying to run your package on Jetson Xavier NX. The package launches but as soon its it receives and image the following error is thrown:

[component_container-1] terminate called after throwing an instance of 'cv::Exception'
[component_container-1]   what():  OpenCV(4.5.4) /home/ubuntu/build_opencv/opencv/modules/core/src/matrix.cpp:250: error: (-215:Assertion failed) s >= 0 in function 'setSize'
[component_container-1] 
[ERROR] [component_container-1]: process has died [pid 37461, exit code -6, cmd '/opt/ros/foxy/lib/rclcpp_components/component_container --ros-args -r __node:=tag_container -r __ns:=/apriltag'].

I think it is something do with the OpenCV version, where the Jetson Xavier has 4.5 inbuild. I have tried to install Jetson OS without OpenCV and install OpenCV with (sudo apt install libopencv-dev python3-opencv).

I have been on this for 3 day, please could you help me out :D

Last things, when I build I get the following warning:

/usr/bin/ld: warning: libopencv_calib3d.so.4.2, needed by /opt/ros/foxy/lib/libimage_geometry.so, may conflict with libopencv_calib3d.so.4.5
/usr/bin/ld: warning: libopencv_core.so.4.2, needed by /opt/ros/foxy/lib/libimage_geometry.so, may conflict with libopencv_core.so.4.5
/usr/bin/ld: warning: libopencv_imgcodecs.so.4.2, needed by /opt/ros/foxy/lib/libcv_bridge.so, may conflict with libopencv_imgcodecs.so.4.5
@christianrauch
Copy link
Owner

I haven't encountered this error nor do I have the hardware to test this. Could you provide a full backtrace of the error?

Btw, it makes it easier to read if you format code and terminal output as "code" (via backticks).

@christianrauch
Copy link
Owner

There is not enough information to debug this issue. It is unclear if this is an issue with the apriltag library or this node.

I suggest that you install the dbgsym packages for OpenCV and any other libraries in the stack.

I am closing this for now. If this occurs again, please reopen the issue and provide a detailed backtrace and maybe a reproducible example with a bag file.

@christianrauch christianrauch closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2022
@orjano-max
Copy link

Posting here as i had a similar issue and my solution might help others that are stuck with this.

Using

  • Nvidia AGX Xavier
  • Jetpack 5.0.2
  • ROS2 Foxy.

Encountered the issue described in #2, did the fix, but got complaints about missing apriltag_msgs.
Decided to use the following git repo which is inspired by this one(but has a foxy branch and contains apriltag_msgs package): https://github.com/Adlink-ROS/apriltag_ros

Successfully built packages and got the issue described by @trentatsa here.

Solved this issue by cloning and building the vision_opencv packages from source and using these instead of binaries:

https://github.com/ros-perception/vision_opencv

Of course using the foxy branch as it corresponds to the ROS2 distro i am using.

@christianrauch
Copy link
Owner

Encountered the issue described in #2, did the fix, but got complaints about missing apriltag_msgs.

FYI, it is here: https://github.com/christianrauch/apriltag_msgs. I should probably document the installation from source.

Solved this issue by cloning and building the vision_opencv packages from source and using these instead of binaries:

Thanks for the tip. I assume that other packages using vision_opencv (or cv_bridge specifically) would also exhibit this issue.

Can it be that there are multiple versions of OpenCV installed on your system? If you have multiple versions of OpenCV installed and libcv_bridge.so selects the wrong one, then this is likely causing this issue. Make sure to only have the OpenCV version installed that is also used by the ros-$ROS_DISTRO-cv-bridge package.

@orjano-max
Copy link

@christianrauch Yeah, Jetpack 5.0.2 comes with opencv 4.5.4 preinstalled, ref: https://developer.nvidia.com/embedded/vpi
Which might cause problems.

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

3 participants