Skip to content

Commit

Permalink
Merge pull request #2504 from JdeRobot/issue-2494
Browse files Browse the repository at this point in the history
Exercise docs update
  • Loading branch information
jmplaza authored Apr 29, 2024
2 parents 5306d5b + f0fd66f commit 999dd9f
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 98 deletions.
20 changes: 10 additions & 10 deletions _pages/exercises/AutonomousCars/autoparking.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ The objective of this practice is to implement the logic of a navigation algorit

2. Pull the current distribution of Robotics Academy Docker Image:

```bash
docker pull jderobot/robotics-academy:latest
```
```bash
docker pull jderobot/robotics-academy:latest
```

- In order to obtain optimal performance, Docker should be using multiple CPU cores. In case of Docker for Mac or Docker for Windows, the VM should be assigned a greater number of cores.

Expand All @@ -62,9 +62,9 @@ The objective of this practice is to implement the logic of a navigation algorit
### How to perform the exercises?
- Start a new docker container of the image and keep it running in the background:

```bash
docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```
```bash
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.

Expand All @@ -80,8 +80,8 @@ The objective of this practice is to implement the logic of a navigation algorit
In the launched webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!


Expand All @@ -104,8 +104,8 @@ while True:

## Robot API

* `from HAL import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `from GUI import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `HAL.getPose3d()` - to get all the position information
* `HAL.getPose3d().x` - to get the position of the robot (x coordinate)
* `HAL.getPose3d().y` - to get the position of the robot (y coordinate)
Expand Down
20 changes: 10 additions & 10 deletions _pages/exercises/AutonomousCars/follow_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ This is the preferred way for running the exercise.

2. Pull the current distribution of Robotics Academy Docker Image:

```bash
docker pull jderobot/robotics-academy:latest
```
```bash
docker pull jderobot/robotics-academy:latest
```

- In order to obtain optimal performance, Docker should be using multiple CPU cores. In case of Docker for Mac or Docker for Windows, the VM should be assigned a greater number of cores.

Expand All @@ -85,9 +85,9 @@ This is the preferred way for running the exercise.
### How to perform the exercises?
- Start a new docker container of the image and keep it running in the background:

```bash
docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```
```bash
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.

Expand All @@ -103,8 +103,8 @@ This is the preferred way for running the exercise.
In the launched webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!


Expand All @@ -126,8 +126,8 @@ while True:

## Robot API

* `from HAL import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `from GUI import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `HAL.getImage()` - to get the image
* `HAL.setV()` - to set the linear speed
* `HAL.setW()` - to set the angular velocity
Expand Down
23 changes: 12 additions & 11 deletions _pages/exercises/Drones/rescue_people.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ This is the preferred way for running the exercise.

2. Pull the current distribution of Robotics Academy Docker Image:

```bash
docker pull jderobot/robotics-academy:latest
```
```bash
docker pull jderobot/robotics-academy:latest
```

- In order to obtain optimal performance, Docker should be using multiple CPU cores. In case of Docker for Mac or Docker for Windows, the VM should be assigned a greater number of cores.

Expand All @@ -54,9 +54,9 @@ This is the preferred way for running the exercise.
### How to perform the exercises?
- Start a new docker container of the image and keep it running in the background:

```bash
docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```
```bash
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.

Expand All @@ -69,8 +69,9 @@ This is the preferred way for running the exercise.

### Optional: Store terminal output
- To store the terminal output of manager.py and launch.py to a file execute the following docker run command and keep it running in the background:

```bash
docker run -it --rm -v $HOME/.roboticsacademy/log/:/root/.roboticsacademy/log/ --device /dev/dri -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 2304:2304 -p 1904:1904 jderobot/robotics-academy --logs
docker run -it --rm -v $HOME/.roboticsacademy/log/:/root/.roboticsacademy/log/ --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy --logs
```

- The log files will be stored inside `$HOME/.roboticsacademy/{year-month-date-hours-mins}/`. After the session, use `more` to view the logs, for example:
Expand All @@ -83,8 +84,8 @@ more $HOME/.roboticsacademy/log/2021-11-06-14-45/manager.log
In the launched webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!

while True:
Expand All @@ -111,8 +112,8 @@ Please note that the code executing process might take a few seconds.

## Robot API

* `from HAL import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `from GUI import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.

### Sensors and drone state

Expand Down
20 changes: 10 additions & 10 deletions _pages/exercises/MobileRobots/amazon_warehouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ This is the preferred way for running the exercise.

2. Pull the current distribution of Robotics Academy Docker Image:

```bash
docker pull jderobot/robotics-academy:latest
```
```bash
docker pull jderobot/robotics-academy:latest
```

- In order to obtain optimal performance, Docker should be using multiple CPU cores. In case of Docker for Mac or Docker for Windows, the VM should be assigned a greater number of cores.

Expand All @@ -76,9 +76,9 @@ This is the preferred way for running the exercise.
### How to perform the exercises?
- Start a new docker container of the image and keep it running in the background:

```bash
docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```
```bash
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.

Expand All @@ -94,8 +94,8 @@ This is the preferred way for running the exercise.
In the launched webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!


Expand All @@ -115,8 +115,8 @@ while True:

## Robot API

