Skip to content

Commit fcdc7c4

Browse files
author
Murilo Marinho
committed
Adjusting and to balance the explanation properly.
1 parent c47a53f commit fcdc7c4

File tree

3 files changed

+84
-82
lines changed

3 files changed

+84
-82
lines changed

docs/source/action_clients.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
Action Clients
88
==============
99

10-
TODO
10+
TODO
11+
12+
#. Create the Node with an :code:`ActionClient`.

docs/source/action_servers.rst

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -13,88 +13,10 @@ While being conscious of our objectives, for any action server, it is important
1313
#. Publish feedback as it becomes available. Without feedback, an Action might always be replaced more effectively by a Service.
1414
#. Set the final state of the goal and send a Result.
1515

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-
9316
Before we start exploring the elements of the package, let us do the following.
9417

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.
9820

9921
Let us create the action server as follows.
10022

docs/source/actions.rst

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,82 @@ This can be mathematically described as follows.
5353
5454
\boldsymbol{p}(k+1) = \boldsymbol{p}(k) - s\left(\frac{\boldsymbol{p} - \boldsymbol{p}_d}{d}\right),
5555
56-
where :math:`\boldsymbol{p}(k+1)` represents the next position and :math:`\boldsymbol{p}(k)` the current position.
56+
where :math:`\boldsymbol{p}(k+1)` represents the next position and :math:`\boldsymbol{p}(k)` the current position.
57+
58+
Create the package
59+
------------------
60+
61+
We start by creating a package to use the action we first created in :ref:`The action file`.
62+
63+
.. code-block:: console
64+
65+
cd ~/ros2_tutorial_workspace/src
66+
ros2 pkg create python_package_that_uses_the_actions \
67+
--build-type ament_python \
68+
--dependencies rclpy package_with_interfaces
69+
70+
.. dropdown:: ros2 pkg create output
71+
72+
.. code :: console
73+
74+
going to create a new package
75+
package name: python_package_that_uses_the_actions
76+
destination directory: ~/ros2_tutorial_workspace/src
77+
package format: 3
78+
version: 0.0.0
79+
description: TODO: Package description
80+
maintainer: ['root <[email protected]>']
81+
licenses: ['TODO: License declaration']
82+
build type: ament_python
83+
dependencies: ['rclpy', 'package_with_interfaces']
84+
creating folder ./python_package_that_uses_the_actions
85+
creating ./python_package_that_uses_the_actions/package.xml
86+
creating source folder
87+
creating folder ./python_package_that_uses_the_actions/python_package_that_uses_the_actions
88+
creating ./python_package_that_uses_the_actions/setup.py
89+
creating ./python_package_that_uses_the_actions/setup.cfg
90+
creating folder ./python_package_that_uses_the_actions/resource
91+
creating ./python_package_that_uses_the_actions/resource/python_package_that_uses_the_actions
92+
creating ./python_package_that_uses_the_actions/python_package_that_uses_the_actions/__init__.py
93+
creating folder ./python_package_that_uses_the_actions/test
94+
creating ./python_package_that_uses_the_actions/test/test_copyright.py
95+
creating ./python_package_that_uses_the_actions/test/test_flake8.py
96+
creating ./python_package_that_uses_the_actions/test/test_pep257.py
97+
98+
[WARNING]: Unknown license 'TODO: License declaration'. This has been set in the package.xml, but no LICENSE file has been created.
99+
It is recommended to use one of the ament license identifiers:
100+
Apache-2.0
101+
BSL-1.0
102+
BSD-2.0
103+
BSD-2-Clause
104+
BSD-3-Clause
105+
GPL-3.0-only
106+
LGPL-3.0-only
107+
MIT
108+
MIT-0
109+
110+
111+
Overview
112+
--------
113+
114+
This will be the file structure for the :code:`Action` tutorial. Highlighted are the main files for the :code:`ActionServer` and :code:`ActionClient`.
115+
116+
.. admonition:: File structure
117+
118+
.. code-block:: console
119+
:emphasize-lines: 5,6
120+
121+
python_package_that_uses_the_actions/
122+
|-- package.xml
123+
|-- python_package_that_uses_the_actions
124+
| |-- __init__.py
125+
| |-- move_straight_in_2d_action_client_node.py
126+
| `-- move_straight_in_2d_action_server_node.py
127+
|-- resource
128+
| `-- python_package_that_uses_the_actions
129+
|-- setup.cfg
130+
|-- setup.py
131+
`-- test
132+
|-- test_copyright.py
133+
|-- test_flake8.py
134+
`-- test_pep257.py

0 commit comments

Comments
 (0)