|
26 | 26 | ActorTransformSetterToOSCPosition,
|
27 | 27 | RunScript,
|
28 | 28 | ChangeWeather,
|
29 |
| - ChangeAutoPilot, |
30 | 29 | ChangeRoadFriction,
|
31 | 30 | ChangeActorTargetSpeed,
|
32 | 31 | ChangeActorControl,
|
33 | 32 | ChangeActorWaypoints,
|
34 | 33 | ChangeActorLateralMotion,
|
| 34 | + DeActivateActorControlComponents, |
35 | 35 | ChangeActorLaneOffset,
|
36 | 36 | SyncArrivalOSC,
|
37 | 37 | Idle)
|
@@ -1081,31 +1081,25 @@ def convert_maneuver_to_atomic(action, actor, actor_list, catalogs):
|
1081 | 1081 | lat_maneuver = private_action.find('LaneOffsetAction')
|
1082 | 1082 | continuous = strtobool(lat_maneuver.attrib.get('continuous', True))
|
1083 | 1083 | # Parsing of the different Dynamic shapes is missing
|
1084 |
| - |
1085 | 1084 | lane_target_offset = lat_maneuver.find('LaneOffsetTarget')
|
1086 | 1085 | if lane_target_offset.find('AbsoluteTargetLaneOffset') is not None:
|
1087 | 1086 | absolute_offset = float(
|
1088 | 1087 | lane_target_offset.find('AbsoluteTargetLaneOffset').attrib.get('value', 0))
|
1089 | 1088 | atomic = ChangeActorLaneOffset(
|
1090 | 1089 | actor, absolute_offset, continuous=continuous, name=maneuver_name)
|
1091 |
| - |
1092 | 1090 | elif lane_target_offset.find('RelativeTargetLaneOffset') is not None:
|
1093 | 1091 | relative_target_offset = lane_target_offset.find('RelativeTargetLaneOffset')
|
1094 | 1092 | relative_offset = float(relative_target_offset.attrib.get('value', 0))
|
1095 |
| - |
1096 | 1093 | relative_actor = None
|
1097 | 1094 | for _actor in actor_list:
|
1098 | 1095 | if relative_target_offset.attrib.get('entityRef', None) == _actor.attributes['role_name']:
|
1099 | 1096 | relative_actor = _actor
|
1100 | 1097 | break
|
1101 |
| - |
1102 | 1098 | if relative_actor is None:
|
1103 | 1099 | raise AttributeError("Cannot find actor '{}' for condition".format(
|
1104 | 1100 | relative_target_offset.attrib.get('entityRef', None)))
|
1105 |
| - |
1106 | 1101 | atomic = ChangeActorLaneOffset(actor, relative_offset, relative_actor,
|
1107 | 1102 | continuous=continuous, name=maneuver_name)
|
1108 |
| - |
1109 | 1103 | else:
|
1110 | 1104 | raise AttributeError("Unknown target offset")
|
1111 | 1105 | else:
|
@@ -1147,13 +1141,19 @@ def convert_maneuver_to_atomic(action, actor, actor_list, catalogs):
|
1147 | 1141 | raise AttributeError("Unknown speed action")
|
1148 | 1142 | elif private_action.find('ActivateControllerAction') is not None:
|
1149 | 1143 | private_action = private_action.find('ActivateControllerAction')
|
1150 |
| - activate = strtobool(private_action.attrib.get('longitudinal')) |
1151 |
| - atomic = ChangeAutoPilot(actor, activate, name=maneuver_name) |
| 1144 | + lon_control = None |
| 1145 | + lat_control = None |
| 1146 | + if 'longitudinal' in private_action.attrib.keys(): |
| 1147 | + lon_control = strtobool(private_action.attrib.get('longitudinal')) |
| 1148 | + if 'lateral' in private_action.attrib.keys(): |
| 1149 | + lat_control = strtobool(private_action.attrib.get('lateral')) |
| 1150 | + atomic = DeActivateActorControlComponents(actor, lon_control, lat_control, name=maneuver_name) |
1152 | 1151 | elif private_action.find('ControllerAction') is not None:
|
1153 | 1152 | controller_action = private_action.find('ControllerAction')
|
1154 | 1153 | module, args = OpenScenarioParser.get_controller(controller_action, catalogs)
|
1155 | 1154 | atomic = ChangeActorControl(actor, control_py_module=module, args=args,
|
1156 |
| - scenario_file_path=OpenScenarioParser.osc_filepath) |
| 1155 | + scenario_file_path=OpenScenarioParser.osc_filepath, |
| 1156 | + name=maneuver_name) |
1157 | 1157 | elif private_action.find('TeleportAction') is not None:
|
1158 | 1158 | teleport_action = private_action.find('TeleportAction')
|
1159 | 1159 | position = teleport_action.find('Position')
|
|
0 commit comments