Repo symbol

topnode repository

Repo symbol

topnode repository

Repo symbol

topnode repository

Repo symbol

topnode repository

Repository Summary

Description Resource-monitoring ROS2 component node
Checkout URI https://github.com/safe-ros/topnode.git
VCS Type git
VCS Version main
Last Updated 2025-02-04
Dev Status UNKNOWN
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
topnode 0.1.0
topnode_interfaces 0.1.0

README

TopNode

A resource-monitoring component node for ROS 2.

Installation

On humble:

sudo apt install ros-humble-mcap-vendor

cd ~/ros2_ws/src
git clone https://github.com/safe-ros/topnode
cd ~/ros2_ws

colcon build
source ~/ros2_ws/install/setup.sh

On rolling:

sudo apt install ros-rolling-mcap-vendor 

cd ~/ros2_ws/src
git clone https://github.com/safe-ros/topnode
cd ~/ros2_ws

colcon build
source ~/ros2_ws/install/setup.sh

Usage

To see that the workspace was correctly built and installed, the component should appear in the component list

$ ros2 component types
topnode
  ResourceMonitorNode

Standalone Node

The standalone resource monitor may be started with

ros2 run topnode resource_monitor

Component Node

The primary intended use of the resource monitor is as a component node.

When the component is added to a running container, it will monitor the resource usage of that container.

Instrumenting a running container

To add the resource monitor node to an existing container:

ros2 component load $COMPONENT_MANAGER_NODE topnode ResourceMonitorNode

Instrumenting a container via launch

To add the resource monitor to a container via launch:

container = ComposableNodeContainer(
        name='instrumented_container',
        namespace='',
        package='rclcpp_components',
        executable='component_container',
        composable_node_descriptions=[
            ComposableNode(
                package='topnode',
                plugin='ResourceMonitorNode',
                name='resource_monitor',
                parameters=[{
                    "publish_cpu_memory_usage": True,
                    "publish_memory_state": True,
                    "publish_io_stats": True,
                    "publish_stat": True,
                    "publish_period_ms": 500,
                    "record_cpu_memory_usage": True,
                    "record_memory_state": True,
                    "record_io_stats": True,
                    "record_stat": True,
                }]),
        ],
        output='screen',
)

Controlling the monitor via lifecycle

The monitor is implemented as a managed node

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

topnode repository

Repo symbol

topnode repository

Repo symbol

topnode repository

Repo symbol

topnode repository