diff --git a/axis_camera/launch/axis.launch b/axis_camera/launch/axis.launch index dde79e4..1393841 100644 --- a/axis_camera/launch/axis.launch +++ b/axis_camera/launch/axis.launch @@ -13,6 +13,7 @@ + @@ -22,21 +23,23 @@ - - - - - - - - - - - - - - + + + hostname: '$(arg hostname)' + username: '$(arg username)' + password: '$(arg password)' + use_encrypted_password: $(arg encrypt_password) + width: $(arg width) + height: $(arg height) + camera: $(arg camera) + frame_id: '$(arg frame_id)' + wiper: $(arg enable_wiper) + defog: $(arg enable_defog) + fps: $(arg fps) + ptz: $(arg enable_ptz) + + diff --git a/axis_camera/nodes/axis_camera_node b/axis_camera/nodes/axis_camera_node index 985d7f7..b4b0d6a 100755 --- a/axis_camera/nodes/axis_camera_node +++ b/axis_camera/nodes/axis_camera_node @@ -13,20 +13,15 @@ def updateArgs(arg_defaults): ''' args = {} for name, val in arg_defaults.items(): - full_name = rospy.search_param(name) - if full_name is None: - args[name] = val + if rospy.has_param('~' + name): + args[name] = rospy.get_param('~' + name) else: - args[name] = rospy.get_param(full_name, val) - # resolve frame_id with tf_prefix (unless already absolute) - if args['frame_id'][0] != '/': # not absolute? - tf_prefix = rospy.search_param('tf_prefix') - prefix_val = '' - if tf_prefix is not None: # prefix defined? - prefix_val = rospy.get_param(tf_prefix) - if prefix_val[0] != '/': # prefix not absolute? - prefix_val = '/' + prefix_val - args['frame_id'] = prefix_val + '/' + args['frame_id'] + args[name] = rospy.get_param(name, val) + # resolve frame_id with tf_prefix + args['frame_id'] = args['frame_id'].lstrip('/') + tf_prefix = rospy.get_param('tf_prefix', '').lstrip('/') + if tf_prefix: + args['frame_id'] = tf_prefix + '/' + args['frame_id'] return(args)