Commit 840c00f0 authored by garciay's avatar garciay

Finalise UC6

parent 365ab4fc
......@@ -60,12 +60,21 @@ module ItsRSUsSimulator_Functions {
group externalFunctions {
/**
* @desc External function to compute a position using a reference position, a distance and an orientation
* @param p_refLongPosVector Vehicle reference position
* @param p_cenLongPosVector Collision point position
* @param p_rotation Rotation angle in 1/10 of degrees (from North)
* @param p_latitude Computed position's latitude
* @param p_longitude Computed position's longitude
* @remark See http://www.movable-type.co.uk/scripts/latlong.html
*/
external function fx_computePositionFromRotation(
in Int32 p_refLatitude,
in Int32 p_refLongitude,
in Int32 p_cenLatitude,
in Int32 p_cenLongitude,
in float p_rotation,
in Int32 p_rotation,
out Int32 p_latitude,
out Int32 p_longitude
);
......@@ -88,7 +97,7 @@ module ItsRSUsSimulator_Functions {
// Map
map(self:acPort, system:acPort);
map(self:cfPort, system:cfPort);
//map(self:cfPort, system:cfPort);
map(self:geoNetworkingPort, system:geoNetworkingPort);
// Connect
......@@ -99,7 +108,7 @@ module ItsRSUsSimulator_Functions {
f_initialiseSecuredMode();
//Initialze the Config module
cfPort.send(CfInitialize:{});
//cfPort.send(CfInitialize:{});
// Initialisations
f_setup_rsu(vc_rsu_id);
......@@ -114,7 +123,7 @@ module ItsRSUsSimulator_Functions {
// Unmap
unmap(self:acPort, system:acPort);
unmap(self:cfPort, system:cfPort);
//unmap(self:cfPort, system:cfPort);
unmap(self:geoNetworkingPort, system:geoNetworkingPort);
// Disconnect
......@@ -652,17 +661,29 @@ module ItsRSUsSimulator_Functions {
var template (value) Payload v_payload;
// Apply 90° rotation
fx_computePositionFromRotation(
p_location.latitude,
p_location.longitude,
// p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude,
// p_camVehicle.cam.camParameters.basicContainer.referencePosition.longitude,
PICS_UC6_COLLISION_POINT.latitude,
PICS_UC6_COLLISION_POINT.longitude,
-90.0,
v_newPosition.latitude,
v_newPosition.longitude);
log("Rotation: (", p_location.latitude, ", ", p_location.longitude, ") --> (", v_newPosition.latitude, ", ", v_newPosition.longitude, ")");
if (PICS_USE_SPV == true) {
fx_computePositionFromRotation(
p_location.latitude,
p_location.longitude,
PICS_UC6_COLLISION_POINT.latitude,
PICS_UC6_COLLISION_POINT.longitude,
900,
v_newPosition.latitude,
v_newPosition.longitude
);
log("Rotation: (", p_location.latitude, ", ", p_location.longitude, ") --> (", v_newPosition.latitude, ", ", v_newPosition.longitude, ")");
} else {
fx_computePositionFromRotation(
p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude,
p_camVehicle.cam.camParameters.basicContainer.referencePosition.longitude,
PICS_UC6_COLLISION_POINT.latitude,
PICS_UC6_COLLISION_POINT.longitude,
900,
v_newPosition.latitude,
v_newPosition.longitude
);
log("Rotation: (", p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude, ", ", p_camVehicle.cam.camParameters.basicContainer.referencePosition.longitude, ") --> (", v_newPosition.latitude, ", ", v_newPosition.longitude, ")");
}
/*v_newPosition.latitude := ;
v_newPosition.longitude := ;*/
// Update CAM
......
......@@ -425,6 +425,8 @@ module ItsRSUsSimulator_Pics {
group camUseCase6 {
modulepar integer SIMULTANEOUS_VEHICLE_NUM := 10;
group camUseCase6VehicleTemplateDescription {
modulepar LongPosVector PICS_UC6_VEHICLE_TEMPLATE_POSITION := {
......@@ -453,6 +455,8 @@ module ItsRSUsSimulator_Pics {
}
} // End of PICS_UC6_VEHICLE_GEOAREA
modulepar boolean PICS_USE_SPV := true;
} // End of group camUseCase6VehicleDescription
group camUseCase6SyncLocation {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment