MCPcopy Create free account
hub / github.com/OpenDriveLab/TCP / publish_camera

Method publish_camera

scenario_runner/srunner/autoagents/ros_agent.py:301–313  ·  view source on GitHub ↗

Function to publish camera data

(self, sensor_id, data)

Source from the content-addressed store, hash-verified

299 self.publisher_map[sensor_id].publish(msg)
300
301 def publish_camera(self, sensor_id, data):
302 """
303 Function to publish camera data
304 """
305 msg = self.cv_bridge.cv2_to_imgmsg(data, encoding='bgra8')
306 # the camera data is in respect to the camera's own frame
307 msg.header = self.get_header()
308 msg.header.frame_id = 'ego_vehicle/camera/rgb/{}'.format(sensor_id)
309
310 cam_info = self.id_to_camera_info_map[sensor_id]
311 cam_info.header = msg.header
312 self.publisher_map[sensor_id + '_info'].publish(cam_info)
313 self.publisher_map[sensor_id].publish(msg)
314
315 def publish_can(self, sensor_id, data):
316 """

Callers 1

run_stepMethod · 0.95

Calls 1

get_headerMethod · 0.95

Tested by

no test coverage detected