Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
RouteCreation_KML2CSV Namespace Reference

Functions

def convertKMLToWaypoints (filename)
 
def main ()
 

Function Documentation

◆ convertKMLToWaypoints()

def RouteCreation_KML2CSV.convertKMLToWaypoints (   filename)
Convert the point data located in filename into a lane element

Definition at line 23 of file RouteCreation_KML2CSV.py.

23def convertKMLToWaypoints(filename):
24 """
25 Convert the point data located in filename into a lane element
26 """
27
28 out = []
29 xml = ET.parse(filename)
30 root = xml.getroot()
31
32 for coord in root.findall(".//{http://www.opengis.net/kml/2.2}coordinates"):
33 (lon, lat, _) = coord.text.split(",")
34 out.append((lat.strip(), lon.strip()))
35
36 return out
37
def convertKMLToWaypoints(filename)

Referenced by main().

Here is the caller graph for this function:

◆ main()

def RouteCreation_KML2CSV.main ( )

Definition at line 38 of file RouteCreation_KML2CSV.py.

38def main():
39 parser = argparse.ArgumentParser("Convert a KML file into a CSV file, to further process with RouteCreation_CSV2Yaml.py")
40 parser.add_argument("kml_input", help="KML input containing the desired route geometry")
41 parser.add_argument("default_speed", help="The default speed limit along the route")
42 parser.add_argument("csv_output", help="The file to write the CSV out to")
43 args = parser.parse_args()
44 print("Converting {} to CSV as {}".format(args.kml_input, args.csv_output))
45 output = open(args.csv_output, "w")
46 output.write("Latitude,Longitude,Speed\n")
47
48 waypoints = convertKMLToWaypoints(args.kml_input)
49 print("{} waypoints found. Using speed {} for all. Writing output...".format(len(waypoints), args.default_speed))
50 count = 0
51 for waypoint in waypoints:
52 output.write("{},{},{}\n".format(waypoint[0], waypoint[1], args.default_speed))
53 count += 1
54 print("Wrote {} entries to {}.".format(count, args.csv_output))
55
56

References convertKMLToWaypoints(), and main().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: