Skip to content

Visualize KITTI data. Implement YOLOv5 and SGBM algorithms in ROS2 node.

Notifications You must be signed in to change notification settings

junmeng6025/ros2_kitti

Repository files navigation

ROS2 + KITTI: Objet detection & Stereo depth estimation

ROS Ubuntu Python

  • Visualize raw images and point cloud in ROS2
  • Implement object detection algorithm YOLOv5
  • Implement stereo depth estimation algorithm SGBM

Visualization

Software pipeline


Software pipeline


Prerequisitions

Install ROS2-galactic

  • For ROS2 install follow the official documentation

    What if I have to install ROS2 with ROS1 already in my PC?
    $\to$ Settings for ROS2 coexistence with ROS1.

  • Install tf-transformations

    sudo apt-get install ros-galactic-tf-transformations
    

    for other ros2 distors substitude the galactic with your distro name



Build and Run

Clone the repository to local

git clone https://github.com/junmeng6025/ros2_kitti.git

Install libiaries for YOLOv5

cd ros2_kitti
pip install -r requirements.txt
  • If you run into errors that claims missing some python libraries, please check requirements.txt in /colcon_ws/src/kitti_ros2/yolov5.
  • Or you can use rosdep to install dependencies automatically. (See below Possible issues)
  • Or install the missing libraries according to the error messages ...

Download KITTI dataset and extract

see Data preparation

Build the workspace

  • use colcon build command to generate executable files automatically
    cd ros2_kitti/colcon_ws
    ! ALWAYS make sure you've sourced ROS2 to your current terminal before "colcon build"
    source /opt/ros/galactic/setup.bash
    colcon build

    use the command echo ${ROS_DISTRO} to check the current ROS distro in your working Terminal
    make sure it returns galactic or other ROS2 distro

  • after build, copy the folder /data in
    /src/kitti_ros2/yolov5
    to
    /install/kitti_ros2/lib/python3.8/site-packages/yolov5

Launch the nodes

source the setup.sh to current terminal

# stay in the directory /ros2_kitti/colcon_ws
source install/setup.sh
ros2 launch kitti_ros2 kitti_stereo_detect.launch.py 

There are two other options:

  • B: Visualize KITTI data in Rviz without detection or depth estimation
    ros2 launch kitti_ros2 kitti_visualization.launch.py
  • C: Implement the detection but without depth estimation
    ros2 launch kitti_ros2 kitti_detect.launch.py 

Possible issues:

1) Coexist ROS1 and ROS2

Settings for ROS2 coexistence with ROS1.

2) Use rosdep or rosdepc ('c' for Chinese)

rosdepc is a tool that can help to install all the dependencies for a workspace automatically.

install and initialize rosdepc

sudo pip3 install rosdepc
sudo rosdepc init & rosdepc update

install dependencies for workspace

# cd to the workspace root path
rosdepc install -i --from-path src --rosdistro galactic -y

About

Visualize KITTI data. Implement YOLOv5 and SGBM algorithms in ROS2 node.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages