Ficed conversion from object record to signal.

This commit is contained in:
Axel1092 2020-07-24 15:28:53 +02:00 committed by Axel1092
parent 6d4e92bc6d
commit 284f1e726f
2 changed files with 7 additions and 2 deletions

View File

@ -63,7 +63,7 @@ namespace parser {
node_object.attribute("length").as_double(),
points);
} else if (name.substr(0, 6) == "Speed_") {
} else if (name.substr(0, 6) == "Speed_" || name.substr(0, 6) == "speed_") {
road::RoadId road_id = node_road.attribute("id").as_uint();
road::Road *road = map_builder.GetRoad(road_id);
// speed signal by roadrunner
@ -75,7 +75,7 @@ namespace parser {
node_object.attribute("t").as_double(),
node_object.attribute("name").as_string(),
"no",
node_object.attribute("orientation").value(),
node_object.attribute("orientation").as_string(),
node_object.attribute("zOffset").as_double(),
"OpenDRIVE",
"274",

View File

@ -964,6 +964,11 @@ void MapBuilder::CreateController(
auto signal_position = signal->GetTransform().location;
auto closest_waypoint_to_signal =
map.GetClosestWaypointOnRoad(signal_position);
// workarround to not move speed signals
if (signal->GetName().substr(0, 6) == "Speed_" ||
signal->GetName().substr(0, 6) == "speed_") {
continue;
}
if(closest_waypoint_to_signal) {
auto distance_to_road =
(map.ComputeTransform(closest_waypoint_to_signal.get()).location -