Skip to content

Commit

Permalink
fix(sumo): revert recent changes on existing lane change modes
Browse files Browse the repository at this point in the history
  • Loading branch information
kschrab committed Mar 19, 2024
1 parent b1dc545 commit 4aa975e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ public static SumoLaneChangeMode translateFromEnum(final LaneChangeMode laneChan
mode.setSublaneChanges(false, false);
mode.setRespectOtherDrivers(RESPECT_SPEED_GAPS_OF_OTHER_DRIVERS_ADAPT_SPEED);
break;
// For strategic lane changes (change lanes to continue the route),
// we always let SUMO overwrite requested lane changes (overrideTraci = true)
case FOLLOW_ROUTE:
mode.setSublaneChanges(false, false);
mode.setStrategicChanges(true, false);
mode.setStrategicChanges(true, true);
mode.setRespectOtherDrivers(RESPECT_SPEED_GAPS_OF_OTHER_DRIVERS_ADAPT_SPEED);
break;
case AGGRESSIVE:
mode.setStrategicChanges(true, false);
mode.setStrategicChanges(true, true);
mode.setSpeedChanges(true, false);
break;
case CAUTIOUS:
mode.setStrategicChanges(true, false);
mode.setStrategicChanges(true, true);
mode.setCooperativeChanges(true, false);
mode.setSpeedChanges(true, false);
mode.setRightDriveChanges(true, false);
Expand All @@ -59,7 +61,7 @@ public static SumoLaneChangeMode translateFromEnum(final LaneChangeMode laneChan
case PASSIVE:
case COOPERATIVE:
case DEFAULT:
mode.setStrategicChanges(true, false);
mode.setStrategicChanges(true, true);
mode.setCooperativeChanges(true, false);
mode.setSpeedChanges(true, false);
mode.setRightDriveChanges(true, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public void testGetAsInteger_overrideTraci() {

@Test
public void testTranslateFromEnum() {
assertEquals(1621, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.DEFAULT).getAsInteger());
assertEquals(1622, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.DEFAULT).getAsInteger());
assertEquals(512, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.OFF).getAsInteger());
assertEquals(513, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.FOLLOW_ROUTE).getAsInteger());
assertEquals(1041, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.AGGRESSIVE).getAsInteger());
assertEquals(1621, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.COOPERATIVE).getAsInteger());
assertEquals(1877, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.CAUTIOUS).getAsInteger());
assertEquals(1621, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.PASSIVE).getAsInteger());
assertEquals(514, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.FOLLOW_ROUTE).getAsInteger());
assertEquals(1042, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.AGGRESSIVE).getAsInteger());
assertEquals(1622, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.COOPERATIVE).getAsInteger());
assertEquals(1878, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.CAUTIOUS).getAsInteger());
assertEquals(1622, SumoLaneChangeMode.translateFromEnum(LaneChangeMode.PASSIVE).getAsInteger());
}

}

0 comments on commit 4aa975e

Please sign in to comment.