This projects implements a 2D reactive robot that wanders around an environment until an end position is reached. The project was built using Robot Operating System (ROS) and the Flatland Package.
This assignment was done with ROS Noetic Ninjemys. Ubuntu 20.04 LTS (Focal Fossa) was used since this is the one that natively supports ROS Noetic.
-
Download and install Ubuntu 20.04 (Focal).
-
After Ubuntu 20.03 is installed, is necessary to install ROS. For ROS installation, this installation guide was followed.
-
Our project depends on Flatland which is a performance centric 2D robot simulator started at Avidbots Corp. It's necessary to install this extra dependencie for the package to run:
$ sudo apt-get update
$ sudo apt-get install liblua5.1-0-dev
- After everything is installed, it's necessary to setup the folders in order to run the project. Let's start by creating the necessary folders. The folder
flatland_ws
will be the root for this project.
$ mkdir flatland_ws
$ cd flatland_ws
$ mkdir src
$ cd src
- In the folder
flatland_ws/src/
you will put the Flatland Repository. You also need to copy theproject
folder inside this repository under the folderflatland_ws/src
.
$ git clone https://github.com/avidbots/flatland
- After the previous step, you should have the following folders:
flatland_ws/src/flatland
andflatland_ws/src/project/
. Now it is necessary to allow the python code to be executable.
chmod +x project/robot_movement.py project/robot_movement.py project/run.py project/world.py
cd ..
- Build the project on the root and activate the environment
catkin_make
source devel/setup.bash
- After the last step, the project is ready to run.
Inside the project
folder, the user should run the following command:
python run.py [target_x] [target_y]
The user can also choose wether the robot should stop or not at the tip of the letter "Ç" by passing a target value as follows
python run.py -1 -17
This repository was the following folder structure:
.
├── project # ROS Project Files
│ ├── launch
│ │ └── project.launch # File responsible to initialize the program
│ ├── models # Models of the map and robot
│ │ ├── world.yaml
│ │ └── ...
│ ├── robot_movement.py # Manage sensor information and gives actions to the robot
│ ├── run.py # Inits the program
│ ├── world.py # Generate the map and the initial position of the robot
│ └── .. # Packages necessary to run the ROS Project
└── README.md
Name | Number | |
---|---|---|
Diogo Fernandes | 201806250 | up201806250@edu.fe.up.pt |
Hugo Guimarães | 201806490 | up201806490@edu.fe.up.pt |
Iohan Sardinha | 201801011 | up201801011@edu.fe.up.pt |