Skip to content

Commit ecffc52

Browse files
committed
Update to latest APIs.
Signed-off-by: Chris Lalancette <[email protected]>
1 parent ca25669 commit ecffc52

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

image_tools_py/cam2image_py.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# ROS2 imports
2626
import rclpy
27-
from rclpy.qos import qos_profile_default, qos_profile_sensor_data
27+
from rclpy.qos import qos_profile_system_default, qos_profile_sensor_data
2828
import sensor_msgs.msg
2929
import std_msgs.msg
3030

@@ -73,18 +73,18 @@ def main(args=None):
7373
'-b', '--burger', dest='burger_mode', action='store_true', default=False,
7474
help='Produce images of burgers rather than connecting to a camera')
7575
parser.add_argument(
76-
'-d', '--depth', dest='depth', action='store', default=qos_profile_default.depth, type=int,
76+
'-d', '--depth', dest='depth', action='store', default=qos_profile_system_default.depth, type=int,
7777
help='Queue depth')
7878
parser.add_argument(
7979
'-f', '--frequency', dest='frequency', action='store', default=30, type=int,
8080
help='Publish frequency in Hz')
8181
parser.add_argument(
82-
'-k', '--keep', dest='history_policy', action='store', default=qos_profile_default.history,
82+
'-k', '--keep', dest='history_policy', action='store', default=qos_profile_system_default.history,
8383
type=int, choices=[0, 1],
8484
help='History QoS setting, 0 - keep last sample, 1 - keep all the samples')
8585
parser.add_argument(
8686
'-r', '--reliability', dest='reliability_policy', action='store',
87-
default=qos_profile_default.reliability, type=int, choices=[0, 1],
87+
default=qos_profile_system_default.reliability, type=int, choices=[0, 1],
8888
help='Reliability QoS setting, 0 - best effort, 1 - reliable')
8989
parser.add_argument(
9090
'-s', '--show', dest='show_camera', action='store', default=0, type=int, choices=[0, 1],
@@ -106,7 +106,7 @@ def main(args=None):
106106

107107
# Set the parameters of the quality of service profile. Initialize as the
108108
# default profile and set the QoS parameters specified on the command line.
109-
custom_camera_qos_profile = qos_profile_default
109+
custom_camera_qos_profile = qos_profile_system_default
110110

111111
# Depth represents how many messages to store in history when the history policy is KEEP_LAST
112112
custom_camera_qos_profile.depth = args.depth

image_tools_py/showimage_py.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# ROS2 imports
2525
import rclpy
26-
from rclpy.qos import qos_profile_default
26+
from rclpy.qos import qos_profile_system_default
2727
import sensor_msgs.msg
2828

2929

@@ -52,15 +52,15 @@ def main(args=None):
5252
# Parse the command-line options.
5353
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
5454
parser.add_argument(
55-
'-d', '--depth', dest='depth', action='store', default=qos_profile_default.depth, type=int,
55+
'-d', '--depth', dest='depth', action='store', default=qos_profile_system_default.depth, type=int,
5656
help='Queue depth')
5757
parser.add_argument(
58-
'-k', '--keep', dest='history_policy', action='store', default=qos_profile_default.history,
58+
'-k', '--keep', dest='history_policy', action='store', default=qos_profile_system_default.history,
5959
type=int, choices=[0, 1],
6060
help='History QoS setting, 0 - keep last sample, 1 - keep all the samples')
6161
parser.add_argument(
6262
'-r', '--reliability', dest='reliability_policy', action='store',
63-
default=qos_profile_default.reliability, type=int, choices=[0, 1],
63+
default=qos_profile_system_default.reliability, type=int, choices=[0, 1],
6464
help='Reliability QoS setting, 0 - best effort, 1 - reliable')
6565
parser.add_argument(
6666
'-s', '--show', dest='show_camera', action='store', default=1, type=int, choices=[0, 1],
@@ -74,7 +74,7 @@ def main(args=None):
7474
# the camera.
7575
node = rclpy.create_node('showimagepy')
7676

77-
custom_qos_profile = qos_profile_default
77+
custom_qos_profile = qos_profile_system_default
7878

7979
# Depth represents how many messages to store in history when the history policy is KEEP_LAST.
8080
custom_qos_profile.depth = args.depth

0 commit comments

Comments
 (0)