Add intrsuctions to install nav2 spawner (#13)

main
Carlos Andrés Álvarez Restrepo 2022-05-23 19:24:10 -05:00 committed by GitHub
parent f808bc404a
commit f8ba7caeff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -46,10 +46,10 @@ And run this package with
ros2 launch explore_lite explore.launch.py
```
You can open an rviz2 and add the exploration frontiers marker to see the algorithm working and choose a frontier to explore.
You can open a rviz2 and add the exploration frontiers marker to see the algorithm working and choose a frontier to explore.
#### TB3 troubleshooting (with foxy)
If you have trouble with TB3 in simulation like we did, add this extra steps for configuring it.
If you have trouble with TB3 in simulation, as we did, add these extra steps for configuring it.
```
source /opt/ros/${ROS_DISTRO}/setup.bash
@ -76,7 +76,7 @@ https://user-images.githubusercontent.com/8033598/144522696-517d54fd-74d0-4c55-9
### ROS2 requirements
#### SLAM
Because of the logic that merges the maps, currently as a straight forward port to ROS2 from the ROS1 version, the SLAM needs to be done using the ROS1 defacto slam option which is [slam_gmapping](https://github.com/ros-perception/slam_gmapping), which hasn't ported officially to ROS2 yet. There is an unofficial port but it lacks to pass a namespace to its launch file. For that, this repo was tested with one of the authors of this package [fork](https://github.com/charlielito/slam_gmapping/tree/feature/namespace_launch). You'll need to git clone to your workspace and build it with colcon.
Because of the logic that merges the maps, currently as a straightforward port to ROS2 from the ROS1 version, the SLAM needs to be done using the ROS1 defacto slam option which is [slam_gmapping](https://github.com/ros-perception/slam_gmapping), which hasn't been ported officially to ROS2 yet. There is an unofficial port but it lacks to pass a namespace to its launch file. For that, this repo was tested with one of the authors of this package [fork](https://github.com/charlielito/slam_gmapping/tree/feature/namespace_launch). You'll need to git clone to your workspace and build it with colcon.
```
@ -85,11 +85,14 @@ git clone https://github.com/charlielito/slam_gmapping.git --branch feature/name
cd ..
colcon build --symlink-install --packages-up-to slam_gmapping
```
#### Nav2 gazebo spawner
To spawn multiple robots, you need the `nav2_gazebo_spawner` which does not come up with the `nav2-bringup` installation. For that, install it with `sudo apt install ros-${ROS_DISTRO}-nav2-gazebo-spawner`.
#### Nav2 config files
This repo has some config examples and launch files for running this package with 2 TB3 robots and a world with nav2. Nonetheless, they are only compatible with the galactic branch and since some breaking changes were introduced in this branch, if you want to try it with another ros2 distro you'll need to tweak those param files for that nav2's distro version (which shouldn't be hard).
### Running the demo with TB3
First you'll need to launch the whole simulation stack, nav2 stacks and slam stacks per robot. For that just launch::
First, you'll need to launch the whole simulation stack, nav2 stacks and slam stacks per robot. For that just launch::
```
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/${ROS_DISTRO}/share/turtlebot3_gazebo/models
@ -100,7 +103,7 @@ Now run the merging node:
ros2 launch multirobot_map_merge map_merge.launch.py
```
By default the demo runs with known initial poses. You can change that by launching again both launch commands with with the flag `known_init_poses:=False`
By default, the demo runs with known initial poses. You can change that by launching again both launch commands with the flag `known_init_poses:=False`
Then you can start moving each robot with its corresponding rviz2 interface sending nav2 goals. To see the map merged just launch rviz2:
```