OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.81k stars 1.09k forks source link

How to edit ccd_defs.json from docker installation #314

Closed kikislater closed 7 years ago

kikislater commented 8 years ago

Hi, How to edit or add information in ccd_defs.json with docker installation ?

dakotabenjamin commented 8 years ago

Good question-- normally I would say submit a PR here (the image rebuilds after every pushed commit) but as per #237 we are not accepting PRs for ccd_defs. If your camera is not in the definitions list simply use --force-ccd.

kikislater commented 8 years ago

ok thank you for --force-ccd, I miss it. But normally, in a docker container we can run a bourne shell and modify a file with it but bash seems to not working from ODM container : docker exec -i opendronemap /bin/bash -c 'cat > /inside-container-file' < external_file It just launch run.py

So I found how it works : ENTRYPOINT in dockerfile launch by default run.py If I want to enter in the container with bash, I must have to specify it with : docker run -t -i --entrypoint="/bin/bash" opendronemap I can watch the file in /code/ccd_defs.json with cat but cannot edit because nano is not installed. So I have to run the container with root => docker run -t -i --user root --entrypoint="/bin/bash" opendronemap apt-get install nano nano /code/ccd_defs.json Unfortunately installing nano is not persistent ... Still learning docker under archlinux, I have to investigate !

dakotabenjamin commented 8 years ago

For one, you should be appending to SuperBuild/src/opensfm/opensfm/data/sensor_data.json. ccd_defs is depreciated.

Second, you can use sed to append to the second to last line of a file without using nano. e.g.

sed '$i    "Camera Model": 1.23,' SuperBuild/src/opensfm/opensfm/data/sensor_data.json
smathermather commented 7 years ago

@kikislater -- is this issue closed?

kikislater commented 7 years ago

Yes, now I have more knowledge with docker. It just basic usage like using docker commit. You could close

winsento commented 7 years ago

Small changes @dakotabenjamin command:

sed '2i\    "Camera Model": 1.23,' SuperBuild/src/opensfm/opensfm/data/sensor_data.json