#!/bin/pythonimportrclpyfromrclpy.nodeimportNodefromsensor_msgs.msgimportCameraInfofromsensor_msgs.srvimportSetCameraInfoclassCameraInfoClient(Node):def__init__(self):super().__init__('camera_info_client')self.client=self.create_client(SetCameraInfo,'/set_camera_info')# Wait for the service to be availablewhilenotself.client.wait_for_service(timeout_sec=3.0):self.get_logger().warn("Waiting for /set_camera_info service...")self.send_request()defsend_request(self):request=SetCameraInfo.Request()# Fill the CameraInfo messagerequest.camera_info=CameraInfo()request.camera_info.width=1280request.camera_info.height=720request.camera_info.k=[900.0,0.0,640.0,0.0,900.0,360.0,0.0,0.0,1.0]# Intrinsic matrixrequest.camera_info.d=[0.1,-0.05,0.001,0.002,0.0]# Distortion coefficientsrequest.camera_info.distortion_model="plumb_bob"self.future=self.client.call_async(request)self.future.add_done_callback(self.response_callback)defresponse_callback(self,future):try:response=future.result()ifresponse.success:self.get_logger().info("Camera info updated successfully!")else:self.get_logger().error("Failed to update camera info!")exceptExceptionase:self.get_logger().error(f"Service call failed: {str(e)}")defmain():rclpy.init()node=CameraInfoClient()rclpy.spin(node)node.destroy_node()rclpy.shutdown()if__name__=='__main__':main()