0
$\begingroup$

Rosanswers logo

Related to this question: https://answers.ros.org/question/368557/alternative-to-launch-files/

What would go wrong if instead of roslaunch of a .launch file, I wrote a bash script with a series of rosrun commands? Here are two possibilities:

  • would performance would suffer badly?
  • does roslaunch do something in addition (e.g. handling errors or handling roscore

Originally posted by pitosalas on ROS Answers with karma: 628 on 2020-12-29

Post score: 0


Original comments

Comment by gvdhoorn on 2020-12-29:
Seeing #q368557 and your question here: perhaps you could add some words on what made you ask your question(s).

Using roslaunch is quite central to a normal workflow in ROS 1.

I'm not claiming it's perfect (not at all actually), but I'm curious as to what you've encountered that made you post your question here.

Are you running into some (perceived) limitation perhaps?

Comment by pitosalas on 2020-12-29:
As for limitation, the only one is that I wish I could have roslaunch print messages so while I am debugging it I can see what is happening. But xml is so verbose and redundant and unreadable. I want something much simpler for the 90% use case. It doesn't have to be python, it could be json or something else. I could easily imagine this existing. So all my questions are around finding a better way to orchestrate the launch of nodes.

Comment by gvdhoorn on 2020-12-29:\

I wish I could have roslaunch print messages so while I am debugging it

what sort of messages?

Comment by pitosalas on 2020-12-29:
For example, printing the value of a param

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

roslaunch was not invented for performance reasons, but for convenience.

From wiki/roslaunch:

roslaunch is a tool for easily launching multiple ROS nodes locally and remotely via SSH, as well as setting parameters on the Parameter Server. It includes options to automatically respawn processes that have already died. roslaunch takes in one or more XML configuration files (with the .launch extension) that specify the parameters to set and nodes to launch, as well as the machines that they should be run on.

In addition to what is written there, roslaunch also provides a way to easily configure node names, remap topics and refer to files and other resources (using substitution args).

rosrun has none of this. You could do all of this yourself (in a .bash script), but that would just mean you'd be spending effort duplicating what a tool can already do for you.

In the end roslaunch doesn't perform any magic: it resolves locations of binaries (in packages), constructs a command line (including the values of the special keys) and Popen(..)s them (so to speak).


Originally posted by gvdhoorn with karma: 86574 on 2020-12-29

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.