@@ -73,7 +73,7 @@ def __init__(self, *args, **kwargs) -> None:
73
73
74
74
# setup publisher to pass launch test without image callback being
75
75
# triggered
76
- self .pose_image
76
+ self .pnp_image
77
77
78
78
# Initialize the transform broadcaster and listener
79
79
self ._tf_buffer = tf2_ros .Buffer ()
@@ -86,12 +86,9 @@ def __init__(self, *args, **kwargs) -> None:
86
86
87
87
def _orthoimage_cb (self , msg : OrthoImage ) -> None :
88
88
# TODO: rotation and pose image should be cached atomically
89
- # TODO 2: fix use of "_orthoimage" - brittle if the private variable name is
90
- # changed
91
- if not hasattr (self , "_orthoimage" ) or (
92
- hasattr (self , "_orthoimage" )
93
- and rclpy .time .Time .from_msg (msg .image .header .stamp )
94
- != rclpy .time .Time .from_msg (self ._orthoimage .image .header .stamp )
89
+ if self ._pose_image is None or (
90
+ rclpy .time .Time .from_msg (msg .image .header .stamp )
91
+ != rclpy .time .Time .from_msg (self ._pose_image .reference .header .stamp )
95
92
):
96
93
# Set cached rotation to None to trigger rotation and cropping on
97
94
# new reference orthoimages. But only if the new orthoimage has a different
@@ -122,7 +119,7 @@ def camera_info(self) -> Optional[CameraInfo]:
122
119
123
120
def _keypoints_cb (self , msg : PointCloud2 ) -> None :
124
121
"""Callback for :attr:`.image` message"""
125
- self .pose_image (msg )
122
+ self .pnp_image (msg )
126
123
127
124
@property
128
125
# @ROS.max_delay_ms(messaging.DELAY_FAST_MS) - gst plugin does not enable timestamp?
@@ -174,7 +171,7 @@ def _transform(
174
171
ROS_TOPIC_RELATIVE_POSE_IMAGE ,
175
172
QoSPresetProfiles .SENSOR_DATA .value ,
176
173
)
177
- def pose_image (self , keypoint_cloud : PointCloud2 ) -> Optional [OrthoStereoImage ]:
174
+ def pnp_image (self , keypoint_cloud : PointCloud2 ) -> Optional [OrthoStereoImage ]:
178
175
"""Published aligned and cropped orthoimage consisting of query image,
179
176
reference image, and optional reference elevation raster (DEM).
180
177
"""
0 commit comments