All Projects → Aryaman22102002 → Wall-e-simulation-ros2

Aryaman22102002 / Wall-e-simulation-ros2

Licence: MIT license
Self-balancing and line-following bot simulation

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects
shell
77523 projects

Projects that are alternatives of or similar to Wall-e-simulation-ros2

my ROS mobile robot
Differential drive mobile robot using ROS.
Stars: ✭ 123 (+373.08%)
Mutual labels:  rviz
mycobot ros
A ros package for myCobot.
Stars: ✭ 76 (+192.31%)
Mutual labels:  rviz
microstrain inertial
ROS driver for all of MicroStrain's current G and C series products. To learn more visit
Stars: ✭ 44 (+69.23%)
Mutual labels:  ros2-foxy
isaac ros apriltag
CUDA-accelerated Apriltag detection
Stars: ✭ 42 (+61.54%)
Mutual labels:  ros2-foxy
travesim
Gazebo simulation environment for IEEE Very Small Size Soccer robots
Stars: ✭ 28 (+7.69%)
Mutual labels:  gazebo-simulator
ddpg biped
Repository for Planar Bipedal walking robot in Gazebo environment using Deep Deterministic Policy Gradient(DDPG) using TensorFlow.
Stars: ✭ 65 (+150%)
Mutual labels:  gazebo-simulator
annotate
Create 3D labelled bounding boxes in RViz
Stars: ✭ 104 (+300%)
Mutual labels:  rviz
diffbot
DiffBot is an autonomous 2wd differential drive robot using ROS Noetic on a Raspberry Pi 4 B. With its SLAMTEC Lidar and the ROS Control hardware interface it's capable of navigating in an environment using the ROS Navigation stack and making use of SLAM algorithms to create maps of unknown environments.
Stars: ✭ 172 (+561.54%)
Mutual labels:  rviz
dynamixel control
ros2_control packages for ROBOTIS Dynamixel
Stars: ✭ 69 (+165.38%)
Mutual labels:  ros2-foxy
qml ros plugin
Connects QML to ROS
Stars: ✭ 19 (-26.92%)
Mutual labels:  rviz
turtlebot rrt
Rapidly Exploring Random Tree (RRT) global path planning plugin for ROS Kinetic Kame
Stars: ✭ 86 (+230.77%)
Mutual labels:  rviz
SASensorProcessing
ROS node to create pointcloud out of stereo images from the KITTI Vision Benchmark Suite
Stars: ✭ 26 (+0%)
Mutual labels:  rviz
ROS
ROS机器人操作系统 学习(写于2020年夏)
Stars: ✭ 102 (+292.31%)
Mutual labels:  rviz
ROS-GPS
GPS Localization with ROS, OSM and rviz
Stars: ✭ 19 (-26.92%)
Mutual labels:  rviz
ignition vs gazebo
Tests of gazebo and ignition ROS simulators
Stars: ✭ 18 (-30.77%)
Mutual labels:  gazebo-simulator
summit xl sim
Packages for the simulation of the Summit XL, Summit XL HL and Summit-X (including X-WAM) robots
Stars: ✭ 32 (+23.08%)
Mutual labels:  gazebo-simulator
gazebo video monitors
Various Gazebo video plugins for capturing the operation of a robot, for monitoring during tests, etc.
Stars: ✭ 13 (-50%)
Mutual labels:  gazebo-simulator
dvrk env
Accurate URDF and SDF models of Intuitive Surgical's daVinici Research Kit (dVRK)
Stars: ✭ 13 (-50%)
Mutual labels:  gazebo-simulator
isaac ros visual odometry
Visual odometry package based on hardware-accelerated NVIDIA Elbrus library with world class quality and performance.
Stars: ✭ 101 (+288.46%)
Mutual labels:  ros2-foxy

Wall-e-simulation-ros2

A simulation of a self-balancing and line following bot using ROS2

Table of Contents

About the Project

