ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

roslaunch, rosrun, and ./mynode.py

asked 2018-07-28 08:42:49 -0500

pitosalas gravatar image

For a trivial single node scenario (for example in python) I believe I could run it in any of the above three ways. A launch file is obviously overkill if I am still designing and experimenting. But is there anything wrong with just running it from the command line assuming it's dependencies are satisfied?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-30 13:52:56 -0500

simbha gravatar image

updated 2018-07-30 13:54:03 -0500

Each one had its own advantage. we generally use the roslaunch when we have multiple scripts to work. If you want to run the single script then rosrun is enough. The advantage of running these commands is, no need to worry about the path of script/s. you can run the command (rolaunch, rosrun) from anywhere.

there are other possibilities is also like python mynode.py. So there is no harm to use the anyone mentioned.

Yes, in case of rosservice it can

edit flag offensive delete link more

Comments

Thanks. All clear, but I don't understand your last sentence

pitosalas gravatar image pitosalas  ( 2018-07-31 05:55:34 -0500 )edit

in case of rosservice, your client should run before the server. if you keep these script in the launch file, then this can cause an issue.

simbha gravatar image simbha  ( 2018-07-31 08:45:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-28 08:42:49 -0500

Seen: 147 times

Last updated: Jul 30 '18