Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions docs/graphs/network.mmd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/graphs/network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/graphs/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/source/action_clients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ of the instance to guarantee they will not get out of scope before the result is

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_the_actions/python_package_that_uses_the_actions/move_straight_in_2d_action_client_node.py
:language: python
:lines: 37-43
:emphasize-lines: 4,6,7
:lines: 37-45
:emphasize-lines: 4,7,8

The following method can be used to send the action goal and trigger the entire process. Notably, suppose that a suitable
action has already been instantiated and is sent as argument to this method. We wait for the action server to be available.
Expand All @@ -104,7 +104,7 @@ is for the result of the goal request operation.

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_the_actions/python_package_that_uses_the_actions/move_straight_in_2d_action_client_node.py
:language: python
:lines: 45-55
:lines: 47-57
:emphasize-lines: 1,5,10,11

After the goal is processed, the goal-related callback will be automatically called for us given that it was added to the respective
Expand All @@ -115,21 +115,21 @@ We ask for a result asynchronously. We then assign a third callback for when a r

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_the_actions/python_package_that_uses_the_actions/move_straight_in_2d_action_client_node.py
:language: python
:lines: 57-66
:lines: 59-68
:emphasize-lines: 1,4,9,10

The result callback will receive a future and process the result of the action somehow. In this toy example, we simply
print the results to the screen.

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_the_actions/python_package_that_uses_the_actions/move_straight_in_2d_action_client_node.py
:language: python
:lines: 68-70
:lines: 70-72

Lastly, we see that the callback for the feedback is, again, very similar to that for a subscriber.

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_the_actions/python_package_that_uses_the_actions/move_straight_in_2d_action_client_node.py
:language: python
:lines: 72-74
:lines: 74-76

To simplify this example slightly, please notice that the action is instantiated in the :code:`main` function, and
the action is triggered only once.
Expand All @@ -139,7 +139,7 @@ the object will not yet exist, or you will be locked in the spinner before sendi

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_the_actions/python_package_that_uses_the_actions/move_straight_in_2d_action_client_node.py
:language: python
:lines: 85-93
:lines: 87-95

Build and source
----------------
Expand Down
1 change: 1 addition & 0 deletions docs/source/cybersecurity/secret_message_decrypted.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You have solved the exercise.
12 changes: 6 additions & 6 deletions docs/source/gazebo/custom_nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ name for :program:`Gazebo` to know which entity to set the pose. This name can b

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_gazebo/python_package_that_uses_gazebo/send_poses_to_gazebo_node.py
:language: python
:lines: 46-65
:lines: 47-66
:emphasize-lines: 7

The second possibly unfamiliar is the choice of ``rclpy.spin_until_future_complete`` to illustrate calling the service
client only once.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_gazebo/python_package_that_uses_gazebo/send_poses_to_gazebo_node.py
:language: python
:lines: 68-83
:lines: 69-84
:emphasize-lines: 11

.. admonition:: Exercises
Expand Down Expand Up @@ -334,7 +334,7 @@ and :program:`Gazebo` won't recognise it.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_gazebo/python_package_that_uses_gazebo/send_wrenches_to_gazebo_node.py
:language: python
:lines: 46-70
:lines: 47-71
:emphasize-lines: 7

.. admonition:: Wait... what?
Expand Down Expand Up @@ -387,21 +387,21 @@ Lastly, `_gazebo_entity_id` is used to send the wrench to the correct entity.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_gazebo/python_package_that_uses_gazebo/control_shape_thrust_node.py
:language: python
:lines: 40-44
:lines: 43-47

There is also a simple proportional controller in one dimension.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_gazebo/python_package_that_uses_gazebo/control_shape_thrust_node.py
:language: python
:lines: 68-72
:lines: 71-75

Lastly, in the ``timer_callback``, we use the current coordinate value to compute the control action and send it to
:program:`Gazebo`.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_gazebo/python_package_that_uses_gazebo/control_shape_thrust_node.py
:language: python
:emphasize-lines: 11,13
:lines: 94-115
:lines: 97-118

.. admonition:: Exercises

Expand Down
4 changes: 2 additions & 2 deletions docs/source/navigation/custom_nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ with the initialisation.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_nav2/python_package_that_uses_nav2/nav2_initial_pose_publisher_node.py
:language: python
:lines: 44-49
:lines: 45-50
:emphasize-lines: 2

The second part that might be unfamiliar is the covariance used in the message. The covariance matrix holds the variance
Expand All @@ -405,7 +405,7 @@ The covariance is highlighted below.

.. literalinclude:: ../../../ros2_tutorial_workspace/src/python_package_that_uses_nav2/python_package_that_uses_nav2/nav2_initial_pose_publisher_node.py
:language: python
:lines: 51-73
:lines: 52-74
:emphasize-lines: 19-21

It is important not to be distracted by the nested ``pose``. The first one os the ``PoseWithCovariance``, part of the
Expand Down
6 changes: 3 additions & 3 deletions docs/source/parameters_and_launch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ For one-off parameters, we just get them once after declaring them. Because we'r

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_parameters_and_launch_files/python_package_that_uses_parameters_and_launch_files/amazing_quote_configurable_publisher_node.py
:language: python
:lines: 40-51
:lines: 42-53
:emphasize-lines: 2-5,9,12

In this case, we're making the topic name and publication periodicity as one-off configurable parameters.
Expand All @@ -108,13 +108,13 @@ For parameters that we obtain continuously through the lifetime of the Node, we

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_parameters_and_launch_files/python_package_that_uses_parameters_and_launch_files/amazing_quote_configurable_publisher_node.py
:language: python
:lines: 36-38
:lines: 38-40

then obtain them in another method, like so

.. literalinclude:: ../../ros2_tutorial_workspace/src/python_package_that_uses_parameters_and_launch_files/python_package_that_uses_parameters_and_launch_files/amazing_quote_configurable_publisher_node.py
:language: python
:lines: 55-68
:lines: 57-70
:emphasize-lines: 4,5,9,10

In this example, we are making the :code:`quote` and the :code:`philosopher_name` as configurable parameters that can be changed continuously, during the lifetime of the Node. After they are changed, the node will publish a message with different contents.
Expand Down
Loading