* `from HAL import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware (Gazebo).
* `from GUI import GUI` - to import the GUI (Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware (Gazebo).
* `import GUI` - to import the GUI (Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `HAL.getPose3d()` - returns x,y and theta components of the robot in world coordinates
* `HAL.setV()` - to set the linear speed
* `HAL.setW()` - to set the angular speed
Expand Down
40 changes: 18 additions & 22 deletions _pages/exercises/MobileRobots/follow_person.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,47 +77,43 @@ This is the preferred way for running the exercise.
### Installation
- Clone the Robotics Academy repository on your local machine

```bash
```bash
git clone https://github.com/JdeRobot/RoboticsAcademy
```
```

- Download [Docker](https://docs.docker.com/get-docker/). Windows users should choose WSL 2 backend Docker installation if possible, as it has better performance than Hyper-V.

- Pull the current distribution of Robotics Academy Docker Image

```bash
```bash
docker pull jderobot/robotics-academy:latest
```
```

- In order to obtain optimal performance, Docker should be using multiple CPU cores. In case of Docker for Mac or Docker for Windows, the VM should be assigned a greater number of cores.

### Enable GPU Acceleration
- For Linux machines with NVIDIA GPUs, acceleration can be enabled by using NVIDIA proprietary drivers, installing [VirtualGL](https://virtualgl.org/) and executing the following docker run command:
```bash
docker run --rm -it --device /dev/dri -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 6081:6081 -p 1108:1108 -p 6082:6082 -p 7163:7163 -p 7164:7164 jderobot/robotics-academy:latest
```


- For Windows machines, GPU acceleration to Docker is an experimental approach and can be implemented as per instructions given [here](https://www.docker.com/blog/wsl-2-gpu-support-is-here/)

### How to perform the exercise?
- Start a new docker container of the image and keep it running in the background ([hardware accelerated version](#enable-gpu-acceleration))
- Start a new docker container of the image and keep it running in the background:

```bash
docker run --rm -it -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 6081:6081 -p 1108:1108 -p 6082:6082 -p 7163:7163 -p 7164:7164 jderobot/robotics-academy:latest
```
```bash
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.

- The exercise can be used after both *Connected* and *Ready* turn green.
- Wait for the Connect button to turn green and display "Connected". Click on the "Launch" button and wait for some time until an alert appears with the message `Connection Established` and button displays "Ready".

- The exercise can be used after the alert.

### Enable GPU Acceleration
- Follow the advanced launching instructions from [here](https://jderobot.github.io/RoboticsAcademy/user_guide/#enable-gpu-acceleration).

**Where to insert the code?**

In the webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!


Expand All @@ -144,8 +140,8 @@ The robot that we will use is a Turtlebot2 (a circular mobile robot) implemented

## Robot API

* `from HAL import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `from GUI import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `HAL.getImage()` - to obtain the current frame of the camera robot.
* `HAL.getPose3d().x` - to get the position of the robot (x coordinate)
* `HAL.getPose3d().y` - to obtain the position of the robot (y coordinate)
Expand Down
12 changes: 7 additions & 5 deletions _pages/exercises/MobileRobots/montecarlo_laser_loc.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ docker pull jderobot/robotics-academy:latest
- Start a new docker container of the image and keep it running in the background.

```bash
docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 jderobot/robotics-academy
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.
Expand All @@ -77,14 +77,16 @@ docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:

- The exercise can be used after the alert.

### Enable GPU Acceleration
- Follow the advanced launching instructions from [here](https://jderobot.github.io/RoboticsAcademy/user_guide/#enable-gpu-acceleration).

**Where to insert the code?**

In the launched webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!


Expand All @@ -104,8 +106,8 @@ while True:

## Robot API

* `from HAL import HAL` - to import the HAL library class. This class contains the functions that receives information from the webcam.
* `from GUI import GUI` - to import the GUI (Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL library class. This class contains the functions that receives information from the webcam.
* `import GUI` - to import the GUI (Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `HAL.setW()` - to set the angular velocity
* `HAL.setV()` - to set the linear velocity
* `GUI.showParticles(particles)` - shows the particles on the map. Accepts a list of particles as an argument. Each particle must be a list with [position_x, position_y, angle_in_radians]. The values must be in gazebo world coordinate system.
Expand Down
20 changes: 10 additions & 10 deletions _pages/exercises/MobileRobots/vacuum_cleaner.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ This is the preferred way for running the exercise.

2. Pull the current distribution of Robotics Academy Docker Image:

```bash
docker pull jderobot/robotics-academy:latest
```
```bash
docker pull jderobot/robotics-academy:latest
```

- In order to obtain optimal performance, Docker should be using multiple CPU cores. In case of Docker for Mac or Docker for Windows, the VM should be assigned a greater number of cores.

Expand All @@ -44,9 +44,9 @@ This is the preferred way for running the exercise.
### How to perform the exercises?
- Start a new docker container of the image and keep it running in the background:

```bash
docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```
```bash
docker run --rm -it -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-academy
```

- On the local machine navigate to 127.0.0.1:7164/ in the browser and choose the desired exercise.

Expand All @@ -62,8 +62,8 @@ This is the preferred way for running the exercise.
In the launched webpage, type your code in the text editor,

```python
from GUI import GUI
from HAL import HAL
import GUI
import HAL
# Enter sequential code!


Expand All @@ -83,8 +83,8 @@ while True:

## Robot API

* `from HAL import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `from GUI import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `import HAL` - to import the HAL(Hardware Abstraction Layer) library class. This class contains the functions that sends and receives information to and from the Hardware(Gazebo).
* `import GUI` - to import the GUI(Graphical User Interface) library class. This class contains the functions used to view the debugging information, like image widgets.
* `HAL.getBumperData().state` - To establish if the robot has crashed or not. Returns a 1 if the robot collides and a 0 if it has not crashed.
* `HAL.getBumperData().bumper` - If the robot has crashed, it turns to 1 when the crash occurs at the center of the robot, 0 when it occurs at its left and 2 if the collision is at its right.
* `HAL.getPose3d().x` - to get the position of the robot (x coordinate)
Expand Down
Loading

0 comments on commit 999dd9f

Please sign in to comment.