From c4306a2787270cce3ea85c93f40f1839a366c4ea Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Tue, 4 Feb 2025 16:15:34 -0400 Subject: [PATCH 1/8] Making Docker setup more user friendly, minor rviz file updates and updating gtsam version for rosinstall --- README.md | 2 +- Dockerfile => docker/Dockerfile | 21 +++-- docker/README.md | 19 +++++ docker/docker_test.bash | 19 +++++ install/kimera_vio_ros_https.rosinstall | 2 +- install/kimera_vio_ros_ssh.rosinstall | 2 +- rviz/kimera_vio_euroc.rviz | 100 ++++++++++++------------ 7 files changed, 109 insertions(+), 56 deletions(-) rename Dockerfile => docker/Dockerfile (64%) create mode 100644 docker/README.md create mode 100755 docker/docker_test.bash diff --git a/README.md b/README.md index 2a0c81a3..0f9ad393 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Download a [Euroc](https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisuali 2. In another terminal, launch KimeraVIO ROS wrapper: ```bash - roslaunch kimera_vio_ros kimera_vio_ros_euroc.launch + roslaunch kimera_vio_ros kimera_vio_ros_euroc.launch online:=true ``` 3. In another terminal, launch rviz for visualization: diff --git a/Dockerfile b/docker/Dockerfile similarity index 64% rename from Dockerfile rename to docker/Dockerfile index 98add506..c8b607c4 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,7 @@ FROM ros:noetic-ros-base +ENV DEBIAN_FRONTEND=noninteractive + RUN apt-get update && apt-get install -y --no-install-recommends apt-utils RUN apt-get install -y ros-noetic-image-geometry ros-noetic-pcl-ros \ ros-noetic-cv-bridge git cmake build-essential unzip pkg-config autoconf \ @@ -11,18 +13,27 @@ RUN apt-get install -y ros-noetic-image-geometry ros-noetic-pcl-ros \ libparmetis-dev \ python3-wstool python3-catkin-tools \ # libtbb recommended for speed: \ - libtbb-dev + libtbb-dev \ + # for use with rviz + xvfb RUN mkdir -p /catkin_ws/src/ RUN git clone https://github.com/MIT-SPARK/Kimera-VIO-ROS.git /catkin_ws/src/Kimera-VIO-ROS -RUN cd /catkin_ws/src/Kimera-VIO-ROS - # && git checkout ___ + RUN cd /catkin_ws/src/ && wstool init && \ wstool merge Kimera-VIO-ROS/install/kimera_vio_ros_https.rosinstall && wstool update # Build catkin workspace RUN apt-get install -y ros-noetic-image-pipeline ros-noetic-geometry ros-noetic-rviz +# Downloading EuRoC bag file for demo +RUN apt-get install -y wget && \ + wget -P /catkin_ws/ http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/vicon_room1/V1_01_easy/V1_01_easy.bag + RUN . /opt/ros/noetic/setup.sh && cd /catkin_ws && \ - catkin init && catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ - catkin build + catkin init && catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ + catkin build -j4 + +# Setting up bashrc +RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc +RUN echo "source /catkin_ws/devel/setup.bash" >> ~/.bashrc diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..399402b0 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,19 @@ +# Using the Kimera-VIO ROS wrapper with Docker + +## Building and running your container +To build the container, in this directory, run the following: +``` +docker build -t kimera_vio_ros:latest . +``` +To run the container while being able to use RViz, run the following command: +``` +./docker_test.bash [optional container name; default is kimera_vio_ros] +``` + +## Running the EuRoC demonstration with Rviz +For running the EuRoC demonstration with Rviz, simply follow the instructions [here](https://github.com/MIT-SPARK/Kimera-VIO-ROS?tab=readme-ov-file#online). + +The bag file path you will need to specify is `/catkin_ws/V1_01_easy.bag`. + +### Possible errors: +* If your trajectory tracking looks incorrect immediately, update the `autoInitialize` field from 0 to 1 in `/catkin_ws/src/Kimera-VIO/params/Euroc/BackendParams.yaml`. diff --git a/docker/docker_test.bash b/docker/docker_test.bash new file mode 100755 index 00000000..0aa75036 --- /dev/null +++ b/docker/docker_test.bash @@ -0,0 +1,19 @@ +#!/bin/bash + +# Base script taken from https://github.com/MIT-SPARK/Kimera-VIO/blob/master/scripts/docker/kimera_vio_docker.bash +DOCKER_CONTAINER="kimera_vio_ros" + +if [ "$#" -eq 1 ]; then + DOCKER_CONTAINER=$1 + echo "container name: $DOCKER_CONTAINER" +fi + +# Allow X server connection +xhost +local:root +docker run -it --rm \ + --env="DISPLAY" \ + --env="QT_X11_NO_MITSHM=1" \ + --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ + $DOCKER_CONTAINER +# Disallow X server connection +xhost -local:root diff --git a/install/kimera_vio_ros_https.rosinstall b/install/kimera_vio_ros_https.rosinstall index 940a08d6..1754c6a1 100644 --- a/install/kimera_vio_ros_https.rosinstall +++ b/install/kimera_vio_ros_https.rosinstall @@ -13,7 +13,7 @@ - git: local-name: gtsam uri: https://github.com/borglab/gtsam.git - version: develop + version: 4.2 - git: local-name: opengv_catkin uri: https://github.com/MIT-SPARK/opengv_catkin.git diff --git a/install/kimera_vio_ros_ssh.rosinstall b/install/kimera_vio_ros_ssh.rosinstall index 093a5ee7..8a67e9f4 100644 --- a/install/kimera_vio_ros_ssh.rosinstall +++ b/install/kimera_vio_ros_ssh.rosinstall @@ -13,7 +13,7 @@ - git: local-name: gtsam uri: git@github.com:borglab/gtsam.git - version: develop + version: 4.2 - git: local-name: opengv_catkin uri: git@github.com:MIT-SPARK/opengv_catkin.git diff --git a/rviz/kimera_vio_euroc.rviz b/rviz/kimera_vio_euroc.rviz index 354a2314..f4694a8b 100644 --- a/rviz/kimera_vio_euroc.rviz +++ b/rviz/kimera_vio_euroc.rviz @@ -6,7 +6,7 @@ Panels: Expanded: - /Global Options1 Splitter Ratio: 0.5 - Tree Height: 493 + Tree Height: 293 - Class: rviz/Selection Name: Selection - Class: rviz/Tool Properties @@ -15,17 +15,18 @@ Panels: - /2D Nav Goal1 - /Publish Point1 Name: Tool Properties - Splitter Ratio: 0.588679016 + Splitter Ratio: 0.5886790156364441 - Class: rviz/Views Expanded: - /Current View1 Name: Views - Splitter Ratio: 0.75836432 + Splitter Ratio: 0.7583643198013306 - Class: rviz/Time - Experimental: false Name: Time SyncMode: 0 SyncSource: PointCloud Time Horizon +Preferences: + PromptSaveOnExit: true Toolbars: toolButtonStyle: 2 Visualization Manager: @@ -33,6 +34,8 @@ Visualization Manager: Displays: - Class: rviz/TF Enabled: true + Filter (blacklist): "" + Filter (whitelist): "" Frame Timeout: 15 Frames: All Enabled: false @@ -42,7 +45,7 @@ Visualization Manager: Value: true cam1: Value: true - world: + odom: Value: true Marker Alpha: 1 Marker Scale: 1 @@ -51,7 +54,7 @@ Visualization Manager: Show Axes: true Show Names: true Tree: - world: + odom: base_link: cam0: {} @@ -74,15 +77,13 @@ Visualization Manager: Enabled: true Invert Rainbow: false Max Color: 255; 255; 255 - Max Intensity: 4096 Min Color: 0; 0; 0 - Min Intensity: 0 Name: PointCloud Time Horizon Position Transformer: XYZ Queue Size: 10 Selectable: true Size (Pixels): 3 - Size (m): 0.0199999996 + Size (m): 0.019999999552965164 Style: Spheres Topic: /kimera_vio_ros/time_horizon_pointcloud Unreliable: false @@ -116,7 +117,7 @@ Visualization Manager: - Class: mesh_rviz_plugins/TexturedMesh Enabled: true Name: 3D Mesh Textured - Normal Size: 0.0500000007 + Normal Size: 0.05000000074505806 Phong Shading: true Point Size: 1 Polygon Mode: SOLID @@ -128,7 +129,7 @@ Visualization Manager: Texture Transport Hint: raw Texture topic: /kimera_vio_ros/kimera_vio_ros_node/feature_tracks Value: true - - Angle Tolerance: 0.100000001 + - Angle Tolerance: 0.10000000149011612 Class: rviz/Odometry Covariance: Orientation: @@ -140,7 +141,7 @@ Visualization Manager: Scale: 1 Value: true Position: - Alpha: 0.300000012 + Alpha: 0.30000001192092896 Color: 204; 51; 204 Scale: 1 Value: true @@ -148,16 +149,17 @@ Visualization Manager: Enabled: true Keep: 1 Name: Odometry - Position Tolerance: 0.100000001 + Position Tolerance: 0.10000000149011612 + Queue Size: 10 Shape: Alpha: 1 - Axes Length: 0.300000012 - Axes Radius: 0.00999999978 + Axes Length: 0.30000001192092896 + Axes Radius: 0.009999999776482582 Color: 255; 25; 0 - Head Length: 0.300000012 - Head Radius: 0.100000001 + Head Length: 0.30000001192092896 + Head Radius: 0.10000000149011612 Shaft Length: 1 - Shaft Radius: 0.0500000007 + Shaft Radius: 0.05000000074505806 Value: Axes Topic: /kimera_vio_ros/odometry Unreliable: false @@ -201,11 +203,11 @@ Visualization Manager: Class: rviz/Path Color: 25; 255; 0 Enabled: false - Head Diameter: 0.300000012 - Head Length: 0.200000003 - Length: 0.300000012 + Head Diameter: 0.30000001192092896 + Head Length: 0.20000000298023224 + Length: 0.30000001192092896 Line Style: Lines - Line Width: 0.0299999993 + Line Width: 0.029999999329447746 Name: PGO Trajectory Offset: X: 0 @@ -213,9 +215,10 @@ Visualization Manager: Z: 0 Pose Color: 255; 85; 255 Pose Style: None - Radius: 0.0299999993 - Shaft Diameter: 0.100000001 - Shaft Length: 0.100000001 + Queue Size: 10 + Radius: 0.029999999329447746 + Shaft Diameter: 0.10000000149011612 + Shaft Length: 0.10000000149011612 Topic: /kimera_vio_ros/optimized_trajectory Unreliable: false Value: false @@ -223,9 +226,9 @@ Visualization Manager: Name: PoseGraph Enabled: true Global Options: - Background Color: 255; 255; 255 + Background Color: 0; 0; 0 Default Light: true - Fixed Frame: world + Fixed Frame: odom Frame Rate: 30 Name: root Tools: @@ -236,7 +239,10 @@ Visualization Manager: - Class: rviz/FocusCamera - Class: rviz/Measure - Class: rviz/SetInitialPose + Theta std deviation: 0.2617993950843811 Topic: /initialpose + X std deviation: 0.5 + Y std deviation: 0.5 - Class: rviz/SetGoal Topic: /move_base_simple/goal - Class: rviz/PublishPoint @@ -246,31 +252,30 @@ Visualization Manager: Views: Current: Class: rviz/ThirdPersonFollower - Distance: 17.9643116 + Distance: 17.964311599731445 Enable Stereo Rendering: - Stereo Eye Separation: 0.0599999987 + Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false Field of View: 0.7853981852531433 Focal Point: - X: 0.217152834 - Y: 0.697479725 - Z: 4.14300621e-06 + X: 0.21715283393859863 + Y: 0.6974797248840332 + Z: 4.143006208323641e-06 Focal Shape Fixed Size: true - Focal Shape Size: 0.0500000007 + Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: Current View - Near Clip Distance: 0.00999999978 - Pitch: 0.52479744 + Near Clip Distance: 0.009999999776482582 + Pitch: 0.5247974395751953 Target Frame: base_link - Value: ThirdPersonFollower (rviz) - Yaw: 2.69867611 + Yaw: 2.698676109313965 Saved: - Class: rviz/ThirdPersonFollower - Distance: 6.81472015 + Distance: 6.814720153808594 Enable Stereo Rendering: - Stereo Eye Separation: 0.0599999987 + Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false @@ -280,25 +285,24 @@ Visualization Manager: Y: 0 Z: 0 Focal Shape Fixed Size: true - Focal Shape Size: 0.0500000007 + Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: ThirdPersonFollower - Near Clip Distance: 0.00999999978 - Pitch: 0.495398402 + Near Clip Distance: 0.009999999776482582 + Pitch: 0.4953984022140503 Target Frame: base_link - Value: ThirdPersonFollower (rviz) - Yaw: 3.04540014 + Yaw: 3.0454001426696777 Window Geometry: Debug Img: collapsed: false Displays: collapsed: false - Height: 2082 + Height: 1371 Hide Left Dock: false Hide Right Dock: true Left Img: collapsed: false - QMainWindow State: 000000ff00000000fd0000000400000000000002660000074ffc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000007100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d0000029f000000fd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000016004c006500660074002000430061006d0065007200610000000222000001490000000000000000fb00000010004c00650066007400200049006d006701000002e7000002260000002600fffffffb000000120044006500620075006700200049006d00670100000518000002740000002600fffffffb0000000e003200440020004d00650073006800000004350000009f0000000000000000000000010000019000000569fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000569000000e900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007540000005cfc0100000002fb0000000800540069006d00650100000000000007540000059600fffffffb0000000800540069006d00650100000000000004500000000000000000000004e30000074f00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd000000040000000000000266000004a3fc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003b000001ab000000c700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000016004c006500660074002000430061006d0065007200610000000222000001490000000000000000fb00000010004c00650066007400200049006d006701000001ec0000015d0000001600fffffffb000000120044006500620075006700200049006d0067010000034f0000018f0000001600fffffffb0000000e003200440020004d00650073006800000004350000009f0000000000000000000000010000019000000569fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000569000000a000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007540000005cfc0100000002fb0000000800540069006d00650100000000000007540000030700fffffffb0000000800540069006d00650100000000000004500000000000000000000004e8000004a300000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -308,5 +312,5 @@ Window Geometry: Views: collapsed: true Width: 1876 - X: 1964 - Y: 36 + X: 1582 + Y: 43 From 75105b497ca80391e777cd8b5b3892e07a8adc2f Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Fri, 7 Feb 2025 11:34:51 -0400 Subject: [PATCH 2/8] Addressing PR comments --- README.md | 2 ++ docker/Dockerfile | 27 ++++++++++++++++++--------- docker/README.md | 9 +++++---- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0f9ad393..863b2800 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ We kindly ask to cite our paper if you find this library useful: # 1. Installation +**If you use an Ubuntu version that is newer than 20.04, it is highly recommended that you use Docker due to avoid ROS imcompatibility issues. See `docker` directory for instructions.** + ## A. Prerequisities - Install ROS by following [our reference](./docs/ros_installation.md), or the official [ROS website](https://www.ros.org/install/). diff --git a/docker/Dockerfile b/docker/Dockerfile index c8b607c4..8bd758a0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,14 @@ FROM ros:noetic-ros-base -ENV DEBIAN_FRONTEND=noninteractive +# Some ROS dependencies require user input for keyboard version. +# This prevents those processes from stalling the install process. +ENV DEBIAN_FRONTEND=noninteractive + +#https://github.com/MIT-SPARK/Kimera-VIO-ROS.git +# https://github.com/Virtana/Kimera-VIO-ROS.git +ARG url=https://github.com/MIT-SPARK/Kimera-VIO-ROS.git +ARG branch=master +ARG build_threads=4 RUN apt-get update && apt-get install -y --no-install-recommends apt-utils RUN apt-get install -y ros-noetic-image-geometry ros-noetic-pcl-ros \ @@ -15,10 +23,11 @@ RUN apt-get install -y ros-noetic-image-geometry ros-noetic-pcl-ros \ # libtbb recommended for speed: \ libtbb-dev \ # for use with rviz - xvfb + xvfb RUN mkdir -p /catkin_ws/src/ -RUN git clone https://github.com/MIT-SPARK/Kimera-VIO-ROS.git /catkin_ws/src/Kimera-VIO-ROS +RUN git clone ${url} /catkin_ws/src/Kimera-VIO-ROS +RUN cd /catkin_ws/src/Kimera-VIO-ROS && git checkout origin/${branch} RUN cd /catkin_ws/src/ && wstool init && \ wstool merge Kimera-VIO-ROS/install/kimera_vio_ros_https.rosinstall && wstool update @@ -26,14 +35,14 @@ RUN cd /catkin_ws/src/ && wstool init && \ # Build catkin workspace RUN apt-get install -y ros-noetic-image-pipeline ros-noetic-geometry ros-noetic-rviz -# Downloading EuRoC bag file for demo -RUN apt-get install -y wget && \ - wget -P /catkin_ws/ http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/vicon_room1/V1_01_easy/V1_01_easy.bag - RUN . /opt/ros/noetic/setup.sh && cd /catkin_ws && \ catkin init && catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ - catkin build -j4 + catkin build -j${build_threads} + +# Download EuRoC bag file for demo +RUN apt-get install -y wget && \ + wget -P /catkin_ws/ http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/vicon_room1/V1_01_easy/V1_01_easy.bag -# Setting up bashrc +# Add to bashrc so user doesn't have to manually do this in every new ROS terminal. RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc RUN echo "source /catkin_ws/devel/setup.bash" >> ~/.bashrc diff --git a/docker/README.md b/docker/README.md index 399402b0..07fea36e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -5,15 +5,16 @@ To build the container, in this directory, run the following: ``` docker build -t kimera_vio_ros:latest . ``` -To run the container while being able to use RViz, run the following command: +To run the container, run the following command. This script allows X11 forwarding, which allows Rviz to be used with the container. ``` -./docker_test.bash [optional container name; default is kimera_vio_ros] +./docker_test.bash [optional image name; default is kimera_vio_ros] ``` ## Running the EuRoC demonstration with Rviz -For running the EuRoC demonstration with Rviz, simply follow the instructions [here](https://github.com/MIT-SPARK/Kimera-VIO-ROS?tab=readme-ov-file#online). +For running the EuRoC demonstration with Rviz, follow the instructions [here](https://github.com/MIT-SPARK/Kimera-VIO-ROS?tab=readme-ov-file#online). The bag file path you will need to specify is `/catkin_ws/V1_01_easy.bag`. -### Possible errors: +### Possible errors: * If your trajectory tracking looks incorrect immediately, update the `autoInitialize` field from 0 to 1 in `/catkin_ws/src/Kimera-VIO/params/Euroc/BackendParams.yaml`. +* An X server should be installed on your local machine to allow Rviz to be used with the container. From 7acc03a2fb17f7b475cb7851bd7a7ad59ae78a96 Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Mon, 10 Feb 2025 13:30:42 -0400 Subject: [PATCH 3/8] Only included for testing. Revert after --- install/kimera_vio_ros_https.rosinstall | 4 ---- 1 file changed, 4 deletions(-) diff --git a/install/kimera_vio_ros_https.rosinstall b/install/kimera_vio_ros_https.rosinstall index 1754c6a1..d33d218b 100644 --- a/install/kimera_vio_ros_https.rosinstall +++ b/install/kimera_vio_ros_https.rosinstall @@ -38,10 +38,6 @@ local-name: Kimera-VIO uri: https://github.com/MIT-SPARK/Kimera-VIO.git version: master -- git: - local-name: Kimera-VIO-ROS - uri: https://github.com/MIT-SPARK/Kimera-VIO-ROS.git - version: master - git: local-name: glog_catkin uri: https://github.com/ethz-asl/glog_catkin.git From 9cce03af1b5620b0f57b93a32789cc4efe58a79c Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Thu, 13 Feb 2025 11:40:40 -0400 Subject: [PATCH 4/8] Adding changes to support building from a branch on a fork for improved user convenience --- docker/Dockerfile | 18 ++++++------------ docker/README.md | 26 ++++++++++++++++++++++---- install/kimera_vio_ros_ssh.rosinstall | 4 ---- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8bd758a0..be054385 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,11 +4,9 @@ FROM ros:noetic-ros-base # This prevents those processes from stalling the install process. ENV DEBIAN_FRONTEND=noninteractive -#https://github.com/MIT-SPARK/Kimera-VIO-ROS.git -# https://github.com/Virtana/Kimera-VIO-ROS.git -ARG url=https://github.com/MIT-SPARK/Kimera-VIO-ROS.git -ARG branch=master -ARG build_threads=4 +ARG URL=https://github.com/MIT-SPARK/Kimera-VIO-ROS.git +ARG BRANCH=master +ARG THREADS=4 RUN apt-get update && apt-get install -y --no-install-recommends apt-utils RUN apt-get install -y ros-noetic-image-geometry ros-noetic-pcl-ros \ @@ -26,8 +24,8 @@ RUN apt-get install -y ros-noetic-image-geometry ros-noetic-pcl-ros \ xvfb RUN mkdir -p /catkin_ws/src/ -RUN git clone ${url} /catkin_ws/src/Kimera-VIO-ROS -RUN cd /catkin_ws/src/Kimera-VIO-ROS && git checkout origin/${branch} +RUN git clone ${URL} /catkin_ws/src/Kimera-VIO-ROS +RUN cd /catkin_ws/src/Kimera-VIO-ROS && git checkout origin/${BRANCH} RUN cd /catkin_ws/src/ && wstool init && \ wstool merge Kimera-VIO-ROS/install/kimera_vio_ros_https.rosinstall && wstool update @@ -37,11 +35,7 @@ RUN apt-get install -y ros-noetic-image-pipeline ros-noetic-geometry ros-noetic- RUN . /opt/ros/noetic/setup.sh && cd /catkin_ws && \ catkin init && catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ - catkin build -j${build_threads} - -# Download EuRoC bag file for demo -RUN apt-get install -y wget && \ - wget -P /catkin_ws/ http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/vicon_room1/V1_01_easy/V1_01_easy.bag + catkin build -j${THREADS} # Add to bashrc so user doesn't have to manually do this in every new ROS terminal. RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc diff --git a/docker/README.md b/docker/README.md index 07fea36e..e1f15c80 100644 --- a/docker/README.md +++ b/docker/README.md @@ -5,16 +5,34 @@ To build the container, in this directory, run the following: ``` docker build -t kimera_vio_ros:latest . ``` +The Dockerfile also provide build arguments which allow the user to specify: +1. URL (default: https://github.com/MIT-SPARK/Kimera-VIO-ROS.git)- The URL for the repository that you want to clone. This is useful when developing using a fork. +2. BRANCH (default: master) - The branch on the _remote_ repository that should be checked out to. Also useful when doing development. +3. THREADS (default: 4)- The number of threads to use when building with catkin. + +Example use with these flags: +``` +docker build -t kimera_vio_ros:latest \ + --build-arg URL=https://github.com/MIT-SPARK/Kimera-VIO-ROS.git \ + --build-arg BRANCH=master \ + --build-arg THREADS=8 . +``` + To run the container, run the following command. This script allows X11 forwarding, which allows Rviz to be used with the container. ``` ./docker_test.bash [optional image name; default is kimera_vio_ros] ``` ## Running the EuRoC demonstration with Rviz -For running the EuRoC demonstration with Rviz, follow the instructions [here](https://github.com/MIT-SPARK/Kimera-VIO-ROS?tab=readme-ov-file#online). +For running the EuRoC demonstration with Rviz, follow the instructions [here](https://github.com/MIT-SPARK/Kimera-VIO-ROS?tab=readme-ov-file#2-usage). + +These instructions mention running various commands in multiple terminals. This can be done with Docker in the following ways: -The bag file path you will need to specify is `/catkin_ws/V1_01_easy.bag`. +1. Using `docker exec` [commands](https://docs.docker.com/reference/cli/docker/container/exec/). +2. If you are using VS Code, you can use the Dev Containers [plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) to connect to your container and use terminals from within VS Code. +3. Using [tmux](https://www.redhat.com/en/blog/introduction-tmux-linux) for terminal multiplexing. -### Possible errors: -* If your trajectory tracking looks incorrect immediately, update the `autoInitialize` field from 0 to 1 in `/catkin_ws/src/Kimera-VIO/params/Euroc/BackendParams.yaml`. +## Possible errors: +* If your trajectory tracking looks incorrect immediately on running, update the `autoInitialize` field from 0 to 1 in `/catkin_ws/src/Kimera-VIO/params/Euroc/BackendParams.yaml`. * An X server should be installed on your local machine to allow Rviz to be used with the container. +* Currently, the default number of jobs for building is set to 4. With a 13th Gen Intel i7-1360P Processor, this takes up to ~8GB of RAM with no other applications running. You may want to reduce the number of jobs if your machine does not have enough memory. diff --git a/install/kimera_vio_ros_ssh.rosinstall b/install/kimera_vio_ros_ssh.rosinstall index 8a67e9f4..2a3ff2e2 100644 --- a/install/kimera_vio_ros_ssh.rosinstall +++ b/install/kimera_vio_ros_ssh.rosinstall @@ -38,10 +38,6 @@ local-name: Kimera-VIO uri: git@github.com:MIT-SPARK/Kimera-VIO.git version: master -- git: - local-name: Kimera-VIO-ROS - uri: git@github.com:MIT-SPARK/Kimera-VIO-ROS.git - version: master - git: local-name: glog_catkin uri: git@github.com:ethz-asl/glog_catkin.git From e0c32c34b1f3bd3b7bd57193c3362e3df728106d Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Fri, 28 Feb 2025 14:30:10 -0400 Subject: [PATCH 5/8] resolving rviz segfault issue...probably --- docker/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index be054385..dcf99c40 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -40,3 +40,6 @@ RUN . /opt/ros/noetic/setup.sh && cd /catkin_ws && \ # Add to bashrc so user doesn't have to manually do this in every new ROS terminal. RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc RUN echo "source /catkin_ws/devel/setup.bash" >> ~/.bashrc + +# Resolves an issue where Rviz seg faults on older intel processors +RUN echo "export LIBGL_ALWAYS_SOFTWARE=1" >> ~/.bashrc \ No newline at end of file From eea7e298ab85dd4d46df47b6ec7486e0a1be1fde Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Fri, 28 Feb 2025 15:04:04 -0400 Subject: [PATCH 6/8] rviz file cleanup to get rid of clutter in PR changes --- rviz/kimera_vio_euroc.rviz | 66 +++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/rviz/kimera_vio_euroc.rviz b/rviz/kimera_vio_euroc.rviz index f4694a8b..07f1f281 100644 --- a/rviz/kimera_vio_euroc.rviz +++ b/rviz/kimera_vio_euroc.rviz @@ -15,12 +15,12 @@ Panels: - /2D Nav Goal1 - /Publish Point1 Name: Tool Properties - Splitter Ratio: 0.5886790156364441 + Splitter Ratio: 0.588679016 - Class: rviz/Views Expanded: - /Current View1 Name: Views - Splitter Ratio: 0.7583643198013306 + Splitter Ratio: 0.75836432 - Class: rviz/Time Name: Time SyncMode: 0 @@ -83,7 +83,7 @@ Visualization Manager: Queue Size: 10 Selectable: true Size (Pixels): 3 - Size (m): 0.019999999552965164 + Size (m): 0.0199999996 Style: Spheres Topic: /kimera_vio_ros/time_horizon_pointcloud Unreliable: false @@ -117,7 +117,7 @@ Visualization Manager: - Class: mesh_rviz_plugins/TexturedMesh Enabled: true Name: 3D Mesh Textured - Normal Size: 0.05000000074505806 + Normal Size: 0.0500000007 Phong Shading: true Point Size: 1 Polygon Mode: SOLID @@ -129,7 +129,7 @@ Visualization Manager: Texture Transport Hint: raw Texture topic: /kimera_vio_ros/kimera_vio_ros_node/feature_tracks Value: true - - Angle Tolerance: 0.10000000149011612 + - Angle Tolerance: 0.100000001 Class: rviz/Odometry Covariance: Orientation: @@ -141,7 +141,7 @@ Visualization Manager: Scale: 1 Value: true Position: - Alpha: 0.30000001192092896 + Alpha: 0.300000012 Color: 204; 51; 204 Scale: 1 Value: true @@ -149,17 +149,17 @@ Visualization Manager: Enabled: true Keep: 1 Name: Odometry - Position Tolerance: 0.10000000149011612 + Position Tolerance: 0.100000001 Queue Size: 10 Shape: Alpha: 1 - Axes Length: 0.30000001192092896 - Axes Radius: 0.009999999776482582 + Axes Length: 0.300000012 + Axes Radius: 0.00999999978 Color: 255; 25; 0 - Head Length: 0.30000001192092896 - Head Radius: 0.10000000149011612 + Head Length: 0.300000012 + Head Radius: 0.100000001 Shaft Length: 1 - Shaft Radius: 0.05000000074505806 + Shaft Radius: 0.0500000007 Value: Axes Topic: /kimera_vio_ros/odometry Unreliable: false @@ -203,11 +203,11 @@ Visualization Manager: Class: rviz/Path Color: 25; 255; 0 Enabled: false - Head Diameter: 0.30000001192092896 - Head Length: 0.20000000298023224 - Length: 0.30000001192092896 + Head Diameter: 0.300000012 + Head Length: 0.200000003 + Length: 0.300000012 Line Style: Lines - Line Width: 0.029999999329447746 + Line Width: 0.0299999993 Name: PGO Trajectory Offset: X: 0 @@ -216,9 +216,9 @@ Visualization Manager: Pose Color: 255; 85; 255 Pose Style: None Queue Size: 10 - Radius: 0.029999999329447746 - Shaft Diameter: 0.10000000149011612 - Shaft Length: 0.10000000149011612 + Radius: 0.0299999993 + Shaft Diameter: 0.100000001 + Shaft Length: 0.100000001 Topic: /kimera_vio_ros/optimized_trajectory Unreliable: false Value: false @@ -252,17 +252,17 @@ Visualization Manager: Views: Current: Class: rviz/ThirdPersonFollower - Distance: 17.964311599731445 + Distance: 17.9643116 Enable Stereo Rendering: - Stereo Eye Separation: 0.05999999865889549 + Stereo Eye Separation: 0.0599999987 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false Field of View: 0.7853981852531433 Focal Point: - X: 0.21715283393859863 - Y: 0.6974797248840332 - Z: 4.143006208323641e-06 + X: 0.217152834 + Y: 0.697479725 + Z: 4.14300621e-06 Focal Shape Fixed Size: true Focal Shape Size: 0.05000000074505806 Invert Z Axis: false @@ -273,9 +273,9 @@ Visualization Manager: Yaw: 2.698676109313965 Saved: - Class: rviz/ThirdPersonFollower - Distance: 6.814720153808594 + Distance: 6.81472015 Enable Stereo Rendering: - Stereo Eye Separation: 0.05999999865889549 + Stereo Eye Separation: 0.0599999987 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false @@ -285,11 +285,11 @@ Visualization Manager: Y: 0 Z: 0 Focal Shape Fixed Size: true - Focal Shape Size: 0.05000000074505806 + Focal Shape Size: 0.0500000007 Invert Z Axis: false Name: ThirdPersonFollower - Near Clip Distance: 0.009999999776482582 - Pitch: 0.4953984022140503 + Near Clip Distance: 0.00999999978 + Pitch: 0.495398402 Target Frame: base_link Yaw: 3.0454001426696777 Window Geometry: @@ -297,12 +297,12 @@ Window Geometry: collapsed: false Displays: collapsed: false - Height: 1371 + Height: 2082 Hide Left Dock: false Hide Right Dock: true Left Img: collapsed: false - QMainWindow State: 000000ff00000000fd000000040000000000000266000004a3fc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003b000001ab000000c700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000016004c006500660074002000430061006d0065007200610000000222000001490000000000000000fb00000010004c00650066007400200049006d006701000001ec0000015d0000001600fffffffb000000120044006500620075006700200049006d0067010000034f0000018f0000001600fffffffb0000000e003200440020004d00650073006800000004350000009f0000000000000000000000010000019000000569fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000569000000a000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007540000005cfc0100000002fb0000000800540069006d00650100000000000007540000030700fffffffb0000000800540069006d00650100000000000004500000000000000000000004e8000004a300000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd0000000400000000000002660000074ffc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000007100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d0000029f000000fd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000016004c006500660074002000430061006d0065007200610000000222000001490000000000000000fb00000010004c00650066007400200049006d006701000002e7000002260000002600fffffffb000000120044006500620075006700200049006d00670100000518000002740000002600fffffffb0000000e003200440020004d00650073006800000004350000009f0000000000000000000000010000019000000569fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000569000000e900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007540000005cfc0100000002fb0000000800540069006d00650100000000000007540000059600fffffffb0000000800540069006d00650100000000000004500000000000000000000004e30000074f00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -312,5 +312,5 @@ Window Geometry: Views: collapsed: true Width: 1876 - X: 1582 - Y: 43 + X: 1964 + Y: 36 From 51f48c6fa6b6ed6d3ed6b104b15ac1ebf18425d7 Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Fri, 28 Feb 2025 15:07:10 -0400 Subject: [PATCH 7/8] Missed something in the last commit --- rviz/kimera_vio_euroc.rviz | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rviz/kimera_vio_euroc.rviz b/rviz/kimera_vio_euroc.rviz index 07f1f281..7417cc6f 100644 --- a/rviz/kimera_vio_euroc.rviz +++ b/rviz/kimera_vio_euroc.rviz @@ -264,11 +264,11 @@ Visualization Manager: Y: 0.697479725 Z: 4.14300621e-06 Focal Shape Fixed Size: true - Focal Shape Size: 0.05000000074505806 + Focal Shape Size: 0.0500000007 Invert Z Axis: false Name: Current View - Near Clip Distance: 0.009999999776482582 - Pitch: 0.5247974395751953 + Near Clip Distance: 0.00999999978 + Pitch: 0.52479744 Target Frame: base_link Yaw: 2.698676109313965 Saved: From c34630944b65653a5cc6d1e964bec16062d63f16 Mon Sep 17 00:00:00 2001 From: Sarika Ramroop Date: Wed, 5 Mar 2025 09:30:34 -0400 Subject: [PATCH 8/8] Updating readme to reflect bug discovered during review on some devices --- docker/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/README.md b/docker/README.md index e1f15c80..fcda74ef 100644 --- a/docker/README.md +++ b/docker/README.md @@ -34,5 +34,6 @@ These instructions mention running various commands in multiple terminals. This ## Possible errors: * If your trajectory tracking looks incorrect immediately on running, update the `autoInitialize` field from 0 to 1 in `/catkin_ws/src/Kimera-VIO/params/Euroc/BackendParams.yaml`. + * In some configurations rviz seg faults if this value is 0. The exact cause is unknown, but will be investigated and fixed if possible. * An X server should be installed on your local machine to allow Rviz to be used with the container. * Currently, the default number of jobs for building is set to 4. With a 13th Gen Intel i7-1360P Processor, this takes up to ~8GB of RAM with no other applications running. You may want to reduce the number of jobs if your machine does not have enough memory.