Screenshot from 2021-10-16 01-21-54 Screenshot from 2021-10-16 01-22-21

  • The aim of the project was to design a bot and implement self-balancing and line-following algorithms on it.
  • The designing of the bot is done using solidworks and the self-balancing and line-following have been achieved using PID.

Tech Stack

  • ROS2 Foxy

Tools

  • Gazebo Version: 11.0
  • RViz
  • SolidWorks
  • Autocad
  • MS Paint

File Structure

   ┣ 📂Bot_SolidWorks_Parts
   ┃ ┗ 📜WallE_Simulation_ROS2.zip               # Zip file containing all the SolidWorks files for our bot
   ┣ 📂assets
   ┃ ┗ 📜Project_Report.pdf                      # Project Report
   ┃ ┗ 📜WallE.gif                               # Gif of WallE bot performing self-balancing and line-following together
   ┣ 📂config
   ┃ ┗ 📜joint_names_Wall-E-urdf1.yaml           # Configuration file for joints of the bot
   ┣ 📂launch                                    # All launch files
   ┃ ┣ 📜emptyworld.launch.py
   ┃ ┣ 📜gazebo.launch.py
   ┃ ┣ 📜gzclient.launch.py
   ┃ ┣ 📜gzserver.launch.py
   ┃ ┣ 📜line_following.launch.py                # Launch file for bot for line-following algorithm
   ┃ ┣ 📜robot_state_publisher.launch.py         
   ┃ ┣ 📜self_balancing.launch.py                # Launch file for bot for self-balancing algorithm
   ┃ ┣ 📜walle.launch.py                         # Launch file for bot for self-balancing and line-following combined algorithm
   ┣ 📂meshes                                    # Meshes for different parts of bot
   ┃ ┣ 📜base_link.STL
   ┃ ┣ 📜chassis.STL
   ┃ ┣ 📜leftwheel.STL
   ┃ ┗ 📜rightwheel.STL
   ┣ 📂models
   ┃ ┗ 📜combinedworld.png                       # The png which decides the design of the world in Gazebo(for combined algorithm)
   ┃ ┣ 📜course.material                         # The file which links the world file to the png of the world
   ┃ ┣ 📜course2.material                        # The file which links the world file to the png of the world(for combined algorithm)
   ┃ ┗ 📜redline.png                             # The png which decides the design of the world in Gazebo(for combined algorithm)  
   ┃ ┗ 📜sra.png                                 # The png which decides the design of the world in Gazebo
   ┣ 📂rviz
   ┃ ┗ 📜urdf_config.rviz                        # The file for rviz configuration
   ┣ 📂src                                       # All cpp codes are stored here
   ┃ ┣ 📜line_following.cpp                      # The line-following algorithm
   ┃ ┣ 📜self_balancing.cpp                      # The self-balancing algorithm
   ┃ ┣ 📜wall_e.cpp                              # The self-balancing and line-following combined algorithm
   ┣ 📂urdf                                      # The sdf files for bot are stored here 
   ┃ ┣ 📜walle.csv
   ┃ ┣ 📜walle.urdf   
   ┃ ┣ 📜walle.sdf                               # The sdf file for self-balancing bot
   ┃ ┣ 📜walle2.sdf                              # The sdf file for line-following bot
   ┃ ┣ 📜walle4.sdf                              # The sdf file for line-following and self-balancing combined bot
   ┣ 📂worlds
   ┃ ┗ 📜sra.world                               # The line-following path
   ┃ ┗ 📜sra2.world                              # The line-following and self-balancing combined path
   ┣ 📜.gitignore
   ┣ 📜CMakeLists.txt                            # Contains all the information regarding the packages to be imported
   ┣ 📜LICENSE
   ┣ 📜README.md
   ┣ 📜build.sh                                  # The script executes the build and source commands from within the package
   ┣ 📜export.log
   ┣ 📜package.xml                               # Contains all the information regarding the dependencies to be imported

Getting Started

Prerequisites

