Skip to content

Commit

Permalink
Improves andino_navigation package. (#224)
Browse files Browse the repository at this point in the history
Signed-off-by: Franco Cipollone <[email protected]>
  • Loading branch information
francocipollone authored Feb 14, 2024
1 parent 4fe7a6e commit 34b23af
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 43 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,19 @@ ros2 launch andino_bringup rviz.launch.py

For starting `rviz2` visualization with a provided configuration.

## :computer: Simulation

The [`andino_gz_classic`](./andino_gz_classic/README.MD) package provides a Gazebo simulation fo the Andino robot.

<img src="./andino_gz_classic/docs/andino_gz_classic.png" width=400/>

## :compass: Navigation

The [`andino_navigation`](./andino_navigation/README.md) package provides a navigation stack based on the great [Nav2](https://github.com/ros-planning/navigation2) package.

https://github.com/Ekumen-OS/andino/assets/53065142/29951e74-e604-4a6e-80fc-421c0c6d8fee

_Important!: At the moment this package is only working with the simulation. The support for the real robot is forthcoming._
Follow the [`andino_navigation`'s README](./andino_navigation/README.md) instructions for bringing up the Navigation stack in the real robot or in the simulation.

## :computer: Simulation

The [`andino_gz_classic`](./andino_gz_classic/README.MD) package provides a Gazebo simulation for the Andino robot.

<img src="./andino_gz_classic/docs/andino_gz_classic.png" width=400/>

## :selfie: Media

Expand Down
46 changes: 23 additions & 23 deletions andino_navigation/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# Nav2 with Andino robot
*Note*: Nav2 is only configured to work with the simulation for the moment.
Support to real robot is forthcoming.
# Andino Navigation

## Build
We rely on [Nav2](https://github.com/ros-planning/navigation2) stack in order to navigate Andino.

Install package dependencies:
# Usage

```
rosdep install --from-paths src -i -y
```
## Real Robot

Build the package:
### Prerequisites

```
colcon build
```
1. Andino robot needs to be up and running:
```sh
ros2 launch andino_bringup andino_robot.launch.py
```

Note: `--symlink-install` can be added if needed.
2. We need a previously recorded map in order to navigate on.
Refer to [andino_slam](../andino_slam/README.md) to learn how to record a map with Andino.

Finally, source the install folder
```
. install/setup.bash
```
### Run nav stack

# Usage
```sh
ros2 launch andino_navigation bringup.launch.py map:=<path-to-my-map-yaml-file>
```

This package has the next option to be executed.
By default, [config file](params/nav2_params.yaml) is used. For using a custom param file use:
```sh
ros2 launch andino_navigation bringup.launch.py map:=<path-to-my-map-yaml-file> params_file:=<path-to-my-param-file>
```

## Andino with nav2 in Gazebo Simulation
## Simulation

This launch file use the [turtlebot3_world](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/master) like world example which has an Apache 2 license.
A launch file for running the andino_gz_classic simulation and the nav2 stack is provided.
It uses the [turtlebot3_world](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/master) world (_Apache 2 license_) by default.

```
. /usr/share/gazebo/setup.bash
ros2 launch andino_navigation andino_simulation_navigation.launch.py
ros2 launch andino_navigation andino_simulation_navigation.launch.py
```

To test the navigation inside rviz:
Expand Down
26 changes: 13 additions & 13 deletions andino_navigation/params/nav2_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ amcl:
laser_min_range: -1.0
laser_model_type: "likelihood_field"
max_beams: 60
max_particles: 2000
max_particles: 3000
min_particles: 500
odom_frame_id: "odom"
pf_err: 0.05
Expand Down Expand Up @@ -130,7 +130,7 @@ bt_navigator_navigate_to_pose_rclcpp_node:
controller_server:
ros__parameters:
use_sim_time: True
controller_frequency: 20.0
controller_frequency: 10.0
min_x_velocity_threshold: 0.001
min_y_velocity_threshold: 0.5
min_theta_velocity_threshold: 0.001
Expand Down Expand Up @@ -212,8 +212,8 @@ local_costmap:
plugins: ["voxel_layer", "inflation_layer"]
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.55
cost_scaling_factor: 2.0
inflation_radius: 0.2
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
Expand Down Expand Up @@ -270,8 +270,8 @@ global_costmap:
map_subscribe_transient_local: True
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.55
cost_scaling_factor: 2.0
inflation_radius: 0.2
always_send_full_costmap: True

map_server:
Expand All @@ -291,13 +291,13 @@ map_saver:

planner_server:
ros__parameters:
expected_planner_frequency: 20.0
expected_planner_frequency: 10.0
use_sim_time: True
planner_plugins: ["GridBased"]
GridBased:
plugin: "nav2_navfn_planner/NavfnPlanner"
tolerance: 0.5
use_astar: false
use_astar: true
allow_unknown: true

smoother_server:
Expand Down Expand Up @@ -342,7 +342,7 @@ robot_state_publisher:
waypoint_follower:
ros__parameters:
use_sim_time: True
loop_rate: 20
loop_rate: 10
stop_on_failure: false
waypoint_task_executor_plugin: "wait_at_waypoint"
wait_at_waypoint:
Expand All @@ -353,14 +353,14 @@ waypoint_follower:
velocity_smoother:
ros__parameters:
use_sim_time: True
smoothing_frequency: 20.0
smoothing_frequency: 10.0
scale_velocities: False
feedback: "OPEN_LOOP"
max_velocity: [0.26, 0.0, 1.0]
min_velocity: [-0.26, 0.0, -1.0]
max_velocity: [0.15, 0.0, 1.0]
min_velocity: [-0.15, 0.0, -1.0]
max_accel: [2.5, 0.0, 3.2]
max_decel: [-2.5, 0.0, -3.2]
odom_topic: "odom"
odom_topic: "/odom"
odom_duration: 0.1
deadband_velocity: [0.0, 0.0, 0.0]
velocity_timeout: 1.0
19 changes: 19 additions & 0 deletions andino_slam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,22 @@ Several configuration can be forwarded to the `slam_toolbox_node`. By default, t
```
ros2 launch andino_slam slam_toolbox_online_async.launch.py slams_param_file:=<my_path>
```

For saving the map you can use `map_saver_cli` node provided by Nav2.
```sh
ros2 run nav2_map_server map_saver_cli -f <my-map-name>
```

You can modify the threshold for free space (0.25) and occupied space (0.65) by using
`--free` and `--occ` arguments.

```sh
ros2 run nav2_map_server map_saver_cli --free 0.15 -f <my-map-name>
```
More information at:
- https://navigation.ros.org/configuration/packages/configuring-map-server.html
- https://github.com/ros-planning/navigation2/tree/main/nav2_map_server


Once you have the map saved, you can navigate on it!
Go to [`andino_navigation`](../andino_navigation/README.md) to learn how.

0 comments on commit 34b23af

Please sign in to comment.