Commit 1a79f5fe authored by garciay's avatar garciay
Browse files

Validation in Livorno (20161003-05)

parent 0b7c9381
Loading
Loading
Loading
Loading
+58 −26
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ module ItsRSUsSimulator_Functions {
            vc_ivim := false;
        }
        // DENM, only if PX_ETSI_USE_CASE_ID is set to 1
        if ((vc_denm == true) and (PX_ETSI_USE_CASE_ID == 5)) {
        if ((vc_denm == true) and (PX_ETSI_USE_CASE_ID == 1)) {
            // Build the list of the DENM events for the specified RSU (PX_RSU_ID) and the given zone (PX_ETSI_ZONE_ID)
            for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[p_rsu_id][PX_ETSI_ZONE_ID - 1]); v_counter := v_counter + 1) {
                var DenmEventsParmsPerZone v_denmEventsParmsPerZone := PICS_DENM_EVENTS_RSU[p_rsu_id][PX_ETSI_ZONE_ID - 1];
@@ -235,6 +235,19 @@ module ItsRSUsSimulator_Functions {
                    v_denms[v_counter].denm.alacarte := m_alacarte(v_denmEventsParmsPerZone[v_counter].roadWorksContainerExtended);
                }
            } // End of 'for' statement
            // Update referenceDenms field
            for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[p_rsu_id][PX_ETSI_ZONE_ID - 1]); v_counter := v_counter + 1) {
                if (ispresent(v_denms[v_counter].denm.alacarte.roadWorks)) {
                    var integer v_referenceDenms := 0;
                    for (var integer v_counter1 := 0; v_counter1 < lengthof(PICS_DENM_EVENTS_RSU[p_rsu_id][PX_ETSI_ZONE_ID - 1]); v_counter1 := v_counter1 + 1) {
                        if (v_counter1 == v_counter) {
                            continue;
                        }
                        v_denms[v_counter].denm.alacarte.roadWorks.referenceDenms[v_referenceDenms] := v_denms[v_counter1].denm.management.actionID;
                        v_referenceDenms := v_referenceDenms + 1;
                    } // End of 'for' statement
                }
            } // End of 'for' statement
        } else {
            vc_denm := false;
        }
