Function to publish camera data
(self, sensor_id, data)
| 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 | """ |