# Depth-VSLAM
vSLAM can be based on either a mono camera or a depth camera. The depth-vslam sample can generate odometry continuously using the image sequence, IMU sequence, and wheel odometry sequence as the input. The odometry is from your robot.
The figure shows the pipeline of depth-vslam sample. The depth-vslam sample fuses depth information from the RealSense depth camera, IMU data from ICM42688 and odometry from your robot, and then outputs the pose and odometry. Depth-vslam sample supports target and targetless modes.

**Figure : Depth-VSLAM pipeline**
For information on the ROS nodes and topics used in the pipeline flow, see [Pipeline flow for depth-VSLAM](https://docs.qualcomm.com/doc/80-70017-265/topic/depth-vslam_5_3_4.html#pipeline-depth-vslam).
## Use cases
**Prerequisites:**
- The QIRP SDK and dependencies are installed, see [Build the software](https://docs.qualcomm.com/doc/80-70017-265/topic/build-the-software_4_1.html#build-the-software-4-1) and [Flash and install](https://docs.qualcomm.com/doc/80-70017-265/topic/flash-and-install_4_3.html#flash-and-install-4-3).
- `SSH` is enabled in ‘Permissive’ mode with the steps mentioned in [Log in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/how_to.html#use-ssh).
- The RealSense D455 camera is set up.
**Case 1: Run out-of-the-box depth-VLSAM**
**Steps:**
The sample follows this node sequence.
realsense2-camera in depth mode
qti-robot-amr-ctrl
depth-vslam
qti-robot-keyboard
Copy to clipboard
1. Connect the RealSense D455 camera and boot up your robot.
2. Start five terminals, and run the following commands in each terminal to set up QIRP SDK and ROS2 environment on the device.
Value range of `ROS_DOMAIN_ID`: [0, 232]
ssh root@[ip-addr]
(ssh) mount -o remount,rw /usr
(ssh) export HOME=/home
(ssh) source /usr/share/qirp-setup.sh
(ssh) source /usr/bin/ros_setup.bash
(ssh) export ROS_DOMAIN_ID=xx
Copy to clipboard
Note
In the following steps 3 to 7, each step is run in a separate terminal window that is set up in this step.
3. In terminal 1, launch `realsense2_camera` in depth mode.
(ssh) ros2 launch realsense2_camera rs_launch.py enable_sync:=true align_depth.enable:=true rgb_camera.profile:=848x480x30 depth_module.profile:=848x480x30
Copy to clipboard
4. In terminal 2, launch `qti_robot_amr_ctrl`.
(ssh) ros2 launch qti_robot_amr_ctrl qti_robot_amr_ctrl.launch.py
Copy to clipboard
Note
Replace this step with your robot bring-up commands.
5. In terminal 3, run `depth-vslam`.
(ssh) export FASTRTPS_DEFAULT_PROFILES_FILE=/usr/share/mono-vslam/Configuration/vslam-node_profile.xml
(ssh) cd /usr/lib/depth-vslam/
(ssh) chmod 777 depth-vslam
(ssh) ./depth-vslam
Copy to clipboard
The following log is shown in the terminal.

6. In terminal 4, run `qti_robot_keyboard`.
(ssh) ros2 run qti_robot_keyboard qti_keyboard
Copy to clipboard
Note
Replace this step with your keyboard commands.
7. In terminal 5, you can observe the output result by executing this command.
(ssh) ros2 topic echo /robot_odom
(ssh) ros2 topic echo /vslam_odom_raw
Copy to clipboard
8. To show the result in Rviz2 on your Ubuntu PC, perform the following configurations.
1. Install Rviz2 according to [Install Rviz2](https://docs.qualcomm.com/doc/80-70017-265/topic/install-rviz2_5_1_3.html#install-rviz2-5-1-3).
2. Select the frame as `/odom`.
3. Add `TF`, `Grid` by display type.
4. Add `vslam/labeled_img`, `odom`, and `robot_odom` by topic.

Table : Default configuration and output files for depth-vslam
| Files | Default path | Description |
| --- | --- | --- |
| Configuration file and path | /usr/share/mono-vslam/Configuration/rgbdWSlam.cfg
/usr/share/mono-vslam/Configuration/vslam.cfg
Copy to clipboard |
The rgbdWSlam.cfg file configures parameters of the depth-vslam algorithm, such as initialization mode.
The vslam.cfg file configures hardware parameters of depth-vslam, such as camera parameters.