https://github.com/aliy98/nav2-keepout-zone
Navigation in ROS2 with Nav2 introduced a lot of new features and possibilities. The goal of this assignment is to explore and test the new feature of navigating in a known environment while avoiding user-defined “keep out areas”.
https://github.com/aliy98/nav2-keepout-zone
navigation2 ros2 slam-toolbox tiago-robot
Last synced: 11 months ago
JSON representation
Navigation in ROS2 with Nav2 introduced a lot of new features and possibilities. The goal of this assignment is to explore and test the new feature of navigating in a known environment while avoiding user-defined “keep out areas”.
- Host: GitHub
- URL: https://github.com/aliy98/nav2-keepout-zone
- Owner: aliy98
- Created: 2022-06-22T14:44:43.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T14:23:17.000Z (about 3 years ago)
- Last Synced: 2025-03-28T16:43:41.355Z (about 1 year ago)
- Topics: navigation2, ros2, slam-toolbox, tiago-robot
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nav2-keepout-zone
Navigation in ROS2 with [Nav2](https://navigation.ros.org/) introduced a lot of new features and possibilities. The goal of this assignment is to explore and test the new feature
of navigating in a known environment while avoiding user-defined [keep out areas](https://navigation.ros.org/tutorials/docs/navigation2_with_keepout_filter.html).
## Installation
This package requires the following dependencies:
```
sudo apt install ros--slam-toolbox
```
```
sudo apt install ros--navigation2 ros--nav2-bringup '~ros--turtlebot3-.*'
```
Once all the dependencies are met, the packge could be cloned and compiled as it is represented:
```
mkdir -p colcon_ws/src
```
```
cd colcon_ws/src
```
```
git clone https://github.com/aliy98/nav2-keepout-zone
```
```
cd colcon_ws
```
```
colcon build --symlink-install
```
```
source install/setup.bash
```
## Simulation Environment
[Webots2023a](https://cyberbotics.com/doc/blog/Webots-2023-a-release) is a simulation software, in which this project was done. It is compliant with ROS2,
and provides the [TIAGo](https://github.com/cyberbotics/webots_ros2/tree/master/webots_ros2_tiago) robot urdf model,
which is chosen to be used in this project.
The following figure, provides an overview from the simulation environment of this project:
## Mapping
The first step of this experiment, consists of creating a map of the indoor environemnt. [slam_toolbox](https://github.com/SteveMacenski/slam_toolbox) provides an online
synchronous mapping ROS node, using the following command:
```
ros2 launch slam_toolbox online_async_launch.py
```
which was used in this project along with [Nav2](https://github.com/ros-planning/navigation2) applications. The following command would bringup navigation:
```
ros2 launch nav2_bringup navigation_launch.py
```
This would help us to define goal points during slam. In order to launch these two nodes along with the simulation environment, the `slam_launch.py` file
is provided in this package, which takes an `world` file as an argument:
```
ros2 launch sofar_assignment slam_launch.py world:=default.wbt
```
Here is an overview of the mapping process:
The UML component diagram of this part is shown in following figure:
## Creating keepout filter masks:
Once the map is built, the keepout areas could be drwan on the `map.pgm` file and saved as the mask filter. The corresponding mask yaml file mode has to be chosen as scale,
so that the occupancy grids of each area, would be defined with a certain level of occupancy.
The follwoing figures show a sample of keepout filter mask along with the original map file:
## Navigation and path planning
In the last step of this project, the navigation and path planning part is done, considering the keepout zones. The provided `nav_launch.py` in this package
would bring the simulation environment along with navigation2 applications such as `map_server`, `costmap_filter_info_server` and `life_cycle_manager`. The following
command represents the arguments that this launch file requires:
```
ros2 launch sofar_assignment nav_launch.py world:=default.wbt map:=src/nav2-keepout-zone/resource/map.yaml params_file:=src/nav2-keepout-zone/resource/nav2_params.yaml keepout_params_file:=src/nav2-keepout-zone/resource/keepout_params.yaml mask:=src/nav2-keepout-zone/resource/keepout_mask.yaml
```
The UML component diagram of this part is shown in following figure:
## Authors and Contacts
- Ali Yousefi
- email: aliyousefi98@outlook.com