Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run_name entry in app_manager to specify the node name #64

Open
wants to merge 1 commit into
base: kinetic-devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/app_manager/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,21 @@ def _AppDefinition_load_run_args_entry(app_data, appfile="UNKNOWN"):
except ValueError as e:
raise InvalidAppException("Malformed appfile [%s]: bad run_args entry: %s"%(appfile, e))


def _AppDefinition_load_run_name_entry(app_data, appfile="UNKNOWN"):
"""
@raise InvalidAppException: if app definition is invalid.
"""
# load/validate launch entry
try:
run_name = app_data.get('run_name', '')
if run_name == '':
return None
return run_name
except ValueError as e:
raise InvalidAppException("Malformed appfile [%s]: bad run_name entry: %s"%(appfile, e))


def _AppDefinition_load_run_entry(app_data, appfile="UNKNOWN", rospack=None):
"""
@raise InvalidAppExcetion: if app definition is invalid.
Expand All @@ -237,7 +252,8 @@ def _AppDefinition_load_run_entry(app_data, appfile="UNKNOWN", rospack=None):
# create node
p, a = roslib.names.package_resource_name(run_resource)
args = _AppDefinition_load_run_args_entry(app_data, appfile)
node = roslaunch.core.Node(p, a, args=args, output='screen')
name = _AppDefinition_load_run_name_entry(app_data, appfile)
node = roslaunch.core.Node(p, a, name=name, args=args, output='screen')
return node
except ValueError as e:
raise InvalidAppException("Malformed appfile [%s]: bad run entry: %s"%(appfile, e))
Expand Down