Coder Social home page Coder Social logo

aaqibmahamood / a-simple-diff-drive-robot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8.01 MB

A Simple 2 wheel Differential Drive Robot designed in Fusion 360 and that is simulated in Gazebo and visualised in RViz.

License: MIT License

CMake 100.00%

a-simple-diff-drive-robot's Introduction

cover.png

ubuntu ROS

A Simple Differential Drive Robot

Welcome to the GitHub repository for a straightforward yet versatile robotics project! This repository hosts the code and simulation files for a 2-wheel robot with a caster, equipped with a lidar sensor for environment mapping using various SLAM (Simultaneous Localization and Mapping) packages.

Key Features:

  • Robot Design: The robot's mechanical design was crafted using Fusion 360, providing a detailed and realistic representation of the physical robot. The model was then exported as a URDF (Unified Robot Description Format) file for simulation purposes.

  • Simulation Environment: The robot comes to life in the Gazebo simulator, featuring a realistic physics engine for accurate behavior. Rviz is integrated into the simulation setup for visualizing sensor data and robot movements.

  • Mapping Capability: Gmapping SLAM package has been employed for mapping the environment. The robot, equipped with a lidar sensor, creates a 2D occupancy grid map of its surroundings, aiding in understanding and navigating within the simulated world.

  • Custom Gazebo World: To enhance the simulation experience, a custom world with various objects has been created in Gazebo. This allows for a more diverse testing environment, simulating real-world scenarios.

  • Teleoperation Control: While the robot does not possess autonomous navigation capabilities, it can be controlled using the teleop_key package. This enables users to remotely control the robot's movement, making it a hands-on and interactive experience.

How to Use:

  1. Clone this repository to your local machine using the following command:

    git clone https://github.com/aaqibmahamood/A-Simple-Diff-Drive-Robot.git
  2. Follow the provided documentation in the repository to set up the simulation environment and launch the robot in Gazebo along with Rviz.

  3. Control the robot using the teleop_key package to explore the simulated environment and observe its mapping capabilities.

Reporting Issues: If you encounter any issues or have suggestions for improvement, please raise an issue on the GitHub repository. Your feedback is valuable, and I will actively work to address and resolve any problems you may encounter.

Happy simulating!

Your stars, forks and PRs are welcome!

diff-drive.mp4.mp4

Table of Contents

0. Quick Start

Tested on ubuntu 20.04 LTS with ROS Noetic.

  1. Install ROS (Desktop-Full suggested).

  2. Install git.

    sudo apt install git
  3. Other dependence.

    sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy ros-noetic-teleop-twist-keyboard ros-noetic-amcl ros-noetic-map-server ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro ros-noetic-rqt-image-view ros-noetic-gmapping ros-noetic-navigation ros-noetic-robot-state-publisher ros-noetic-dwa-local-planner ros-noetic-joint-state-publisher-gui
  4. Clone this reposity.

    cd catkin_ws/src
    git clone https://github.com/aaqibmahamood/A-Simple-Diff-Drive-Robot.git
  5. Compile the code.

    cd /catkin_ws
    catkin_make
    # or
    # catkin build
    # you may need to install it by: sudo apt install python-catkin-tools

1. Model

Modelled in Fusion 360

Links and Joints:

  1. base_link
  2. lidar_1
  3. right_wheel_1
  4. left_wheel_1
  5. caster_1

*Both the right wheel and left wheel have been assigned Revolute Joints and lidar_1 has been assigned Rigid Joint with respect to base_link. Exported URDF file from Fusion360 using URDF_Exporter plugin.

2. Simulation

Run the Model

Run ROS Master

roscore

To Load the Robot in Gazebo simulator and rviz use the following commands in separate terminals:

  • Load Robot in Gazebo
roslaunch rmpbot01_description gazebo.launch
  • Start Rviz for visualisation
rviz
  • Pause Simulation in Gazebo pause.png

  • Add Robot Model in Rviz## 0. Quick Start

  • Add and Select Robot Model. robotmodel.png

  • Set Fixed Frame to base_link fixedframe.png fixedframe2.png

3. Gmapping

Open another terminal to run the following command for mapping using Gmapping package

  • Run Launch file having Gmapping Package
roslaunch rmpbot01_description mapping.launch
  • Add Robot Model in Rviz
  • Add and Select Map. map_add.png

  • Select Topic in Map to /map. map_topic

  • Add and Select Laserscan. laserscan.png

  • Set Topic to /scan. laserscan_topic.png

  • Increase the size parameter of the laser scan to 0.05(m) size.png

4. Control Robot Movement

Keyboard teleop mode:

The ~/catkin_ws/src/myrobot_control/scripts folder contains the myrobot_key node, which is the teleop node. There is already a standard teleop node implementation available (for the turtlebot), we simply reused the node. Then a remapping is done from the turtlebot_teleop_keyboard/cmd_vel to /cmd_vel of our robot in the keyboard_teleop.launch file.

To drive around the robot for mapping the world use teleop_twist_keyboard package - Open another terminal and run the following commands:

  • Start the teleop node:
roslaunch teleop_twist_keyboard teleop_twist_keyboard.py

Here are some keyboard controls for Teleop Twist Keyboard:

  1. Forward
  2. Backwards
  3. Stop
  4. Rotate left in place
  5. Rotate right in place teleop_key.png

Notice that the teleop node receives keypresses only when the terminal window is active. mapping.png

5. Saving Map

6. Acknowledgement

a-simple-diff-drive-robot's People

Contributors

aaqibmahamood avatar

Watchers

 avatar

a-simple-diff-drive-robot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.