@@ -546,32 +559,54 @@ module ItsRSUsSimulator_Functions {
    } // End of function f_adaptPayload
    
    function f_send_vehicle_cam(
                                in template (value) CAM p_cam,
                                in integer p_idx
                                in template (value) CAM p_camSimu,
                                in template (value) CAM p_camVehicle
    ) runs on ItsRSUsSimulator {
        // Local variables
        var LongPosVector v_vehiclePosition := PICS_UC6_VEHICLE_POSITION;
        var float v_distanceToCollision;
        var SpeedValue v_vehicleSpeed := valueof(p_camVehicle.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.speed.speedValue);
        var template (value) Payload v_payload;
        
        p_cam.cam.generationDeltaTime := f_getCurrentTime() mod 65536; // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
        p_cam.cam.camParameters.basicContainer.referencePosition := PICS_USECASE6_VEHICLE_POSITIONS[p_idx];
        // Compute distance to collision point
        v_vehiclePosition.latitude := valueof(p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude);
        v_vehiclePosition.longitude := valueof(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
            p_camSimu.cam.generationDeltaTime := f_getCurrentTime() mod 65536; // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
            v_payload := valueof(
                f_adaptPayload(
                    bit2oct(
                        encvalue(
                            valueof(
                            p_cam
                                p_camSimu
                    ))),
                    PICS_CAM_BTP_DESTINATION_PORT,
                    PICS_CAM_BTP_SOURCE_PORT
                )
            );
        vc_longPosVectorRsu := PICS_UC6_VEHICLE_POSITION;
            // FIXME Update GN
            /*vc_longPosVectorRsu := PICS_UC6_VEHICLE_POSITION;
            vc_longPosVectorRsu.latitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].latitude;
            vc_longPosVectorRsu.longitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].longitude;
            vc_geoArea := PICS_UC6_VEHICLE_GEOAREA;
            vc_geoArea.area.geoAreaPosLatitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].latitude;
        vc_geoArea.area.geoAreaPosLongitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].longitude;
            vc_geoArea.area.geoAreaPosLongitude := PICS_USECASE6_VEHICLE_POSITIONS[p_idx].longitude;*/
            // And send it
            f_send(v_payload, PICS_CAM_ITS_AID);
            
        } else {
        }
    } // End of function f_send_vehicle_cam
    
    function f_send(
@@ -582,11 +617,8 @@ module ItsRSUsSimulator_Functions {
        
        if (p_its_aid == 36) { // CAM 
            v_geoNetworkingPdu := valueof(m_geoNwPdu( // FIXME Use PIXIT parameter to get a fully configurable template
                m_geoNwTsbPacket_payload( // TODO modifes 'template (value) GnNonSecuredPacket m_geoNwBroadcastPacket' to set the field
                    f_incLocalSeqNumber(),
                m_geoNwShbPacket_payload(
                    vc_longPosVectorRsu,
                    -,
                    -,
                    valueof(p_payload)
                ),
                m_defaultLifetime,
+29 −30
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ module ItsRSUsSimulator_Pics {
            
            group camUseCase6SyncLocation {
                
                modulepar LongPosVector PICS_UC6_DETECTION_POINT := {
                modulepar LongPosVector PICS_UC6_COLLISION_POINT := {
                    gnAddr := {
                        typeOfAddress         := e_manual,
                        stationType           := e_unknown,
@@ -1212,7 +1212,7 @@ module ItsRSUsSimulator_Pics {
                expiryTime               := omit,
                protectedZoneLatitude    := 435924080,
                protectedZoneLongitude   := 103374530,
                protectedZoneRadius      := 500,
                protectedZoneRadius      := 50,
                protectedZoneID          := 1
            } // End of PICS_USECASE9_PCZ_1
            
@@ -1379,17 +1379,17 @@ module ItsRSUsSimulator_Pics {
                        eventHistory                                := PICS_Z1_D1_Hx,
                        traces                                      := PICS_Z1_D1_Tx,
                        roadWorksContainerExtended := {
                            lightBarSirenInUse                      := LightBarSirenInUse_sirenActivated_,
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := availableForDriving,
                                drivingLaneStatus                   := '10'B
                                drivingLaneStatus                   := '0001'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := PICS_Z1_D1_POS0,
                            trafficFlowRule                         := passToLeft,
                            trafficFlowRule                         := passToRight,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z1_D1
@@ -1486,10 +1486,10 @@ module ItsRSUsSimulator_Pics {
                        eventHistory                                := PICS_Z1_D2_Hx,
                        traces                                      := PICS_Z1_D2_Tx,
                        roadWorksContainerExtended := {
                            lightBarSirenInUse                      := LightBarSirenInUse_lightBarActivated_,
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := availableForDriving,
                                drivingLaneStatus                   := '1100'B
                                drivingLaneStatus                   := '0011'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
@@ -1589,7 +1589,7 @@ module ItsRSUsSimulator_Pics {
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := closed,
                                drivingLaneStatus                   := '11001'B
                                drivingLaneStatus                   := '0100'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
@@ -1600,8 +1600,9 @@ module ItsRSUsSimulator_Pics {
                                deltaLongitude                      := 0,
                                deltaAltitude                       := 0
                            },
                            trafficFlowRule                         := passToRight,
                            referenceDenms                          := omit
                            trafficFlowRule                         := passToLeft,
                            referenceDenms                          := {
                            }
                        }
                        
                    } // End of PICS_Z1_D3
@@ -1721,7 +1722,7 @@ module ItsRSUsSimulator_Pics {
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := PICS_Z2_D1_POS0,
                            trafficFlowRule                         := passToLeft,
                            trafficFlowRule                         := passToRight,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z2_D1
@@ -1921,14 +1922,14 @@ module ItsRSUsSimulator_Pics {
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := closed,
                                drivingLaneStatus                   := '01'B
                                drivingLaneStatus                   := '0100'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := omit,
                            trafficFlowRule                         := passToRight,
                            trafficFlowRule                         := passToLeft,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z2_D3
@@ -2248,7 +2249,7 @@ module ItsRSUsSimulator_Pics {
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := closed,
                                drivingLaneStatus                   := '01'B
                                drivingLaneStatus                   := '0100'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
@@ -2375,7 +2376,7 @@ module ItsRSUsSimulator_Pics {
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := PICS_Z4_D1_POS0,
                            trafficFlowRule                         := passToLeft,
                            trafficFlowRule                         := passToRight,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z4_D1
@@ -2575,7 +2576,7 @@ module ItsRSUsSimulator_Pics {
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := closed,
                                drivingLaneStatus                   := '01'B
                                drivingLaneStatus                   := '0100'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
@@ -2702,7 +2703,7 @@ module ItsRSUsSimulator_Pics {
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := PICS_Z5_D1_POS0,
                            trafficFlowRule                         := passToLeft,
                            trafficFlowRule                         := passToRight,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z5_D1
@@ -2902,14 +2903,14 @@ module ItsRSUsSimulator_Pics {
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := closed,
                                drivingLaneStatus                   := '01'B
                                drivingLaneStatus                   := '0100'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := omit,
                            trafficFlowRule                         := passToRight,
                            trafficFlowRule                         := passToLeft,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z5_D3
@@ -3029,7 +3030,7 @@ module ItsRSUsSimulator_Pics {
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := PICS_Z6_D1_POS0,
                            trafficFlowRule                         := passToLeft,
                            trafficFlowRule                         := passToRight,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z6_D1
@@ -3229,14 +3230,14 @@ module ItsRSUsSimulator_Pics {
                            lightBarSirenInUse                      := omit,
                            closedLanes := {
                                hardShoulderStatus                  := closed,
                                drivingLaneStatus                   := '01'B
                                drivingLaneStatus                   := '0100'B
                            },
                            restriction                             := omit,
                            speedLimit                              := PICS_SPEED_LIMIT,
                            incidentIndication                      := omit,
                            recommendedPath                         := omit,
                            startingPointSpeedLimit                 := omit,
                            trafficFlowRule                         := passToRight,
                            trafficFlowRule                         := passToLeft,
                            referenceDenms                          := omit
                        }
                    } // End of PICS_Z6_D3
@@ -4080,10 +4081,10 @@ module ItsRSUsSimulator_Pics {
        
        modulepar MapemParmListRsu PICS_MAPEM_PARMS_RSUs := {
            PICS_Z1_M1_SL,                 // RSU #1
            {
            PICS_Z2_M1_SL/*{
                intersections := omit,
                roadSegments  := omit
            },                              // RSU #2
            }*/,                              // RSU #2
            PICS_Z2_M1_SL,                  // RSU #3
            PICS_Z5_M1_SL,                  // RSU #4
            PICS_Z4_M1_SL,                  // RSU #5
@@ -4667,7 +4668,7 @@ module ItsRSUsSimulator_Pics {
        
        modulepar SpatemParmRsu PICS_SPATEM_PARMS_RSUs := {
            PICS_Z1_S1_SL_LIST,              // RSU #1
            {},                              // RSU #2
            PICS_Z2_S1_SL_LIST/*{}*/,                              // RSU #2
            PICS_Z2_S1_SL_LIST,              // RSU #3
            PICS_Z5_S1_SL_LIST,              // RSU #4
            PICS_Z4_S1_SL_LIST,              // RSU #5
@@ -6105,12 +6106,11 @@ module ItsRSUsSimulator_Pics {
        
        modulepar IvimParmListRsu PICS_IVIM_PARMS_RSUs := {
            PICS_Z1_I1_POS1,                             // RSU #1
            { 
            PICS_Z2_I1_POS1,/*{ 
                provider := omit, 
                iviIdentificationNumber := omit, 
                iviContainers := omit 
            },                                           // RSU #2
            PICS_Z2_I1_POS1,                             // RSU #3
            },*/                                           // RSU #2                             // RSU #3
            PICS_Z5_I1_POS1,                             // RSU #4
            PICS_Z4_I1_POS1,                             // RSU #5
            { 
@@ -6193,7 +6193,6 @@ module ItsRSUsSimulator_Pics {
         * @desc CAM frequency timer
         */
        modulepar float PICS_CAM_FREQUENCY       := 1.0;
        modulepar float PICS_CAM_FREQUENCY_UC6   := 0.1;
        
        /**
         * @desc DENM frequency timer
@@ -6213,7 +6212,7 @@ module ItsRSUsSimulator_Pics {
        /**
         * @desc IVIM frequency timer
         */
        modulepar float PICS_IVIM_FREQUENCY      := 5.0;
        modulepar float PICS_IVIM_FREQUENCY      := 1.0;
        
    } // End of group generationFrequencies 
    
+1 −1
Original line number Diff line number Diff line
@@ -38,6 +38,6 @@ module ItsRSUsSimulator_Pixits {
     * @desc Indicate which zone to simulate
     * @remark Used only for DENM
     */
    modulepar integer PX_ETSI_ZONE_ID := 1;
    modulepar integer PX_ETSI_ZONE_ID := 2;
    
} // End of module ItsRSUsSimulator_Pixits
+45 −7
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@ module ItsRSUsSimulator_Templates {
         * @param   p_seqNumber         Sequence number of TSB packet
         * @param   p_sourceLongPosVec  Long position vector of source
         * @param   p_hopLimit          The maximum number of hops (Default: c_defaultHopLimit)
         * @param   p_trafficClass      TODO
         * @param   p_payload           TODO
         */
        template (value) GnNonSecuredPacket m_geoNwTsbPacket_payload(
                                                                     in template (value) UInt16 p_seqNumber,
@@ -91,6 +93,20 @@ module ItsRSUsSimulator_Templates {
            payload :=  p_payload
        }
        
        /**
         * @desc    Send template for GeoNetworking SHB Packet
         * @param   p_sourceLongPosVec  Long position vector of source
         * @param   p_hopLimit          The maximum number of hops (Default: c_defaultHopLimit)
         * @param   p_trafficClass      TODO
         * @param   p_payload           TODO
         */
        template (value) GnNonSecuredPacket m_geoNwShbPacket_payload(
                                                                     in template (value) LongPosVector p_sourceLongPosVec,
                                                                     in template (value) Payload p_payload
        ) modifies m_geoNwShbPacket:= {
            payload :=  p_payload
        }
        
        /**
         * @desc    Receive template for GeoNetworking Unicast Packet
         * @param   p_destinationShortPosVec    Short position vector of destination
@@ -163,7 +179,7 @@ module ItsRSUsSimulator_Templates {
                }, 
                rawPayload := ?
            }
        }
        } // End of template mw_geoNwTsbPacketWithNextHeader_denm
        
        /**
         * @desc    Receive template for GeoNetworking CAM Packet
@@ -174,19 +190,25 @@ module ItsRSUsSimulator_Templates {
        template (present) GnNonSecuredPacket mw_geoNwShbPacketWithNextHeader_cam(
                                                                                  in template (present) LongPosVector p_sourceLongPosVec := ?,
                                                                                  in template (present) UInt8 p_hopLimit := ?,
                                                                                  in template (value) NextHeader p_nextHeader
                                                                                  in template (value) NextHeader p_nextHeader,
                                                                                  in template (present) CAM p_cam := ?
        ) modifies mw_geoNwShbPacket := {
            payload := { 
                decodedPayload := { 
                    btpPacket := mw_btpB(
                        PICS_CAM_BTP_DESTINATION_PORT, 
                        PICS_CAM_BTP_SOURCE_PORT, 
                        ?
                    )
                        {
                            decodedPayload := {
                                camPacket := p_cam
                            },
                            rawPayload := ?
                        }
                    )
                }, 
                rawPayload := ?
            }
        } // End of template mw_geoNwShbPacketWithNextHeader_cam
        
    } // End of group geoNetworkingTemplates 
    
@@ -280,7 +302,23 @@ module ItsRSUsSimulator_Templates {
            }
        } // End of template m_camParm
        
        // TODO Add ProtectedZone
        template (present) CAM mw_cam_stationID(
                                                in template (present) BasicVehicleContainerHighFrequency p_basicVehicleContainer := mw_HF_BV_speed(?),
                                                in template (value) StationID p_stationID,
                                                in template (present) ReferencePosition p_referencePosition := ?
        ) modifies mw_camMsg_HF_BV := {
            header := {
                stationID := p_stationID
            }, 
            cam := {
                camParameters := {
                    basicContainer := {
                        stationType := ?,
                        referencePosition := p_referencePosition
                    }
                }
            }
        } // End of template mw_cam_stationID
        
    } // End of group camTemplates
    
+33 −64

File changed.

Preview size limit exceeded, changes collapsed.

Loading