Skip to content

RB0609/differential_drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Indoor Navigation of a Differential-Dirve robot using 3D Lidar and Depth camera

image

Watch this below video for Navigation

dd_robot_10.mp4

ROS2 System Architecture

ros

Features

  • Robot simulation in a indoor environment in Gazebo Harmonic
  • Navigation (using Nav2 Stack) from Point A to Point B, using "Nav2goal" feature from Nav2 stack
  • Docker file included

Requirements

  • Ubuntu 24.04
  • ROS 2 Jazzy Jalisco
  • Gazebo Sim Harmonic
  • Nav2 Stack

Installation

  1. Git clone the repo for SImulation in Gazebo
    NOTE: Replace ros2_ws/with your own folder
cd ~/ros2_ws/src
git clone https://github.com/RB0609/differential_drive.git
  1. Build the Workspace
cd ~/ros2_ws
colcon build
source install/setup.bash
  1. Launch file in Gazebo and Rviz
ros2 launch dd_robot display.launch.py

Steps to Perform Navigation

In nav2_params.yaml file which is in config folder.

dd_robot/
└── config/  
    └── nav2_params.yaml    
map_server:
  ros__parameters:
    use_sim_time: true
    yaml_filename: "<path_to_file location>/map.yaml" #Here choose your own folder, where you store "map.yaml" file
    #topic_name: "map"
    #frame_id: "map"

in Terminal1:(First launch this file)

ros2 launch nav2_bringup rviz_launch.py 

For below code, careful with file location
map:=<path_to_file_location>/map.yaml
params_file:=<path_to_file_location>/nav2_params.yaml
below is the example usage
in Terminal2:

ros2 launch nav2_bringup bringup_launch.py   use_sim_time:=true   map:=/home/rakesh/map.yaml   params_file:=/home/rakesh/ros2_ws/src/differential_drive/dd_robot/config/nav2_params.yaml

Follow these steps to view this project

1. Prerequisites

  • OS: Linux with a graphical desktop (X11)
  • Docker installed and running

You do not need ROS 2 installed on the host.


2. Clone this repository

git clone https://github.com/RB0609/differential_drive.git
cd differential_drive    # this should contain the Dockerfile and src/

3. Build the Docker image

From the repo root where the Dokcerfile is:

docker build -t differential_drive_jazzy .

4. Run the container with GUI support (Gazebo)

On the host (not inside Docker), allow Docker to access your X server:

xhost +local:docker

Then start the container:

docker run -it \
  --name dd_container \
  --net=host \
  -e DISPLAY=$DISPLAY \
  -e QT_X11_NO_MITSHM=1 \
  -e LIBGL_ALWAYS_SOFTWARE=1 \
  -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
  differential_drive_jazzy

You’ll get a shell inside the container:

root@<container-id>:/ros2_ws#

5. Launch the simulation inside the container

Inside the container:

ros2 launch dd_robot display.launch.py

6. Open additional terminals inside the same container (for debugging)

You can open as many extra shells as you want in the same running container.
On the host, in a new terminal:

docker exec -it dd_container bash

Inside that new shell, you can run:

ros2 topic list
ros2 topic echo /odom
ros2 node list

Further work

  1. Plan to Include Turtlebot3 waffle model
  2. Working on Sim2Real

About

This contains scripts for simulating Differential-Drive robot in Gazebo environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published