Skip to content

Commit

Permalink
Merge pull request #17 from IPG-Automotive-UK/enhancement/adding-info…
Browse files Browse the repository at this point in the history
…file-validator

TD-2263 Adding infofile validator
  • Loading branch information
arpadlomenipg authored Mar 27, 2024
2 parents 40d29f2 + a18c970 commit caec7d1
Show file tree
Hide file tree
Showing 30 changed files with 8,032 additions and 30 deletions.
135 changes: 108 additions & 27 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ipguk/infofile-utils",
"version": "1.0.2",
"version": "1.1.0-1",
"description": "File reader and writer for IPG Automotive infofiles",
"main": "src",
"author": "IPG Automotive UK",
Expand Down
61 changes: 61 additions & 0 deletions src/__tests__/infofiles/ADTFConf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#INFOFILE1.1 - Do not remove this line!
FileIdent = CarMaker-ADTF 2.0
Description:
Example ADTF configuration without synchronization
ADTF.active = 0
ADTF.Protocol = TCP
ADTF.Version = 3
ADTF.HostURL = http://localhost:8000
ADTF.DDL_filename = adtf.description

ADTF.Sync.Mode = 0
ADTF.Sync.StreamName =
ADTF.Sync.StreamNameOut =
ADTF.Sync.ExpUpdCycleCount = 0
ADTF.Sync.SigNameIn =
ADTF.Sync.SigNameOut =
ADTF.Sync.MaxPermDev = 0
ADTF.Sync.Step = 1
ADTF.Sync.TimeOut = 0.5

ADTF.Stream.In:
FeedbackTime Info
TrafficFeedback Traffic
CMRecv Vehicle
ADTF.Stream.Out:
CMSend Vehicle 100
Info Info 100
TrafficInfo Traffic 100

