安装并配置Nvblox ROS1
- 下载Nvblox ROS1
mkdir -p ~/nvblox_ros1_ws/src/
mkdir ~/data
cd ~/nvblox_ros1_ws/src/
git clone https://github.com/ethz-asl/nvblox_ros1.git
cd nvblox_ros1
git submodule update --init --recursive
- 安装Docker
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
sudo usermod -aG docker $USER
sudo reboot
- 构建Docker镜像
cd ~/nvblox_ros1_ws/src/nvblox_ros1/docker
bash run_docker.sh -b -w /home/$USER/nvblox_ros1_ws
- 在Docker容器内构建ROS工作空间
注意: 这些操作应当在Docker的nvblox容器中进行。
docker exec -it nvblox bash
cd ~/nvblox_ws/
catkin init
catkin config --extend /opt/ros/noetic
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build
echo "source ~/nvblox_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
测试
- 下载测试数据包
cd ~/data/
wget http://robotics.ethz.ch/~asl-datasets/2023_nvblox_datasets/panopt/run1.bag
- 启动nvblox docker容器
cd nvblox_ros1/docker
./run_docker.sh
注意: 以下操作应当在Docker的nvblox容器中进行。
docker exec -it nvblox bash
- 运行nvblox_ros节点
# Terminal 1 in docker
roslaunch nvblox_ros nvblox_ros_panopt.launch rviz:=true
- 回放测试数据包
# Terminal 2 in docker
rosbag play --clock ~/data/run1.bag
- 保存Mesh文件
# Terminal 3 in docker
rosservice call /nvblox_node/save_ply "file_path: '/root/nvblox_ws'"
TroubleShooting
CUDA
Occurred on x86_64 Ubuntu20.04 RTX4070Ti
Error string: CUDA driver version is insufficient for CUDA runtime version.
[nvblox_node-3] process has died [pid 6628, exit code 99, cmd /root/nvblox_ws/devel/lib/nvblox_ros/nvblox_node depth/image:=/data/depth_image depth/camera_info:=/data/depth_image/camera_info color/image:=/data/color_image color/camera_info:=/data/color_image/camera_info __name:=nvblox_node __log:=/root/.ros/log/25507420-a6c3-11ee-8137-70a8d35674a3/nvblox_node-3.log].
log file: /root/.ros/log/25507420-a6c3-11ee-8137-70a8d35674a3/nvblox_node-3*.log
sudo apt update
sudo apt install nvidia-driver-535
docker
删除所有容器
docker rm -f $(docker ps -a -q)
删除所有镜像
docker rmi -f $(docker images -q)
删除所有未使用的镜像
docker image prune -a
删除所有未使用的数据
docker system prune