Newer
Older
* @author ETSI / STF405
* @version $URL$
* $Id$
* @desc Module containing base template definitions for CAM
// LibIts
import from LibItsCommon_Functions all;
import from LibItsCam_TypesAndValues all;
import from LibItsCam_Pixits all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
* @desc Receive template for CAM Message (CamPort Primitive)
* @param p_camMsg CAM Message to be sent
*/
template CamInd mw_camInd (
in template (present) CamPdu p_camMsg
) := {
msgIn := p_camMsg
};
/**
* @desc Send template for CAM Message (CamPort Primitive)
*/
template (value) CamReq m_camReq (
in template (value) CamPdu p_camMsg
) := {
msgOut := p_camMsg
};
/**
* @desc Initializes the CAM IUT.
*/
template (value) UtInitialize m_camInitialize := {
utCamInitialize := {
}
}
/**
* @desc Change the heading
* @param p_offset Offset to the current heading
template (value) UtEvent m_changeHeading(Direction p_offset) := {
utCamEvent := {
changeHeading := p_offset
}
* @desc Change the position in the direction of the current heading
* @param p_offset Offset to the current position
*/
template (value) UtEvent m_changePosition(integer p_offset) := {
utCamEvent := {
changePosition := p_offset
}
}
/**
* @desc Change the speed
* @param p_offset Offset to the current position
*/
template (value) UtEvent m_changeSpeed(Speed p_offset) := {
utCamEvent := {
changeSpeed := p_offset
}
}
/**
* @desc Set the crash status
* @param p_status The status to set
*/
template (value) UtEvent m_setCrashSignal(CrashStatus p_status) := {
utCamEvent := {
setCrashSignal := p_status
}
}
/**
* @desc Set the dangerous goods status
* @param p_status The status to set
*/
template (value) UtEvent m_setDangerousGoodsStatus(DangerousGoods p_status) := {
utCamEvent := {
setDangerousGoodsStatus := p_status
}
}
/**
* @desc Set the length and width precision
* @param p_precision The precision to set
*/
template (value) UtEvent m_setLengthWidthPrecision(boolean p_precision) := {
utCamEvent := {
setLengthWidthPrecision := p_precision
}
}
/**
* @desc Set the distance to the stop line
* @param p_distance The distance to set
*/
template (value) UtEvent m_setDistanceToStopLine(Distance p_distance) := {
utCamEvent := {
setDistanceToStopLine := p_distance
}
}
/**
* @desc Set the turn advice
* @param p_turnAdvice The turn advice to set
*/
template (value) UtEvent m_setTurnAdvice(TurnAdvice p_turnAdvice) := {
utCamEvent := {
setTurnAdvice := p_turnAdvice
}
}
/**
* @desc Change the curvature
* @param p_offset Offset to the current curvature
*/
template (value) UtEvent m_changeCurvature(Curvature p_offset) := {
utCamEvent := {
changeCurvature := p_offset
}
}
/**
* @desc Set the occupancy
* @param p_occupancy The occupancy to set
*/
template (value) UtEvent m_setOccupancy(Occupancy p_occupancy) := {
utCamEvent := {
setOccupancy := p_occupancy
}
}
/**
* @desc Set the door status
* @param p_status The status to set
*/
template (value) UtEvent m_setDoorStatus(DoorOpen p_status) := {
utCamEvent := {
setDoorStatus := p_status
}
}
/**
* @desc Set the light bar status
* @param p_status The status to set
*/
template (value) UtEvent m_setLightBarStatus(SimpleSystemState p_status) := {
utCamEvent := {
setLightBarStatus := p_status
}
}
/**
* @desc Set the sirene status
* @param p_status The status to set
*/
template (value) UtEvent m_setSireneStatus(SimpleSystemState p_status) := {
utCamEvent := {
setSireneStatus := p_status
}
}
/**
* @desc Set the traffic light priority
* @param p_priority The priority to set
*/
template (value) UtEvent m_setTrafficLightPriority(Priority p_priority) := {
utCamEvent := {
setTrafficLightPriority := p_priority
}
}
/**
* @desc Set the schedule deviation
* @param p_scheduleDeviation The schedule deviation to set
*/
template (value) UtEvent m_setScheduleDeviation(ScheduleDeviation p_scheduleDeviation) := {
utCamEvent := {
setScheduleDeviation := p_scheduleDeviation
}
}
/**
* @desc Set the PT line description
* @param p_ptLineDescription The PT line description to set
*/
template (value) UtEvent m_setPtLineDescription(PTLineDescription p_ptLineDescription) := {
utCamEvent := {
setPtLineDescription := p_ptLineDescription
}
}
/**
* @desc Set the exterior lights status
* @param p_status The status to set
*/
template (value) UtEvent m_setExteriorLightsStatus(ExteriorLights p_status) := {
utCamEvent := {
setExteriorLightsStatus := p_status
}
}
/**
* @desc Checks the receive of a message at LDM
* @param p_message The CAM message to check
*/
template (value) UtEvent m_checkLdm(CamPdu p_message) := {
utCamEvent := {
checkLdm := p_message
}
}
} // end utPrimitives
} // end group Primitives
group positionTemplates {
template (value) ReferencePosition m_tsPosition := {
longitude := f_getTsLongitude(),
latitude := f_getTsLatitude(),
elevation := 0,
heading := omit, //present if mobileItsStation flag is TRUE
streetName := omit,
positionConfidence := omit, //present if mobileItsStation flag is TRUE
elevationConfidence := omit, //present if mobileItsStation flag is TRUE
roadSegmentID := omit
}
} // end positionTemplates
/**
* @desc Default Receive template for CAM PDU
template CamPdu mw_camMsg_any := {
header := {
protocolVersion := 0,
messageID := 0,
generationTime := ?
},
cam := {
stationID := ?,
stationCharacteristics := ?,
referencePosition := ?,
camParameters := *
}
}
* @param p_generationTime Timestamp of the generated message
* @param p_stationId Station ID of the source
* @param p_stationCharacteristics Characteristics of the sending station
* @param p_referencePosition Position of the sending station
CoopAwareness.stationCharacteristics p_stationCharacteristics,
template (value) ReferencePosition p_referencePosition
) := {
header := {
protocolVersion := 0,
messageID := 0,
generationTime := p_generationTime
},
cam := {
stationCharacteristics := p_stationCharacteristics,
referencePosition := p_referencePosition,
camParameters := omit
}
};
/**
* @desc Send template for Vehicle CAM PDU
* @param p_generationTime Timestamp of the generated message
* @param p_stationId Station ID of the source
* @param p_stationCharacteristics Characteristics of the sending station
* @param p_referencePosition Position of the sending station
*/
template (value) CamPdu m_camMsg_vehicle(
TimeStamp p_generationTime,
StationID p_stationId,
CoopAwareness.stationCharacteristics p_stationCharacteristics,
template (value) ReferencePosition p_referencePosition
) := {
header := {
protocolVersion := 0,
messageID := 0,
generationTime := p_generationTime
},
cam := {
stationID := p_stationId,
stationCharacteristics := p_stationCharacteristics,
referencePosition := p_referencePosition,
camParameters := {
vehicleCommonParameters := {
vehicleType := 0,
garciay
committed
stationLength := 1,
stationLengthConfidence := 3,
stationWidth := 12,
stationWidthConfidence := 4,
vehicleSpeed := 45,
vehicleSpeedConfidence := 5,
longAcceleration := 33,
longAccelerationConfidence := 4,
garciay
committed
yawDirection := right,
yawRateValue := 123
},
yawRateConfidence := 0,
exteriorLights := '00000000'B,
garciay
committed
turnAdvice := {
direction := TurnDirection_right_,
distance := 10
},
distanceToStopLine := 10,
occupancy := 15,
doorOpen := DoorOpen_passenger_,
garciay
committed
semiMajorConfidence := 7,
semiMinorConfidence := 8,
semiMajorOrientation := 19
garciay
committed
curvature := -175,
curvatureChange := -50,
curvatureConfidence := 9,
crashStatus := false,
headingConfidence := 10,
dangerousGoods := 125
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
*/
template CamPdu mw_camMsg_anyVehicle
modifies mw_camMsg_any := {
cam := {
stationCharacteristics := {?, ?, ?},
camParameters := {
vehicleCommonParameters := {
vehicleType := ?,
stationLength := ?,
stationLengthConfidence := *,
stationWidth := ?,
stationWidthConfidence := *,
vehicleSpeed := ?,
vehicleSpeedConfidence := ?,
longAcceleration := ?,
longAccelerationConfidence := ?,
accelerationControl := ?,
yawRate := ?,
yawRateConfidence := ?,
exteriorLights := ?,
turnAdvice := *,
distanceToStopLine := *,
occupancy := *,
doorOpen := *,
posConfidenceEllipse := ?,
curvature := ?,
curvatureChange := *,
curvatureConfidence := ?,
crashStatus := *,
headingConfidence := ?,
dangerousGoods := *
},
profileDependent := *
}
}
}
template CamPdu mw_camMsg_anyVehicleReferencePosition(in template (present) ReferencePosition p_referencePosition)
modifies mw_camMsg_anyVehicle := {
cam := {
referencePosition := p_referencePosition
}
};
template CamPdu mw_camMsg_withCrashStatus
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
crashStatus := true
}
}
}
};
template CamPdu mw_camMsg_withoutCrashStatus
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
crashStatus := false ifpresent
}
}
}
};
template CamPdu mw_camMsg_withDangerousGoods(in template (present) DangerousGoods p_dangerousGoods)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
dangerousGoods := p_dangerousGoods
}
}
}
};
template CamPdu mw_camMsg_withoutDangerousGoods
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
dangerousGoods := omit
}
}
}
};
template CamPdu mw_camMsg_withLengthWidthConfidence
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
stationLengthConfidence := ?,
stationWidthConfidence := ?
}
}
}
};
template CamPdu mw_camMsg_withoutLengthWidthConfidence
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
stationLengthConfidence := omit,
stationWidthConfidence := omit
}
}
}
};
template CamPdu mw_camMsg_withDoorOpen(in template (present) DoorOpen p_doorOpen)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
doorOpen := p_doorOpen
}
}
}
};
template CamPdu mw_camMsg_withoutDoorOpen
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
doorOpen := omit
}
}
}
};
template CamPdu mw_camMsg_withDistanceToStopLine(in template (present) Distance p_distance)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
distanceToStopLine := p_distance
}
}
}
};
template CamPdu mw_camMsg_withTurnAdvice(in template (present) TurnAdvice p_turnAdvice)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
turnAdvice := p_turnAdvice
}
}
}
};
template CamPdu mw_camMsg_withCurvatureChange(in template (present) CurvatureChange p_curvatureChange)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
curvatureChange := p_curvatureChange
}
}
}
};
template CamPdu mw_camMsg_withOccupancy(in template (present) Occupancy p_occupancy)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
occupancy := p_occupancy
}
}
}
};
template CamPdu mw_camMsg_withExteriorLights(in template (present) ExteriorLights p_exteriorLights)
modifies mw_camMsg_anyVehicle := {
cam := {
camParameters := {
vehicleCommonParameters := {
exteriorLights := p_exteriorLights
}
}
}
};
} // end camAnyVehicle
group camBasicIrs {
* @desc Receive template for CAM PDU for road-side unit
*/
template CamPdu mw_camMsg_basicIrs
modifies mw_camMsg_any := {
cam := {
stationCharacteristics := {false, false, false},
referencePosition := {
longitude := ?,
latitude := ?,
elevation := ?,
heading := omit,
streetName := *,
positionConfidence := omit,
elevationConfidence := omit,
roadSegmentID := *
},
camParameters := omit
}
}
} // end camBasicIrs
group camBasicVehicle {
* @desc Receive template for CAM PDU for basic vehicle
*/
template CamPdu mw_camMsg_basicVehicle
modifies mw_camMsg_anyVehicle := {
stationCharacteristics := {true, true, true},
camParameters := {
profileDependent := {basicVehicle := ?}
}
}
}
* @desc Receive template for CAM PDU for emergency vehicle
*/
template CamPdu mw_camMsg_emergencyVehicle
modifies mw_camMsg_anyVehicle := {
cam := {
stationCharacteristics := {true, false, true},
camParameters := {
profileDependent := {
emergencyVehicle := {
lightBarInUse := *,
sireneInUse := *,
emergencyResponseType := ?
}
};
template CamPdu mw_camMsg_emergencyVehicle_withLightBar(in template (present) LightBarInUse p_status)
modifies mw_camMsg_emergencyVehicle := {
cam := {
camParameters := {
profileDependent := {
emergencyVehicle := {
lightBarInUse := p_status
}
}
}
}
template CamPdu mw_camMsg_emergencyVehicle_withSirene(in template (present) SireneInUse p_status)
modifies mw_camMsg_emergencyVehicle := {
cam := {
camParameters := {
profileDependent := {
emergencyVehicle := {
sireneInUse := p_status
}
} // end camEmergencyVehicle
group camPublicTransportVehicle {
* @desc Receive template for CAM PDU for public transport vehicle
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
*/
template CamPdu mw_camMsg_publicTransportVehicle
modifies mw_camMsg_basicVehicle := {
cam := {
stationCharacteristics := {true, false, true},
camParameters := {
profileDependent := {
publicTransportVehicle := {
publicVehicleType := ?,
pTLineDescription := *,
scheduleDeviation := *,
trafficLightPriority := *
}
}
}
}
};
template CamPdu mw_camMsg_publicTransportVehicle_withTrafficLightPriority(in template (present) TrafficLightPriority p_trafficLightPriority)
modifies mw_camMsg_publicTransportVehicle := {
cam := {
camParameters := {
profileDependent := {
publicTransportVehicle := {
trafficLightPriority := p_trafficLightPriority
}
}
}
}
};
template CamPdu mw_camMsg_publicTransportVehicle_withPTLineDescription(in template (present) PTLineDescription p_pTLineDescription)
modifies mw_camMsg_publicTransportVehicle := {
cam := {
camParameters := {
profileDependent := {
publicTransportVehicle := {
pTLineDescription := p_pTLineDescription
}
}
}
}
};
template CamPdu mw_camMsg_publicTransportVehicle_withScheduleDeviation(in template (present) ScheduleDeviation p_scheduleDeviation)
modifies mw_camMsg_publicTransportVehicle := {
cam := {
camParameters := {
profileDependent := {
publicTransportVehicle := {
scheduleDeviation := p_scheduleDeviation
}
}
}
}
};
} // end camPublicTransportVehicle
group camExteriorLightsTemplates {
/**
* @desc Receive template for exterior lights with low beam lights off
template ExteriorLights mw_lowBeamLightsOff := complement(mw_lowBeamLightsOn, omit) ;
/**
* @desc Receive template for exterior lights with low beam lights on
*/
template ExteriorLights mw_lowBeamLightsOn := '1*'B ;
/**
* @desc Receive template for exterior lights with high beam lights off
template ExteriorLights mw_highBeamLightsOff := complement(mw_highBeamLightsOn, omit);
/**
* @desc Receive template for exterior lights with high beam lights on
*/
template ExteriorLights mw_highBeamLightsOn := '?1*'B ;
/**
* @desc Receive template for exterior lights with left turn signal off
template ExteriorLights mw_leftTurnSignalOff := complement(mw_leftTurnSignalOn, omit);
/**
* @desc Receive template for exterior lights with left turn signal on
*/
template ExteriorLights mw_leftTurnSignalOn := '??1*'B ;
/**
* @desc Receive template for exterior lights with right turn signal off
template ExteriorLights mw_rightTurnSignalOff := complement(mw_rightTurnSignalOn, omit);
/**
* @desc Receive template for exterior lights with right turn signal on
*/
template ExteriorLights mw_rightTurnSignalOn := '???1*'B ;
/**
* @desc Receive template for exterior lights with automatic light control off
template ExteriorLights mw_automaticLightControlOff := complement(mw_automaticLightControlOn, omit);
/**
* @desc Receive template for exterior lights with automatic light control on
*/
template ExteriorLights mw_automaticLightControlOn := '????1*'B ;
/**
* @desc Receive template for exterior lights with day time running lights off
template ExteriorLights mw_daytimeRunningLightOff := complement(mw_daytimeRunningLightOn, omit);
/**
* @desc Receive template for exterior lights with day time running lights on
*/
template ExteriorLights mw_daytimeRunningLightOn := '?????1*'B ;
/**
* @desc Receive template for exterior lights with fog lights off
template ExteriorLights mw_fogLightOff := complement(mw_fogLightOn, omit);
/**
* @desc Receive template for exterior lights with fog lights on
*/
template ExteriorLights mw_fogLightOn := '??????1*'B ;
/**
* @desc Receive template for exterior lights with parking lights off
template ExteriorLights mw_parkingLightsOff := complement(mw_parkingLightsOn, omit);
/**
* @desc Receive template for exterior lights with parking lights on
*/
template ExteriorLights mw_parkingLightsOn := '???????1'B ;
/**
* @desc Receive template for exterior lights with hazard lights on
*/
template ExteriorLights mw_hazardConditionOn := '??11*'B ;
} // end group exteriorLights