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
Copy file name to clipboardExpand all lines: docs/source/action_servers.rst
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,10 +74,23 @@ Overview
74
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
75
76
76
.. code-block:: console
77
-
78
-
TODO
79
-
80
-
Before we start exploring the elements of the package, let us
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
+
Before we start exploring the elements of the package, let us do the following.
81
94
82
95
#. Create the Node with an :code:`ActionServer`.
83
96
#. Create the Node with an :code:`ActionClient`.
@@ -126,12 +139,7 @@ in the action file description, therefore we populate it as needed.
126
139
:emphasize-lines: 1, 7, 12, 18, 24, 30, 32
127
140
128
141
The other methods are to support the important aspects of the action server. The :code:`get_distance` method will compute
129
-
the Euclidean distance between :code:`current_position` and :code:`desired_position`. The distance :math:`d` will be calculated
130
-
from the terms :math:`x`, :math:`x_d`, :math:`y`, and :math:`y_d`, as follows.
131
-
132
-
.. math::
133
-
134
-
d = \sqrt{(x-x_d)^2 + (y-y_d)^2}.
142
+
the Euclidean distance between :code:`current_position` and :code:`desired_position`.
135
143
136
144
This is represented by the following piece of code.
137
145
@@ -140,14 +148,7 @@ This is represented by the following piece of code.
140
148
:lines: 53-64
141
149
:emphasize-lines: 1, 12
142
150
143
-
The action server will update the :code:`current_position` based on a simple constant speed motion of the point. This
144
-
can be mathematically described as follows.
145
-
146
-
.. math::
147
-
148
-
p(k+1) = p(k) - s\left(\frac{p - p_d}{d}\right),
149
-
150
-
where in the :math:`k`\-ith iteration :math:`p(k+1)` represents the next position, :math:`p(k)` the current position, and :math:`s \in\mathbb{R}` is the desired speed.
151
+
The action server will update the :code:`current_position` based on a simple constant speed motion of the point.
151
152
This is represented by the following piece of code.
Suppose that we want to design an action server that takes this robot-like object from its current position :math:`\boldsymbol{p}` and moves it
37
37
towards the goal :math:`\boldsymbol{p}_d` with a speed :math:`s \in\mathbb{R}`. As feedback, it gives us the distance :math:`d \in\mathbb{R}` between the current
38
-
position and the desired position.
38
+
position and the desired position.
39
+
40
+
The distance :math:`d \in\mathbb{R}` will be calculated
41
+
from the terms :math:`x`, :math:`x_d`, :math:`y`, and :math:`y_d`, as follows.
42
+
43
+
.. math::
44
+
45
+
d = \sqrt{(x-x_d)^2 + (y-y_d)^2}.
46
+
47
+
The action server will update the position :math:`\boldsymbol{p}(k)` based on a simple constant speed motion of the point.
where in the :math:`k`\-ith iteration :math:`\boldsymbol{p}(k+1)` represents the next position, :math:`\boldsymbol{p}(k)` the current position, and :math:`s \in\mathbb{R}` is the desired speed.
0 commit comments