# Stream Mappings:
ADTF.FeedbackTime.StreamMap:
Time UserOut_00 1.0
ADTF.CMRecv.StreamMap:
Distance UserOut_01 1.0
Engine.rotv UserOut_02 1.0
v UserOut_03 3.6
Wheel.0.rotv UserOut_04 1.0
ADTF.CMSend.StreamMap:
Distance Vhcl.Distance 1.0
Engine.on PT.ECU.Engine_on 1.0
Engine.rotv Vhcl.Engine.rotv 1.0
v Vhcl.v 1.0
Wheel.0.rotv Vhcl.FL.rotv 1.0
Wheel.0.tx Vhcl.FL.tx 1.0
Wheel.0.ty Vhcl.FL.ty 1.0
Wheel.0.tz Vhcl.FL.tz 1.0
Wheel.1.rotv Vhcl.FR.rotv 1.0
Wheel.1.tx Vhcl.FR.tx 1.0
Wheel.1.ty Vhcl.FR.ty 1.0
Wheel.1.tz Vhcl.FR.tz 1.0
Wheel.2.rotv Vhcl.RL.rotv 1.0
Wheel.2.tx Vhcl.RL.tx 1.0
Wheel.2.ty Vhcl.RL.ty 1.0
Wheel.2.tz Vhcl.RL.tz 1.0
Wheel.3.rotv Vhcl.RR.rotv 1.0
Wheel.3.tx Vhcl.RR.tx 1.0
Wheel.3.ty Vhcl.RR.ty 1.0
Wheel.3.tz Vhcl.RR.tz 1.0
ADTF.Info.StreamMap:
Time Time 1.0
ADTF.SyncRunLevel = 1
291 changes: 291 additions & 0 deletions src/__tests__/infofiles/BackAndForthTestRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
#INFOFILE1.1 (UTF-8) - Do not remove this line!
FileIdent = CarMaker-TestRun 12
FileCreator = CarMaker 12.0 TEMPLATE
Description:
Demonstration of the 'Stop' and 'Driving backwards' maneuvers.
Vehicle = Examples/Demo_IPG_CompanyCar
Trailer =
Tire.0 =
Tire.1 =
Tire.2 =
Tire.3 =
Snapshot.TimeLimit =
Snapshot.DistLimit =
VehicleLoad.0.mass = 0
VehicleLoad.0.pos = 0.0 0.0 0.0
VehicleLoad.1.mass = 0
VehicleLoad.1.pos = 0.0 0.0 0.0
VehicleLoad.2.mass = 0
VehicleLoad.2.pos = 0.0 0.0 0.0
VehicleLoad.3.mass = 0
VehicleLoad.3.pos = 0.0 0.0 0.0
TrailerLoad.0.mass = 0
TrailerLoad.0.pos = 0.0 0.0 0.0
TrailerLoad.1.mass = 0
TrailerLoad.1.pos = 0.0 0.0 0.0
TrailerLoad.2.mass = 0
TrailerLoad.2.pos = 0.0 0.0 0.0
Road.FileIdent = IPGRoad 12.0
Road.LibVersion = 12.0
Road.Country = DEU
Road.nLinks = 1
Road.nJunctions = 0
Road.nObjects = 30
Road.nRoutes = 1
Road.RoadNetworkLength = 400
Road.BBox = -10 410 -13 13 -11 11
Road.Route.0.Length = 400
Road.RST.Unit = kmh
Road.RST = 50 100 -1 30 70 50 -1 -1
Road.Movie = 0.2 1 0.02 1.5 1.5 1 1
Road.Visualization.SamplingParams = 0.2 1 0.02
Road.Visualization.RoadsideWidth = 1.5 1.5
Road.Visualization.RoadsideSlope = 1 1
Road.Visualization.MovieNX.RenderMask = 4095
Road.PathMode = -1
Road.Terrain.Param = 50 25 300 100 0.75 0
Road.Link.0.ID = 0
Road.Link.0.Node0 = 0 0 0 0
Road.Link.0.Node1 = 400 0 0 0
Road.Link.0.RST = Undefined
Road.Link.0.RL.ID = 1
Road.Link.0.Seg.0.ID = 2
Road.Link.0.Seg.0.Type = Straight
Road.Link.0.Seg.0.Param = 400 0 0 0 0 0 0 0
Road.Link.0.LateralCenterLineOffset.ID = 8
Road.Link.0.LateralCenterLineOffset:
38 -1 0 0 0 2.5 -999 -999 -999
39 -1 0 1 0 2.5 -999 -999 -999
Road.Link.0.LaneSection.0.ID = 3
Road.Link.0.LaneSection.0.Start = 0
Road.Link.0.LaneSection.0.LaneL.0.ID = 6
Road.Link.0.LaneSection.0.LaneL.0 = 2 0.5 0.5 5 0 0 0
Road.Link.0.LaneSection.0.LaneR.0.ID = 7
Road.Link.0.LaneSection.0.LaneR.0 = 0 5 5 0 0 0 0
Road.Link.0.LaneSection.0.LaneR.0.ARP = 43 44 45 46 47 48
Road.Link.0.LaneSection.0.LaneR.1.ID = 9
Road.Link.0.LaneSection.0.LaneR.1 = 2 0.5 0.5 5 0 0 0
Road.LanePath.0 = 29 7 2 10 0.1 0.1 -1 -1
Route.0.ID = 12
Route.0.Name = Route
Route.0.DrvPath.ID = 13
Route.0.DrvPath:
29
Road.RL.1.RoadMarking.0.ID = 24 1
Road.RL.1.RoadMarking.0 = 0 0 0 1 -0.1 1 0.1 0 1 0 0 9 1 1 1 4 ""
Road.RL.1.RoadMarking.1.ID = 25 1
Road.RL.1.RoadMarking.1 = 0 0 0 1 0.1 -1 0.1 0 1 0 0 9 1 1 1 4 ""
Road.MaxUsedObjId = 48
Vehicle.Routing.Type = Route
Vehicle.Routing.ObjId = 12
Vehicle.StartPos.Type = Route
Vehicle.StartPos.ObjId = 12
Vehicle.StartPos = 0.00 0
Vehicle.StartPos.Orientation = 0
DrivMan.nMan = 1
DrivMan.Man.Start.Velocity = 0
DrivMan.Man.Start.GearNo = 0
DrivMan.Man.Start.SteerAng = 0
DrivMan.Man.Start.LaneOffset = 0
DrivMan.Man.Start.OperatorActive = 1
DrivMan.Man.Start.OperatorState = drive
DrivMan.VhclOperator.Kind = IPGOperator 1
DrivMan.Man.0.nLongSteps = 7
DrivMan.Man.0.nLatSteps = 7
DrivMan.Man.0.CombinedSteps = 1
DrivMan.Man.0.MaxExec = 1
DrivMan.Man.0.ConsiderDomain = own
DrivMan.Man.0.Transition.Interrupt = end
DrivMan.Man.0.Transition.EndCond = end
DrivMan.Man.0.Transition.SimultanStart = end
DrivMan.Man.0.LongStep.0.Info = Drive forward for 10s
DrivMan.Man.0.LongStep.0.TimeLimit = 10.0
DrivMan.Man.0.LongStep.0.Dyn = Driver 1 0
DrivMan.Man.0.LongStep.1.Info = Stop the vehicle with defined deceleration
DrivMan.Man.0.LongStep.1.TimeLimit = 10.0
DrivMan.Man.0.LongStep.1.Dyn = Stop 6.0 0
DrivMan.Man.0.LongStep.2.Info = Drive forward for 10s
DrivMan.Man.0.LongStep.2.TimeLimit = 10.0
DrivMan.Man.0.LongStep.2.Dyn = Driver 1 0
DrivMan.Man.0.LongStep.3.Info = Stop the vehicle with defined deceleration
DrivMan.Man.0.LongStep.3.TimeLimit = 5.0
DrivMan.Man.0.LongStep.3.Dyn = Stop 6.0 0
DrivMan.Man.0.LongStep.4.Info = Drive backwards for 10s
DrivMan.Man.0.LongStep.4.TimeLimit = 10.0
DrivMan.Man.0.LongStep.4.Dyn = Backward 3.0 20
DrivMan.Man.0.LongStep.5.Info = Stop the vehicle
DrivMan.Man.0.LongStep.5.TimeLimit = 5.0
DrivMan.Man.0.LongStep.5.Dyn = Stop 4.0 0
DrivMan.Man.0.LongStep.6.Info = Drive forward for 999s or till end of road
DrivMan.Man.0.LongStep.6.TimeLimit = 999.0
DrivMan.Man.0.LongStep.6.Dyn = Driver 1 0
DrivMan.Man.0.LatStep.0.Info = Drive forward for 10s
DrivMan.Man.0.LatStep.0.TimeLimit = 10.0
DrivMan.Man.0.LatStep.0.Dyn = Driver 0
DrivMan.Man.0.LatStep.1.Info = Stop the vehicle with defined deceleration
DrivMan.Man.0.LatStep.1.TimeLimit = 10.0
DrivMan.Man.0.LatStep.1.Dyn = Driver 0
DrivMan.Man.0.LatStep.2.Info = Drive forward for 10s
DrivMan.Man.0.LatStep.2.TimeLimit = 10.0
DrivMan.Man.0.LatStep.2.Dyn = Driver 0
DrivMan.Man.0.LatStep.3.Info = Stop the vehicle with defined deceleration
DrivMan.Man.0.LatStep.3.TimeLimit = 5.0
DrivMan.Man.0.LatStep.3.Dyn = Driver 0
DrivMan.Man.0.LatStep.4.Info = Drive backwards for 10s
DrivMan.Man.0.LatStep.4.TimeLimit = 10.0
DrivMan.Man.0.LatStep.4.Dyn = Driver 0
DrivMan.Man.0.LatStep.5.Info = Stop the vehicle
DrivMan.Man.0.LatStep.5.TimeLimit = 5.0
DrivMan.Man.0.LatStep.5.Dyn = Driver 0
DrivMan.Man.0.LatStep.6.Info = Drive forward for 999s or till end of road
DrivMan.Man.0.LatStep.6.TimeLimit = 999.0
DrivMan.Man.0.LatStep.6.Dyn = Driver 0
Traffic.SpeedUnit = ms
Traffic.IFF.FName =
Traffic.IFF.Time.Name =
Traffic.GenDriverBehavior.FName = Default
Traffic.N = 0
Traffic.SourceSink.Active = 0
DrivMan.OW.Active = 0
DrivMan.OW.Quantities =
DrivMan.OW.StartGearNo =
DrivMan.OW.StartVelocity =
DrivMan.OW.GasMax =
DrivMan.OW.RefCh = Time
DrivMan.OW.ConsiderRoadSigns = 0
DrivMan.OW.sRoute.Offset = 0
ErrorClass.0.Action = abort
ErrorClass.0.Save =
ErrorClass.0.WarningLimit = 3 5.0
ErrorClass.1.Action = abort
ErrorClass.1.Save =
ErrorClass.1.WarningLimit = 3 5.0
ErrorClass.2.Action = abort
ErrorClass.2.Save =
ErrorClass.2.WarningLimit = 3 5.0
ErrorClass.3.Action = abort
ErrorClass.3.Save =
ErrorClass.3.WarningLimit = 3 5.0
ErrorClass.4.Action = abort
ErrorClass.4.Save =
ErrorClass.4.WarningLimit = 3 5.0
ErrorClass.5.Action = abort
ErrorClass.5.Save =
ErrorClass.5.WarningLimit = 3 5.0
ErrorClass.6.Action = abort
ErrorClass.6.Save = 0
ErrorClass.6.WarningLimit = 10 5
ErrorClass.7.Action = abort
ErrorClass.7.Save = 0
ErrorClass.7.WarningLimit = 3 5
ErrorClass.10.Action = abort
ErrorClass.10.Save =
ErrorClass.10.WarningLimit = 3 5.0
ErrorClass.11.Action = abort
ErrorClass.11.Save =
ErrorClass.11.WarningLimit = 3 5.0
Env.StartTime.Year = 2014
Env.StartTime.Month = 1
Env.StartTime.Day = 1
Env.StartTime.Hour = 12
Env.StartTime.Min = 0
Env.StartTime.Sec = 0
Env.StartTime.DeltaUTC = 0.0
Env.GNav.Active = 0
Env.Temperature = 20.0
Env.AirDensity = 1.205
Env.AirPressure = 1.013
Env.AirHumidity = 60
Env.SolarRadiation = 400.0
Env.Sun.Position = angleDefinition
Env.Sun.Azimuth = 45.0
Env.Sun.Elevation = 45.0
Env.Cloud.Kind = simple
Env.Cloud.Height = 200
Env.Cloud.Intensity = 0.1
Env.Cloud.Velocity = 15
Env.Cloud.Angle = 0
Env.FogActive = 0
Env.VisRangeInFog = 10000.0
Env.FogUseSkyColor = 0
Env.FogColor = 0.5 0.5 0.5
Env.RainRate = 0.0
Env.Wind.Kind = none
Env.Wind.Velocity = 0.0
Env.Wind.Angle = 0.0
Env.Kind = Generic
Env.Temp.Offset_Elev = -0.0065
Env.Temp.Offset_sRoad.Amplify = 1.0
Env.Temp.Offset_sRoad.On = 0
Env.Temp.Offset_Time.Amplify = 1.0
Env.Temp.Offset_Time.On = 1
Env.Temp.Offset_Time:
0.0 -2.0
3.0 -2.5
6.0 -2.7
7.5 -2.7
9.0 -2.5
10.0 -2.3
11.0 -1.6
12.0 0.0
13.0 1.4
14.0 2.1
15.5 2.5
17.0 2.2
18.0 1.7
19.0 1.1
20.0 0.2
21.0 -0.6
22.0 -1.1
23.0 -1.6
24.0 -2.0
Driver.ParamIdent = IPGDriver 5
Driver.Mode = std
Driver.Long.DrivMaxSpeed = 0
Driver.Long.CruisingSpeed = 100
Driver.CornerCutCoef = 0.5
Driver.ConsiderTraffic = 1
Driver.Traffic.TimeGapMin = 1.8
Driver.Traffic.TimeGapMax = 5.0
Driver.Traffic.DistMin = 6
Driver.Traffic.DistMax = 250
Driver.Traffic.EcoCoef = 0.75
Driver.Traffic.Overtake = 0
Driver.Traffic.Overtake_Rate = 1
Driver.Traffic.Overtake_dSpeedMin = 10
Driver.Long.dtAccBrake = 0.5
Driver.Long.axMax = 3.0
Driver.Long.axMin = -4.0
Driver.Long.ayMax = 4.0
Driver.Long.GGExp:
50 1.0 1.0
Driver.Long.DevMax = 0.0
Driver.Long.tReact = 0.0
Driver.Long.TractionControl = 1
Driver.DecShift.UseBrakePark = 0
Driver.DecShift.tSwitchGear = 1.0
Driver.DecShift.nEngine.Limits:
1500 4000
Driver.DecShift.nEngine.Shift:
2000 3000
Driver.Lat.DevMax = 0.0
Driver.Lat.tReact = 0.0
Driver.Knowl.Long.tActionMin = 4
Driver.Knowl.Lat.StWhlAngleMax = 630
Driver.Knowl.Lat.StWhlAngleVelMax = 500
Driver.Knowl.Lat.StWhlAngleAccMax = 3000
Driver.Learn.VehicleLimits.TestRun =
Driver.Learn.VehicleLimits.Date = 0
Driver.Learn.ControllerDyn.TestRun =
Driver.Learn.ControllerDyn.Date = 0
Driver.Learn.MaxSpeed.TestRun =
Driver.Learn.MaxSpeed.Date = 0
Driver.Learn.Remember = 0
Driver.Learn.Friction = 1.0
Driver.Knowl.Long.tPreviewBra = 0.6
Driver.Knowl.Long.tPreviewAcc = 1.5
Driver.Knowl.Lat.tPreview = 0.8
Driver.Learn.NEng_S = 1
Driver.Consider.SpeedLimit = 1
Driver.Consider.StopMarker = 1
Driver.Consider.TrfLight = 1
20 changes: 20 additions & 0 deletions src/__tests__/infofiles/BattECM_basic
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#INFOFILE1.1 - Do not remove this line!
FileIdent = CarMaker-PTBattery-BattECM 13
FileCreator = CarMaker 12.0
FileClass.New = 12.0

Description:
Basic BattECM configuration file defining mandatory parameters only.

# ECM configuration
Capacity = 150
Voltage_oc = 400

# Maximal battery output power
PwrMax.Pwr_max = 100

# Body mass configuration
Bdy.0.I = 0.0 0.0 0.0
Bdy.0.mass = 0.0
Bdy.1.I = 0.0 0.0 0.0
Bdy.1.mass = 0.0
Loading

0 comments on commit caec7d1

Please sign in to comment.