Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom rosdoc2 config #161

Merged
merged 23 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
51eabec
Remove unused dox file
christophfroehlich Apr 8, 2024
717add5
Add doxygen file and script
christophfroehlich Apr 8, 2024
aada082
Add doxygen workflow
christophfroehlich Apr 8, 2024
a81c22d
Add rosdoc2.yaml
christophfroehlich Apr 8, 2024
4e1381a
Add an index.rst used for rosdoc2
christophfroehlich Apr 8, 2024
033b093
Add doxygen to pre-commit
christophfroehlich Apr 8, 2024
228b807
Update doxygen workflow
christophfroehlich Apr 8, 2024
72a3499
Exclude sphinx/rosdoc2 config files from pre-commit
christophfroehlich Apr 9, 2024
1b75fd6
Use doxygen branch for ci
christophfroehlich Apr 9, 2024
0a12138
Fix flow-map syntax
christophfroehlich Apr 9, 2024
a4177a9
export rosdoc2
christophfroehlich Apr 9, 2024
52ac7d6
Add a oneline description
christophfroehlich Apr 9, 2024
9ae18f8
Go back to master branch
christophfroehlich Apr 13, 2024
3b9c759
Remove all doxygen workflows or settings
christophfroehlich Apr 14, 2024
4227953
Add ros2_control logo and link to control.ros.org
christophfroehlich Apr 14, 2024
6ba4d0f
Add rosdoc2 workflow
christophfroehlich Apr 14, 2024
6ee234e
Reduce config to a minimum
christophfroehlich Apr 16, 2024
e8df222
Run workflow only if relevant config changed
christophfroehlich Apr 16, 2024
7e12242
Remove link to ROS 1 wiki
christophfroehlich Apr 16, 2024
2786dbf
Copy info over from wiki.ros.org
christophfroehlich Apr 16, 2024
ec0d31d
Add control.ros.org
christophfroehlich Apr 16, 2024
19b7624
Add details on realtime loops
christophfroehlich Apr 16, 2024
42eb589
Use master branch of ros2_control_ci repo
christophfroehlich Apr 17, 2024
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
16 changes: 16 additions & 0 deletions .github/workflows/rosdoc2.yml
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
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repos:
- id: check-symlinks
- id: check-xml
- id: check-yaml
exclude: rosdoc2.yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
Expand Down Expand Up @@ -105,6 +106,7 @@ repos:
description: Check if copyright notice is available in all files.
entry: ament_copyright
language: system
exclude: doc/conf.py

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ realtime_tools
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![codecov](https://codecov.io/gh/ros-controls/realtime_tools/branch/master/graph/badge.svg?token=Osge1FOaAh)](https://app.codecov.io/gh/ros-controls/realtime_tools/tree/master)

Contains a set of tools that can be used from a hard realtime thread, without breaking the realtime behavior.

## Build status
ROS2 Distro | Branch | Build status | Documentation | Released packages
Expand Down
13 changes: 0 additions & 13 deletions doc.dox

This file was deleted.

5 changes: 5 additions & 0 deletions doc/conf.py
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"
59 changes: 59 additions & 0 deletions doc/index.rst
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`
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<license>3-Clause BSD</license>

<url type="website">http://ros.org/wiki/realtime_tools</url>
<url type="website">https://control.ros.org</url>
<url type="bugtracker">https://github.com/ros-controls/realtime_tools/issues</url>
<url type="repository">https://github.com/ros-controls/realtime_tools/</url>

Expand Down
Loading