-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Felix Exner (fexner) <felix_mauch@web.de>
- Loading branch information
1 parent
99b6153
commit 9f0db26
Showing
7 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: rosdoc2 | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- doc/** | ||
- rosdoc2.yaml | ||
- package.xml | ||
|
||
|
||
jobs: | ||
check: | ||
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rosdoc2.yml@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# settings will be overridden by rosdoc2, so we add here only custom settings | ||
|
||
copyright = "2024, ros2_control development team" | ||
html_logo = "https://control.ros.org/master/_static/logo_ros-controls.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Welcome to the documentation for realtime_tools | ||
=============================================== | ||
|
||
Contains a set of tools that can be used from a hard realtime thread, without breaking the realtime behavior. | ||
|
||
For more information of the ros2_control framework see `control.ros.org <https://control.ros.org/>`__. | ||
|
||
Realtime Publisher | ||
------------------ | ||
The ``realtime_tools::RealtimePublisher`` allows users that write C++ ros2_controllers to publish messages on a ROS topic from a hard realtime loop. The normal ROS publisher is not realtime safe, and should not be used from within the update loop of a realtime controller. The realtime publisher is a wrapper around the ROS publisher; the wrapper creates an extra non-realtime thread that publishes messages on a ROS topic. The example below shows a typical usage of the realtime publisher in the ``on_configure()`` (non-realtime method) and ``update()`` (realtime method) methods of a realtime controller: | ||
|
||
.. code-block:: cpp | ||
#include <realtime_tools/realtime_publisher.h> | ||
class MyController : public controller_interface::ControllerInterface | ||
{ | ||
... | ||
private: | ||
std::shared_ptr<realtime_tools::RealtimePublisher<my_msgs::msg::MyMsg>> state_publisher_; | ||
std::shared_ptr<rclcpp::Publisher<my_msgs::msg::MyMsg>> s_publisher_; | ||
} | ||
controller_interface::CallbackReturn MyController::on_configure( | ||
const rclcpp_lifecycle::State & /*previous_state*/) | ||
{ | ||
... | ||
s_publisher_ = get_node()->create_publisher<my_msgs::msg::MyMsg>( | ||
"~/status", rclcpp::SystemDefaultsQoS()); | ||
state_publisher_ = | ||
std::make_unique<realtime_tools::RealtimePublisher<ControllerStateMsg>>(s_publisher_); | ||
... | ||
} | ||
controller_interface::return_type MyController::update( | ||
const rclcpp::Time & /*time*/, const rclcpp::Duration & /*period*/) | ||
{ | ||
... | ||
// Publish controller state | ||
state_publisher_->lock(); | ||
state_publisher_->msg_ = some_msg; | ||
state_publisher_->unlockAndPublish(); | ||
} | ||
API documentation | ||
------------------ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
C++ API <generated/index> | ||
|
||
|
||
Indices and Search | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters