Skip to content

Commit

Permalink
PR Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Oct 25, 2023
1 parent 0a41526 commit 25ea36d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"updateInterval": 100,
"carlaUE4Path": "/opt/carla/",
"bridgePath": "/opt/carma-simulation/scenarios/Town04/carla; bridge.sh",
"carlaConnectionPort": 8913
"carlaConnectionPort": 8913,
"carlaCDASimAdapterUrl":"http://127.0.0.1:8090/RPC2"

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"updateInterval": 100,
"carlaUE4Path": "/opt/carla/",
"bridgePath": "/opt/carma-simulation/scenarios/Town04_test/carla; bridge.sh",
"carlaConnectionPort": 8913
"carlaConnectionPort": 8913,
"carlaCDASimAdapterUrl":"http://127.0.0.1:8090/RPC2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.StringUtils;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClientException;
import org.eclipse.mosaic.fed.carla.carlaconnect.CarlaConnection;
import org.eclipse.mosaic.fed.carla.carlaconnect.CarlaXmlRpcClient;
import org.eclipse.mosaic.fed.carla.config.CarlaConfiguration;
Expand All @@ -28,7 +27,6 @@
import org.eclipse.mosaic.interactions.detector.DetectedObjectInteraction;
import org.eclipse.mosaic.interactions.detector.DetectorRegistration;
import org.eclipse.mosaic.lib.objects.detector.DetectedObject;
import org.eclipse.mosaic.lib.objects.detector.Detector;
import org.eclipse.mosaic.lib.util.ProcessLoggingThread;
import org.eclipse.mosaic.lib.util.objects.ObjectInstantiation;
import org.eclipse.mosaic.rti.TIME;
Expand All @@ -43,7 +41,6 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -219,7 +216,7 @@ public void initialize(long startTime, long endTime) throws InternalFederateExce
//initialize CarlaXmlRpcClient
//set the connected server URL
try{
URL xmlRpcServerUrl = new URL("http://127.0.0.1:8090/RPC2");
URL xmlRpcServerUrl = new URL(carlaConfig.carlaCDASimAdapterUrl);
carlaXmlRpcClient = new CarlaXmlRpcClient(xmlRpcServerUrl);
}
catch (MalformedURLException m)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
package org.eclipse.mosaic.fed.carla.carlaconnect;

import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import org.apache.xmlrpc.client.XmlRpcClientException;
import org.eclipse.mosaic.interactions.detector.DetectedObjectInteraction;
import org.eclipse.mosaic.interactions.detector.DetectorRegistration;
import org.eclipse.mosaic.lib.objects.detector.DetectedObject;
import org.slf4j.Logger;
Expand All @@ -39,7 +36,6 @@ public class CarlaXmlRpcClient{

boolean isConnected;
private static final String CREATE_SENSOR = "create_simulated_semantic_lidar_sensor";
private static final String GET_SENSOR = "get_simulated_sensor";
private static final String GET_DETECTED_OBJECTS = "get_detected_objects";

private XmlRpcClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@ public class CarlaConfiguration implements Serializable {
* Carla connection port
*/
public int carlaConnectionPort;
/**
* URL where CARLACDASimAdapter XMLRPC Server is hosted
*/
public String carlaCDASimAdapterUrl;


}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void readConfig_assertProperties() throws InstantiationException {
assertEquals("D:/CARLA_0.9.10/", carlaConfiguration.carlaUE4Path);
assertEquals("./scenarios/Town04_10/carla; bridge.bat", carlaConfiguration.bridgePath);
assertEquals(8913, carlaConfiguration.carlaConnectionPort);
assertEquals("http://127.0.0.1:8090/RPC2",carlaConfiguration.carlaCDASimAdapterUrl);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"updateInterval": 200,
"carlaUE4Path": "D:/CARLA_0.9.10/",
"bridgePath": "./scenarios/Town04_10/carla; bridge.bat",
"carlaConnectionPort": 8913
"carlaConnectionPort": 8913,
"carlaCDASimAdapterUrl":"http://127.0.0.1:8090/RPC2"

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import org.eclipse.mosaic.rti.api.parameters.AmbassadorParameter;
import org.eclipse.mosaic.rti.api.parameters.FederateDescriptor;
import org.eclipse.mosaic.rti.config.CLocalHost;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down

0 comments on commit 25ea36d

Please sign in to comment.