This repository contains the files required to install Docker and ROS. Go through the README file, please.
- Install Visual Studio Code from the Microsoft Store. (Store > Search for "VS Code" > Get)
- Search for "Turn Windows features on and off".
- Enable "Windows Hypervisor platform" and "Windows Subsystem for Linux".
- Start Docker Desktop and ensure it is running.
- Docker Setup Video (up to 5:48) (Note: Download Humble Desktop Full)
- Download Version: Ubuntu 22.04 LTS from microsoft store
- Ubuntu on WSL2 Installation Guide
-
Open the Ubuntu Terminal:
- Search for "Ubuntu" in the Windows Start menu and open it.
-
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.
-
Start Docker Desktop:
- Open Docker Desktop from the Windows Start menu.
-
Navigate to Settings:
- In Docker Desktop, click the Settings button.
-
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.
-
Apply & Restart:
- Click the Apply & Restart button to apply the changes.
-
Open Command Prompt or PowerShell on your Windows machine.
-
Run the following command to set Ubuntu 22.04 as the default WSL version:
wsl.exe --set-default Ubuntu 22.04
-
Open VS Code in the desired folder.
-
Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window.
-
Search for "Dev Containers" and install the "Remote Development" extension pack.
- Click on the bottom-left corner (left to the launch pad).
- Select "Reopen in Container".
-
Add configuration to the data folder.
-
Search for "ROS" and select "Humble".
- Select "Desktop Full".
Follow the steps below to set up and run the moving robot simulation using Ignition Gazebo.
- Ensure you have Ignition Gazebo installed and properly configured.
- Open Visual Studio Code (VS Code) with the necessary extensions for Docker.
-
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.
- Download the robot simulation file from the following link:
-
Open the Terminal in VS Code
-
Run the Simulation
- Execute the following command to start the simulation:
ign gazebo moving_robot.sdf
- Execute the following command to start the simulation:
-
Access the Gazebo Interface
-
Configure the Robot Control
- Click on the three dots appearing at the top of the interface and search for Key Publisher.
-
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}"
- In the new terminal, run the following command to publish velocity commands:
-
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.
-
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:
- Left ➞
16777234
➞linear: {x: 0.0}, angular: {z: 0.5}
- Up ➞
16777235
➞linear: {x: 0.5}, angular: {z: 0.0}
- Right ➞
16777236
➞linear: {x: 0.0}, angular: {z: -0.5}
- Down ➞
16777237
➞linear: {x: -0.5}, angular: {z: 0.0}
- Left ➞
- To control the robot using keyboard inputs, run the following command in the terminal:
Ensure that the simulation is running smoothly by monitoring the Gazebo interface for any errors.
Happy Learning!