Git Product home page Git Product logo

roslaunch_monitor's Introduction

roslaunch_monitor

Provides a roslaunch server that can be invoked by actionlib, and that monitors CPU and RAM usage

User interface

Dependencies

The interface requires npyscreen: sudo pip install npyscreen

Usage

There are four ways of using the monitor server. All of the them requires first having the launch_server running:

rosrun roslaunch_monitor launch_server.py

First way: same as roslaunch

rosrun roslaunch_monitor monitor_server.py my_pkg my_file.launch my_parameter:=42

Second way: using the service

This way requires already having a monitor_server instance running, same as above. The monitor server may also be invoked without any arguments. After we have the launch_server and monitor_server running, we can call the service:

rosservice call /monitor_server/monitor_launch "pkg: 'my_pkg'
launch_file: 'my_file.launch'                                                                           
parameters: ['my_parameter']
values: ['42']
monitor_cfg: ''" 

The service will return the launch_id value, which we may keep track of if we want to shut down the launch file again, using the following call:

rosservice call /monitor_server/cancel_launch "launch_id: 2"

Third way: using the API

We may also configure our launch files programatically, in Python. This gives us a UI, same as the monitor_server above.

import rospy
from roslaunch_monitor.monitor_app import MonitorApp

rospy.init_node('my_monitor_server')

App = MonitorApp()

slam_monitor_cfg = {'test_slam_node': [{'condition': 'cpu_percent', 'action': 'RESTART', 'limit': 90, 'window': 100},
                                       {'condition': 'nbr_restarts', 'action': 'KILL', 'limit': 1}]}
sim_monitor_cfg = {'test_slam_sim_node': [{'condition': 'ram_mb', 'action': 'RESTART', 'limit': 30, 'window': 10},
                                          {'condition': 'nbr_restarts', 'action': 'KILL', 'limit': 10}]}

App.queue_launch("rfs_slam", "test_sim.launch", sim_monitor_cfg)
App.queue_launch("rfs_slam", "slam.launch", slam_monitor_cfg)

App.run()

Fourth way: using the RQT Plugin

You can also launch nodes using the RQT plugin interface as shown below. Note that you can not use this interface for monitoring, or for killing/restarting individual nodes. User interface

roslaunch_monitor's People

Contributors

nilsbore avatar rayman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

roslaunch_monitor's Issues

Release package for melodic/noetic

Have you ever thought about releasing this package for melodic or noetic. This would enable users to install this package with apt-get install. If you want, I could give you help with that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.