Skip to content

Commit 1020a6c

Browse files
authored
add documenation for PhotoAtWaypoint plugin (#104)
* add documenation for PhotoAtWaypoint plugin Signed-off-by: jediofgever <[email protected]> * add missing link to plugins/index.rst Signed-off-by: jediofgever <[email protected]> * resolve requested changes of first review Signed-off-by: jediofgever <[email protected]> * update image filename extension info Signed-off-by: jediofgever <[email protected]> * update default save_dir Signed-off-by: jediofgever <[email protected]>
1 parent 2d50f50 commit 1020a6c

File tree

4 files changed

+91
-18
lines changed

4 files changed

+91
-18
lines changed

configuration/packages/configuring-waypoint-follower.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Parameters
4242
============== ========================
4343
Type Default
4444
-------------- ------------------------
45-
string 'waypoint_task_executor'
45+
string 'wait_at_waypoint'
4646
============== ========================
4747

4848
Description
@@ -57,9 +57,11 @@ Parameters
5757
5858
waypoint_follower:
5959
ros__parameters:
60-
waypoint_task_executor_plugin: "waypoint_task_executor"
61-
waypoint_task_executor:
60+
waypoint_task_executor_plugin: "wait_at_waypoint"
61+
wait_at_waypoint:
6262
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
63+
enabled: True
64+
waypoint_pause_duration: 0
6365
..
6466
6567
Provided Plugins
@@ -70,16 +72,17 @@ Provided Plugins
7072
:maxdepth: 1
7173

7274
nav2_waypoint_follower-plugins/wait_at_waypoint.rst
75+
nav2_waypoint_follower-plugins/photo_at_waypoint.rst
7376
nav2_waypoint_follower-plugins/input_at_waypoint.rst
7477

7578

76-
Default Plugins
79+
Default Plugin
7780
***************
7881

7982
========================== ===================================================
8083
Namespace Plugin
8184
-------------------------- ---------------------------------------------------
82-
"waypoint_task_executor" "nav2_waypoint_follower::WaitAtWaypoint"
85+
"wait_at_waypoint" "nav2_waypoint_follower::WaitAtWaypoint"
8386
========================== ===================================================
8487

8588
Example
@@ -90,9 +93,8 @@ Example
9093
ros__parameters:
9194
loop_rate: 20
9295
stop_on_failure: false
93-
waypoint_task_executor_plugin: "waypoint_task_executor"
94-
waypoint_task_executor:
96+
waypoint_task_executor_plugin: "wait_at_waypoint"
97+
wait_at_waypoint:
9598
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
96-
enabled: True
97-
waypoint_pause_duration: 0
98-
99+
enabled: True
100+
waypoint_pause_duration: 0
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.. _configuring_nav2_waypoint_follower_waypoint_task_execution_plugin:
2+
3+
PhotoAtWaypoint
4+
=================
5+
6+
Run-time plugin that takes photos at waypoint arrivals when using waypoint follower node. Saves the taken photos to specified directory. The name for taken photos are determined by
7+
the waypoint index and timestamp(seconds). For instance ``/home/atas/0_1602582820.png`` is an sample taken image, where ``0_1602582820`` is the file name determined by waypoint
8+
index and time stamp. The leading digit in file name implies the waypoint index and the rest of digits at righthand side imples the time stamp when the photo was taken.
9+
10+
Parameters
11+
**********
12+
13+
``<nav2_waypoint_follower plugin>``: nav2_waypoint_follower plugin name defined in the **waypoint_task_executor_plugin_id** parameter in :ref:`configuring_waypoint_follower`.
14+
15+
:``<nav2_waypoint_follower plugin>``.enabled:
16+
17+
============== =============================
18+
Type Default
19+
-------------- -----------------------------
20+
bool true
21+
============== =============================
22+
23+
Description
24+
Whether waypoint_task_executor plugin is enabled.
25+
26+
27+
:``<nav2_waypoint_follower plugin>``.camera_image_topic_name:
28+
29+
============== =============================
30+
Type Default
31+
-------------- -----------------------------
32+
string "/camera/color/image_raw"
33+
============== =============================
34+
35+
Description
36+
Camera image topic name to susbcribe
37+
38+
:``<nav2_waypoint_follower plugin>``.save_images_dir:
39+
40+
============== =============================
41+
Type Default
42+
-------------- -----------------------------
43+
string "/tmp/waypoint_images"
44+
============== =============================
45+
46+
Description
47+
Path to directory to save taken photos at waypoint arrivals.
48+
49+
:``<nav2_waypoint_follower plugin>``.image_format:
50+
51+
============== =============================
52+
Type Default
53+
-------------- -----------------------------
54+
string "png"
55+
============== =============================
56+
57+
Description
58+
Desired image format.

migration/Foxy.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ New Plugins
2929

3030
``nav2_waypoint_follower`` has an action server that takes in a list of waypoints to follow and follow them in order. In some cases we might want robot to
3131
perform some tasks/behaviours at arrivals of these waypoints. In order to perform such tasks, a generic plugin interface `WaypointTaskExecutor` has been added to ``nav2_core``.
32-
Users can inherit from this interface to implement their own plugin to perform more specific tasks at waypoint arrivals for their needs. An example implementation `WaitAtWaypoint`, is included in
33-
``nav2_waypoint_follower`` as a run-time loadable plugin. `WaitAtWaypoint` simply lets robot to pause for a specified amount of time in milliseconds, at waypoint arrivals. Loading a plugin of this type
34-
is done through `nav2_bringup/params/nav2_param.yaml`, by specifying plugin's name, type and it's used parameters.
32+
Users can inherit from this interface to implement their own plugin to perform more specific tasks at waypoint arrivals for their needs.
33+
34+
Several example implementations are included in ``nav2_waypoint_follower``. ``WaitAtWaypoint`` and ``PhotoAtWaypoint`` plusings are included in
35+
``nav2_waypoint_follower`` as run-time loadable plugins. ``WaitAtWaypoint`` simply lets robot to pause for a specified amount of time in milliseconds, at waypoint arrivals.
36+
While ``PhotoAtWaypoint`` takes photos at waypoint arrivals and saves the taken photos to specified directory, the format for taken photos also can be configured through parameters.
37+
All major image formats such as ``png``, ``jpeg``, ``jpg`` etc. are supported, the default format is ``png``.
38+
39+
Loading a plugin of this type is done through ``nav2_bringup/params/nav2_param.yaml``, by specifying plugin's name, type and it's used parameters.
3540

3641
For instance;
3742
.. code-block:: yaml
@@ -40,15 +45,17 @@ For instance;
4045
ros__parameters:
4146
loop_rate: 20
4247
stop_on_failure: false
43-
waypoint_task_executor_plugin: "waypoint_task_executor"
44-
waypoint_task_executor:
45-
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
46-
enabled: True
47-
waypoint_pause_duration: 0
48+
waypoint_task_executor_plugin: "wait_at_waypoint"
49+
wait_at_waypoint:
50+
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
51+
enabled: True
52+
waypoint_pause_duration: 0
4853
4954
Original GitHub tickets:
5055

5156
- `WaypointTaskExecutor <https://github.com/ros-planning/navigation2/pull/1993>`_
57+
- `WaitAtWaypoint <https://github.com/ros-planning/navigation2/pull/1993>`_
58+
- `PhotoAtWaypoint <https://github.com/ros-planning/navigation2/pull/2041>`_
5259
- `InputAtWaypoint <https://github.com/ros-planning/navigation2/pull/2049>`_
5360

5461
Costmap Filters

plugins/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,18 @@ Waypoint Task Executors
156156
| | | waypoint arrivals. |
157157
| | | |
158158
+---------------------------------+------------------------+----------------------------------+
159+
| `PhotoAtWaypoint`_ | Fetullah Atas | A plugin to take and save photos |
160+
| | | to specified directory on |
161+
| | | waypoint arrivals. |
162+
| | | |
163+
+---------------------------------+------------------------+----------------------------------+
159164
| `InputAtWaypoint`_ | Steve Macenski | A plugin to wait for user input |
160165
| | | before moving onto the next |
161166
| | | waypoint. |
162167
+---------------------------------+------------------------+----------------------------------+
163168

164169
.. _WaitAtWaypoint: https://github.com/ros-planning/navigation2/tree/main/nav2_waypoint_follower/plugins/wait_at_waypoint.cpp
170+
.. _PhotoAtWaypoint: https://github.com/ros-planning/navigation2/tree/main/nav2_waypoint_follower/plugins/photo_at_waypoint.cpp
165171
.. _InputAtWaypoint: https://github.com/ros-planning/navigation2/tree/main/nav2_waypoint_follower/plugins/input_at_waypoint.cpp
166172

167173
Goal Checkers

0 commit comments

Comments
 (0)