Loading ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn +102 −67 Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ module ItsRSUsSimulator_Functions { import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Pixits all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Functions all; // AtsRSUsSimulator import from ItsRSUsSimulator_TypesAndValues all; import from ItsRSUsSimulator_TestSystem all; Loading @@ -54,6 +58,20 @@ module ItsRSUsSimulator_Functions { import from ItsRSUsSimulator_Pics all; import from ItsRSUsSimulator_Pixits all; group externalFunctions { external function fx_computePositionFromRotation( in Int32 p_refLatitude, in Int32 p_refLongitude, in Int32 p_cenLatitude, in Int32 p_cenLongitude, in float p_rotation, out Int32 p_latitude, out Int32 p_longitude ); } // End of group externalFunctions group rsuConfigurationFunctions { /** Loading Loading @@ -106,6 +124,8 @@ module ItsRSUsSimulator_Functions { } // End of group rsuConfigurationFunctions group usecase6 { function f_initialiseVehicleSimulatorComponent( in ItsRSUsSimulator p_component, out template (omit) CAM p_cam Loading @@ -115,8 +135,8 @@ module ItsRSUsSimulator_Functions { f_getTsStationId(), f_getCurrentTime() mod 65536, // Shall be updated in function f_prepare_vehicle_cam m_rsuPosition( PICS_USECASE6_VEHICLE_POSITIONS[0].latitude, // Shall be updated in function f_prepare_vehicle_cam PICS_USECASE6_VEHICLE_POSITIONS[0].longitude // Shall be updated in function f_prepare_vehicle_cam 0, // Shall be computed 0 // Shall be computed ) ); map(p_component:geoNetworkingPort, system:geoNetworkingPort); Loading @@ -129,6 +149,8 @@ module ItsRSUsSimulator_Functions { unmap(p_component:geoNetworkingPort, system:geoNetworkingPort); } // End of function f_uninitialiseVehicleSimulatorComponent } // End of group usecase6 function f_setup_rsu( in integer p_rsu_id ) runs on ItsRSUsSimulator { Loading Loading @@ -255,7 +277,23 @@ module ItsRSUsSimulator_Functions { // CAM if (vc_cam == true) { // Build the list of the CAM events if (PX_ETSI_USE_CASE_ID == 9) { if (PX_ETSI_USE_CASE_ID == 7) { vc_longPosVectorRsu := PICS_UC7_LPV.longPosVector; v_cam := m_camParm( PICS_UC7_LPV.stationID, m_rsuPosition( PICS_UC7_LPV.longPosVector.latitude, PICS_UC7_LPV.longPosVector.longitude ), PICS_UC7_LPV.pathHistory, { rsuContainerHighFrequency := { protectedCommunicationZonesRSU := omit } } ); } else if (PX_ETSI_USE_CASE_ID == 9) { v_cam := m_camParm( PICS_RSU_PARAMS[p_rsu_id].stationID, Loading Loading @@ -572,32 +610,30 @@ module ItsRSUsSimulator_Functions { return v_payload; } // End of function f_adaptPayload function f_send_vehicle_cam( function f_mirror_and_send_vehicle_cam( in template (value) CAM p_camSimu, in CAM p_camVehicle in CAM p_camVehicle, in ThreeDLocation p_location ) runs on ItsRSUsSimulator { // Local variables var LongPosVector v_vehiclePosition := PICS_UC6_VEHICLE_POSITION; var float v_distanceToCollision; var SpeedValue v_vehicleSpeed := p_camVehicle.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.speed.speedValue; var ReferencePosition v_newPosition := p_camVehicle.cam.camParameters.basicContainer.referencePosition; var template (value) Payload v_payload; // Compute distance to collision point v_vehiclePosition.latitude := p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude; v_vehiclePosition.longitude := p_camVehicle.cam.camParameters.basicContainer.referencePosition.longitude; v_distanceToCollision := LibItsGeoNetworking_Functions.f_distance( v_vehiclePosition, PICS_UC6_COLLISION_POINT ); // Compute time to collision point if (v_vehicleSpeed != 0) { var float v_timeToCollision := v_distanceToCollision / int2float(v_vehicleSpeed); // Updade simulated CAM to setup the same distance to the collision point // FIXME p_camSimu.cam.camParameters.basicContainer.referencePosition := PICS_USECASE6_VEHICLE_POSITIONS[p_idx]; // Update generationDeltaTime // Apply 90° rotation 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, -90.0, v_newPosition.latitude, v_newPosition.longitude); /*v_newPosition.latitude := ; v_newPosition.longitude := ;*/ // Update CAM p_camSimu.cam.generationDeltaTime := f_getCurrentTime() mod 65536; // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime p_camSimu.cam.camParameters.basicContainer.referencePosition := v_newPosition; p_camSimu.cam.camParameters.highFrequencyContainer := p_camVehicle.cam.camParameters.highFrequencyContainer; v_payload := valueof( f_adaptPayload( bit2oct( Loading @@ -610,17 +646,14 @@ module ItsRSUsSimulator_Functions { ) ); // Update GN vc_longPosVectorRsu := PICS_UC6_VEHICLE_POSITION; vc_longPosVectorRsu := PICS_UC6_VEHICLE_TEMPLATE_POSITION; vc_longPosVectorRsu.latitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.latitude); vc_longPosVectorRsu.longitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.longitude); vc_geoArea := PICS_UC6_VEHICLE_GEOAREA; vc_geoArea := PICS_UC6_VEHICLE_TEMPLATE_GEOAREA; vc_geoArea.area.geoAreaPosLatitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.latitude); vc_geoArea.area.geoAreaPosLongitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.longitude); // And send it f_send(v_payload, PICS_CAM_ITS_AID); } else { } } // End of function f_send_vehicle_cam function f_send( Loading @@ -629,6 +662,8 @@ module ItsRSUsSimulator_Functions { ) runs on ItsRSUsSimulator { var GeoNetworkingPdu v_geoNetworkingPdu; vc_longPosVectorRsu.timestamp_ := f_getCurrentTime(); if (p_its_aid == 36) { // CAM v_geoNetworkingPdu := valueof(m_geoNwPdu( // FIXME Use PIXIT parameter to get a fully configurable template m_geoNwShbPacket_payload( Loading ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn +94 −47 Original line number Diff line number Diff line Loading @@ -23,6 +23,9 @@ module ItsRSUsSimulator_Pics { // LibItsGeoNetworking import from LibItsGeoNetworking_TypesAndValues all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; // ItsRSUsSimulator import from ItsRSUsSimulator_TypesAndValues all; Loading Loading @@ -582,38 +585,9 @@ module ItsRSUsSimulator_Pics { group camUseCase6 { group camUseCase6SyncLocation { group camUseCase6VehicleTemplateDescription { modulepar LongPosVector PICS_UC6_COLLISION_POINT := { gnAddr := { typeOfAddress := e_manual, stationType := e_unknown, stationCountryCode := 0, mid := '000000000000'O }, timestamp_ := 0, latitude := 433310000, longitude := 101803000, pai := '0'B, speed := 0, heading := 0 } // End of PICS_UC6_DETECTION_POINT /** * @desc Maximum synchronisation area to start sending CAM */ modulepar float PICS_UC6_DETECTION_DISTANCE := 11.0; /** * @desc Maximum synchronisation area to start sending CAM */ modulepar float PICS_UC6_DETECTION_EPSILLON := 0.01; } // End of group camUseCase6SyncLocation group camUseCase6VehicleDescription { modulepar LongPosVector PICS_UC6_VEHICLE_POSITION := { modulepar LongPosVector PICS_UC6_VEHICLE_TEMPLATE_POSITION := { gnAddr := { typeOfAddress := e_manual, stationType := e_passengerCar, Loading @@ -628,7 +602,7 @@ module ItsRSUsSimulator_Pics { heading := 0 } // End of PICS_UC6_VEHICLE_POSITION modulepar GeoArea PICS_UC6_VEHICLE_GEOAREA := { modulepar GeoArea PICS_UC6_VEHICLE_TEMPLATE_GEOAREA := { shape := e_geoElip, area := { geoAreaPosLatitude := 0, Loading @@ -641,7 +615,33 @@ module ItsRSUsSimulator_Pics { } // End of group camUseCase6VehicleDescription modulepar Usecase6VehiclePositions PICS_USECASE6_VEHICLE_POSITIONS := { group camUseCase6SyncLocation { /** * @desc Coordinates of the collision point */ modulepar TwoDLocation PICS_UC6_COLLISION_POINT := { latitude := 433310000, longitude := 101803000 } // End of PICS_UC6_COLLISION_POINT /** * @desc Vehicle detection area */ modulepar RectangularRegion PICS_UC6_CAM_DETECTION_AREA := { northwest := { latitude := 435523210, longitude := 103000210 }, southeast := { latitude := 435528290, longitude := 103010320 } } // End of PICS_UC6_CAM_DETECTION_AREA } // End of group camUseCase6SyncLocation /*modulepar Usecase6VehiclePositions PICS_USECASE6_VEHICLE_POSITIONS := { { // UC-Z1-P0 latitude := 43551930, longitude := 10300440, Loading Loading @@ -1201,10 +1201,57 @@ module ItsRSUsSimulator_Pics { altitudeConfidence := unavailable } } } // End of PICS_USECASE6_VEHICLE_POSITIONS }*/ // End of PICS_USECASE6_VEHICLE_POSITIONS } // End of group camUseCase6 group camUseCase7 { /** * @desc RSU GN address */ modulepar GN_Address PICS_UC7_GN_ADDRESS := { typeOfAddress := e_manual, stationType := e_bus, stationCountryCode := 39, mid := 'AABBCCDDEEEE'O } // End of PICS_UC7_GN_ADDRESS modulepar RsuParm PICS_UC7_LPV := { gnAddress := PICS_UC7_GN_ADDRESS, longPosVector := { gnAddr := PICS_RSU_GN_ADDRESS_RSU4, timestamp_ := 0, latitude := 435582150, longitude := 103065170, pai := '0'B, speed := 0, heading := 10 }, stationID := 12345, geoShape := e_geoCircle, geoParms := { radius := 300 }, pathHistory := {} } // End of PICS_UC7_LPV modulepar ReferencePosition PICS_UC7_COLLISION_POINT := { latitude := 435582150, longitude := 103065170, positionConfidenceEllipse := { semiMajorConfidence := SemiAxisLength_oneCentimeter_, semiMinorConfidence := SemiAxisLength_oneCentimeter_, semiMajorOrientation := HeadingValue_wgs84North_ }, altitude := { altitudeValue := AltitudeValue_referenceEllipsoidSurface_, altitudeConfidence := unavailable } } } // End of group camUseCase7 group camUseCase9 { modulepar ProtectedCommunicationZone PICS_USECASE9_PCZ_1 := { Loading @@ -1220,7 +1267,7 @@ module ItsRSUsSimulator_Pics { PICS_USECASE9_PCZ_1 } // End of PICS_USECASE9_PCZ } // End of group camUseCase9 } // End of group camUseCase7 } // End of group camParams Loading Loading @@ -1981,8 +2028,8 @@ module ItsRSUsSimulator_Pics { }, { // Z3_D1_H2 eventPosition := { deltaLatitude := -3699, deltaLongitude := -5788, deltaLatitude := 2969, deltaLongitude := 3874, deltaAltitude := 0 }, eventDeltaTime := omit, Loading @@ -1997,40 +2044,40 @@ module ItsRSUsSimulator_Pics { { { // Z3-D1-T1 pathPosition := { deltaLatitude := 4659, deltaLongitude := 7205, deltaLatitude := -4657, deltaLongitude := -9320, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T2 pathPosition := { deltaLatitude := 510, deltaLongitude := 720, deltaLatitude := -34, deltaLongitude := -1018, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T3 pathPosition := { deltaLatitude := -247, deltaLongitude := -797, deltaLatitude := -109, deltaLongitude := -897, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T4 pathPosition := { deltaLatitude := -258, deltaLongitude := -675, deltaLatitude := -247, deltaLongitude := -797, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T5 pathPosition := { deltaLatitude := -4657, deltaLongitude := -9320, deltaLatitude := -258, deltaLongitude := -675, deltaAltitude := 0 }, pathDeltaTime := omit Loading ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pixits.ttcn +6 −5 Original line number Diff line number Diff line Loading @@ -26,11 +26,12 @@ module ItsRSUsSimulator_Pixits { /** * @desc Indicate which Use Case to simulate * @remark UC1 (DENM): PX_ETSI_USE_CASE_ID := 1 * UC3 (TLM): PX_ETSI_USE_CASE_ID := 3 * UC5 (IVIM): PX_ETSI_USE_CASE_ID := 5 * UC6 (CAM): PX_ETSI_USE_CASE_ID := 6 * UC9 (CAM): PX_ETSI_USE_CASE_ID := 9 !! PX_RSU_ID 5 * @remark UC1 (DENM only): PX_ETSI_USE_CASE_ID := 1 !! PX_RSU_ID 2 * UC3 (TLM MAPEM/SPATEM): PX_ETSI_USE_CASE_ID := 3 !! PX_RSU_ID 2 * UC5 (IVIM only): PX_ETSI_USE_CASE_ID := 5 !! PX_RSU_ID 2 * UC6 (CAM only): PX_ETSI_USE_CASE_ID := 6 !! PX_RSU_ID 2 * UC7 (CAM only): PX_ETSI_USE_CASE_ID := 7 !! PX_RSU_ID 2 * UC9 (CAM only): PX_ETSI_USE_CASE_ID := 9 !! PX_RSU_ID 5 */ modulepar integer PX_ETSI_USE_CASE_ID := 6; Loading ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Templates.ttcn +1 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,7 @@ module ItsRSUsSimulator_Templates { timestamp_ := ?, latitude := ?, longitude := ?, pai := ?, //FIXME May the delta factor should be based on the actual speed value -> low speed=lower delta, high speed=higher delta speed := ?, heading := ? Loading ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn +33 −13 Original line number Diff line number Diff line Loading @@ -19,6 +19,10 @@ module ItsRSUsSimulator_TestCases { // LibItsDenm import from LibItsDenm_Templates all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Functions all; // AtsRSUsSimulator import from ItsRSUsSimulator_TypesAndValues all; import from ItsRSUsSimulator_Templates all; Loading Loading @@ -169,6 +173,7 @@ module ItsRSUsSimulator_TestCases { var integer v_vehiclesIdx := 0; var charstring v_stationIDs := ""; var charstring v_stationID; var ThreeDLocation v_location; var GeoNetworkingInd v_gnInd; var CfEvent v_cfEvent; Loading @@ -194,12 +199,21 @@ module ItsRSUsSimulator_TestCases { -, e_btpB )))) -> value v_gnInd { // Receive a CAM message v_location := { v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.cam.camParameters.basicContainer.referencePosition.latitude, v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.cam.camParameters.basicContainer.referencePosition.longitude, int2oct(v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.cam.camParameters.basicContainer.referencePosition.altitude.altitudeValue, 2) }; v_stationID := int2str(v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.header.stationID); tc_ac.stop; // Check if it entered into the rectangular area if (f_isLocationInsideRectangularRegion({ PICS_UC6_CAM_DETECTION_AREA }, v_location) == true) { // Check if it already processed v_stationID := int2str(v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.header.stationID); if (regexp(v_stationIDs, charstring:"(" & v_stationID & ",)", 0) == "") { // Vehicle not processed yet log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " is entering in area ***"); v_vehicles[v_vehiclesIdx] := ItsRSUsSimulator.create("Node" & int2char(v_vehiclesIdx + 65)) alive; v_vehicles[v_vehiclesIdx].start(f_startVehicleSimulator(v_vehicles[v_vehiclesIdx], v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket)); v_vehicles[v_vehiclesIdx].start(f_startVehicleSimulator(v_vehicles[v_vehiclesIdx], v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket, v_location)); v_vehiclesIdx := v_vehiclesIdx + 1; v_stationIDs := v_stationIDs & v_stationID & ","; log("*** " & testcasename() & ": DEBUG: New v_stationIDs: " & v_stationIDs & " ***"); Loading @@ -207,6 +221,10 @@ module ItsRSUsSimulator_TestCases { // Nothing to do log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " already processed ***"); } } else { // Nothing to do log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " is outside of area ***"); } tc_ac.start; repeat; } Loading Loading @@ -236,7 +254,8 @@ module ItsRSUsSimulator_TestCases { function f_startVehicleSimulator( in ItsRSUsSimulator p_component, in CAM p_camVehicle in CAM p_camVehicle, in ThreeDLocation p_location ) runs on ItsRSUsSimulator { // Local variables Loading @@ -261,12 +280,13 @@ module ItsRSUsSimulator_TestCases { ))))) -> value v_gnInd { // Receive a CAM message from the processed vehicle log("*** " & testcasename() & ": DEBUG: Processing CAM #" & int2str(p_camVehicle.header.stationID) & " ***"); tc_cam.stop; f_send_vehicle_cam(v_camSimu, v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket); f_mirror_and_send_vehicle_cam(v_camSimu, v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket, p_location); tc_cam.start; } /*[] cfPort.receive { [] cfPort.receive { tc_cam.stop; repeat; }*/ } [] tc_cam.timeout { log("*** " & testcasename() & ": DEBUG: No CAM message received ***"); } Loading Loading
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn +102 −67 Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ module ItsRSUsSimulator_Functions { import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Pixits all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Functions all; // AtsRSUsSimulator import from ItsRSUsSimulator_TypesAndValues all; import from ItsRSUsSimulator_TestSystem all; Loading @@ -54,6 +58,20 @@ module ItsRSUsSimulator_Functions { import from ItsRSUsSimulator_Pics all; import from ItsRSUsSimulator_Pixits all; group externalFunctions { external function fx_computePositionFromRotation( in Int32 p_refLatitude, in Int32 p_refLongitude, in Int32 p_cenLatitude, in Int32 p_cenLongitude, in float p_rotation, out Int32 p_latitude, out Int32 p_longitude ); } // End of group externalFunctions group rsuConfigurationFunctions { /** Loading Loading @@ -106,6 +124,8 @@ module ItsRSUsSimulator_Functions { } // End of group rsuConfigurationFunctions group usecase6 { function f_initialiseVehicleSimulatorComponent( in ItsRSUsSimulator p_component, out template (omit) CAM p_cam Loading @@ -115,8 +135,8 @@ module ItsRSUsSimulator_Functions { f_getTsStationId(), f_getCurrentTime() mod 65536, // Shall be updated in function f_prepare_vehicle_cam m_rsuPosition( PICS_USECASE6_VEHICLE_POSITIONS[0].latitude, // Shall be updated in function f_prepare_vehicle_cam PICS_USECASE6_VEHICLE_POSITIONS[0].longitude // Shall be updated in function f_prepare_vehicle_cam 0, // Shall be computed 0 // Shall be computed ) ); map(p_component:geoNetworkingPort, system:geoNetworkingPort); Loading @@ -129,6 +149,8 @@ module ItsRSUsSimulator_Functions { unmap(p_component:geoNetworkingPort, system:geoNetworkingPort); } // End of function f_uninitialiseVehicleSimulatorComponent } // End of group usecase6 function f_setup_rsu( in integer p_rsu_id ) runs on ItsRSUsSimulator { Loading Loading @@ -255,7 +277,23 @@ module ItsRSUsSimulator_Functions { // CAM if (vc_cam == true) { // Build the list of the CAM events if (PX_ETSI_USE_CASE_ID == 9) { if (PX_ETSI_USE_CASE_ID == 7) { vc_longPosVectorRsu := PICS_UC7_LPV.longPosVector; v_cam := m_camParm( PICS_UC7_LPV.stationID, m_rsuPosition( PICS_UC7_LPV.longPosVector.latitude, PICS_UC7_LPV.longPosVector.longitude ), PICS_UC7_LPV.pathHistory, { rsuContainerHighFrequency := { protectedCommunicationZonesRSU := omit } } ); } else if (PX_ETSI_USE_CASE_ID == 9) { v_cam := m_camParm( PICS_RSU_PARAMS[p_rsu_id].stationID, Loading Loading @@ -572,32 +610,30 @@ module ItsRSUsSimulator_Functions { return v_payload; } // End of function f_adaptPayload function f_send_vehicle_cam( function f_mirror_and_send_vehicle_cam( in template (value) CAM p_camSimu, in CAM p_camVehicle in CAM p_camVehicle, in ThreeDLocation p_location ) runs on ItsRSUsSimulator { // Local variables var LongPosVector v_vehiclePosition := PICS_UC6_VEHICLE_POSITION; var float v_distanceToCollision; var SpeedValue v_vehicleSpeed := p_camVehicle.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.speed.speedValue; var ReferencePosition v_newPosition := p_camVehicle.cam.camParameters.basicContainer.referencePosition; var template (value) Payload v_payload; // Compute distance to collision point v_vehiclePosition.latitude := p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude; v_vehiclePosition.longitude := p_camVehicle.cam.camParameters.basicContainer.referencePosition.longitude; v_distanceToCollision := LibItsGeoNetworking_Functions.f_distance( v_vehiclePosition, PICS_UC6_COLLISION_POINT ); // Compute time to collision point if (v_vehicleSpeed != 0) { var float v_timeToCollision := v_distanceToCollision / int2float(v_vehicleSpeed); // Updade simulated CAM to setup the same distance to the collision point // FIXME p_camSimu.cam.camParameters.basicContainer.referencePosition := PICS_USECASE6_VEHICLE_POSITIONS[p_idx]; // Update generationDeltaTime // Apply 90° rotation 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, -90.0, v_newPosition.latitude, v_newPosition.longitude); /*v_newPosition.latitude := ; v_newPosition.longitude := ;*/ // Update CAM p_camSimu.cam.generationDeltaTime := f_getCurrentTime() mod 65536; // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime p_camSimu.cam.camParameters.basicContainer.referencePosition := v_newPosition; p_camSimu.cam.camParameters.highFrequencyContainer := p_camVehicle.cam.camParameters.highFrequencyContainer; v_payload := valueof( f_adaptPayload( bit2oct( Loading @@ -610,17 +646,14 @@ module ItsRSUsSimulator_Functions { ) ); // Update GN vc_longPosVectorRsu := PICS_UC6_VEHICLE_POSITION; vc_longPosVectorRsu := PICS_UC6_VEHICLE_TEMPLATE_POSITION; vc_longPosVectorRsu.latitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.latitude); vc_longPosVectorRsu.longitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.longitude); vc_geoArea := PICS_UC6_VEHICLE_GEOAREA; vc_geoArea := PICS_UC6_VEHICLE_TEMPLATE_GEOAREA; vc_geoArea.area.geoAreaPosLatitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.latitude); vc_geoArea.area.geoAreaPosLongitude := valueof(p_camSimu.cam.camParameters.basicContainer.referencePosition.longitude); // And send it f_send(v_payload, PICS_CAM_ITS_AID); } else { } } // End of function f_send_vehicle_cam function f_send( Loading @@ -629,6 +662,8 @@ module ItsRSUsSimulator_Functions { ) runs on ItsRSUsSimulator { var GeoNetworkingPdu v_geoNetworkingPdu; vc_longPosVectorRsu.timestamp_ := f_getCurrentTime(); if (p_its_aid == 36) { // CAM v_geoNetworkingPdu := valueof(m_geoNwPdu( // FIXME Use PIXIT parameter to get a fully configurable template m_geoNwShbPacket_payload( Loading
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn +94 −47 Original line number Diff line number Diff line Loading @@ -23,6 +23,9 @@ module ItsRSUsSimulator_Pics { // LibItsGeoNetworking import from LibItsGeoNetworking_TypesAndValues all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; // ItsRSUsSimulator import from ItsRSUsSimulator_TypesAndValues all; Loading Loading @@ -582,38 +585,9 @@ module ItsRSUsSimulator_Pics { group camUseCase6 { group camUseCase6SyncLocation { group camUseCase6VehicleTemplateDescription { modulepar LongPosVector PICS_UC6_COLLISION_POINT := { gnAddr := { typeOfAddress := e_manual, stationType := e_unknown, stationCountryCode := 0, mid := '000000000000'O }, timestamp_ := 0, latitude := 433310000, longitude := 101803000, pai := '0'B, speed := 0, heading := 0 } // End of PICS_UC6_DETECTION_POINT /** * @desc Maximum synchronisation area to start sending CAM */ modulepar float PICS_UC6_DETECTION_DISTANCE := 11.0; /** * @desc Maximum synchronisation area to start sending CAM */ modulepar float PICS_UC6_DETECTION_EPSILLON := 0.01; } // End of group camUseCase6SyncLocation group camUseCase6VehicleDescription { modulepar LongPosVector PICS_UC6_VEHICLE_POSITION := { modulepar LongPosVector PICS_UC6_VEHICLE_TEMPLATE_POSITION := { gnAddr := { typeOfAddress := e_manual, stationType := e_passengerCar, Loading @@ -628,7 +602,7 @@ module ItsRSUsSimulator_Pics { heading := 0 } // End of PICS_UC6_VEHICLE_POSITION modulepar GeoArea PICS_UC6_VEHICLE_GEOAREA := { modulepar GeoArea PICS_UC6_VEHICLE_TEMPLATE_GEOAREA := { shape := e_geoElip, area := { geoAreaPosLatitude := 0, Loading @@ -641,7 +615,33 @@ module ItsRSUsSimulator_Pics { } // End of group camUseCase6VehicleDescription modulepar Usecase6VehiclePositions PICS_USECASE6_VEHICLE_POSITIONS := { group camUseCase6SyncLocation { /** * @desc Coordinates of the collision point */ modulepar TwoDLocation PICS_UC6_COLLISION_POINT := { latitude := 433310000, longitude := 101803000 } // End of PICS_UC6_COLLISION_POINT /** * @desc Vehicle detection area */ modulepar RectangularRegion PICS_UC6_CAM_DETECTION_AREA := { northwest := { latitude := 435523210, longitude := 103000210 }, southeast := { latitude := 435528290, longitude := 103010320 } } // End of PICS_UC6_CAM_DETECTION_AREA } // End of group camUseCase6SyncLocation /*modulepar Usecase6VehiclePositions PICS_USECASE6_VEHICLE_POSITIONS := { { // UC-Z1-P0 latitude := 43551930, longitude := 10300440, Loading Loading @@ -1201,10 +1201,57 @@ module ItsRSUsSimulator_Pics { altitudeConfidence := unavailable } } } // End of PICS_USECASE6_VEHICLE_POSITIONS }*/ // End of PICS_USECASE6_VEHICLE_POSITIONS } // End of group camUseCase6 group camUseCase7 { /** * @desc RSU GN address */ modulepar GN_Address PICS_UC7_GN_ADDRESS := { typeOfAddress := e_manual, stationType := e_bus, stationCountryCode := 39, mid := 'AABBCCDDEEEE'O } // End of PICS_UC7_GN_ADDRESS modulepar RsuParm PICS_UC7_LPV := { gnAddress := PICS_UC7_GN_ADDRESS, longPosVector := { gnAddr := PICS_RSU_GN_ADDRESS_RSU4, timestamp_ := 0, latitude := 435582150, longitude := 103065170, pai := '0'B, speed := 0, heading := 10 }, stationID := 12345, geoShape := e_geoCircle, geoParms := { radius := 300 }, pathHistory := {} } // End of PICS_UC7_LPV modulepar ReferencePosition PICS_UC7_COLLISION_POINT := { latitude := 435582150, longitude := 103065170, positionConfidenceEllipse := { semiMajorConfidence := SemiAxisLength_oneCentimeter_, semiMinorConfidence := SemiAxisLength_oneCentimeter_, semiMajorOrientation := HeadingValue_wgs84North_ }, altitude := { altitudeValue := AltitudeValue_referenceEllipsoidSurface_, altitudeConfidence := unavailable } } } // End of group camUseCase7 group camUseCase9 { modulepar ProtectedCommunicationZone PICS_USECASE9_PCZ_1 := { Loading @@ -1220,7 +1267,7 @@ module ItsRSUsSimulator_Pics { PICS_USECASE9_PCZ_1 } // End of PICS_USECASE9_PCZ } // End of group camUseCase9 } // End of group camUseCase7 } // End of group camParams Loading Loading @@ -1981,8 +2028,8 @@ module ItsRSUsSimulator_Pics { }, { // Z3_D1_H2 eventPosition := { deltaLatitude := -3699, deltaLongitude := -5788, deltaLatitude := 2969, deltaLongitude := 3874, deltaAltitude := 0 }, eventDeltaTime := omit, Loading @@ -1997,40 +2044,40 @@ module ItsRSUsSimulator_Pics { { { // Z3-D1-T1 pathPosition := { deltaLatitude := 4659, deltaLongitude := 7205, deltaLatitude := -4657, deltaLongitude := -9320, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T2 pathPosition := { deltaLatitude := 510, deltaLongitude := 720, deltaLatitude := -34, deltaLongitude := -1018, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T3 pathPosition := { deltaLatitude := -247, deltaLongitude := -797, deltaLatitude := -109, deltaLongitude := -897, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T4 pathPosition := { deltaLatitude := -258, deltaLongitude := -675, deltaLatitude := -247, deltaLongitude := -797, deltaAltitude := 0 }, pathDeltaTime := omit }, { // Z3-D1-T5 pathPosition := { deltaLatitude := -4657, deltaLongitude := -9320, deltaLatitude := -258, deltaLongitude := -675, deltaAltitude := 0 }, pathDeltaTime := omit Loading
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pixits.ttcn +6 −5 Original line number Diff line number Diff line Loading @@ -26,11 +26,12 @@ module ItsRSUsSimulator_Pixits { /** * @desc Indicate which Use Case to simulate * @remark UC1 (DENM): PX_ETSI_USE_CASE_ID := 1 * UC3 (TLM): PX_ETSI_USE_CASE_ID := 3 * UC5 (IVIM): PX_ETSI_USE_CASE_ID := 5 * UC6 (CAM): PX_ETSI_USE_CASE_ID := 6 * UC9 (CAM): PX_ETSI_USE_CASE_ID := 9 !! PX_RSU_ID 5 * @remark UC1 (DENM only): PX_ETSI_USE_CASE_ID := 1 !! PX_RSU_ID 2 * UC3 (TLM MAPEM/SPATEM): PX_ETSI_USE_CASE_ID := 3 !! PX_RSU_ID 2 * UC5 (IVIM only): PX_ETSI_USE_CASE_ID := 5 !! PX_RSU_ID 2 * UC6 (CAM only): PX_ETSI_USE_CASE_ID := 6 !! PX_RSU_ID 2 * UC7 (CAM only): PX_ETSI_USE_CASE_ID := 7 !! PX_RSU_ID 2 * UC9 (CAM only): PX_ETSI_USE_CASE_ID := 9 !! PX_RSU_ID 5 */ modulepar integer PX_ETSI_USE_CASE_ID := 6; Loading
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Templates.ttcn +1 −0 Original line number Diff line number Diff line Loading @@ -250,6 +250,7 @@ module ItsRSUsSimulator_Templates { timestamp_ := ?, latitude := ?, longitude := ?, pai := ?, //FIXME May the delta factor should be based on the actual speed value -> low speed=lower delta, high speed=higher delta speed := ?, heading := ? Loading
ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn +33 −13 Original line number Diff line number Diff line Loading @@ -19,6 +19,10 @@ module ItsRSUsSimulator_TestCases { // LibItsDenm import from LibItsDenm_Templates all; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Functions all; // AtsRSUsSimulator import from ItsRSUsSimulator_TypesAndValues all; import from ItsRSUsSimulator_Templates all; Loading Loading @@ -169,6 +173,7 @@ module ItsRSUsSimulator_TestCases { var integer v_vehiclesIdx := 0; var charstring v_stationIDs := ""; var charstring v_stationID; var ThreeDLocation v_location; var GeoNetworkingInd v_gnInd; var CfEvent v_cfEvent; Loading @@ -194,12 +199,21 @@ module ItsRSUsSimulator_TestCases { -, e_btpB )))) -> value v_gnInd { // Receive a CAM message v_location := { v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.cam.camParameters.basicContainer.referencePosition.latitude, v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.cam.camParameters.basicContainer.referencePosition.longitude, int2oct(v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.cam.camParameters.basicContainer.referencePosition.altitude.altitudeValue, 2) }; v_stationID := int2str(v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.header.stationID); tc_ac.stop; // Check if it entered into the rectangular area if (f_isLocationInsideRectangularRegion({ PICS_UC6_CAM_DETECTION_AREA }, v_location) == true) { // Check if it already processed v_stationID := int2str(v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket.header.stationID); if (regexp(v_stationIDs, charstring:"(" & v_stationID & ",)", 0) == "") { // Vehicle not processed yet log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " is entering in area ***"); v_vehicles[v_vehiclesIdx] := ItsRSUsSimulator.create("Node" & int2char(v_vehiclesIdx + 65)) alive; v_vehicles[v_vehiclesIdx].start(f_startVehicleSimulator(v_vehicles[v_vehiclesIdx], v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket)); v_vehicles[v_vehiclesIdx].start(f_startVehicleSimulator(v_vehicles[v_vehiclesIdx], v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket, v_location)); v_vehiclesIdx := v_vehiclesIdx + 1; v_stationIDs := v_stationIDs & v_stationID & ","; log("*** " & testcasename() & ": DEBUG: New v_stationIDs: " & v_stationIDs & " ***"); Loading @@ -207,6 +221,10 @@ module ItsRSUsSimulator_TestCases { // Nothing to do log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " already processed ***"); } } else { // Nothing to do log("*** " & testcasename() & ": DEBUG: StationID: " & v_stationID & " is outside of area ***"); } tc_ac.start; repeat; } Loading Loading @@ -236,7 +254,8 @@ module ItsRSUsSimulator_TestCases { function f_startVehicleSimulator( in ItsRSUsSimulator p_component, in CAM p_camVehicle in CAM p_camVehicle, in ThreeDLocation p_location ) runs on ItsRSUsSimulator { // Local variables Loading @@ -261,12 +280,13 @@ module ItsRSUsSimulator_TestCases { ))))) -> value v_gnInd { // Receive a CAM message from the processed vehicle log("*** " & testcasename() & ": DEBUG: Processing CAM #" & int2str(p_camVehicle.header.stationID) & " ***"); tc_cam.stop; f_send_vehicle_cam(v_camSimu, v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket); f_mirror_and_send_vehicle_cam(v_camSimu, v_gnInd.msgIn.gnPacket.packet.payload.decodedPayload.btpPacket.payload.decodedPayload.camPacket, p_location); tc_cam.start; } /*[] cfPort.receive { [] cfPort.receive { tc_cam.stop; repeat; }*/ } [] tc_cam.timeout { log("*** " & testcasename() & ": DEBUG: No CAM message received ***"); } Loading