koide3 / direct_visual_lidar_calibration

A toolbox for target-less LiDAR-camera calibration [ROS1/ROS2]
https://koide3.github.io/direct_visual_lidar_calibration/
740 stars 112 forks source link

Initial guess (Automatic) in Docker #83

Open Prabuddhi-05 opened 5 months ago

Prabuddhi-05 commented 5 months ago

In the Docker image of your repository in ROS2, could you please inform me about how "Initial guess Automatic" (initial_guess_auto) works? I'm encountering an error when testing it. Screenshot from 2024-05-16 16-03-22

koide3 commented 4 months ago

Is there a file named "*_matches.json" in the preprocessed directory? If not, you have to run find_matches_superglue.py.

Prabuddhi-05 commented 4 months ago

Is there a file named "*_matches.json" in the preprocessed directory? If not, you have to run find_matches_superglue.py.

Thank you for the response. However, they still ask us to install things like Torch, Matplotlib, etc. Screenshot from 2024-05-28 13-03-05

Seekerzero commented 4 months ago

Seems like the torch package was not sucessfully deployed into the container after pulling the image. Can you remove the original docker container and repull the image to see if there is any error about torch installation? Thanks.

Prabuddhi-05 commented 4 months ago

As per your request, I removed the original Docker container and repulled the image. Unfortunately, the torch package still seems to be missing or not installed correctly. I am still getting the same error.

Seekerzero commented 4 months ago

could you try to post the installation log to here?

Davabbb commented 4 months ago

@Seekerzero i have same error

Seekerzero commented 4 months ago

Hi @koide3, seems like the GTSAM docker files does not setup the python environment properly. maybe add the following # Install PyTorch and torchvision RUN pip3 install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu111/torch_stable.html at here (also the humble one) can ensure the installation.

Thanks.

Davabbb commented 4 months ago

@Seekerzero I created a docker based on yours and there are still not enough modules there

Davabbb commented 4 months ago

and there is an old docker file on github, here is an updated version, but it still doesn’t work for me https://hub.docker.com/r/koide3/direct_visual_lidar_calibration

Seekerzero commented 4 months ago

Thanks for your information. Do you have any errors report while you installing torch in docker?

Davabbb commented 4 months ago

@Seekerzero thanks for your quick response my dockerfile: FROM koide3/direct_visual_lidar_calibration:humble

RUN apt-get update && apt-get install -y python3-pip

RUN pip3 install numpy==1.21.0 RUN pip3 install torch RUN pip3 install opencv-python RUN pip3 install matplotlib RUN pip3 install torchvision RUN pip3 install models I installed the modules that were needed step by step, but on the 8 layer i have error:

[8/8] RUN pip3 install models:
0.929 Collecting models
1.131 Downloading models-0.9.3.tar.gz (16 kB)
1.189 Preparing metadata (setup.py): started 1.354 Preparing metadata (setup.py): finished with status 'error' 1.362 error: subprocess-exited-with-error 1.362
1.362 × python setup.py egg_info did not run successfully. 1.362 │ exit code: 1 1.362 ╰─> [8 lines of output] 1.362 Traceback (most recent call last): 1.362 File "", line 2, in 1.362 File "", line 34, in 1.362 File "/tmp/pip-install-9_hqdy_l/models_7c2cba2a7c3b46c897307929c70d7580/setup.py", line 25, in 1.362 import models 1.362 File "/tmp/pip-install-9_hqdy_l/models_7c2cba2a7c3b46c897307929c70d7580/models/init.py", line 23, in 1.362 from base import * 1.362 ModuleNotFoundError: No module named 'base' 1.362 [end of output] 1.362
1.362 note: This error originates from a subprocess, and is likely not a problem with pip. 1.364 error: metadata-generation-failed

and i dont have idea how it solve

Seekerzero commented 4 months ago

This might be related to the version of pip3 and setuptools try to upgrade them first.

Davabbb commented 4 months ago

i solve problem with models, clone this repo https://github.com/magicleap/SuperGluePretrainedNetwork/tree/master and copy models folder

Seekerzero commented 4 months ago

this is the version problem with matplotlib, either you can downgrade it (might cause problem with numpy) or you just edit the code to adapt the newer version.

Davabbb commented 4 months ago

try install matplotlib 3.4.0

Davabbb commented 4 months ago

git clone https://github.com/magicleap/SuperGluePretrainedNetwork/tree/master

FROM koide3/direct_visual_lidar_calibration:humble

RUN apt-get update && apt-get install -y python3-pip

RUN pip3 install numpy==1.21.0 RUN pip3 install torch RUN pip3 install opencv-python RUN pip3 install torchvision RUN pip3 install matplotlib==3.7.3

COPY ./models /root/ros2_ws/src/direct_visual_lidar_calibration/scripts/models COPY ./models /root/ros2_ws/install/direct_visual_lidar_calibration/lib/direct_visual_lidar_calibration/models

it work!!

Seekerzero commented 4 months ago

Hi @koide3, you might want to add the lines above to the dockerfile for setting up the torch environment.

Davabbb commented 4 months ago

@Seekerzero can you please help me with another error?

Seekerzero commented 4 months ago

hi @Davabbb, you might want to raise another issue if the question is not related to this one.

koide3 commented 3 months ago

Hi guys, If I remember correctly, I avoided including SuperGlue in the docker image because of its license. MagicLeap employs a non-standard strict license, and I was not sure if it's safe to include it. I have read the license again, but I'm still not sure if it allows redistributing the code in a binary docker image. Does anybody have idea about this?

I think it is safe to provide a separate Dockerfile with SuperGlue at least, and I'm going to add something like Dockerfile_with_superglue so that the user can build the image by themselves.

@Seekerzero Thank a lot for your help!, and sorry for making you respond to issues.

koide3 commented 3 months ago

I just added Dockerfile_with_superglue. https://github.com/koide3/direct_visual_lidar_calibration/blob/main/docker/humble/Dockerfile_with_superglue

Seekerzero commented 3 months ago

Hi guys, If I remember correctly, I avoided including SuperGlue in the docker image because of its license. MagicLeap employs a non-standard strict license, and I was not sure if it's safe to include it. I have read the license again, but I'm still not sure if it allows redistributing the code in a binary docker image. Does anybody have idea about this?

I think it is safe to provide a separate Dockerfile with SuperGlue at least, and I'm going to add something like Dockerfile_with_superglue so that the user can build the image by themselves.

@Seekerzero Thank a lot for your help!, and sorry for making you respond to issues.

Hi @koide3, you are right, seems like magic leap prohibited any kinds of sublicense from its original copy, even for the research purpose. We want to avoid this risk from it, also the risk of docker distribution. Sorry for not realizing that! We might want to add a way let user link the external path from the superglue folder to the docker file. Or in the future, we can introduce more framework for auto matching.

It is my pleasure to help!