An open API service indexing awesome lists of open source software.

https://github.com/nvidia-ai-iot/ros2_jetson_stats

ROS 2 package for monitoring and controlling NVIDIA Jetson Platform resources
https://github.com/nvidia-ai-iot/ros2_jetson_stats

eloquent jetson robotics ros2

Last synced: 3 months ago
JSON representation

ROS 2 package for monitoring and controlling NVIDIA Jetson Platform resources

Awesome Lists containing this project

README

          

# ROS 2 jetson_stats
[NVIDIA Developer Blog](https://developer.nvidia.com/blog/implementing-robotics-applications-with-ros-2-and-ai-on-jetson-platform-2/)

## ROS2 wrapper for Jetson Stats (jtop)
This repository takes inspiration from [ROS-jtop](https://github.com/rbonghi/ros_jetson_stats) and creates package for ros2 (currently tested on eloquent)

## Pre-requisite
ROS2 Eloquent [Install Guide](https://index.ros.org/doc/ros2/Installation/Eloquent/Linux-Development-Setup/)

## Set up
1. Install Jetson Stats:

```sudo -H pip install -U jetson-stats```
2. Clone repo in ros2 workspace
``` cd dev_ws/src```

``` git clone https://github.com/NVIDIA-AI-IOT/ros2_jetson_stats.git```

3. Build
``` sudo rosdep install --from-paths ros2_jtop --ignore-src --rosdistro eloquent -y ```

``` colcon build ```

``` . install/setup.bash ```

### Usage

The basic usage consists of creating `diagnostics_msgs` and services for control fan mode/speed, setting up `jetson_clocks`, and power mode.

1. Run JTOP node:

``` ros2 run ros2_jetson_stats ros2_jtop ```

If you want to change frequency of JTOP messages, do following:

``` ros2 run ros2_jetson_stats ros2_jtop --ros-args -p interval:=0.2```

*Note: JTOP frequency is from 0 - 1 range*

2. You can see diagnostic messages using following command:
``` sudo . install/setup.bash ```

``` sudo . install/local_setup.bash ```

``` ros2 run rqt_topic rqt_topic ```

*Note: for default interval you will see message frequency ~2Hz if you change interval to 0.2 the message frequency will change to 6Hz*

3. To run JTOP services:

You will need to keep running ```ros2_jetson_stats``` ; as shown in step 1.

A. Change Power Model:

Open new terminal

``` sudo . install/local_setup.bash ```

```ros2 service call /jtop/nvpmodel jtop_services/srv/NVPModel "{nvpmodel: 0}"```

This will change power mode to ``` 15 W 2 Core ``` on Jetson Xavier NX
Following Message will appear on the terminal:

```

requester: making request: jtop_services.srv.NVPModel_Request(nvpmodel=2)

response:
jtop_services.srv.NVPModel_Response(power_mode='MODE_15W_2CORE')

```

B. Change Fan mode and Fan Speed:

Open new terminal

``` sudo . install/local_setup.bash ```

```ros2 service call /jtop/fan jtop_services/srv/Fan "{mode: system, speed: 100}"```

This will change fan speed to 100; you can see Jetson Fan being turned on.

```

requester: making request: jtop_services.srv.Fan_Request(mode='system', speed=100)

response:
jtop_services.srv.Fan_Response(set_fan_mode='system', set_fan_speed=100)
```

C. Start Jetson Clocks:
Open new terminal

``` sudo . install/local_setup.bash ```

``` ros2 service call /jtop/jetson_clocks jtop_services/srv/JetsonClocks "{status: True}"```

## Other related ROS 2 projects
- [ros2_torch_trt](https://github.com/NVIDIA-AI-IOT/ros2_torch_trt) : ROS2 Real Time Classification and Detection

- [ros2_deepstream](https://github.com/NVIDIA-AI-IOT/ros2_deepstream) : ROS2 nodes for DeepStream applications

- [ros2_trt_pose](https://github.com/NVIDIA-AI-IOT/ros2_trt_pose) : ROS 2 package for "trt_pose": real-time human pose estimation on NVIDIA Jetson Platform