update_frame_id.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import rospy
4 from sensor_msgs.msg import Image
5 from sensor_msgs.msg import CameraInfo
6 
7 rospy.init_node("update_frame_id")
8 
9 #Updating frame id for the error depth_front frame id does not match rgb_front frame id
11  def __init__(self):
12  self.image = Image()
13  #subscribe to your specific sensors
14  self.sub_raw = rospy.Subscriber("/carla/ego_vehicle/rgb_front/image", Image, self.callback_raw)
15  self.sub_info = rospy.Subscriber("/carla/ego_vehicle/rgb_front/camera_info", CameraInfo, self.callback_info)
16  self.pub_raw = rospy.Publisher("/rgb/image_rect_color", Image, queue_size = 1)
17  self.pub_info = rospy.Publisher("/rgb/camera_info", CameraInfo, queue_size = 1)
18  def callback_raw(self, message):
19  message.header.frame_id = "ego_vehicle/depth_front"
20  self.pub_raw.publish(message)
21  def callback_info(self, message):
22  message.header.frame_id = "ego_vehicle/depth_front"
23  self.pub_info.publish(message)
24 
25 update_frame_id = update_frame_id()
26 rospy.spin()
27 
28 print("\nNode shutdown\n")
update_frame_id.update_frame_id.image
image
Definition: update_frame_id.py:12
update_frame_id.update_frame_id
Definition: update_frame_id.py:10
update_frame_id.update_frame_id.callback_raw
def callback_raw(self, message)
Definition: update_frame_id.py:18
update_frame_id.update_frame_id.sub_raw
sub_raw
Definition: update_frame_id.py:14
update_frame_id.update_frame_id.sub_info
sub_info
Definition: update_frame_id.py:15
update_frame_id.update_frame_id.__init__
def __init__(self)
Definition: update_frame_id.py:11
update_frame_id.update_frame_id.pub_raw
pub_raw
Definition: update_frame_id.py:16
update_frame_id.update_frame_id.callback_info
def callback_info(self, message)
Definition: update_frame_id.py:21
update_frame_id.update_frame_id.pub_info
pub_info
Definition: update_frame_id.py:17


depth_image_proc
Author(s): Patrick Mihelich
autogenerated on Wed Jan 24 2024 03:57:15