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

roslaunch using tmux for large project [solved]

asked 2018-04-20 12:55:55 -0600

updated 2021-06-16 02:47:20 -0600

Hello,

I have a project with a launch file that includes other launch files and many nodes. I would like to run it in a tmux session in a specific way with various windows and panes, some nodes running with gdb or valgrind.

For now I'm testing a simple script that would take the window name as a first argument, so something like this in the launch file in a node tag:

launch-prefix="$(find my_package)/script/tmux.sh window_name"

And with the script (set with chmod +x) :

#!/bin/sh

tmux new-window -n $1 "gdb --args ${*:2}"

So the command should create a new window named as the first argument, and forward everything else to gdb. But the node crashes with "process has died".

Has anybody done something similar, or am I missing something ?

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-01-30 14:20:23 -0600

Purplefishies gravatar image

Hi

I was looking to do the exact same thing and I found a way to do it with a more recent version of TMUX ( > 1.8 ) using the wait-for command.

I have a script tmux.sh that looks like the following

#!/bin/sh

tmux new-window "gdb -q $GDB_ARGS --args $* ; tmux wait-for -S gdb_ros_done"

tmux wait-for gdb_ros_done

This way your script tmux.sh won't complete until after you are finished debugging your ROS node. This keeps your ROS node from exiting with "process has died". When it finishes, the gdb_ros_done signal is sent, and then the last statement in your tmux.sh script can finally execute.

( The GDB_ARGS was a fix to let me put break points in using the "-ex" command line option to gdb )

edit flag offensive delete link more
2

answered 2018-04-20 14:42:12 -0600

NEngelhard gravatar image

You could have a look at catmux. I haven't used it, but it sounds like the thing you are looking for.

edit flag offensive delete link more

Comments

Thanks, it looks like what I was searching for! It's under development but I'll try it and mark your answer if it works.

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-04-20 14:51:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-20 12:55:55 -0600

Seen: 1,683 times

Last updated: Jun 16 '21