# Depth-VSLAM
Source: [https://docs.qualcomm.com/doc/80-65220-2/topic/depth-vslam_5_3_4.html](https://docs.qualcomm.com/doc/80-65220-2/topic/depth-vslam_5_3_4.html)
vSLAM can be based on either mono camera or 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-65220-2/topic/depth-vslam_5_3_4.html#ID-concept-d32488e7122__section_smc_jqz_vbc).
## Use cases
**Prerequisites:**
- The QIRP SDK and dependencies are installed, see [Build the software](https://docs.qualcomm.com/doc/80-65220-2/topic/build-the-software_4_1.html) and [Flash and install](https://docs.qualcomm.com/doc/80-65220-2/topic/flash-and-install_4_3.html).
- `SSH` is enabled in ‘Permissive’ mode with the steps mentioned in [How to SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html#how-to-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-keyboardCopy to clipboard
1. Connect 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) export HOME=/opt
(ssh) source /opt/qcom/qirp-sdk/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 set up in this step.
3. In terminal 1, launch `realsense2_camera` in depth
mode.
(ssh) setenforce 0
(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=/opt/qcom/qirp-sdk/data/misc/vwslam/Configuration/vslam-node_profile.xml
(ssh) cd /opt/qcom/qirp-sdk/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. Perform the following configurations to show the result in Rviz2 on your Ubuntu PC.
1. Install Rviz2 according to [Install Rviz2](https://docs.qualcomm.com/doc/80-65220-2/topic/install-rviz2_5_1_3.html).
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 | /opt/qcom/qirf-sdk/data/misc/vwslam/Configuration/rgbdWSlam.cfg
/opt/qcom/qirf-sdk/data/misc/vwslam/vslam.cfg Copy to clipboard |
rgbdWSlam.cfg file configures parameters ofvslam.cfg file configures hardware parameters of