1. ROS2 Foxy
2. Gazebo Version: 11.0
3. RViz 
  • You can find the link for installtion of ROS2 Foxy in video format here and in text format here. Note that the video is for installing ROS2 Foxy on Ubuntu whereas you can find the the instructions according to your own operating system in the official documentation provided in the second link above.
  • The link to install Gazebo for Ubuntu is provided here. You can find the instructions to install different versions of Gazebo in the link provided above but using Gazebo 11.0 is recommed for ROS2 Foxy.
  • The link to install RViz on Ubuntu is provided here.

Installation

  1. Clone the repo
git clone https://github.com/Aryaman22102002/Wall-e-simulation-ros2.git

Configuration

The colour of the bot can be varied by the changing the colour in the material tag of the visual element in the bot's sdf. The list of all colours and materials available for Gazebo are avialable here.

Usage

  1. After cloning the repo, go into your ROS2 workspace and run the following commands:
colcon build

. install/setup.bash

  1. Now enter into the Wall-e-simulation-ros folder.

  2. For launching the self-balancing bot, enter the following command: ros2 launch my_bot self_balancing.launch.py

  3. For running the self-balancing code, enter the following command: ros2 run my_bot self_balancing

  4. For launching the line-following bot, enter the following command: ros2 launch my_bot line_following.launch.py

  5. For running the line-following code, enter the following command: ros2 run my_bot line_following

  6. For launching the self-balancing plus line-following combined bot, enter the following command: ros2 launch my_bot walle.launch.py

  7. For running the self-balancing plus line-following combined code, enter the following command: ros2 run my_bot wall_e

  8. Everytime you make a change in the code/files, you will have to execute the build and source commands mentioned in point number 1. Alternatively, you can run the build.sh script which will execute both the commands mentioned in point number 1 from within the ROS 2 package. It will take the package name as input and execute those commands so that you don't have to go to the root of your workspace to build and source everytime you make a change. First create an executable for the script using the following command: chmod +x build.sh

  9. After creating an executable for the build.sh script as instructed in point number 9, to run the script, enter the following command: . build.sh .

Theory and Approach

  • The approach was to first design our bot using SolidWorks. Then we used ROS2 and Gazebo to simulate it. The main theory and concept used for self-balancing and line-following was Proportional Inetgral Derivative(PID).
  • A PID controller is one kind of device used to control different process variables like pressure, flow, temperature, and speed in industrial applications. Here, we first wrote the algorithm for self-balancing the bot. Then we wrote the algorithm for line-following. Then we tried to combine the two and again do the PID tuning.
  • For self-balancing the bot, we need to keep the bot a bit above our desired angle since the bot is very fast and wiill fall down once it's past the desired angle. The pitch angle is required for self-balancing which is obtained from the Inertial Measurement Unit(IMU sensor) plug-in.
  • For making the bot follow the line, we need to first set the frame of the rgb camera which then helps us to decide our desired position which in turn helps us to find the error(i.e by how much is the bot off from the desired position). We then apply PID and decide the angular velcoity which should be given to the bot and in which direction.
  • For combining self-balancing and line-following algorithms, we need to ensure that the bot is balanced. Then only we can make it follow the line. At all times, the bot must give preference to balancing itself first and then following the line.
  • The following flow-chart describes the algorithm used for combining the self-balancing and line-following algorithms.

combined algorithm(1)

Results and Demo

The implementation of the self balancing and line following codes has been demonstarted in the following video.

githubrepo.mp4

Please turn on the volume.

Future Work

  • Combine self-balancing and line-following.
  • To implement the combined algorithm on hardware.
  • Implement maze solving algorithms.

Troubleshooting

  • Sometimes the self-balancing code will behave differently than the previous run. Try to stop the execution of the code and launch the bot again and run the code.
  • Always launch the bot and the codes from within the Wall-e-simulation-ros folder. Otherwise it may not the launch the world correctly.
  • Also sometimes Gazebo might not launch inspite of running the launch commands. In such cases, try entering the command killall gzserver and then launching the bot again.

Contributors

Acknowledgements and Resources

License

The license used for this project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].