Esempio n. 1
0
    def sensor_data_updated(self, lane_invasion_event):
        """
        Function to wrap the lane invasion event into a ros messsage

        :param lane_invasion_event: carla lane invasion event object
        :type lane_invasion_event: carla.LaneInvasionEvent
        """
        lane_invasion_msg = CarlaLaneInvasionEvent()
        lane_invasion_msg.header = self.get_msg_header(use_parent_frame=False)
        for marking in lane_invasion_event.crossed_lane_markings:
            lane_invasion_msg.crossed_lane_markings.append(marking.type)
        self.publish_ros_message(self.topic_name(), lane_invasion_msg)
Esempio n. 2
0
    def sensor_data_updated(self, lane_invasion_event):
        """
        Function to wrap the lane invasion event into a ros messsage

        :param lane_invasion_event: carla lane invasion event object
        :type lane_invasion_event: carla.LaneInvasionEvent
        """
        lane_invasion_msg = CarlaLaneInvasionEvent()
        lane_invasion_msg.header = self.get_msg_header()
        for marking in lane_invasion_event.crossed_lane_markings:
            lane_invasion_msg.crossed_lane_markings.append(marking.type)
        self.lane_invasion_publisher.publish(lane_invasion_msg)
Esempio n. 3
0
 def _publish_lane_inv(self, lane_invasion_event):
     """
     Function to wrap the lane invasion event into a ros messsage
     :param lane_invasion_event: carla lane invasion event object
     :type lane_invasion_event: carla.LaneInvasionEvent
     """
     lane_invasion_msg = CarlaLaneInvasionEvent()
     lane_invasion_msg.header.frame_id = "ego_vehicle"
     set_timestamp(lane_invasion_msg.header, lane_invasion_event.timestamp)
     for marking in lane_invasion_event.crossed_lane_markings:
         lane_invasion_msg.crossed_lane_markings.append(marking.type)
     self.publish("lanes_invasion", lane_invasion_msg)