Delft University of Technology
A toolbox for automated driving on the STISIM driving simulator
Eriksson, A.; de Winter, Joost; Stanton, Neville A.
DOI
10.1016/j.mex.2018.08.003
Publication date
2018
Document Version
Final published version
Published in
MethodsX
Citation (APA)
Eriksson, A., de Winter, J., & Stanton, N. A. (2018). A toolbox for automated driving on the STISIM driving
simulator. MethodsX, 5, 1073-1088. https://doi.org/10.1016/j.mex.2018.08.003
Important note
To cite this publication, please use the final published version (if applicable).
Please check the document version above.
Copyright
Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons. Takedown policy
Please contact us and provide details if you believe this document breaches copyrights. We will remove access to the work immediately and investigate your claim.
This work is downloaded from Delft University of Technology.
Method
Article
A
toolbox
for
automated
driving
on
the
STISIM
driving
simulator
Alexander
Eriksson
a,c,
Joost
de
Winter
b,*
,
Neville
A.
Stanton
aaTransportationResearchGroup,FacultyofEngineeringandEnvironment,UniversityofSouthampton, BoldrewoodCampus,SouthamptonSO167QF,UK
b
DepartmentofBiomechanicalEngineering,FacultyofMechanical,MaritimeandMaterialsEngineering, DelftUniversityofTechnology,Delft,TheNetherlands
c
TheSwedishNationalRoadandTransportResearchInstitute,Box8072,SE-40278Göteborg,Sweden ABSTRACT
Drivingsimulatorshavebeenusedsincethebeginningofthe1930stoassistresearchersinassessingdriver behaviourwithoutputtingthedriverinharm’sway.Thecurrentmanuscriptdescribestheimplementationofa toolboxforautomateddrivingresearchonthewidelyusedSTISIMplatform.Thetoolboxpresented inthis manuscriptallowsresearcherstoconductflexibleresearchintoautomateddriving,enablingindependentuseof longitudinalcontrol,andacombinationoflongitudinalandlateralcontrol,andisavailableasanopensource downloadthrough GitHub.Thetoolboxallowsthedrivertoadjustparameterssuchassetspeed (in5kph increments)andtime-headway(instepsof1,1.5,and2s)aswellasautomationmodedynamically,whilelogging additionalvariablesthatSTISIMdoesnotprovideout-of-the-box(time-headway,timetocollision).Moreover,the toolboxpresentedinthismanuscripthasgonethroughvalidationtrialsshowingaccuratespeed,time-headway, andlanetracking,aswellastransitionsofcontrolbetweenmanualandautomateddriving.
AtoolboxwasdevelopedforSTISIMdrivingsimulators. Thetoolboxallowsforautomateddriving.
Functionalityincludestrackingofspeed,headway,andlane.
©2018TheAuthors.PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense(http:// creativecommons.org/licenses/by/4.0/).
ARTICLE INFO Methodname:Softwaretoolbox
Keywords:Drivingsimulator,Automateddriving,Toolbox,Humanfactors,Adaptivecruisecontrol,Highlyautomateddriving, STISIM
Articlehistory:Received10August2017;Accepted6August2018;Availableonline15August2018
*Correspondingauthor.
E-mailaddresses:alexander.eriksson@vti.se(A.Eriksson),j.c.f.dewinter@tudelft.nl(J.deWinter),n.stanton@soton.ac.uk
(N.A. Stanton).
https://doi.org/10.1016/j.mex.2018.08.003
2215-0161/©2018TheAuthors.PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense(http:// creativecommons.org/licenses/by/4.0/).
ContentslistsavailableatScienceDirect
MethodsX
SpecificationsTable
SubjectArea Psychology Morespecificsubjectarea HumanFactors Methodname Softwaretoolbox Nameandreferenceoforiginalmethod Notapplicable,seepaper
Resourceavailability https://github.com/he1y13/Toolbox-for-automated-driving-in-STISIM
Methoddescription
In thispaper, we describeaset ofalgorithms developedfor theSTISIM drivingsimulator
platform. The goal of the algorithms was to enable dynamic human-automation
interactionthroughcustomsoftwareusingtheSTISIMV3Build3.07.04OpenModuleinVisual Basic6 (VB6). Althoughthis implementation ofautomated driving is platform-specific, the toolbox can be implemented on other platforms that offer an API or SDK by translating thesubroutinesintotheprogramminglanguagesupportedbythesimulatorinquestion,with therequirement that the lead-vehiclecanbe identifiedandqueried forinformation suchas speedthroughthe API/SDK.
OpenModuleisapluginfeatureoftheSTISIMplatformthatallowsresearcherstoimplementtheir modulesusing unmanagedcode(e.g., VB6or C++).One ofthe functionsof OpenModule is the ‘Update’-functionwhich is called once every simulation frame, just before the graphics display updates.The‘Update’-functionallowstheresearchertodirectlycontrolthebehaviourofavehiclevia pedalandsteeringinput, afunctionalitythat wasutilisedin developingourtoolbox.Thetoolbox consistsofseveralsubroutines,eachresponsibleforapartofthevehiclecontrol,allowinglateraland longitudinalautomationtobeusedseparatelyor inconjunction.Thefunctionalityofthetoolbox algorithmsisdetailedbelow.
Algorithms
Inthissectionthealgorithmsaredescribedintwoparts:(1)longitudinalcontroland(2)lateral control.Thisstructureenablesthesimulationofdifferentlevelsofautomateddriving,rangingfrom manualdrivingandACC (i.e.,automatedlongitudinalcontrol) tohighly automateddriving(i.e., automatedlongitudinalandlateralcontrol)asshown inFig.1.Themanualmodeisvoidof any automatedfeatures,meaningthattheoperationofthevehicleisdependentonthehumandriver only.
TheACCmodeshowninFig.1controlsthevehicle’sspeedbyprovidingcontrolsignalstothe throttleandbrakeinceptorstodrivethevehicleatatargetspeed.Thismodeisbrokendownintoits constituentsinFig.2.Thetargetspeedissetbythedriverorisdictatedbythespeedofaslowervehicle withinsensorrange(thisrangemaybechangedinthesourcecodetosimulateradarswithhigheror lowerrange).Additionally,thereisanoptiontouncommentasectionofthecodein‘OM_Module.cls’ whichwillsetthemaximumspeedtothatofthespeedlimit.ACCisanintegralpartofachievinghighly automateddrivingandisnowcommonlyavailableinproductionvehicles.ACConproductionvehicles utilisesaradarunitattachedtothefrontofthevehiclethatkeepstrackofanyleadingvehicles,feeding thecruise controlalgorithmwiththedistancetotheleadvehicle,whichis usedtocomputethe desiredspeedtomaintaintheselectedtime-headway.
ThehighlyautomateddrivingmodeincorporatesthefunctionalityoftheACCfeature,withthe additionofautomatedlateralcontrol.Thehostvehicle(hostvehiclereferstothevehicleequipped withthedescribedalgorithm)automaticallyfollowstheroadcurvature.Inaddition,lanechangesmay beperformedin responsetodrivercommands,byforexampleflickingtheindicatorstalkin the directionofthelane-changewheninhighlyautomateddrivingmode,muchlikeafunctionofthemost recentadditionofautomationonthemarket,theTeslaMotors[1]AutopilotLanechangefunctionality (however,initscurrentstatetheautomationdoesnotassessthetrafficintheadjacentlanebefore
changing lane).Thelongitudinalandlateral automationsubroutinesarefurtherexplained inthe sectionsbelow.
Longitudinalautomation
Longitudinalautomationfunctionalityandstates
Theprimaryfunctionandfundamentalrequirementofalongitudinalcontrolsystemistocontrol andadaptspeedtoleadingvehiclesanddriversettings(thisisreferredtoastargetspeed,vtarget). Furtherrequirementsandassumptionsforalongitudinal(i.e.,ACC-based)controlsystemarethat:
Fig.1.Afunctionalblockdiagramoftheautomateddrivingtoolbox.ASreferstoautomatedsteeringcontrol.Hostvehiclerefers tothevehicleequippedwiththedescribedalgorithm.
1 thesystemcannotbeengagedwhilethevehicleisdrivinginreverse[2]. 2 thedriverhastheabilitytooverridethesystem.
3 thesystemmaintainsthespeedsetbythedriverintheabsenceofaslowleadingvehicle. 4 thesystemusesaccelerationthresholdstoensurecomfortabledrivingduringnormaloperating
conditions.
5 thesystemslowsdownthevehicletothespeedofaslowermovingleadvehicleandmaintainsthe desiredheadway.
6 thesystemignoresdecelerationthresholds(intermsofcomfort)whensuchathresholdhinders bringingthevehicletoasafesystemstatethroughslowingdownorstoppingcompletely. 7 thesystemhandsbackcontroltothedriverwhentheoperationallimitsareapproached.Suchlimits
mayincludesensorfailure,geographicalconstraints,orexternalfactorsleadingtodegradedsystem performance(thiscanbesimulatedthrougha shutdowneventspecifiedinaneventfileinthe automationtoolbox).
Inthealgorithm,theleadingvehicleisconsideredtobeavehicledrivinginthehostvehicle’slane (itisinthehostvehiclelanewhenitscentreofmassiswithinthelaneboundary)withintherangeof thesimulatedradar.ThecontrollerworksinaccordancewithSAEJ2399[3]onallpointsexceptthat ourcontrollerdoesnotallowforsettingaminimumspeed,andthatitdoesnotactivateanauditory, visual,and/orhapticalerttoinformthedriverthathe/sheneedstotakebackmanualcontrol.The formerlackscompliancebecauseourcontrollerworks asastop&gosystem. Thelatterlimitation comesdowntothedesignandimplementationofahuman-machineinterface,whichisnotcoveredin thecurrentmanuscript.However,itispossibletoaddaninterfacebyenablingthesocketconnection describedelsewhereinthispaper.
WebelievethatthiscontrollerforACCworkswellenoughformostHumanFactorsapplications. However, normally, ACC systems on the market include more complex control algorithms for longitudinalcontrol,suchasgainschedulingproportionalintegralcontrol(GSPI),gainscheduling linear quadratic control (GSLQC) [4] and nonlinear model predictive control (NMPC) [4]. The implementationof such control algorithms is straightforward: Should one wish to use a more advancedcontrolalgorithm,thecontrollerusedinthetoolboxcanbereplacedwithanothertypeof control,eitheranimplementationofoneoftheabovementionedoravehiclemanufacturer’sversion. Itmust,however,benotedthatVisualBasic6doesnotsupportmultithreading,andthus,allthecode intheOpenModuleareexecuted inthesamethreadasthesimulation,sotheadditionofmore complexfunctionalitiesmayhaveaneffectonthesimulatorperformance(i.e.,framedrops,lagetc.). Thealgorithmtoaccessvehicledataforthelead-vehicleisdescribedinErikssonandStanton[5]. Parametersrelatedtothelead-vehiclearedenotedwiththesubscriptlead.Thelongitudinalcontrol algorithmisdesignedasaFiniteStateMachine(FSM),containingthreestates(cruise,follow,and adapt),eachwithitscontrollercharacteristics.SeveralconditionsneedtobefulfilledbeforetheFSM cantransitionfromonestatetoanother.Theprocessofdeterminingcontrollerstatesareshownin Pseudocode1.Thefixedparametersinthebelowpseudocodeweretunedmanuallytoensuresmooth switchingbetweenthecontrolstatesoftheFSM.
Pseudocode1:thealgorithmtodeterminethestageofthelongitudinalcontrolsubroutine.Note:^ isthelogical‘AND’operator.The1.15multiplierforthetime-headwayconditionensuresthatthereis nosuddenswitchingoftime-headwayandspeedbasederrorterms.‘Toofast’referstotheleadvehicle travellingfasterthanthedesiredspeedsetbythedriver
Each state has a Proportional-Integral-Derivative (PID)controller and depending onthe state, differentgainsforthedifferentparametersareused.ThetransferfunctionofaPIDcontrolleristhesumof theoutputsofthreesub-controllers:aproportional,anintegral,andaderivativecontroller.Theerror signal undergoesprocessing ineach controller(i.e., theproportional,integral, andderivative sub-controllers),theresultingsignalsareaddedandconstitutethetotaloutputfromthePIDcontroller.
Inthecaseofautomation,oneoftheinputstothecontrolsystemisthetargetspeed,andtheoutput isanumberrepresentingthevirtualpedalposition.Positiveoutputvaluesaresignalssenttothe virtualthrottlepedal.Fornegativesignals,theirabsolutevaluesrepresentthevirtualbrakepedal position.
Becausetheenvironmentisinherentlydigital,discretemathematicsappliestothecomputations. Hence,thetemporalresolution(
D
t)islimitedtoasinglesimulationframe,i.e., 1/30sforafrequencyof 30Hz.Thecontroller’soutput(thebrake/throttleposition)isgovernedbyEq.(1),whereei¼D
vi¼vtarget;iviistheerrortermrepresentingthedifferencebetweenthesetspeedandvehicle’scurrent
speedatthecurrentinstantoftime,i. npedal¼KPeiþKI
D
t Xi j¼0 ejþKD eiei1D
t ð1ÞThe PID controller for car automation in a discrete simulation environment.j=start time of the controllercycle,i=currenttime-stepinthecontrollercycle.Kpistheproportionalgainonthecontroller.Ki istheintegralgainofthecontroller.Kdisthegainofthederivativecomponentofthecontroller.
The K-coefficientsof thesub-controllers representthecontroller gains andhave a significant impactonthebehaviourofthesystem,astheirrelativeandabsolutevaluesdeterminetherisetime, overshoot,anddampingcharacteristics.Therefore,differentcontrolstatesrequiredifferentsettings. Followingstate
TheFollowstateaimstomaintainaconstanttime-headwaytotheleadvehicle.Maintaining headwayisamorechallengingtaskthanmaintainingspeed,asthedistanceiscontrolledbythe hostvehicle speed relativetothe leadvehicle. Thetime-headwayisset by thedriver(in the followingincrements:1,1.5,and2s,thesevalues canbechangedinthesourcecodeinthefile ‘OM_Module.cls’underthe‘cycleTHW’function)andisdefinedast¼dlead=Vhost.Additionally,the
algorithmwillslowdowntoastopifthereisacrossingvehicleinitspath,orifthereisavehicle approachingheadon.It will,however,notexecuteanyevasivelateral manoeuvres initscurrent implementation.
Adaptstate
TheAdaptstateisusedforsmoothspeedadjustmentstomeetthedesiredtargetspeed.Thespeed errorsignalintheAdaptstateisdefineddifferentlythaninotherstates.Theultimatetargetspeedis stilleitherthespeedsetbythedriverortheexternallylimitedspeed (i.e.,comingfromaslower leadingvehicle).However,toattainasmoothmanoeuvreandspeedadjustment,theerrorsignalsrefer toinstantaneoustargetspeed,whichcomesfromlinearinterpolationfromthevehiclecurrentspeed andthetargetspeed.
The interpolatedspeed is calculated using Beziercurves. Bezier curvesare frequently usedin computergraphicstorenderanimationsorvectorgraphics.TheBeziercurvesareusedtodrawsmooth curvesthatcanbescaleddynamicallyandindefinitely.InanimationBeziercurvescanbeusedtocontrol speedovertimeofanimatedobjects.ThesecharacteristicsmakeBezierfunctionswellsuitedforusein trajectoryplanningandinterpolation.Bezierfunctionshavebeenproposedasawayofplanningand traversingtrajectoriesinatwo-dimensionalspacebyChoietal.[6].Suchanalgorithmwouldbedivided intotwoparts,trajectoryplanningandtrajectoryinterpolation[6].Inthecurrentimplementationofthe controlalgorithmforlongitudinalcontroltheBezierfunctionsareusedtointerpolatethespeedofthe hostvehicletoasetspeedoraleadingvehicle’sspeedtoensuresmoothaccelerationanddecelerationby modellingthetargetspeedusingafirst-orderBeziercurve(seeEq.(2)).
1t
ð ÞP0þtP1;t2½0;1 ð2Þ
The equation fora first-orderBezier curve. WhereP0is the host vehiclespeed atthe start of the interpolation,andP1isthetargetspeed.t0isthenormalizedstartpointoftheinterpolationandt1isthe endpoint.ThemanoeuvretimeiscalculatedandnormalizedaccordingtoEqs.(3)and(4)below.
Toplanthespeedtrajectory,amanoeuvredurationmustbecomputedtomatchthehostvehicle speed withthe target speed taking a “comfortable acceleration” thresholdas shown in Eq. (3). Followingthecomputationofthemanoeuvreduration,thetimeintervalneededisrescaledtoavalue between0and1takingthesimulatorframerateintoaccountthroughEq.(4).
Tmanoeuvre¼
D
vi
acomfortable ð3Þ
Theformulausedforfindingmanoeuvredurationusedforinterpolation. t¼ TcurrTinterp:;start
ðTmanoeuvreHzsimulationÞ ð4Þ
RescalingofTManoeuvretoascaleof0–1basedonthefrequencyofthesimulator.Tcurrreferstothecurrent time, Tinterp., startrefers to the start of the interpolation time, Tmanouvre refers to the manoeuvre time calculatedinEq.(3).
Whenthemanoeuvreduration hasbeendeterminedand scaledtotheappropriaterange,the currentspeed,targetspeed,andtimeareintroducedtoEq.(2)tocreatethetrajectory.Followingthe creationofthetrajectory,thecontrollersetpointinterpolatesalongthetrajectoryuntilthetarget speedisreached.Thisapproachensuresthattheaccelerationthresholdisneverexceeded.
Asthespeediscomputedateachdiscretestepofthesimulation,theerrorsignalsforthePIDis significantlysmallerthanastepinput(i.e.,from60kphto100kph),whichismoremanageablebythe PIDasthelikelihoodofanovershoot,oraggressiveaccelerationisavoided.TheerrorsignalforthePID isgivenby:ei¼
D
vi¼vivcurrwhichresultsinsmootheraccelerationanddeceleration.Cruisestate
Thecruisestateisusedwhenthevehicledoesnotneedtoadjustitsspeedmorethan3.5m/s(i.e., whensmalladjustmentstothethrottleoutputarerequiredtomaintainthesetspeed,whenpassing throughhillyareasorcurves),andwhenthereisnoleadvehicleoraleadvehiclefasterthantheset speed.ThecruisestatecontrolsthespeedinaccordancewithEq.(1).TheerrortermusedforthePID controlleriscalculatedas:ei¼vtargetvcurr.
Lateralautomation
Thelateralcontrolisresponsibleforsteeringthecarandcontrollingitspositioninthedesiredlane. Thisisachievedbycontrollingthevehicle'slateralpositionwithrespecttotheroadcentrelineandthe centreofthedesiredlane.Thetargetpositionistypicallytheexactcoordinateofthecentreofthelane with nolook-ahead function. Thus, theimplemented controller for lateral control is somewhat rudimentary,andothercontrollersarereportedintheliterature,asintheworkofHessburg and Tomizuka[7]wherea‘fuzzy’controllertakesinconsiderationroadgeometrytosteerthevehicle.As STISIMdoesnotaffordalookaheadfunctionforroadwaygeometry,thistypeofcontrollerwasnot possibletoimplement.However,theimplementedcontrollerdoesaccommodateforvehiclespeedto someextentthroughamodificationofthegainforthesteeringPIDcontroller.
Avehicle’strajectoryisdependentonbothsteeringangleandvehiclespeed.Withthisinmind,the PIDcontrollerwasmodifiedtovarytheproportionalgainofthecontrolsignalasafunctionofcurrent vehiclespeed(i.e.,atypeofgainscheduling)(Eq.(5)).ThiswasalsodonetocompensatefortheSTISIM vehicledynamicsmodelthathasgotsomeundersteerathigherspeeds:ahighersteeringanglemust beproducedathigherspeedstofollowtheroad’scurvature.Thecontrollerisabletokeepthevehicle initslaneinmostconditions,butinsituationswherethecurveradiusissmall,andthespeedishigh, theundersteeringofthedynamicsmodelcausesthevehicletogooutofthelane.
nsteering¼ðK1PþK2P
viK3PÞeiþKID
t Xi j¼0 ejþKD eiei1D
t ð5ÞPIDcontrollerforthelateralcontroller.K1pisthemainproportionalscalingfactor,K2pisthesecond scalingfactorfortheeffectofvehiclespeedonsteeringoutput,Viisthecurrentspeedofthehostvehicle,eiis theerrorterm(thedifferencebetweencurrentlanepositionandthelanecentre).KIistheintegralscaling factor,ejistheintegratederrorterm,andKDisthederivativescalingfactor.
Algorithmperformance
Anumberoftestswerecarriedouttodemonstratetheeffectivenessoftheautomateddriving toolbox.Thetestscenariowas10kmlongandcontainedanumberofcurvesandcut-insituations.This scenariowasextensivelyusedinErikssonandStanton[8]andproducesthesamevehiclebehaviouron repeatedtests.Thetestsaredetailedinthesectionsbelow.
Carfollowing
Toassesslongitudinaldrivingperformance,thealgorithmswererunthroughamotorwaydriving scenariowhereanumberofcarsmovedintothehostvehicle’slane,aswellascut-insaspartofdouble lanechanges.
Fig.3showsthespeedprofileofthehostvehicleinrelationtothesetspeed,whereasFig.4shows thetime-headwayofanyvehiclesinfront,inrelationtothesettime-headway(1.5s).AsFig.3shows, thehostvehicleslowsdownbelowthelead-vehiclespeedtoaccommodatethelargeneedforsudden decelerationtoachievethedesiredtime-headwaywhenthereisalargedifferenceinspeedbetween thehostandthelead-vehiclecausedbythesuddencut-ins.AsshowninFig.4,thehostvehiclecloses thegapbetweentheleadandhostvehicledowntothedesiredtime-headwayandthenmaintainsthe desiredtime-headwayconsistently. Whenthelead-vehicleisnolongerdetectedthevehiclethen returnstotheoriginalsetspeed.
Lanekeeping
Thesamemotorwayscenariowasusedtoassesstheautomatedlateralcontrolofthealgorithm. Fig.5showsthelateraldeviationfromthelanecentre.Itispossibletoidentifywherethevehicle encounteredaturnbasedonthedeviationdata.However,thelateraldeviationisatmost15cmfrom vehiclecentretolanecentre,indicatinggoodlateralvehiclecontrol.
Scenario
Thefollowingsectioncontainsthescenarioparametersrequiredtoreproducethedriveusedinthe assessmentsectionsabove.
Fig.4.Time-headwayprofileofthecar-followingbehaviourduringmotorwaydriving.Thegapsintherecordedtime-headway signalarecausedbytheleadvehicleleavingthehost-vehiclelane.THW=time-headway.
Behaviouralvalidity
The software toolbox presented in this manuscript has already been used in research into automateddriving witha STISIMdriving simulator[8,9].Eriksson andStanton[8]assessedthe process of driver transitions between automated and manual vehicle control in non-urgent scenarios(SAELevel4Automation[10]).TovalidatethefindingsfromErikssonandStanton[8],an on-roadstudywasdesignedwithamatchedsampletoassessthecorrelationofthetimeittook driverstotransitionbetweenautomatedandmanualcontrolinthesimulatorandontheroad.The resultsshowedthatdrivers’averagetransitionstimesfromautomatedtomanualcontrol,andvice versa,wereabout30%fasterfor on-roaddrivingthanfor simulator-baseddriving;however,the shapeofthedistributionsoftransitiontimeswashighlysimilarbetweensimulator-basedand on-roaddriving[11].ThestudybyErikssonetal.[11]concludedthattherewasanindicationofrelative behaviouralvaliditywhenthealgorithmspresentedinthismanuscriptandusedinErikssonand Stanton’s[8]simulatorstudywerecontrastedwithon-roaddrivingbehaviourinavehicleoffering contemporaryautomateddriving.
Thesefindingsshowthatthesimulator producesresultscorrespondingtothatofon-road conditions. Consequentially, it lends preliminary validity to the use of the algorithms presentedinthismanuscriptforuseinresearchintoautomatedvehiclesbeingconductedin simulators.
Limitations
Thealgorithmoutlinedabovehassomelimitationswhenitcomestointeractingwithcertainroad environmentsandroadusers.Thevehicleisunabletonavigateintersections(requiringturning),and
Fig.5. Lanekeepingperformance(12ftlanewidth)duringamotorwaydrive.Lanepositionreferstothevehiclelateralposition initscurrentlane.
roundaboutswhilstinautomateddrivingmode. Additionally,thesoftware,initscurrentform,is unable toaccount for vulnerable roadusers such ascyclists, pedestrians, and motorcycles. This functionalitymaybecreatedbyaccountingfortheseroadusersinthelateralandlongitudinalcontrol algorithms,shouldtheneedarise.Asoursoftwaretoolboxwasoriginallyintendedforresearchon automotive automation onnon-urban roadways,cyclists, pedestrians, and motorcycles werenot implemented.
Howtousethetoolbox
Thetoolboxisabletorunout-of-the-boxwithlittle set-upandfull accesstoitssourcecode (https://github.com/he1y13/Toolbox-for-automated-driving-in-STISIM) where researchers can makeedits and recommitthem toGitHub for use byotherresearchers. Thesubsections below describehowtosetupthetoolboxtoberunfromthepre-compiledDynamicLinkLibrary(DLL)file andsourcecode.
Usingthepre-compiledDLLfile
Tousethetoolboxusingthepre-compiledDLLfile,anumberofstepsmustbefollowed. 1CreateafolderontheC:/driveofthecomputerthatrunsSTISIMandnameitSTISIM(fullpathof
folder:C:/STISIM/)
2Movethe“OM_Automation.dll”,the“ButtonAssignment.txt”andthe“shutdownevents.txt”filesto C:/STISIM/
3Openthestartmenuonthecomputer,andtypein‘cmd’,rightclickontheshortcutandclickrunas administrator
a Enterthecommand:cdC:/Windows/SysWOW64/
b Enterthecommand:regsvr32C:/STISIM/OM_Automation.dll 4OpenSTISIMtoedittheconfigurationfile
a Openthetab“DataCollection”andtickthebox“Collecttimetocollisiondata”
b Openthetab“OpenModule”andaddthefollowingpathtothe“OpenModuleDLLfile”box:C:/ STISIM/OM_Automation.dll
cOpenthetab“SimulationControl”andchangethedesiredframerateto20framespersecond (thisvaluecanbeeditedinthesourcecodetohighervalues)
5OpenC:/STISIM3/Tools/CalPot32.exeandselectthecontrollerbeingused a Openthetab“TestControls”andclickDriverInputs
b OpenthefileC:/STISIM/ButtonAssignment.txtandmapthebuttonsonthecontrollerbeingused withthecorrespondingfunctionalityshowninTable1
Table1
FunctionmappingintheButtonAssignment.txt.
Lineinfile Functionassociatedwithbuttonvalue 1 Cycletime-headway
2 IncreaseACCspeed 3 DecreaseACCSpeed
4 ActivateAdaptiveCruiseControl 5 ActivateHighlyAutomatedDriving 6 Deactivateautomateddriving 7 Leftlanechange
Whentheabovestepshavebeencompleted,theusermaystartanyscenario(itmustbenoted thattheautomationcannothandleintersectionsandroundabouts)andpresstheactivatebutton onthecontrollerdesignatedinthe“ButtonAssignment.txt”file.Moreover,iftheresearcherwishes thattheautomateddrivingfeatureshouldbecomeunavailableatasetpointduringadrive,this behaviour maybe specified in thefile “shutdownevents.txt”.Thisfile contains a single event wheretheresearchermayspecifya distancedown theroad(inpositivefeetdowntheroad,a negativevaluemeansitisignoredbythesoftware),thetimefromtheeventbeingtriggeredtothe eventoccurring (in seconds), the time after the event occurringuntil the automated driving featurebecomesavailable again(in seconds)inthefollowingmanner:“500;5;2500 (theevent countdown occurs 500 feet down the roadcounting down for 5s after which all automated featuresareunavailabletoengagefor25s).
Datacollection
Tosavetheadditionaldatageneratedbythetoolboxsoftware(suchassettime-headway,setspeed andlevelofautomationetc.)anumberofparametershavebeenpre-settobesavedintotheBSAVdata filenormallygeneratedinSTISIM(theresearchermustaddvariable49tobeloggedasoneofthe collectedparametersintheBSAVeventinthescenariodefinitionlanguage).Theparameterssavedto thedataoutputfileareshowninTable2.
Table2
Parametersfromthetoolboxcollectedfordataloggingpurposessavedinparameter49oftheBSAVevent.Theunitsreportedin thetableareintheunitssuppliedintheOpenModulevariables.
Parameter Typeofdata Units
1 Distancedowntheroad feet
2 Levelofautomation(manual/ACC/Highlyautomated) integer(0,1,2) 3 AdaptiveCruiseControlstate(Cruise,Follow,Adapt) integer(1,2,3)
4 Desiredtime-headway seconds
5 Currenttime-headway seconds
6 Desiredspeed ft/s
7 Currentspeed ft/s
8 Currenttimetocollision seconds
9 Optimallaneposition feet
10 Currentlaneposition feet
Table3
Pre-specifieddatabeingsentoverthesocketconnectionwhenenabled.
Parameter Typeofdata Units
1 Laterallaneposition feet
2 Currentlane integer
3 Selectedtime-headway seconds 4–8 Distancetothefollowingvehicles:–leadvehicleinhostlane–trailingvehiclerightofhost
lane–leadingvehiclerightofhostlane–trailingvehicleleftofhostlane–leading vehiclerightofhostlane
feet
9 Numberoflanesoncurrentsectionofroad Integer
10 Vehiclespeed Ft/s
11 EngineRPM RPM
12 Automationmode Integer(0,1,2) 13 Take-overrequestcountdown Integer(1–X) 14 Distancedowntheroad feet
Socketconnection
The toolbox also allows sending data to an external device, for example, a human-machine interface.This canonly bemade available through re-compilingthe toolbox’s sourcecode after uncommentinganumberoflinesinthefile‘Open_module.cls’.
Theuserneedstouncommentlines700and702toenablethesocketconnection,andalsospecify thedesiredIPaddressandporttoreceivethedatapacketsandlines305–308toenabledatatobesent overthesocket.ThedatabeingsentisspecifiedinTable3:
Compilingfromsourcecode
Thereareafewadditionalstepsrequiredtoruntheautomationtoolboxwheneditsneedtobe madeinthesourcecode(examplesofthiswouldbetoadddata-outputoverTCP/IPortore-tunesome ofthecontrollersforlongitudinalorlateralcontrol).Tomakeeditstothesourcecodeacomputerwith theMicrosoftVisualBasic6.0editorinstalledmustbeused.Wheneditstothesourcecodehavebeen made, the new DLL must be compiled;this is donethrough the drop-down menu “File>Make OM_Automation.dll”intheVisualBasic6.0editor.
Summary
In this manuscript, we described a generic set of algorithms for automated drivingresearch implementable on any simulation platform that allows access to internal variables relating to surroundingtrafficthroughanAPI/SDK.Wethendescribedanimplementationofthesealgorithmson theSTISIMdrivingsimulatorplatformforSTISIMV3.07.04withaccompanyingperformancemetrics andadescriptionofvalidationwork.WethenprovidedastepbystepguideonhowtosetupSTISIMto accessthistoolboxforuseinresearchusingtheOpenSourcereleaseversionofthesoftware.Whilst thisimplementationisprimarilyintendedforusewithSTISIM,itispossibletoimplementthesame controlfunctionsandfinitestatemachineinothersimulators(possiblyinadifferentprogramming language),providedthattheysupportinformationacquisitionfromsurroundingtrafficinorderto providethecontrollerswithdata.
Additionalinformation
The topicofautomated drivingreceives an increasinglevelof attentionfrom HumanFactors researchers.Untilrecently,automateddrivingtechnologyrequiredintermittentdriverfeedback,for examplebytouchingthesteeringwheel,thusmaintainingalevelofdriverengagementsimilarto manualdriving[12].However,recentamendmentstotheViennaConventiononRoadTrafficenable driverstobefullyhands-andfeet-freeaslongasthesystemcanbeoverriddenorswitchedoffbythe driver[13].Thisamendmentallowsdriverstobe‘out-of-the-loop’forprolongedperiodsoftime,yet driversarestillexpectedtoresumecontrolwhentheoperationallimitsoftheautomateddriving systemareapproached[10].
Theavailabilityofthesehighlyautomateddrivingsystemsmayfundamentallyalterthedriving task,andcouldgiveriseto‘ironies’and‘surprises’ofautomationsimilartothoseproposedby Bainbridge[14]andSarteretal.[15]inthecontextofprocesscontrolandaviation.Indeed,several empiricalstudieshaveshownthatdriversofhighlyautomatedcarsoftenrespondslowlywhen manualinterventionisnecessary[16–20].Inlightofthis,intermediateformsofautomationhave beendeemedhazardous becausedrivers arerequired tobeableto regaincontrol atall times [21,22]. To study these psychological phenomena and develop effective Human-Machine Interfaces for supportingdrivers of future automatedcars, the driving simulator is seenas a viableoption[11,23].
Simulators
Driving simulatorshavebeenused sincethebeginning of the1930s [24] andHuman Factors researchintoautomateddrivinghasbeenongoingsincethemid-1990s[25,26].Comparedtoon-road testing,drivingsimulatorsallow driver reactionstonewtechnologytobemeasuredin a virtual environment,withoutphysicalrisk[27–31].
Furthermore,drivingsimulatorsofferahighdegreeofcontrollabilityandreproducibility,and provideaccesstovariablesthataredifficulttoaccuratelydetermineintherealworld[32],suchas lanepositionanddistancetoroadwayobjects[33,34].Mostdrivingsimulatorsofferflexibilityin designingcustomplug-insthroughAPIs.WithOpenSourcesoftwareeffortsindrivingsimulation, suchasOpenDS[35],itislikelythattheuseofdrivingsimulatorswillcometogrowinthecoming years.
STISIM
STISIMisapopulardrivingsimulatorthatisusedforresearchpurposes[36–41].TheSTISIMdriving simulator software comes with an ‘Automated Driving’ feature accessible through its Scenario DefinitionLanguage(SDL)[42,43]. TheSDL-basedautomation allowstheresearchertoenableor disableautomatedlateral and/orlongitudinalcontrolthroughthe‘ControlVehicle’(CV)eventby specifyingadistancedowntheroadatwhichpointtheeventshouldtrigger,andwhatmodechange shouldoccur(e.g.,thescript‘2000,CV,speed,20initiatesautomatedcontrolofbothsteeringandspeed
whentheparticipanthastravelled2000malongtheroad).TheSTISIMdocumentationstatesthatthis automateddrivingfeatureisintendedfordrivertraining[44],anapproachalsotakenbyotherdriving simulatormanufacturers(e.g.[45]).Thatis,byenablingautomatedcontrolofspeed,thedrivercan fullyconcentrateonlearninghowtosteer,orviceversa,byenablingautomatedcontrolofsteeringthe learnerdrivercanconcentrateonhow toaccelerateand stopthecar.Thistypeof automationis sufficientwhenitcomestoresearchwheretheresearcherdoesnotwantthedrivertobeableto(dis) engagetheautomationorchangetheautomationmodes.TheCVeventhasbeensuccessfullyusedin thismanner(asdescribedby[46,47];andpresumedlyalsoinsimilarstudiesusingSTISIM:[40,48– 51]). However, if the researchaims to understand how drivers interact with automated driving systems,asinKircheretal.[52],ErikssonandStanton[8]andErikssonetal.[11],thistypeof hard-codedautomationisnotsufficient.
Acknowledgment
ThisresearchwasfundedbytheEuropeanMarieCurieInternationalTrainingNetworkprojecton theHumanFactorsofAutomatedDriving(PITN-GA-2013-605817).
References
[1]TeslaMotors,ModelSsoftwareversion7.0,(2016).https://www.teslamotors.com/presskit/autopilot.
[2]S.Vakili,Designandformalverificationofanadaptivecruisecontrolplus(ACC+)System.MScThesis,McMasterUniversity, 2015.
[3]SAEJ2399,Adaptivecruisecontrol(ACC)operatingcharacteristicsanduserinterface,SaeJ2399_201409,SAEInternational, 2014.
[4]P.Shakouri,A.Ordys,D.S.Laila,M.Askari,Adaptive CruiseControlsystem:comparinggain-scheduling PIandLQ controllers,IFACProc.Vol.44(2011)12964–12969.
[5]A.Eriksson,N.A.Stanton,he1y13/TrafficQuery_STISIM3:atrafficqueryingclassforstisimdrivesimulationkernel–Build 3.07.04,(2017).
[6]J.W.Choi,R.Curry,G.Elkaim,Pathplanningbasedonbeziercurveforautonomousgroundvehicles,Wcecs2008:Advances inElectricalandElectronicsEngineering-IaengSpecialEditionoftheWorldCongressonEngineeringandComputer Science,(2009),pp.158–166.
[7]T.Hessburg,M.Tomizuka,Fuzzylogiccontrolforlateralvehicleguidance,IEEEControl.Syst.14(1994)55–63. [8]A.Eriksson,N.A.Stanton,Takeovertimeinhighlyautomatedvehicles:noncriticaltransitionstoandfrommanualcontrol,
Hum.Factors59(2017)689–705.
[9]A.Eriksson,N.A.Stanton,Drivingperformanceafterself-regulatedcontroltransitionsinhighlyautomatedvehicles,Hum. Factors59(2017)1233–1248.
[10]SAEJ3016,Taxonomyanddefinitionsfortermsrelatedtodrivingautomationsystemsforon-roadmotorvehicles, J3016_201609,SAEInternational,2016.
[11]A.Eriksson,V.A.Banks,N.A.Stanton,Transitiontomanual:comparingsimulatorwithon-roadcontroltransitions,Accid. Anal.Prev.102(2017)227–234.
[12]F.Naujoks,C.Purucker,A.Neukum,S.Wolter,R.Steiger,Controllabilityofpartiallyautomateddrivingfunctions–doesit matterwhetherdriversareallowedtotaketheirhandsoffthesteeringwheel?Transp.Res.PartFTrafficPsychol.Behav.35 (2015)185–198.
[13]T.Miles,CarscoulddrivethemselvessoonerthanexpectedaftereuropeanpushRetrievedfrom,(2014).https://www. reuters.com/article/us-daimler-autonomous-driving/cars-could-drive-themselves-sooner-than-expected-after-european-push-idUSKBN0DZ0UV20140519.
[14]L.Bainbridge,Ironiesofautomation,Automatica19(1983)775–779.
[15]N.B.Sarter,D.D. Woods,C.E.Billings, Automationsurprises,in:G. Salvendy(Ed.),HandbookofHumanFactors& Ergonomics,2nded.,Wiley,1997.
[16]J.C.F.deWinter,R.Happee,M.H.Martens,N.A.Stanton,Effectsofadaptivecruisecontrolandhighlyautomateddrivingon workloadandsituationawareness:areviewoftheempiricalevidence,Transp.Res.PartFTrafficPsychol.Behav.27(2014) 196–217.
[17]A.H.Jamson,N.Merat,O.M.J.Carsten,F.C.H.Lai,Behaviouralchangesindriversexperiencinghighly-automatedvehicle controlinvaryingtrafficconditions,Transp.Res.PartCEmerg.Technol.30(2013)116–125.
[18]N.A.Stanton,M.S.Young,Vehicleautomationanddrivingperformance,Ergonomics41(1998)1014–1028.
[19]N.A.Stanton,M.S.Young,B.McCaulder,Drive-by-wire:thecaseofmentalworkloadandtheabilityofthedrivertoreclaim control,Saf.Sci.27(1997)149–159.
[20]M.S.Young,N.A.Stanton,Backtothefuture:brakereactiontimesformanualandautomatedvehicles,Ergonomics50 (2007)46–58.
[21]S.M.Casner,E.L.Hutchins,D.Norman,Thechallengesofpartiallyautomateddriving,Commun.ACM59(2016)70–77. [22]B.D.Seppelt,T.W.Victor,Potentialsolutionstohumanfactorschallengesinroadvehicleautomation,RoadVehicle
Automation3,Springer,2016,pp.131–148.
[23]E.R.Boer,M.D.Penna,H.Utz,L.Pedersen,M.Sierhuis,Theroleofdrivingsimulatorsinevaluatingautonomousvehicles, PaperPresentedattheDrivingSimulationConference(2015).
[24]B.D.Greenshields,Reactiontimeinautomobiledriving,J.Appl.Psychol.20(1936)353–358.
[25]L.Nilsson,Safetyeffectsofadaptivecruisecontrolincriticaltrafficsituations,PaperPresentedatthetheSecondWorld CongressonIntelligentTransportSystems:StepsForward(1995).
[26]N.A.Stanton,P.Marsden,Fromfly-by-wiretodrive-by-wire:safetyimplicationsofautomationinvehicles,Saf.Sci.24 (1996)35–49.
[27]O.Carsten,A.H.Jamson,Drivingsimulatorsasresearchtoolsintrafficpsychology,in:B.Porter(Ed.),HandbookofTraffic Psychology,vol.1,AcademicPress,2011,pp.87–96.
[28]J.C.F.deWinter,P.VanLeeuwen,P.Happee,Advantagesanddisadvantagesofdrivingsimulators:adiscussion,Paper PresentedattheProceedingsofMeasuringBehavior,(2012).
[29]J.Flach,S.Dekker,P.J.Stappers,Playingtwentyquestionswithnature(thesurpriseversion):reflectionsonthedynamicsof experience,Theor.IssuesErgon.Sci.9(2008)125–154.
[30]L.Nilsson,Behaviouralresearchinanadvanceddrivingsimulator-experiencesoftheVTIsystem,PaperPresentedatthe ProceedingsoftheHumanFactorsandErgonomicsSocietyAnnualMeeting,(1993).
[31]G.Underwood,D.Crundall,P.Chapman,Drivingsimulatorvalidationwithhazardperception,Transp.Res.PartFTraffic Psychol.Behav.14(2011)435–446.
[32]S.T.Godley,T.J.Triggs,B.N.Fildes,Drivingsimulatorvalidationforspeedresearch,Accid.Anal.Prev.34(2002)589–600. [33]J.Santos,N.Merat,S.Mouta,K.Brookhuis,D.deWaard,Theinteractionbetweendrivingandin-vehicleinformation systems:comparisonofresultsfromlaboratory,simulatorandreal-worldstudies,Transp.Res.PartFTrafficPsychol.Behav. 8(2005)135–146.
[34]W.vanWinsum,K.A.Brookhuis,D.deWaard,Acomparisonofdifferentwaystoapproximatetime-to-linecrossing(TLC) duringcardriving,Accid.Anal.Prev.32(2000)47–56.
[35]OpenDS,Opends:theflexibleopensourcedrivingsimulation,(2017).https://www.opends.eu/.
[36]D.R.Large,G.Burnett,A.Bolton,Augmentinglandmarksduringthehead-upprovisionofin-vehiclenavigationadvice,Int. J.MobileHum.Comput.Interact.(IJMHCI)9(2017)18–38.
[37]D.R.Large,E.Crundall,G.Burnett,C.Harvey,P.Konstantopoulos,Drivingwithoutwings:theeffectofdifferentdigital mirrorlocationsonthevisualbehaviour,performanceandopinionsofdrivers,Appl.Ergon.55(2016)138–148. [38]R.C.McIlroy,N.A.Stanton,L.Godwin,A.P.Wood,Encouragingeco-drivingwithvisual,auditory,andvibrotactilestimuli,
IEEETransactionsonHuman-MachineSystems47(2017)661–672.
[39]C.Neubauer,G.Matthews,D.Saxby,FatigueintheautomatedvehicleDogamesandconversationdistractorenergizethe driver?PaperPresentedattheProceedingsoftheHumanFactorsandErgonomicsSocietyAnnualMeeting(2014). [40]C.Neubauer,G.Matthews,D.Saxby,Theeffectsofcellphoneuseandautomationondriverperformanceandsubjective
stateinsimulateddriving,ProceedingsoftheHumanFactorsandErgonomicsSocietyAnnualMeeting56(2016)1987– 1991.
[41]G.D.Park,R.W.Allen,T.J.Rosenthal,Novicedriversimulationtrainingpotentialforimprovinghazardperceptionand self-confidencewhileloweringspeedingriskattitudesforyoungmales,PaperPresentedattheProceedingsoftheEighth InternationalDrivingSymposiumonHumanFactorsinDriverAssessment,TrainingandVehicleDesign,(2015). [42]R.W.Allen,T.J.Rosenthal,B.L.Aponso,G.Park,Scenariosproducedbyproceduralmethodsfordrivingresearch,assessment
andtrainingapplications,PaperPresentedattheProceedingsoftheDrivingSimulationConference,(2003). [43]W.Allen,T.Rosenthal,B.Aponso,Z.Parseghian,M.Cook,S.Markham,Ascenariodefinitionlanguagefordevelopingdriving
simulatorcourses,PaperPresentedattheDrivingSimulationConference,(2001).
[44]R.Allen,T.Rosenthal,J.Hogue,F.Anderson,Low-costvirtualenvironmentsforsimulatingvehicleoperationtasks,Paper Presentedatthe78thAnnualMeetingoftheTransportationResearchBoard(1999).
[45]J.C.F.deWinter,P.A.Wieringa,J.Kuipers,J.A.Mulder,M.Mulder,Violationsanderrorsduringsimulation-baseddriver training,Ergonomics50(2007)138–158.
[46]G.J.Funke,Theeffectsofautomationandworkloadondriverperformance,subjectiveworkload,andmood.doctoral dissertation,UniversityofCincinnati,2007.
[47]G.Funke,G.Matthews,J.S.Warm,A.K.Emo,Vehicleautomation:aremedyfordriverstress?Ergonomics50(2007)1302– 1323.
[48]C.Neubauer,Theeffectsofdifferenttypesofcellphoneuse,automationandpersonalityondriverperformanceand subjectivestateinsimulateddriving,UniversityofCincinnati,2011.
[49]C.Neubauer,G.Matthews,L.Langheim,D.Saxby,Fatigueandvoluntaryutilizationofautomationinsimulateddriving, Hum.Factors54(2012)734–746.
[50]D.J.Saxby,G.Matthews,E.M.Hitchcock,J.S.Warm,Developmentofactiveandpassivefatiguemanipulationsusinga drivingsimulator,ProceedingsoftheHumanFactorsandErgonomicsSocietyAnnualMeeting51(2016)1237–1241. [51]D.J.Saxby,G. Matthews,E.M.Hitchcock,J.S.Warm,G.J.Funke, T.Gantzer,Effectofactiveandpassive fatigueon
performanceusingadrivingsimulator,ProceedingsoftheHumanFactorsandErgonomicsSocietyAnnualMeeting52 (2008)1751–1755.
[52]K.Kircher,A.Larsson,J.A.Hultgren,Tacticaldrivingbehaviorwithdifferentlevelsofautomation,IEEETrans.Intell.Transp. Syst.15(2014)158–167.