Skip to content

Commit

Permalink
arco_detection.py微修正
Browse files Browse the repository at this point in the history
  • Loading branch information
mizonon committed Nov 12, 2024
1 parent 8e37d8d commit 4064d2c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crane_x7_examples_py/crane_x7_examples_py/aruco_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

class ImageSubscriber(Node):
def __init__(self):
super().__init__("aruco_detection")
super().__init__('aruco_detection')
self.image_subscription = self.create_subscription(
Image, "/camera/color/image_raw", self.listener_callback, 10
Image, '/camera/color/image_raw', self.listener_callback, 10
)
self.camera_info_subscription = self.create_subscription(
CameraInfo, "/camera/color/camera_info", self.listener_callback, 10
CameraInfo, '/camera/color/camera_info', self.listener_callback, 10
)
self.tf_broadcaster = tf2_ros.TransformBroadcaster()

Expand Down Expand Up @@ -81,8 +81,8 @@ def image_callback(self, msg):
# tfの配信
t = TransformStamped()
t.header.stamp = self.get_clock().now().to_msg()
t.header.frame_id = "camera_color_optical_frame"
t.child_frame_id = "target_" + str(ids[i][0])
t.header.frame_id = 'camera_color_optical_frame'
t.child_frame_id = 'target_' + str(ids[i][0])
t.transform.translation.x = tvecs[i][0][0]
t.transform.translation.y = tvecs[i][0][1]
t.transform.translation.z = tvecs[i][0][2]
Expand Down Expand Up @@ -113,5 +113,5 @@ def main(args=None):
rclpy.shutdown()


if __name__ == "__main__":
if __name__ == '__main__':
main()

0 comments on commit 4064d2c

Please sign in to comment.