Skip to content

Commit

Permalink
clarify reliability argument value
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelarguedas committed Oct 31, 2016
1 parent 7d0787b commit 1ce6239
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rclpy_examples/listener_qos_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ def main(argv=sys.argv[1:]):
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'-r', '--reliability', type=int, default=0, choices=[0, 1],
help='0: reliable, 1: best effort')
help='1: reliable, 0: best effort')
parser.add_argument(
'-n', '--number_of_cycles', type=int, default=20,
help='max number of spin_once iterations')
args = parser.parse_args(argv)
rclpy.init()

if args.reliability == 1:
custom_qos_profile = qos_profile_sensor_data
print('best effort publisher')
else:
custom_qos_profile = qos_profile_default
print('reliable publisher')
else:
custom_qos_profile = qos_profile_sensor_data
print('best effort publisher')

node = rclpy.create_node('listener_qos')

Expand Down
8 changes: 4 additions & 4 deletions rclpy_examples/talker_qos_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ def main(argv=sys.argv[1:]):
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'-r', '--reliability', type=int, default=0, choices=[0, 1],
help='0: reliable, 1: best effort')
help='1: reliable, 0: best effort')
parser.add_argument(
'-n', '--number_of_cycles', type=int, default=20,
help='number of sending attempts')
args = parser.parse_args(argv)
rclpy.init()

if args.reliability == 1:
custom_qos_profile = qos_profile_sensor_data
print('best effort publisher')
else:
custom_qos_profile = qos_profile_default
print('reliable publisher')
else:
custom_qos_profile = qos_profile_sensor_data
print('best effort publisher')

node = rclpy.create_node('talker_qos')

Expand Down

0 comments on commit 1ce6239

Please sign in to comment.