Skip to content

oscar-lima/rqt_simple_launcher

Repository files navigation

rqt_simple_launcher

rqt helper to execute ROS1 processes (roslaunch or rosrun) files via GUI.

rqt_simple_launcher.png

Motivation

Sometimes when debugging in robotics you need to launch the same launch file over and over again. This GUI helps with that.

Features

  • launch/kill files with a button.
  • configure up to 4 string or numeric and 1 boolean launch argument.
  • get visual feedback when all srvs manually defined by you are available, can be used in practice to know when the launch file is done launching.
  • run nodes with a button or after a launch file has finishes launching (see Double process exec section).
  • progress bar gives info about the launch state.

Setup

Please follow:

  • ROS_WORKSPACE env needs to be set to the src folder of your workspace, e.g. /home/user/ros_ws/src
  • a folder named rqt_simple_launcher_config needs to be created on the root of your catkin ws.
  • inside it, one folder per launch configuration is required, e.g. tiago_demo folder
  • two files are expected for a (ros)launch configuration: args_config.yaml and required_services.yaml
  • one file is expected for a (ros)run configuration: args_config.yaml, however please create an empty required_services.yaml in case you need to run a standalone node i.e. without launch file, otherwise is not needed.

Inside args_config.yaml you can configure which launch arguments you want to include in the gui.

Inside required_services.yaml you can configure wich ros services to wait for, to assume that the launch file has finished launching. We provide with a script query_existing_srvs.py to automatically query existing ros srvs and dump them to a yaml file. You can then launch manually your launch file the first time, wait until it finishes launching all nodes and do:

cd $ROS_WORKSPACE/rqt_simple_launcher_scripts
python3 query_existing_srvs.py

Then required_services.yaml is autogenerated, simply copy to the appropriate location as described in the above instructions.

You can look at example config files under the config folder of this repo.

Additionally we recorded a video showing these steps available under:

https://youtu.be/5lUL88q_gME

Usage

roscore # important, don't omit
roslaunch rqt_simple_launcher rqt_simple_launcher.launch execution_timeout:=60 args_config:=<my_config>

Ready, a GUI should pop up, you can now launch your files (and/or run your nodes) more conveniently.

NOTE: if you are testing a configuration for the first time, it helps to set the arg only_print_cmd to true. In this case nothing is executed but the GUI only prints the command that would be launch.

roscore # important, don't omit
roslaunch rqt_simple_launcher rqt_simple_launcher.launch execution_timeout:=60 args_config:=<my_config> only_print_cmd:=true

Known bugs

The following will not work:

  • if the launch file you are executing has errors things can go south, workaround: manually press button to kill the launch file, fix errors and try again.

Double process exec

i.e. launch a file and run a node once it finishes launching

multiple_guis.png

This can be achieved with the help of rqt_gui perspectives, create a folder named rqt_gui_perspectives under your rqt_simple_launcher_config folder.

Run rqt_gui: rosrun rqt_gui rqt_gui

An empty gui should pop up (if not, then close all existing gui's first)

Click on Perspectives, then export. Save under your previously created rqt_gui_perspectives folder from the previous step.

Create a custom launch file, use the following code as template:

<?xml version="1.0"?>
<launch>

  <!-- send arm to up, move base to table 3 and pick relay_1, then place it again on table 3 -->

  <arg name="execution_timeout_1" default="30"/>
  <arg name="execution_timeout_2" default="20"/>
  <arg name="estimated_termination_time_1" default="19.0"/> <!-- in sec -->
  <arg name="estimated_termination_time_2" default="5.0"/> <!-- in sec -->
  <arg name="only_print_cmd_1" default="false"/>
  <arg name="only_print_cmd_2" default="false"/>

  <include file="$(find rqt_simple_launcher)/launch/rqt_multiple_launcher.launch" >
    <arg name="perspective_name" value="my_perspective_name"/>
    <arg name="args_config_1" value="my_launch_config"/>
    <arg name="args_config_2" value="my_run_config"/>
    <arg name="execution_timeout_1" value="$(arg execution_timeout_1)"/>
    <arg name="execution_timeout_2" value="$(arg execution_timeout_2)"/>
    <arg name="estimated_termination_time_1" value="$(arg estimated_termination_time_1)"/>
    <arg name="estimated_termination_time_2" value="$(arg estimated_termination_time_2)"/>
    <arg name="only_print_cmd_1" value="$(arg only_print_cmd_1)"/>
    <arg name="only_print_cmd_2" value="$(arg only_print_cmd_2)"/>
  </include>

</launch>

replace my_perspective_name , my_launch_config and my_run_config accordingly.

Tune other values e.g. execution_timeout, estimated_termination_time to your own values.

About

rqt helper to run launch files via GUI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published