Skip to content

Commit

Permalink
Switch priority of detecting directory of CARLA sim
Browse files Browse the repository at this point in the history
  • Loading branch information
chengyuan0124 committed Aug 5, 2022
1 parent ac4990d commit 99ac004
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,14 @@ public FederateExecutor createFederateExecutor(String host, int port, CLocalHost
*/
String getCarlaExecutable(String executable) {
String carlaHome = null;
if (System.getenv("CARLA_HOME") != null) {
carlaHome = System.getenv("CARLA_HOME");
log.info("use carla path from environmental variable: " + carlaHome);
} else if (carlaConfig.carlaUE4Path != null) {
if (carlaConfig.carlaUE4Path != null) {
carlaHome = carlaConfig.carlaUE4Path;
log.info("use carla path from configuration file: " + carlaHome);
}
else if (System.getenv("CARLA_HOME") != null) {
carlaHome = System.getenv("CARLA_HOME");
log.info("use carla path from environmental variable: " + carlaHome);
}
if (StringUtils.isNotBlank(carlaHome)) {
boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("windows");
if (isWindows) {
Expand Down

0 comments on commit 99ac004

Please sign in to comment.