Skip to content

Commit

Permalink
fix: non-main launches no longer crash trying to shut down roscore
Browse files Browse the repository at this point in the history
  • Loading branch information
figuernd committed Mar 29, 2024
1 parent 2c8d079 commit 60b3bd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion phyto-arm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def _start(args):
env['ROS_LOG_DIR'] = log_dir

# The following should only launch once, with the main PhytO-ARM processes
roscore = None
if args.launch_name == "main":
# Before we continue compress any older log files
#print('Compressing older logs')
Expand Down Expand Up @@ -172,7 +173,7 @@ def _start(args):
# Since we called wait() behind subprocess's back, we need to inform it that
# the process terminated. A little hacky.
for proc in [roscore, rosbag, nodes]:
if proc.pid == pid:
if proc is not None and proc.pid == pid:
proc.returncode = os.WEXITSTATUS(status) \
if os.WIFEXITED(status) else -1

Expand Down

0 comments on commit 60b3bd0

Please sign in to comment.