You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update navigation tutorials with scan_topic argument (#480)
* Update the navigation tutorial to include the new scan_topic argument, add a new page for Rviz tools, update the launching page to include steps for Nav2+SLAM and Nav2+Localization instructions for simulation & physical robots. Add a warning about the minumum range of some 3D lidars
* Fix broken link
* Another link
Clearpath's Nav2 demos are written to support 2D lidars. If your robot has a 3D lidar on it, you can use the
24
+
[3d lidar's `scan` topic](../../api/sensors_api#3d-lidar-topics) to provide the necessary 2d `laserscan` input by
25
+
using the `scan_topic` argument, e.g. `scan_topic:=/a300_0000/sensors/lidar3d_0/scan`.
26
+
27
+
:::
28
+
29
+
:::warning
30
+
31
+
Some lidars, especially 3D lidars, can have a minimum range that is _larger_ than the robot's footprint.
32
+
In this case it is possible for an obstacle to be so close to the robot that the lidar cannot detect it, potentially causing damage or injury.
33
+
Always keep an eye on the robot and be ready to press the emergency stop if necessary.
34
+
35
+
:::
36
+
37
+
## Launching Nav2 and SLAM on a physical robot
22
38
23
-
**1.** Move the `robot.yaml` file to your setup folder (`$HOME/clearpath` by default for the simulation or `/etc/clearpath/robot.yaml` on a physical robot).
39
+
The following commands can be run on the robot itself, or on an [offboard computer](../../installation/offboard_pc).
40
+
Running on the robot will result in less latency, but can also result in high CPU usage on the robot, depending what other nodes are running.
24
41
25
-
**2.**Open a terminal and launch the simulation:
42
+
**1.**Ensure the `clearpath-platform` and `clearpath-sensors` services are running. Run `ros2 topic list` to make sure the robot's `scan` topic is visible
26
43
44
+
**2.** Start Nav2 by running
45
+
```bash
46
+
ros2 launch clearpath_nav2_demos nav2.launch.py
27
47
```
28
-
ros2 launch clearpath_gz simulation.launch.py
48
+
If your robot uses a 3D lidar instead of a 2D lidar, specify the `scan_topic` argument:
**4.** Open a third terminal and start either [SLAM](slam.mdx) or [Localization](localization.mdx), depending on
40
-
whether or not you want to create a new map or use a pre-existing map.
105
+
**5.** Drive the robot around manually, or by sending it 2D nav goals.
41
106
42
-
**5.** Set the initial pose of the robot using the [**2D Pose Estimate**](#2d-pose-estimate) tool in RViz.
107
+
See [SLAM](slam) for more information about interacting with SLAM.
43
108
44
-
**6.** Open fourth terminal and launch nav2:
109
+
See [Nav2 Goals](rviz#nav2-goal) for more information about sending navigation goals.
45
110
111
+
## Launching Nav2 and Localization on a physical robot
112
+
113
+
The following commands can be run on the robot itself, or on an [offboard computer](../../installation/offboard_pc).
114
+
Running on the robot will result in less latency, but can also result in high CPU usage on the robot, depending what other nodes are running.
115
+
116
+
**1.** Ensure the `clearpath-platform` and `clearpath-sensors` services are running. Run `ros2 topic list` to make sure the robot's `scan` topic is visible
117
+
118
+
**2.** Start Nav2 by running
119
+
```bash
120
+
ros2 launch clearpath_nav2_demos nav2.launch.py
121
+
```
122
+
If your robot uses a 3D lidar instead of a 2D lidar, specify the `scan_topic` argument:
**5.** Use Rviz to [set the 2D pose estimate](localization#setting-the-2d-pose-estimate).
142
+
143
+
**6.** Send 2D a nav goal to the robot [using Rviz' 2D Nav Goal tool](rviz#nav2-goal) or [the Navigation to Pose action](actions#the-navigate-to-pose-action).
144
+
145
+
## Launching Nav2 and Localization in simulation
146
+
147
+
The following commands can be run on the robot itself, or on an [offboard computer](../../installation/offboard_pc).
148
+
Running on the robot will result in less latency, but can also result in high CPU usage on the robot, depending what other nodes are running.
<figcaption>Rviz's toolbar with Nav2 tools</figcaption>
71
-
</figure>
72
-
</center>
73
-
74
-
### 2D Pose Estimate
75
-
76
-
The **2D Pose Estimate** tool allows you to provide Nav2 with the robot's approximate initial position on
77
-
the map. This is a necessary step before you can navigate with the robot. This step connects the `map`
78
-
frame to the rest of the robot's TF tree.
79
-
80
-
To set the robot's initial position, click and hold the mouse button on the map in the robot's approximate location.
81
-
While holding the left mouse button, drag the green arrow to set the robot's orientation. Releasing the left
82
-
mouse button will set the robot's position and orientation relative to the `map` frame.
83
-
84
-
If you are using SLAM and there is no map yet, simply click on the centre of the screen and drag up.
85
-
86
-
Once you have set the robot's initial pose you should see red markers representing the lidar data as well
87
-
as coloured gradients indicating collision zones around walls and obstacles.
88
-
89
-
<center>
90
-
<figure>
91
-
<img
92
-
src={require("./img/pose_estimate.gif").default}
93
-
width="900"
94
-
/>
95
-
<figcaption>Setting the initial pose estimate</figcaption>
96
-
</figure>
97
-
</center>
98
-
99
-
### Publish Point
100
-
101
-
The **Publish Point** tool allows you to click on the map and publish the XYZ coordinates of that
102
-
point to the `clicked_point` topic. In a terminal run the command
103
-
```bash
104
-
ros2 topic echo /a300_0000/clicked_point
105
-
```
106
-
Then select the Publish Point tool and click somewhere on the map. In the terminal you will see
107
-
the location you clicked as a `geometry_msgs/msg/PointStamped` message:
108
-
```yaml
109
-
header:
110
-
stamp:
111
-
sec: 1747855824
112
-
nanosec: 867726206
113
-
frame_id: map
114
-
point:
115
-
x: -0.12474524974822998
116
-
y: 0.002330044750124216
117
-
z: -0.001434326171875
118
-
```
119
-
120
-
<center>
121
-
<figure>
122
-
<img
123
-
src={require("./img/publish_point.gif").default}
124
-
width="900"
125
-
/>
126
-
<figcaption>Publishing a point</figcaption>
127
-
</figure>
128
-
</center>
129
-
130
-
### Nav2 Goal
131
-
132
-
The **Nav2 Goal** tool allows you to set a goal pose for the robot. The Nav2 stack will then plan a path to the goal pose
133
-
and attempt to drive the robot there.
134
-
135
-
You will see a red path line appear, indicating the robot's planned path, and the robot will start to drive along this path.
136
-
137
-
<center>
138
-
<figure>
139
-
<img
140
-
src={require("./img/nav_goal.gif").default}
141
-
width="900"
142
-
/>
143
-
<figcaption>Navigation in simulation</figcaption>
144
-
</figure>
145
-
</center>
182
+
**6.** Send 2D a nav goal to the robot [using Rviz' 2D Nav Goal tool](rviz#nav2-goal) or [the Navigation to Pose action](actions#the-navigate-to-pose-action).
0 commit comments