安装kalibr docker,利用kalibr生成bag文件

 Installation · ethz-asl/kalibr Wiki · GitHub

解决Ubuntu18.04启动Docker“Got permission denied while trying to connect to the Docker daemon socket“问题_LL Leung的博客-CSDN博客 kalibr 如何从bag中提取图像/由图像生成bag_AndyCheng_hgcc的博客-CSDN博客

  1. Clone and build the docker image

First make sure that you have install docker on your system using the official Docker Get Docker guide. We can then clone and build the docker container using:

git clone https://github.com/ethz-asl/kalibr.git
cd kalibr
docker build -t kalibr -f Dockerfile_ros1_20_04 . # change this to whatever ubuntu version you want
  1. Mounting a data folder for use in the container

We can now mount the data folder in the container /data path and enter the command prompt. Some more details can be found on the ROS wiki for Docker.

FOLDER=/path/to/your/data/on/host
xhost +local:root
docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" \
    -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    -v "$FOLDER:/data" kalibr
  1. Inside the docker, running commands

Using the above command you should have entered the docker container bash prompt. From here you should be able to run kalibr on any files that are in your /data directory. You will want to first load your ROS environment variables.

source devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras \
    --bag /data/cam_april.bag --target /data/april_6x6.yaml \
    --models pinhole-radtan pinhole-radtan \
    --topics /cam0/image_raw /cam1/image_raw

 rosrun kalibr kalibr_bagcreater --folder ./static/pic/cam0

rosrun kalibr kalibr_bagcreater --folder dataset-dir/. --output-bag awsome.bag

    输出的包 只能生成在当前目录,awsome.bag不能包含路径,只能命名包名

    dataset-dir文件夹的组织形式较为固定
    图片文件夹的命名可以是cam,但如果是image_rotation这种,在制作bag包的时候,就不会将图片信息加进去了

最后包制作完后验证一下,想要的信息是否都加进包里面了
 

 启动 docker run -t -i kalibr /bin/bash

退出ctrl+D

如何进入、退出docker的container_我是干勾鱼的博客-CSDN博客_docker 进入container

猜你喜欢

转载自blog.csdn.net/weixin_45834800/article/details/127281371