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

colcon build failed undefined reference to `DUtils::Random::SeedRandOnce()' #15

Open
spectra543 opened this issue Jul 28, 2023 · 18 comments

Comments

@spectra543
Copy link

Hi guy i try to colcon build ORB_SLAM3_ROS2 after i run this line "colcon build --symlink-install --packages-select orbslam3" this error happens.

dtuil

i use
ros2 foxy
opencv 4.2.0
ubuntu 20.04
anyone know how to fix thankyou!

@mjunsen123
Copy link

mjunsen123 commented Apr 26, 2024

  1. Go to ORB_SLAM3/Thirdparty/DBoW2/CMakeLists.txt
  2. Change line add_library(DBoW2 SHARED ${SRCS_DBOW2} ${SRCS_DUTILS}) to add_library(DBoW2 STATIC ${SRCS_DBOW2} ${SRCS_DUTILS}) and,
  3. add line set_property(TARGET DBoW2 PROPERTY POSITION_INDEPENDENT_CODE ON)
  4. Go to ORB_SLAM3/CMakeLists.txt
  5. Replace ${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so with ${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.a
  6. Rebuild

Hope this help!

@1melek
Copy link

1melek commented May 14, 2024

i have the same issue , i tried doing your method and it still didn't work

@mjunsen123
Copy link

i have the same issue , i tried doing your method and it still didn't work

Have you rebuild ORBSLAM3 as well? Do you have .a file in Thirdparty/DBoW2/lib/libDBoW2.a after rebuild?

@1melek
Copy link

1melek commented May 14, 2024

well no i will try to rebuild it now

@1melek
Copy link

1melek commented May 14, 2024

okay that worked ! but now the build failed again..

Screenshot from 2024-05-14 12-20-23

can you help?

@mjunsen123
Copy link

okay that worked ! but now the build failed again..

Screenshot from 2024-05-14 12-20-23

can you help?

Your OpenCV version in ROS is different with the one in your machine. I assume you have build cvbridge, edit the file CMakeList.txt in CVBridge to force it to use OpenCV 4.9.

@1melek
Copy link

1melek commented May 14, 2024

no i haven't build CVBbridge .. should i?
i don't even know what and where it is .

@mjunsen123
Copy link

mjunsen123 commented May 14, 2024

Okay if it is the case i suggest you downgrade your opencv in your ubuntu to 4.2. I belive that would be the most straightforward solution

@1melek
Copy link

1melek commented May 14, 2024

the thing is , i have opencv 4.2 and i have no idea where 4.9 is coming from
11

@mjunsen123
Copy link

Have you build with source before?

@1melek
Copy link

1melek commented May 20, 2024

I figured that and it build successfully but now when i run it i can't see anything in the camera and I don’t know from where it get camera input , like it always says “1 camera in the atlas” even when i deactivated the laptop camera and no usb cam

@andremaurell
Copy link

andremaurell commented Jul 2, 2024

@mjunsen123 Good tutorial my friend, but, can you help-me? after the changes at CMake and generate .a file, I received that error:

image

@mjunsen123
Copy link

Never see this error before. Can you please confirm you have CVBridge (vision_opencv) installed?

@andremaurell
Copy link

I think yes:

image

@mjunsen123
Copy link

And can you confirm that you have same version of OpenCV in both your ROS and Ubuntu?

@andremaurell
Copy link

i don't know how I can see on ROS, but on ubuntu is 4.5.4

@mjunsen123
Copy link

I am not sure but I think it may due to different version of openCV in Ros and Ubuntu. I am aware of this but I am not sure if this is your case. What I did is I build opencv and cvbridge from source, so I can specific the version used in ORBSLAM3

@andremaurell
Copy link

Yeah, I think is the same version, but I'm not sure about that. Do you have same tutorial showing how I can make this build?

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