Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion exercises/easynav/4.using_navmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,69 @@ ros2 run easynav_system system_main

![both_representations](./img/both_representations.png)

## Navigate using NavMap

Now that we have visualized the NavMap and Bonxai representations, we can use NavMap for navigation. EasyNav provides a Planner that can use NavMap representation to plan paths for the robot.

1. To use it, you need to set the Planner type to `Planner` in the parameters file used to launch EasyNav system. The Planner description suggested is shown as follow:

```yaml
planner_node:
ros__parameters:
use_sim_time: true
planner_types: [astar]
astar:
plugin: easynav_navmap_planner/AStarPlanner
max_allowed_slope_deg: 20.0
```

Where the plugin used is `easynav_navmap_planner/AStarPlanner`, which is a Planner implementation for NavMap representation.

As controller. you can use the next description for a `mppi` controller:

```yaml
controller_node:
ros__parameters:
use_sim_time: true
controller_types: [mppi]
mppi:
plugin: easynav_mppi_controller/MPPIController
num_samples: 100
horizon_steps: 10
dt: 0.1
lambda: 0.1
max_linear_velocity: 1.0
max_angular_velocity: 1.0
max_linear_acceleration: 0.5
max_angular_acceleration: 1.0
fov: 1.57
safety_radius: 0.6
```

2. For adding goal pose visualization in RViz2, we add a `Pose` as follow:

![add_pose](./img/add_goalpose.png)

3. For adding the visualization generated by controller, we add a `MarkerArray` visualization as is shown as follow:

![add_mppi_path](./img/add_mppi_path.png)

4. To visualize the planned path by the Planner, we add a `Path` display.

![add_path](./img/add_path.png)

5. Now we can set a goal pose by terminal with the following command:

```bash
ros2 topic pub --once /goal_pose geometry_msgs/msg/PoseStamped "{header: {frame_id: 'map'}, pose: {position:{x: 2, y: 4, z: 0}}}"
```

being `x`, `y` and `z` the coordinates of the goal position in the `map` frame.

6. You should see the robot planning a path to the goal position using NavMap representation as shown below:

![navigation](./img/navigation.png)

## Conclusion

In this exercise, we have learned how to use NavMap representation in EasyNav for localization. We have also seen how to visualize Bonxai representation in RViz2. Both representations provide efficient ways to represent and navigate complex environments in robotics applications and they integrate into EasyNav.
In this exercise, we have learned how to use NavMap representation in EasyNav for localization. We have also seen how to visualize Bonxai representation in RViz2. Both representations provide efficient ways to represent and navigate complex environments in robotics applications and they integrate into EasyNav. Finally you can navigate using NavMap representation with the Planner and Controller provided by EasyNav in 3D spaces.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercises/easynav/4.using_navmap/img/add_path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 21 additions & 16 deletions exercises/easynav/4.using_navmap/navmap.params.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
controller_node:
ros__parameters:
use_sim_time: true
controller_types: [dummy]
dummy:
rt_freq: 30.0
plugin: easynav_controller/DummyController
cycle_time_nort: 0.01
cycle_time_rt: 0.001
controller_types: [mppi]
mppi:
plugin: easynav_mppi_controller/MPPIController
num_samples: 100
horizon_steps: 10
dt: 0.1
lambda: 0.1
max_linear_velocity: 1.0
max_angular_velocity: 1.0
max_linear_acceleration: 0.5
max_angular_acceleration: 1.0
fov: 1.57
safety_radius: 0.6

localizer_node:
ros__parameters:
use_sim_time: true
localizer_types: [dummy]
dummy:
localizer_types: [amcl]
amcl:
rt_freq: 50.0
freq: 5.0
reseed_freq: 0.1
Expand Down Expand Up @@ -49,12 +56,10 @@ maps_manager_node:
planner_node:
ros__parameters:
use_sim_time: true
planner_types: [dummy]
dummy:
freq: 1.0
plugin: easynav_planner/DummyPlanner
cycle_time_nort: 0.2
cycle_time_rt: 0.001
planner_types: [astar]
astar:
plugin: easynav_navmap_planner/AStarPlanner
max_allowed_slope_deg: 20.0

sensors_node:
ros__parameters:
Expand All @@ -76,5 +81,5 @@ system_node:
ros__parameters:
use_sim_time: true
use_real_time: false
position_tolerance: 0.3
angle_tolerance: 0.15
position_tolerance: 1.0
angle_tolerance: 0.25
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
controller_node:
ros__parameters:
use_sim_time: true
controller_types: [dummy]
dummy:
rt_freq: 30.0
plugin: easynav_controller/DummyController
cycle_time_nort: 0.01
cycle_time_rt: 0.001
controller_types: [mppi]
mppi:
plugin: easynav_mppi_controller/MPPIController
num_samples: 100
horizon_steps: 10
dt: 0.1
lambda: 0.1
max_linear_velocity: 1.0
max_angular_velocity: 1.0
max_linear_acceleration: 0.5
max_angular_acceleration: 1.0
fov: 1.57
safety_radius: 0.6

localizer_node:
ros__parameters:
use_sim_time: true
localizer_types: [dummy]
dummy:
localizer_types: [amcl]
amcl:
rt_freq: 50.0
freq: 5.0
reseed_freq: 0.1
Expand Down Expand Up @@ -49,12 +56,10 @@ maps_manager_node:
planner_node:
ros__parameters:
use_sim_time: true
planner_types: [dummy]
dummy:
freq: 1.0
plugin: easynav_planner/DummyPlanner
cycle_time_nort: 0.2
cycle_time_rt: 0.001
planner_types: [astar]
astar:
plugin: easynav_navmap_planner/AStarPlanner
max_allowed_slope_deg: 20.0

sensors_node:
ros__parameters:
Expand All @@ -76,5 +81,5 @@ system_node:
ros__parameters:
use_sim_time: true
use_real_time: false
position_tolerance: 0.3
angle_tolerance: 0.15
position_tolerance: 1.0
angle_tolerance: 0.25
Loading