Skip to content

erciitb/ROS-DOCKED_24-25_For_windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Docker and ROS Setup Guide

This repository contains the files required to install Docker and ROS. Go through the README file, please.

Visual Studio Code

Installation

  • Install Visual Studio Code from the Microsoft Store. (Store > Search for "VS Code" > Get)

Video Reference

Ubuntu and Docker Setup on Windows

Basic Setup

  1. Search for "Turn Windows features on and off".
  2. Enable "Windows Hypervisor platform" and "Windows Subsystem for Linux".

Screenshot 2024-07-27 110932 Screenshot 2024-07-27 113538


Docker

System Requirements and Installation

Windows

Starting Docker Desktop

  • Start Docker Desktop and ensure it is running.

Video Tutorial


Ubuntu

Installation and Setup

Step 1: Setting Up Ubuntu

  1. Open the Ubuntu Terminal:

    • Search for "Ubuntu" in the Windows Start menu and open it.
  2. Fill in the UNIX Name and Password:

    • During the first run, you'll be asked to create a UNIX username and password. Make sure to remember these details as they will be needed for future administrative tasks.

Step 2: Allowing Ubuntu to Run Docker

  1. Start Docker Desktop:

    • Open Docker Desktop from the Windows Start menu.
  2. Navigate to Settings:

    • In Docker Desktop, click the Settings button.
  3. Enable WSL 2 Engine:

    • Under the General tab, select the option Use WSL 2 based engine.
    • If your system supports WSL 2, this option will be turned on by default.
  4. Apply & Restart:

    • Click the Apply & Restart button to apply the changes.

Step 3: Set Ubuntu 22.04 as the Default WSL Version

  1. Open Command Prompt or PowerShell on your Windows machine.

  2. Run the following command to set Ubuntu 22.04 as the default WSL version:

    wsl.exe --set-default Ubuntu 22.04
    
    

Using VS Code with Docker

  1. Open VS Code in the desired folder.

  2. Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window.

  3. Search for "Dev Containers" and install the "Remote Development" extension pack.

image image

  1. Click on the bottom-left corner (left to the launch pad).

Screenshot 2024-07-27 115457

  1. Select "Reopen in Container".

image

  1. Add configuration to the data folder.

  2. Search for "ROS" and select "Humble".

image

  1. Select "Desktop Full".

image image

Moving Robot Simulation Instructions

Follow the steps below to set up and run the moving robot simulation using Ignition Gazebo.

Prerequisites

  • Ensure you have Ignition Gazebo installed and properly configured.
  • Open Visual Studio Code (VS Code) with the necessary extensions for Docker.

Steps

  1. Download the Simulation File

    • Download the robot simulation file from the following link:
       https://github.com/erciitb/ROS-DOCKED_24-25_For_windows.git
    • Save the downloaded file in the folder that you opened in VS Code.
  2. Open the Terminal in VS Code

    • Open the integrated terminal in VS Code. You should see a prompt similar to user@docker-host.
    • image
  3. Run the Simulation

    • Execute the following command to start the simulation:
      ign gazebo moving_robot.sdf
  4. Access the Gazebo Interface

    • The Gazebo interface will appear. It should look similar to the image below: Gazebo Interface
  5. Configure the Robot Control

    • Click on the three dots appearing at the top of the interface and search for Key Publisher.
  6. Open a New Terminal

    • In the new terminal, run the following command to publish velocity commands:
      ign topic -t "/cmd_vel" -m ignition.msgs.Twist -p "linear: {x: 0.5}, angular: {z: 0.05}"
  7. Start the Robot Movement

    • Your robot should now start moving in the simulation. Make sure to press the Play button in the Gazebo interface to begin the simulation.
  8. Control the Robot via Keyboard

    • To control the robot using keyboard inputs, run the following command in the terminal:
      ign topic -e -t /keyboard/keypress
    • The following keyboard mappings are available for controlling the robot:
      • Left16777234linear: {x: 0.0}, angular: {z: 0.5}
      • Up16777235linear: {x: 0.5}, angular: {z: 0.0}
      • Right16777236linear: {x: 0.0}, angular: {z: -0.5}
      • Down16777237linear: {x: -0.5}, angular: {z: 0.0}

Note

Ensure that the simulation is running smoothly by monitoring the Gazebo interface for any errors.

Happy Learning!

About

The resources for the session ROS:DOCKED

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published