@@ -13,88 +13,10 @@ While being conscious of our objectives, for any action server, it is important
13
13
#. Publish feedback as it becomes available. Without feedback, an Action might always be replaced more effectively by a Service.
14
14
#. Set the final state of the goal and send a Result.
15
15
16
- Create the package
17
- ------------------
18
-
19
- We start by creating a package to use the action we first created in :ref: `The action file `.
20
-
21
- .. code-block :: console
22
-
23
- cd ~/ros2_tutorial_workspace/src
24
- ros2 pkg create python_package_that_uses_the_actions \
25
- --build-type ament_python \
26
- --dependencies rclpy package_with_interfaces
27
-
28
- .. dropdown :: ros2 pkg create output
29
-
30
- .. code :: console
31
-
32
- going to create a new package
33
- package name: python_package_that_uses_the_actions
34
- destination directory: ~/ros2_tutorial_workspace/src
35
- package format: 3
36
- version: 0.0.0
37
- description: TODO: Package description
38
- maintainer: ['root <[email protected] >']
39
- licenses: ['TODO: License declaration']
40
- build type: ament_python
41
- dependencies: ['rclpy', 'package_with_interfaces']
42
- creating folder ./python_package_that_uses_the_actions
43
- creating ./python_package_that_uses_the_actions/package.xml
44
- creating source folder
45
- creating folder ./python_package_that_uses_the_actions/python_package_that_uses_the_actions
46
- creating ./python_package_that_uses_the_actions/setup.py
47
- creating ./python_package_that_uses_the_actions/setup.cfg
48
- creating folder ./python_package_that_uses_the_actions/resource
49
- creating ./python_package_that_uses_the_actions/resource/python_package_that_uses_the_actions
50
- creating ./python_package_that_uses_the_actions/python_package_that_uses_the_actions/__init__.py
51
- creating folder ./python_package_that_uses_the_actions/test
52
- creating ./python_package_that_uses_the_actions/test/test_copyright.py
53
- creating ./python_package_that_uses_the_actions/test/test_flake8.py
54
- creating ./python_package_that_uses_the_actions/test/test_pep257.py
55
-
56
- [WARNING]: Unknown license 'TODO: License declaration'. This has been set in the package.xml, but no LICENSE file has been created.
57
- It is recommended to use one of the ament license identifiers:
58
- Apache-2.0
59
- BSL-1.0
60
- BSD-2.0
61
- BSD-2-Clause
62
- BSD-3-Clause
63
- GPL-3.0-only
64
- LGPL-3.0-only
65
- MIT
66
- MIT-0
67
-
68
-
69
- Overview
70
- --------
71
-
72
- .. admonition :: File structure
73
-
74
- This will be the file structure for the :code: `Action ` tutorial. Highlighted are the main files for the :code: `ActionServer ` and :code: `ActionClient `.
75
-
76
- .. code-block :: console
77
- :emphasize-lines: 5
78
-
79
- python_package_that_uses_the_actions/
80
- |-- package.xml
81
- |-- python_package_that_uses_the_actions
82
- | |-- __init__.py
83
- | `-- move_straight_in_2d_action_server_node.py
84
- |-- resource
85
- | `-- python_package_that_uses_the_actions
86
- |-- setup.cfg
87
- |-- setup.py
88
- `-- test
89
- |-- test_copyright.py
90
- |-- test_flake8.py
91
- `-- test_pep257.py
92
-
93
16
Before we start exploring the elements of the package, let us do the following.
94
17
95
- #. Create the Node with an :code: `ActionServer `.
96
- #. Create the Node with an :code: `ActionClient `.
97
- #. Update the :file: `setup.py ` so that :program: `ros2 run ` finds these programs.
18
+ #. Create the node with an :code: `ActionServer `.
19
+ #. Update the :file: `setup.py ` so that :program: `ros2 run ` finds the node.
98
20
99
21
Let us create the action server as follows.
100
22
0 commit comments