├── CACC-CARMA
├── ATTRIBUTION.txt
├── CACC
│ ├── .SimulinkProject
│ │ ├── Extensions.type.Root
│ │ │ └── Information.type.Extension.xml
│ │ ├── Project.xml
│ │ ├── ProjectData.type.Info.xml
│ │ ├── Root.type.Categories
│ │ │ ├── FileClassCategory.type.Category.xml
│ │ │ ├── FileClassCategory.type.Category
│ │ │ │ ├── artifact.type.Label.xml
│ │ │ │ ├── convenience.type.Label.xml
│ │ │ │ ├── derived.type.Label.xml
│ │ │ │ ├── design.type.Label.xml
│ │ │ │ ├── none.type.Label.xml
│ │ │ │ └── other.type.Label.xml
│ │ │ ├── ReviewCategory.type.Category.xml
│ │ │ └── ReviewCategory.type.Category
│ │ │ │ ├── approved.type.Label.xml
│ │ │ │ ├── needMoreInfo.type.Label.xml
│ │ │ │ ├── rejected.type.Label.xml
│ │ │ │ └── toReview.type.Label.xml
│ │ ├── Root.type.EntryPointGroups
│ │ │ ├── 155ef55b-dc7a-47df-9a45-852b88410d9f.type.EntryPointGroup.xml
│ │ │ └── 37a5bbd6-2a5b-4432-9cdc-8c8307e9002f.type.EntryPointGroup.xml
│ │ ├── Root.type.EntryPoints
│ │ │ ├── 3274ceb6-0218-4364-8baf-a6e5fc8d9501.type.EntryPoint.xml
│ │ │ ├── 78fed6d1-a4f7-49a1-abaa-65fb82ca606c.type.EntryPoint.xml
│ │ │ ├── 7ac31638-a942-44c5-a6d2-bfc55e914029.type.EntryPoint.xml
│ │ │ ├── ab052027-6ee8-4a4b-8890-59105d69ed47.type.EntryPoint.xml
│ │ │ ├── b7dfad17-1aae-4172-8f24-3db92667d10a.type.EntryPoint.xml
│ │ │ └── bf31d436-f464-4a72-9f9a-81f4763e8f4d.type.EntryPoint.xml
│ │ ├── Root.type.Extensions
│ │ │ └── .gitignore
│ │ ├── Root.type.Files
│ │ │ ├── src.type.File.xml
│ │ │ └── src.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── adapter.type.File.xml
│ │ │ │ ├── adapter.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── ParsingLibrary.mdl.type.File.xml
│ │ │ │ └── topr5_adapter.mdl.type.File.xml
│ │ │ │ ├── add_paths.m.type.File.xml
│ │ │ │ ├── carma_platform.mdl.type.File.xml
│ │ │ │ ├── data_files.type.File.xml
│ │ │ │ ├── data_files.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── AccelCommandMode.m.type.File.xml
│ │ │ │ ├── GlobalA_FO.dbc.type.File.xml
│ │ │ │ ├── LoggingBus.dbc.type.File.xml
│ │ │ │ ├── accel_command_struct.mat.type.File.xml
│ │ │ │ ├── dsrc_data.mat.type.File.xml
│ │ │ │ ├── fusion_object_struct.mat.type.File.xml
│ │ │ │ ├── light_command_struct.mat.type.File.xml
│ │ │ │ ├── memory_struct.mat.type.File.xml
│ │ │ │ ├── srx_command.dbc.type.File.xml
│ │ │ │ └── srx_high_speed.dbc.type.File.xml
│ │ │ │ ├── platform.type.File.xml
│ │ │ │ ├── platform.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── command_accel_encode.c.type.File.xml
│ │ │ │ ├── srx_initialize.mdl.type.File.xml
│ │ │ │ ├── srx_platform.mdl.type.File.xml
│ │ │ │ └── srx_transmit.mdl.type.File.xml
│ │ │ │ ├── project.type.File.xml
│ │ │ │ ├── project.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── c_src.type.File.xml
│ │ │ │ ├── c_src.type.File
│ │ │ │ │ ├── .gitignore.type.File.xml
│ │ │ │ │ └── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── matlab.type.File.xml
│ │ │ │ ├── matlab.type.File
│ │ │ │ │ ├── .gitignore.type.File.xml
│ │ │ │ │ └── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── models.type.File.xml
│ │ │ │ └── models.type.File
│ │ │ │ │ ├── .gitignore.type.File.xml
│ │ │ │ │ └── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── test.type.File.xml
│ │ │ │ ├── test.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ └── carma_client_test.mdl.type.File.xml
│ │ │ │ ├── utilities.type.File.xml
│ │ │ │ └── utilities.type.File
│ │ │ │ ├── 1.type.DIR_SIGNIFIER.xml
│ │ │ │ ├── eth_bit_decoder_sfcn.c.type.File.xml
│ │ │ │ ├── eth_bit_decoder_sfcn.mexw64.type.File.xml
│ │ │ │ ├── eth_bit_encoder_sfcn.c.type.File.xml
│ │ │ │ ├── eth_bit_encoder_sfcn.mexw64.type.File.xml
│ │ │ │ ├── eth_decode32_sfcn.c.type.File.xml
│ │ │ │ ├── eth_decode32_sfcn.mexw64.type.File.xml
│ │ │ │ ├── eth_encode32_sfcn.c.type.File.xml
│ │ │ │ ├── eth_encode32_sfcn.mexw64.type.File.xml
│ │ │ │ └── parse_utils.mdl.type.File.xml
│ │ ├── Root.type.ProjectData
│ │ │ └── .gitignore
│ │ └── uuid-f4572955-568d-4680-9522-67fd38b478a7
│ ├── .gitignore
│ ├── CarmaPlatform.prj
│ ├── data_files
│ │ └── memory_struct.mat
│ ├── docs
│ │ └── .gitignore
│ ├── simulink_models
│ │ ├── adapter
│ │ │ └── pinpt_decomposer.mdl
│ │ └── platform
│ │ │ └── data_producer.mdl
│ └── src
│ │ └── project
│ │ ├── 3rd_veh
│ │ ├── CACC_system_struct.mdl
│ │ ├── SIZE.H
│ │ ├── cc_v_ref.c
│ │ ├── cc_v_ref.mexw64
│ │ ├── coordination.c
│ │ ├── coordination.mexw64
│ │ ├── dist_contr.c
│ │ ├── dist_contr.mexw64
│ │ ├── dist_contr_n.c
│ │ ├── dist_contr_n.mexw64
│ │ ├── gap_change.c
│ │ ├── gap_change.mexw64
│ │ ├── readme.c
│ │ ├── run_dist.c
│ │ ├── run_dist.mexw64
│ │ ├── sw_contr.c
│ │ ├── sw_contr.mexw64
│ │ ├── sw_contr2.c
│ │ ├── sw_contr2.mexw64
│ │ ├── switch_RC.c
│ │ ├── switch_RC.mexw64
│ │ ├── toggle_sw.c
│ │ └── toggle_sw.mexw64
│ │ ├── follow
│ │ ├── CACC_system_struct.mdl
│ │ ├── SIZE.H
│ │ ├── cc_v_ref.c
│ │ ├── cc_v_ref.mexw64
│ │ ├── coordination.c
│ │ ├── coordination.mexw64
│ │ ├── dist_cont.c
│ │ ├── dist_cont.mexw64
│ │ ├── dist_contr.c
│ │ ├── dist_contr.mexw64
│ │ ├── dist_contr_n.c
│ │ ├── dist_contr_n.mexw64
│ │ ├── dist_contr_pd.c
│ │ ├── dist_contr_pd.mexw64
│ │ ├── gap_change.c
│ │ ├── gap_change.mexw64
│ │ ├── kl_fb_3.c
│ │ ├── kl_fb_3.mexw64
│ │ ├── kl_fb_4.c
│ │ ├── kl_fb_4.mexw64
│ │ ├── kl_fb_5.c
│ │ ├── kl_fb_5.mexw64
│ │ ├── kp_fb.c
│ │ ├── kp_fb.mexw64
│ │ ├── readme.c
│ │ ├── run_dist.c
│ │ ├── run_dist.mexw64
│ │ ├── sw_contr.c
│ │ ├── sw_contr.mexw64
│ │ ├── sw_contr2.c
│ │ ├── sw_contr2.mexw64
│ │ ├── switch_RC.c
│ │ ├── switch_RC.mexw64
│ │ ├── toggle_sw.c
│ │ └── toggle_sw.mexw64
│ │ ├── for-_all_3_veh
│ │ ├── CACC_system_struct.mdl
│ │ ├── SIZE.H
│ │ ├── cc_v_ref.c
│ │ ├── cc_v_ref.mexw64
│ │ ├── coordination.c
│ │ ├── coordination.mexw64
│ │ ├── dist_contr.c
│ │ ├── dist_contr.mexw64
│ │ ├── dist_contr_n.c
│ │ ├── dist_contr_n.mexw64
│ │ ├── gap_change.c
│ │ ├── gap_change.mexw64
│ │ ├── readme.c
│ │ ├── run_dist.c
│ │ ├── run_dist.mexw64
│ │ ├── sw_contr.c
│ │ ├── sw_contr.mexw64
│ │ ├── sw_contr2.c
│ │ ├── sw_contr2.mexw64
│ │ ├── switch_RC.c
│ │ ├── switch_RC.mexw64
│ │ ├── toggle_sw.c
│ │ └── toggle_sw.mexw64
│ │ └── lead
│ │ ├── CACC_system_struct.mdl
│ │ ├── SIZE.H
│ │ ├── Test.prj
│ │ ├── cc_v_ref.asv
│ │ ├── cc_v_ref.c
│ │ ├── cc_v_ref.mexw64
│ │ ├── control.mexw64
│ │ ├── coordination.asv
│ │ ├── coordination.c
│ │ ├── coordination.mexw64
│ │ ├── dist_cont.c
│ │ ├── dist_cont.mexw64
│ │ ├── dist_contr.c
│ │ ├── dist_contr.mexw64
│ │ ├── dist_contr_n.c
│ │ ├── dist_contr_n.mexw64
│ │ ├── dist_contr_not_good.c
│ │ ├── gap_change.c
│ │ ├── gap_change.mexw64
│ │ ├── kl_fb_3.c
│ │ ├── kl_fb_3.mexw64
│ │ ├── kl_fb_4.c
│ │ ├── kl_fb_4.mexw64
│ │ ├── kl_fb_5.c
│ │ ├── kl_fb_5.mexw64
│ │ ├── kp_fb.c
│ │ ├── kp_fb.mexw64
│ │ ├── out_dat.txt
│ │ ├── readme.c
│ │ ├── run_dist.c
│ │ ├── run_dist.mexw64
│ │ ├── sgnl_read.c
│ │ ├── simpleacc_param.m
│ │ ├── sw_contr.c
│ │ ├── sw_contr.mexw64
│ │ ├── sw_contr2.c
│ │ ├── sw_contr2.mexw64
│ │ ├── switch_RC.c
│ │ ├── switch_RC.mexw64
│ │ ├── thcal.c
│ │ ├── thcal.mexw64
│ │ ├── thcal_low_spd.c
│ │ ├── toggle_sw.c
│ │ ├── toggle_sw.mexw64
│ │ └── veh_pos.m
├── CarmaMab
│ ├── .gitignore
│ ├── CarmaPlatform.prj
│ ├── README.md
│ ├── docs
│ │ ├── .gitignore
│ │ ├── CACC Software Installation Instructions.docx
│ │ └── CACC_R0.1.asn
│ └── src
│ │ ├── adapter
│ │ ├── ParsingLibrary.mdl
│ │ ├── c_src
│ │ │ ├── EncodeBSM.c
│ │ │ ├── EncodeBSM.mexw64
│ │ │ ├── EncodeBSM.tlc
│ │ │ ├── EncodeBSM_bus.h
│ │ │ ├── EncodeBSM_wrapper.c
│ │ │ ├── ParseBSM.c
│ │ │ ├── ParseBSM.mexw64
│ │ │ ├── ParseBSM.tlc
│ │ │ ├── ParseBSM_bus.h
│ │ │ ├── ParseBSM_wrapper.c
│ │ │ ├── SFB__EncodeBSM__SFB.mat
│ │ │ ├── SFB__ParseBSM__SFB.mat
│ │ │ ├── bsm.h
│ │ │ ├── bsm_encoder.c
│ │ │ ├── bsm_encoder.h
│ │ │ ├── bsm_parser.c
│ │ │ ├── bsm_parser.h
│ │ │ ├── bsm_validator.c
│ │ │ ├── bsm_validator.h
│ │ │ ├── der_decoder.c
│ │ │ ├── der_decoder.h
│ │ │ ├── der_encoder.c
│ │ │ ├── der_encoder.h
│ │ │ └── rtwmakecfg.m
│ │ ├── models
│ │ │ ├── dsrc_handler.mdl
│ │ │ ├── dsrc_transmitter.mdl
│ │ │ ├── lightbar.mdl
│ │ │ └── lightbar_controller.mdl
│ │ ├── pinpt_tester.mdl
│ │ └── topr5_adapter.mdl
│ │ ├── add_paths.m
│ │ ├── data_files
│ │ ├── AccelCommandMode.m
│ │ ├── accel_command_struct.mat
│ │ ├── dsrc_data.mat
│ │ ├── fusion_object_struct.mat
│ │ ├── light_command_struct.mat
│ │ └── memory_struct.mat
│ │ ├── test
│ │ ├── VehIdRead.mdl
│ │ ├── VehIdWrite.mdl
│ │ └── carma_client_test.mdl
│ │ └── utilities
│ │ ├── eth_bit_decoder_sfcn.c
│ │ ├── eth_bit_decoder_sfcn.mexw64
│ │ ├── eth_bit_encoder_sfcn.c
│ │ ├── eth_bit_encoder_sfcn.mexw64
│ │ ├── eth_decode32_sfcn.c
│ │ ├── eth_decode32_sfcn.mexw64
│ │ ├── eth_encode32_sfcn.c
│ │ ├── eth_encode32_sfcn.mexw64
│ │ └── parse_utils.mdl
├── CarmaSecondary
│ ├── .gitignore
│ ├── arada
│ │ ├── orig_bsm.txt
│ │ ├── pinpoint
│ │ ├── saxton
│ │ └── udp_client_x86
│ ├── data_files
│ │ └── memory_struct.mat
│ ├── linux_host
│ │ ├── cfg
│ │ │ └── .gitignore
│ │ ├── docs
│ │ │ └── .gitignore
│ │ ├── src
│ │ │ ├── c
│ │ │ │ └── pinpoint_consumer
│ │ │ │ │ ├── handlers.c
│ │ │ │ │ ├── handlers.h
│ │ │ │ │ ├── mab_pinpoint_interface
│ │ │ │ │ ├── main.c
│ │ │ │ │ ├── makefile
│ │ │ │ │ ├── pinpoint_utility_functions.c
│ │ │ │ │ ├── pinpoint_utility_functions.h
│ │ │ │ │ ├── socket_includes.h
│ │ │ │ │ └── unpack_macros.h
│ │ │ └── python
│ │ │ │ └── carma_udp_logger.py
│ │ └── v2iServer
│ │ │ ├── .gitignore
│ │ │ ├── pom.xml
│ │ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── java
│ │ │ │ │ └── com
│ │ │ │ │ │ └── leidos
│ │ │ │ │ │ └── v2i
│ │ │ │ │ │ ├── IConsumerInitializer.java
│ │ │ │ │ │ ├── V2IServer.java
│ │ │ │ │ │ ├── appcommon
│ │ │ │ │ │ ├── utils
│ │ │ │ │ │ │ ├── BitStreamPacker.java
│ │ │ │ │ │ │ ├── BitStreamUnpacker.java
│ │ │ │ │ │ │ └── UnpackUtils.java
│ │ │ │ │ │ └── version
│ │ │ │ │ │ │ └── VehicleApplicationVersion.java
│ │ │ │ │ │ ├── command
│ │ │ │ │ │ └── CommandStatusProcessor.java
│ │ │ │ │ │ ├── config
│ │ │ │ │ │ ├── AppConfig.java
│ │ │ │ │ │ ├── V2IApplicationContext.java
│ │ │ │ │ │ └── WebSocketConfig.java
│ │ │ │ │ │ ├── consumers
│ │ │ │ │ │ ├── dsrc
│ │ │ │ │ │ │ ├── MabDsrcProcessor.java
│ │ │ │ │ │ │ └── ObuDsrcProcessor.java
│ │ │ │ │ │ └── gps
│ │ │ │ │ │ │ ├── GpsConsumerInitializer.java
│ │ │ │ │ │ │ ├── GpsScheduleMessage.java
│ │ │ │ │ │ │ ├── GpsScheduledMessageConsumer.java
│ │ │ │ │ │ │ └── NioUtils.java
│ │ │ │ │ │ ├── logger
│ │ │ │ │ │ ├── ILogger.java
│ │ │ │ │ │ ├── LogBuffer.java
│ │ │ │ │ │ ├── LogEntry.java
│ │ │ │ │ │ ├── LogListener.java
│ │ │ │ │ │ ├── Logger.java
│ │ │ │ │ │ └── LoggerManager.java
│ │ │ │ │ │ ├── rest
│ │ │ │ │ │ ├── V2IParameterController.java
│ │ │ │ │ │ └── response
│ │ │ │ │ │ │ ├── AjaxResponse.java
│ │ │ │ │ │ │ └── ParametersResponse.java
│ │ │ │ │ │ ├── services
│ │ │ │ │ │ └── V2IService.java
│ │ │ │ │ │ ├── state
│ │ │ │ │ │ ├── AppState.java
│ │ │ │ │ │ └── V2IParameters.java
│ │ │ │ │ │ └── ui
│ │ │ │ │ │ └── UiMessage.java
│ │ │ │ └── resources
│ │ │ │ │ ├── static
│ │ │ │ │ ├── css
│ │ │ │ │ │ └── v2i.css
│ │ │ │ │ ├── images
│ │ │ │ │ │ ├── Brake.png
│ │ │ │ │ │ ├── BrakeBackground.png
│ │ │ │ │ │ ├── ButtonOff.png
│ │ │ │ │ │ ├── ButtonOn.png
│ │ │ │ │ │ ├── FactoryAccState.png
│ │ │ │ │ │ ├── ManualState.png
│ │ │ │ │ │ ├── PathACCState.png
│ │ │ │ │ │ ├── PathCACCState.png
│ │ │ │ │ │ ├── PathCCState.png
│ │ │ │ │ │ └── cacc.png
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── js
│ │ │ │ │ │ ├── audio-fix.js
│ │ │ │ │ │ ├── connect.js
│ │ │ │ │ │ ├── v2i.js
│ │ │ │ │ │ └── v2iAjax.js
│ │ │ │ │ ├── opensource
│ │ │ │ │ │ ├── jquery
│ │ │ │ │ │ │ ├── css
│ │ │ │ │ │ │ │ └── ui-lightness
│ │ │ │ │ │ │ │ │ ├── images
│ │ │ │ │ │ │ │ │ ├── animated-overlay.gif
│ │ │ │ │ │ │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_flat_10_000000_40x100.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png
│ │ │ │ │ │ │ │ │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png
│ │ │ │ │ │ │ │ │ ├── ui-icons_222222_256x240.png
│ │ │ │ │ │ │ │ │ ├── ui-icons_228ef1_256x240.png
│ │ │ │ │ │ │ │ │ ├── ui-icons_ef8c08_256x240.png
│ │ │ │ │ │ │ │ │ ├── ui-icons_ffd27a_256x240.png
│ │ │ │ │ │ │ │ │ └── ui-icons_ffffff_256x240.png
│ │ │ │ │ │ │ │ │ ├── jquery-ui-1.10.4.custom.css
│ │ │ │ │ │ │ │ │ └── jquery-ui-1.10.4.custom.min.css
│ │ │ │ │ │ │ ├── flot
│ │ │ │ │ │ │ │ ├── css
│ │ │ │ │ │ │ │ │ └── flot-examples.css
│ │ │ │ │ │ │ │ └── js
│ │ │ │ │ │ │ │ │ ├── excanvas.js
│ │ │ │ │ │ │ │ │ ├── jquery.flot.categories.js
│ │ │ │ │ │ │ │ │ └── jquery.flot.js
│ │ │ │ │ │ │ └── js
│ │ │ │ │ │ │ │ ├── jquery-1.10.2.js
│ │ │ │ │ │ │ │ ├── jquery-ui-1.10.4.custom.js
│ │ │ │ │ │ │ │ └── jquery-ui-1.10.4.custom.min.js
│ │ │ │ │ │ ├── sockjs-0.3.4.js
│ │ │ │ │ │ └── stomp.js
│ │ │ │ │ └── sounds
│ │ │ │ │ │ └── warning.wav
│ │ │ │ │ ├── templates
│ │ │ │ │ └── driverView.html
│ │ │ │ │ └── v2i.properties
│ │ │ └── test
│ │ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── leidos
│ │ │ │ └── v2i
│ │ │ │ ├── consumers
│ │ │ │ └── dsrc
│ │ │ │ │ └── ObuDsrcProcessorTester.java
│ │ │ │ └── state
│ │ │ │ └── AppStateTester.java
│ │ │ └── testdata
│ │ │ ├── gpsLiveSaxton20150128.csv
│ │ │ └── gpsSaxton.csv
│ ├── simulink_models
│ │ ├── adapter
│ │ │ └── pinpt_decomposer.mdl
│ │ └── platform
│ │ │ └── data_producer.mdl
│ └── utils
│ │ └── canmatrix
│ │ ├── BusmasterRestbus.py
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── TODO.md
│ │ ├── compare.py
│ │ ├── convert.py
│ │ ├── exampleMerge.py
│ │ ├── library
│ │ ├── __init__.py
│ │ ├── autosarhelper.py
│ │ ├── canmatrix.py
│ │ ├── canmatrixGenerateJS.py
│ │ ├── compare.py
│ │ ├── copy.py
│ │ ├── exportJson.py
│ │ ├── exportall.py
│ │ ├── exportarxml.py
│ │ ├── exportdbc.py
│ │ ├── exportdbf.py
│ │ ├── exportkcd.py
│ │ ├── exportxls.py
│ │ ├── importall.py
│ │ ├── importany.py
│ │ ├── importarxml.py
│ │ ├── importdbc.py
│ │ ├── importdbf.py
│ │ ├── importkcd.py
│ │ ├── importsym.py
│ │ └── importxls.py
│ │ ├── srx_command.sym
│ │ └── todo.sh
├── FHWA Connected Vehicle Research Platform User's Guide.docx
├── LICENSE.txt
└── README.txt
├── CACC-VISSIM
├── ATTRIBUTION.txt
├── CACC_COM_Controller
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ └── Program.cs
├── I-66CalibratedNetwork.inpx
├── I-66CalibratedNetwork.layx
├── Instruction.txt
├── LICENSE.txt
├── README.txt
├── RELEASE-NOTES.txt
├── Type101DriverModel
│ ├── DriverModel.cpp
│ └── DriverModel.h
├── Type104DriverModel
│ ├── DriverModel.cpp
│ └── DriverModel.h
├── VISSIM Model Calibration Results_WB.docx
├── i-66_wb_dedicatedcacclane_2.inpx
├── i-66_wb_dedicatedcacclane_2.layx
└── scenario_template.csv
└── README.md
/CACC-CARMA/ATTRIBUTION.txt:
--------------------------------------------------------------------------------
1 | Key contributors to the development of the Connected Vehicle Research Platform software,
2 | version 1.0, include:
3 | Frank Perry, Kyle Rush, Dave Ference, John Stark of Leidos
4 | Aaron Dalton, Scott Schlachter, Nick Elder of TORC Robotics
5 | Xiao-Yun Lu, Steve Shladover of University of California-Berkeley PATH
6 |
7 | The developers also wish to acknowledge contributors to this study:
8 |
9 | Government task lead: Taylor Lochrane (FHWA TFHRC)
10 | Task advisor: Dan Daley (University of Washington)
11 | COR: Randy VanGorder (FHWA TFHRC)
12 | Test facility management: Jim Rugh and Martin Schy (Willow Grove NAS, Philadelphia, PA)
13 | Hardware integration and testing support: Cary Vick, Ed Leslie (Leidos)
14 | Travel and Logistics Coordination: Margaret Hailemariam, Ayeshah Abuelhiga, Samantha Adam of Leidos
15 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Extensions.type.Root/Information.type.Extension.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/ProjectData.type.Info.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category/artifact.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category/convenience.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category/derived.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category/design.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category/none.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/FileClassCategory.type.Category/other.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/ReviewCategory.type.Category.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/ReviewCategory.type.Category/approved.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/ReviewCategory.type.Category/needMoreInfo.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/ReviewCategory.type.Category/rejected.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Categories/ReviewCategory.type.Category/toReview.type.Label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPointGroups/155ef55b-dc7a-47df-9a45-852b88410d9f.type.EntryPointGroup.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPointGroups/37a5bbd6-2a5b-4432-9cdc-8c8307e9002f.type.EntryPointGroup.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPoints/3274ceb6-0218-4364-8baf-a6e5fc8d9501.type.EntryPoint.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPoints/78fed6d1-a4f7-49a1-abaa-65fb82ca606c.type.EntryPoint.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPoints/7ac31638-a942-44c5-a6d2-bfc55e914029.type.EntryPoint.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPoints/ab052027-6ee8-4a4b-8890-59105d69ed47.type.EntryPoint.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPoints/b7dfad17-1aae-4172-8f24-3db92667d10a.type.EntryPoint.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.EntryPoints/bf31d436-f464-4a72-9f9a-81f4763e8f4d.type.EntryPoint.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Extensions/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/.SimulinkProject/Root.type.Extensions/.gitignore
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/adapter.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/adapter.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/adapter.type.File/ParsingLibrary.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/adapter.type.File/topr5_adapter.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/add_paths.m.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/carma_platform.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/AccelCommandMode.m.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/GlobalA_FO.dbc.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/LoggingBus.dbc.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/accel_command_struct.mat.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/dsrc_data.mat.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/fusion_object_struct.mat.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/light_command_struct.mat.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/memory_struct.mat.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/srx_command.dbc.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File/srx_high_speed.dbc.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File/command_accel_encode.c.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File/srx_initialize.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File/srx_platform.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File/srx_transmit.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/c_src.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/c_src.type.File/.gitignore.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/c_src.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/matlab.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/matlab.type.File/.gitignore.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/matlab.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/models.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/models.type.File/.gitignore.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File/models.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/test.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/test.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/test.type.File/carma_client_test.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/1.type.DIR_SIGNIFIER.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_bit_decoder_sfcn.c.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_bit_decoder_sfcn.mexw64.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_bit_encoder_sfcn.c.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_bit_encoder_sfcn.mexw64.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_decode32_sfcn.c.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_decode32_sfcn.mexw64.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_encode32_sfcn.c.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/eth_encode32_sfcn.mexw64.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File/parse_utils.mdl.type.File.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/Root.type.ProjectData/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/.SimulinkProject/Root.type.ProjectData/.gitignore
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.SimulinkProject/uuid-f4572955-568d-4680-9522-67fd38b478a7:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/.gitignore:
--------------------------------------------------------------------------------
1 | # Object files
2 | *.o
3 | *.ko
4 | *.obj
5 | *.elf
6 |
7 | # Precompiled Headers
8 | *.gch
9 | *.pch
10 |
11 | # Libraries
12 | *.lib
13 | *.a
14 | *.la
15 | *.lo
16 |
17 | # Shared objects (inc. Windows DLLs)
18 | *.dll
19 | *.so
20 | *.so.*
21 | *.dylib
22 |
23 | # Executables
24 | *.exe
25 | *.out
26 | *.app
27 | *.i*86
28 | *.x86_64
29 | *.hex
30 |
31 | # Debug files
32 | *.dSYM/
33 |
34 | microautobox/bld
35 | microautobox/cache
36 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/CarmaPlatform.prj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | This is a Simulink Project
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/data_files/memory_struct.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/data_files/memory_struct.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/docs/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/docs/.gitignore
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/SIZE.H:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/SIZE.H
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/cc_v_ref.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/cc_v_ref.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/coordination.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/coordination.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/dist_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/dist_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/dist_contr_n.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/dist_contr_n.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/gap_change.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/gap_change.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/readme.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/readme.c
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/run_dist.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/run_dist.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/sw_contr.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME sw_contr
8 | #define S_FUNCTION_LEVEL 2
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 |
13 |
14 | //double sport_2;
15 | static double cruise_2;
16 |
17 | static double salida_2;
18 |
19 |
20 |
21 |
22 | static void mdlInitializeSizes( SimStruct *S )
23 | {
24 | long board_base;
25 |
26 | ssSetNumSFcnParams( S, 0 );
27 | ssSetNumContStates( S, 0 );
28 | ssSetNumDiscStates( S, 0 );
29 | ssSetNumInputPorts( S, 1 );
30 | ssSetInputPortWidth( S, 0, 1 );
31 |
32 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
33 | ssSetNumOutputPorts( S, 1 );
34 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
35 |
36 | ssSetNumSampleTimes( S, 1 );
37 | ssSetNumRWork( S, 0 );
38 | ssSetNumIWork( S, 0 );
39 | ssSetNumPWork( S, 0 );
40 | ssSetNumModes( S, 0 );
41 | ssSetNumNonsampledZCs( S, 0 );
42 | ssSetOptions(S, 0);
43 |
44 | }
45 |
46 | static void mdlInitializeSampleTimes( SimStruct *S )
47 | {
48 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
49 | ssSetOffsetTime( S, 0, 0.0 );
50 | }
51 |
52 |
53 | static void mdlOutputs( SimStruct *S, int_T tid )
54 | {
55 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
56 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
57 |
58 |
59 | //sport_2 = *uPtrs[0]; // pre veh drive mode
60 | cruise_2 = *uPtrs[0]; // ACC button status: 0: manual; 1: ACC; 2: CACC
61 |
62 | salida_2 =0; // default: 0
63 |
64 | //if ((sport_2 > 0.5) && (sport_2 < 1.5) && (cruise_2 > 0.5) && (cruise_2 < 1.5)) // ( they both have value 1)
65 | if ((cruise_2 > 1.5) && (cruise_2 < 2.5)) // 0: manual; 1: PATH ACC; 2: PATH CACC
66 | {
67 | salida_2 =1; // activated only when both switches have value 1; otherwise, output 0
68 | }
69 |
70 |
71 | y[0] = salida_2;
72 |
73 | }
74 |
75 | static void mdlTerminate( SimStruct *S )
76 | {
77 | }
78 |
79 | #ifdef MATLAB_MEX_FILE
80 | #include "simulink.c"
81 | #else
82 | #include "cg_sfun.h"
83 | #endif
84 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/sw_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/sw_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/sw_contr2.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 | #define S_FUNCTION_NAME sw_contr2
7 | #define S_FUNCTION_LEVEL 2
8 |
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 | //#include "size.h"
13 |
14 | //double sport;
15 | static double cruise;
16 | //double sportp;
17 | static double cruisep;
18 |
19 | static double salida;
20 |
21 |
22 |
23 |
24 | static void mdlInitializeSizes( SimStruct *S )
25 | {
26 | long board_base;
27 |
28 | ssSetNumSFcnParams( S, 0 );
29 | ssSetNumContStates( S, 0 );
30 | ssSetNumDiscStates( S, 0 );
31 | ssSetNumInputPorts( S, 1 );
32 | ssSetInputPortWidth( S, 0, 2 );
33 |
34 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
35 | ssSetNumOutputPorts( S, 1 );
36 | ssSetOutputPortWidth( S, 0, 1 );
37 |
38 | ssSetNumSampleTimes( S, 1 );
39 | ssSetNumRWork( S, 0 );
40 | ssSetNumIWork( S, 0 );
41 | ssSetNumPWork( S, 0 );
42 | ssSetNumModes( S, 0 );
43 | ssSetNumNonsampledZCs( S, 0 );
44 | ssSetOptions(S, 0);
45 |
46 | }
47 |
48 | static void mdlInitializeSampleTimes( SimStruct *S )
49 | {
50 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
51 | ssSetOffsetTime( S, 0, 0.0 );
52 | }
53 |
54 | static void mdlOutputs( SimStruct *S, int_T tid )
55 | {
56 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
57 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
58 |
59 | cruisep = *uPtrs[0]; // lead (1st) veh man des: 0: manual; 1: ACC; 2: CACC
60 | cruise = *uPtrs[1]; // Pre (3rd) veh man des: 0: manual; 1: ACC; 2: CACC
61 |
62 |
63 | salida =0; // default value
64 |
65 | if ( ((cruise > 1.5) && (cruise < 2.5)) && ((cruisep > 1.5) && (cruisep < 2.5)))
66 | {
67 | salida =1;
68 | }
69 |
70 |
71 | y[0] = salida;
72 |
73 | }
74 |
75 |
76 |
77 | static void mdlTerminate( SimStruct *S )
78 | {
79 | }
80 |
81 | #ifdef MATLAB_MEX_FILE
82 | #include "simulink.c"
83 | #else
84 | #include "cg_sfun.h"
85 | #endif
86 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/sw_contr2.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/sw_contr2.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/switch_RC.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/switch_RC.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/toggle_sw.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 |
8 | #define S_FUNCTION_NAME toggle_sw
9 | #define S_FUNCTION_LEVEL 2
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 |
14 |
15 |
16 | static double sw_count=0.0;
17 |
18 | static double mod_sw;
19 |
20 |
21 | static void mdlInitializeSizes( SimStruct *S )
22 | {
23 | long board_base;
24 |
25 | ssSetNumSFcnParams( S, 0 );
26 | ssSetNumContStates( S, 0 );
27 | ssSetNumDiscStates( S, 0 );
28 | ssSetNumInputPorts( S, 1 );
29 | ssSetInputPortWidth( S, 0, 1 );
30 |
31 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
32 | ssSetNumOutputPorts( S, 1 );
33 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
34 |
35 | ssSetNumSampleTimes( S, 1 );
36 | ssSetNumRWork( S, 0 );
37 | ssSetNumIWork( S, 0 );
38 | ssSetNumPWork( S, 0 );
39 | ssSetNumModes( S, 0 );
40 | ssSetNumNonsampledZCs( S, 0 );
41 | ssSetOptions(S, 0);
42 |
43 | }
44 |
45 | static void mdlInitializeSampleTimes( SimStruct *S )
46 | {
47 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
48 | ssSetOffsetTime( S, 0, 0.0 );
49 | }
50 |
51 |
52 | static void mdlOutputs( SimStruct *S, int_T tid )
53 | {
54 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
55 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
56 |
57 |
58 |
59 | sw_count = sw_count + (*uPtrs[0]);
60 |
61 | modf(sw_count/4.0, &mod_sw);
62 |
63 | if (mod_sw < 2.5) // 0: manual; 1: ACC; 2: CACC; 3~1: ACC; 4~0: back to ACC
64 | y[0] = mod_sw;
65 | else
66 | y[0] = 1;
67 | }
68 |
69 | static void mdlTerminate( SimStruct *S )
70 | {
71 | }
72 |
73 | #ifdef MATLAB_MEX_FILE
74 | #include "simulink.c"
75 | #else
76 | #include "cg_sfun.h"
77 | #endif
78 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/3rd_veh/toggle_sw.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/3rd_veh/toggle_sw.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/SIZE.H:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/SIZE.H
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/cc_v_ref.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/cc_v_ref.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/coordination.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/coordination.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/dist_cont.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/dist_cont.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/dist_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/dist_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/dist_contr_n.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/dist_contr_n.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/dist_contr_pd.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/dist_contr_pd.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/gap_change.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/gap_change.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kl_fb_3.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kl_fb_3
8 | #define S_FUNCTION_LEVEL 2
9 |
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 |
14 |
15 | static double id_in_3;
16 | static double sp_in_3;
17 |
18 | static double ref_3;
19 | static double ref_prev_3;
20 |
21 | static double kpl_3 = 0.1;
22 | static double kdl_3 = 0.05;
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S ) // standar def in simstruc.h
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 );
34 | ssSetInputPortWidth( S, 0, 2 );
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 );
38 | ssSetOutputPortWidth( S, 0, 1 );
39 |
40 | ssSetNumSampleTimes( S, 1 );
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME); // 0.05
53 | ssSetOffsetTime( S, 0, 0.0 );
54 | }
55 |
56 | static void mdlOutputs( SimStruct *S, int_T tid ) // standard name in simulink.c
57 | {
58 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
59 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
60 |
61 |
62 | id_in_3 = *uPtrs[0];
63 | sp_in_3 = *uPtrs[1];
64 |
65 | if (sp_in_3 < 6.0) // original: 4; ==> 6.0
66 | {
67 | sp_in_3 = 6.0;
68 | }
69 |
70 | ref_3 = id_in_3 - sp_in_3; // Gap differnce: (desired - measured) of the subject veh (i.e. 3rd veh) w.r.t to the leader
71 |
72 | y[0] = kpl_3 * ref_3 + kdl_3 * (ref_3-ref_prev_3); // P+D spd control only; distance regultion w.r.t. the leader
73 |
74 | ref_prev_3 = ref_3;
75 |
76 |
77 | }
78 |
79 |
80 | static void mdlTerminate( SimStruct *S ) // standard name in simulink.c
81 | {
82 | }
83 |
84 | #ifdef MATLAB_MEX_FILE
85 | #include "simulink.c"
86 | #else
87 | #include "cg_sfun.h"
88 | #endif
89 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kl_fb_3.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/kl_fb_3.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kl_fb_4.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kl_fb_4
8 | #define S_FUNCTION_LEVEL 2
9 |
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 | //#include "size.h"
14 |
15 | static double id_in_4;
16 | static double sp_in_4;
17 |
18 | static double ref_4;
19 | static double ref_prev_4;
20 |
21 | static double kpl_4 = 0.1;
22 | static double kdl_4 = 0.05;
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S )
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 );
34 | ssSetInputPortWidth( S, 0, 2 );
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 );
38 | ssSetOutputPortWidth( S, 0, 1 );
39 |
40 | ssSetNumSampleTimes( S, 1 );
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
53 | ssSetOffsetTime( S, 0, 0.0 );
54 | }
55 |
56 | static void mdlOutputs( SimStruct *S, int_T tid )
57 | {
58 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
59 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
60 |
61 |
62 | id_in_4 = *uPtrs[0];
63 | sp_in_4 = *uPtrs[1];
64 |
65 | if (sp_in_4 < 4)
66 | {
67 | sp_in_4 = 4;
68 | }
69 |
70 | ref_4 = id_in_4 - sp_in_4; // Gap differnce: (desired - measured) of the subject veh (i.e. 3rd veh) w.r.t to the leader
71 |
72 | y[0] = kpl_4 * ref_4 + kdl_4 * (ref_4-ref_prev_4); // P+D spd control only; distance regultion w.r.t. the leader
73 |
74 | ref_prev_4 = ref_4;
75 |
76 |
77 | }
78 |
79 | static void mdlTerminate( SimStruct *S )
80 | {
81 | }
82 |
83 | #ifdef MATLAB_MEX_FILE
84 | #include "simulink.c"
85 | #else
86 | #include "cg_sfun.h"
87 | #endif
88 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kl_fb_4.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/kl_fb_4.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kl_fb_5.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kl_fb_5
8 | #define S_FUNCTION_LEVEL 2
9 |
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 | //#include "size.h"
14 |
15 | static double id_in_5;
16 | static double sp_in_5;
17 |
18 | static double ref_5;
19 | static double ref_prev_5;
20 |
21 | static double kpl_5 = 0.1;
22 | static double kdl_5 = 0.05;
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S )
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 );
34 | ssSetInputPortWidth( S, 0, 2 );
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 );
38 | ssSetOutputPortWidth( S, 0, 1 );
39 |
40 | ssSetNumSampleTimes( S, 1 );
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
53 | ssSetOffsetTime( S, 0, 0.0 );
54 | }
55 |
56 | static void mdlOutputs( SimStruct *S, int_T tid )
57 | {
58 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
59 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
60 |
61 |
62 | id_in_5 = *uPtrs[0];
63 | sp_in_5 = *uPtrs[1];
64 |
65 | if (sp_in_5 < 4)
66 | {
67 | sp_in_5 = 4;
68 | }
69 |
70 | ref_5 = id_in_5 - sp_in_5; // Gap differnce: (desired - measured) of the subject veh (i.e. 3rd veh) w.r.t to the leader
71 |
72 | y[0] = kpl_5 * ref_5 + kdl_5 * (ref_5-ref_prev_5); // P+D spd control only; distance regultion w.r.t. the leader
73 |
74 | ref_prev_5 = ref_5;
75 |
76 |
77 | }
78 |
79 | static void mdlTerminate( SimStruct *S )
80 | {
81 | }
82 |
83 | #ifdef MATLAB_MEX_FILE
84 | #include "simulink.c"
85 | #else
86 | #include "cg_sfun.h"
87 | #endif
88 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kl_fb_5.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/kl_fb_5.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kp_fb.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kp_fb // this need to be in each S-function
8 | #define S_FUNCTION_LEVEL 2 // this need to be in each S-function
9 |
10 |
11 | #include "simstruc.h" // A Matlab header file
12 | #include "math.h"
13 | //#include "size.h"
14 |
15 | static double id_in;
16 | static double sp_in;
17 |
18 | static double ref;
19 | static double ref_prev; // ref spd of previous veh
20 |
21 | static double kpp = 0.45; // Control Gain
22 | static double kdp = 0.25; // Control Gain
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S ) // Simulink standard initialization function name
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 ); // Number of input ports corresponding to the block
34 | ssSetInputPortWidth( S, 0, 2 ); // Number of parameters for the port: 2 input parameters
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 ); // Number of input ports corresponding to the block
38 | ssSetOutputPortWidth( S, 0, 1 ); // Number of parameters for each port
39 |
40 | ssSetNumSampleTimes( S, 1 ); // 1 sample time
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05, sample time specified for that parameter
53 | ssSetOffsetTime( S, 0, 0.0 ); // off-set time specified for each parameter
54 | }
55 |
56 |
57 | static void mdlOutputs( SimStruct *S, int_T tid ) // Simulink standard output function name
58 | {
59 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 ); // Simulink standard typeset for RT data reading
60 | real_T *y = ssGetOutputPortRealSignal( S, 0 ); // Simulink standard typeset
61 |
62 | // as specified above, 2 input parmeters
63 | id_in = *uPtrs[0]; // measured distance w.r.t. to front veh
64 | sp_in = *uPtrs[1]; // subject veh desired D_Gap
65 |
66 | if (sp_in < 6.0) // lower bound of desired D_Gap: original 4; ==> 6.0
67 | {
68 | sp_in = 6.0;
69 | }
70 |
71 | ref = id_in - sp_in; // Gap differnce: (desired - measured)
72 |
73 | y[0] = kpp * ref + kdp * (ref-ref_prev); // P+D spd control only; distance regultion
74 |
75 | ref_prev = ref;
76 |
77 |
78 | }
79 |
80 |
81 | static void mdlTerminate( SimStruct *S ) // this must be here
82 | {
83 | }
84 |
85 | #ifdef MATLAB_MEX_FILE
86 | #include "simulink.c"
87 | #else
88 | #include "cg_sfun.h"
89 | #endif
90 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/kp_fb.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/kp_fb.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/readme.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/readme.c
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/run_dist.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/run_dist.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/sw_contr.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME sw_contr
8 | #define S_FUNCTION_LEVEL 2
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 |
13 |
14 | //double sport_2;
15 | static double cruise_2;
16 |
17 | static double salida_2;
18 |
19 |
20 |
21 |
22 | static void mdlInitializeSizes( SimStruct *S )
23 | {
24 | long board_base;
25 |
26 | ssSetNumSFcnParams( S, 0 );
27 | ssSetNumContStates( S, 0 );
28 | ssSetNumDiscStates( S, 0 );
29 | ssSetNumInputPorts( S, 1 );
30 | ssSetInputPortWidth( S, 0, 1 );
31 |
32 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
33 | ssSetNumOutputPorts( S, 1 );
34 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
35 |
36 | ssSetNumSampleTimes( S, 1 );
37 | ssSetNumRWork( S, 0 );
38 | ssSetNumIWork( S, 0 );
39 | ssSetNumPWork( S, 0 );
40 | ssSetNumModes( S, 0 );
41 | ssSetNumNonsampledZCs( S, 0 );
42 | ssSetOptions(S, 0);
43 |
44 | }
45 |
46 | static void mdlInitializeSampleTimes( SimStruct *S )
47 | {
48 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
49 | ssSetOffsetTime( S, 0, 0.0 );
50 | }
51 |
52 |
53 | static void mdlOutputs( SimStruct *S, int_T tid )
54 | {
55 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
56 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
57 |
58 |
59 | //sport_2 = *uPtrs[0]; // pre veh drive mode
60 | cruise_2 = *uPtrs[0]; // ACC button status: 0: manual; 1: ACC; 2: CACC
61 |
62 | salida_2 =0; // default: 0
63 |
64 | //if ((sport_2 > 0.5) && (sport_2 < 1.5) && (cruise_2 > 0.5) && (cruise_2 < 1.5)) // ( they both have value 1)
65 | if ((cruise_2 > 1.5) && (cruise_2 < 2.5)) // 0: manual; 1: PATH ACC; 2: PATH CACC
66 | {
67 | salida_2 =1; // activated only when both switches have value 1; otherwise, output 0
68 | }
69 |
70 |
71 | y[0] = salida_2;
72 |
73 | }
74 |
75 | static void mdlTerminate( SimStruct *S )
76 | {
77 | }
78 |
79 | #ifdef MATLAB_MEX_FILE
80 | #include "simulink.c"
81 | #else
82 | #include "cg_sfun.h"
83 | #endif
84 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/sw_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/sw_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/sw_contr2.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 | #define S_FUNCTION_NAME sw_contr2
7 | #define S_FUNCTION_LEVEL 2
8 |
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 | //#include "size.h"
13 |
14 | //double sport;
15 | static double cruise;
16 | //double sportp;
17 | static double cruisep;
18 |
19 | static double salida;
20 |
21 |
22 |
23 |
24 | static void mdlInitializeSizes( SimStruct *S )
25 | {
26 | long board_base;
27 |
28 | ssSetNumSFcnParams( S, 0 );
29 | ssSetNumContStates( S, 0 );
30 | ssSetNumDiscStates( S, 0 );
31 | ssSetNumInputPorts( S, 1 );
32 | ssSetInputPortWidth( S, 0, 2 );
33 |
34 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
35 | ssSetNumOutputPorts( S, 1 );
36 | ssSetOutputPortWidth( S, 0, 1 );
37 |
38 | ssSetNumSampleTimes( S, 1 );
39 | ssSetNumRWork( S, 0 );
40 | ssSetNumIWork( S, 0 );
41 | ssSetNumPWork( S, 0 );
42 | ssSetNumModes( S, 0 );
43 | ssSetNumNonsampledZCs( S, 0 );
44 | ssSetOptions(S, 0);
45 |
46 | }
47 |
48 | static void mdlInitializeSampleTimes( SimStruct *S )
49 | {
50 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
51 | ssSetOffsetTime( S, 0, 0.0 );
52 | }
53 |
54 | static void mdlOutputs( SimStruct *S, int_T tid )
55 | {
56 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
57 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
58 |
59 | cruisep = *uPtrs[0]; // lead (1st) veh man des: 0: manual; 1: ACC; 2: CACC
60 | cruise = *uPtrs[1]; // Pre (3rd) veh man des: 0: manual; 1: ACC; 2: CACC
61 |
62 |
63 | salida =0; // default value
64 |
65 | if ( ((cruise > 1.5) && (cruise < 2.5)) && ((cruisep > 1.5) && (cruisep < 2.5)))
66 | {
67 | salida =1;
68 | }
69 |
70 |
71 | y[0] = salida;
72 |
73 | }
74 |
75 |
76 |
77 | static void mdlTerminate( SimStruct *S )
78 | {
79 | }
80 |
81 | #ifdef MATLAB_MEX_FILE
82 | #include "simulink.c"
83 | #else
84 | #include "cg_sfun.h"
85 | #endif
86 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/sw_contr2.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/sw_contr2.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/switch_RC.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/switch_RC.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/toggle_sw.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 |
8 | #define S_FUNCTION_NAME toggle_sw
9 | #define S_FUNCTION_LEVEL 2
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 |
14 |
15 |
16 | static double sw_count=0.0;
17 |
18 | static double mod_sw;
19 |
20 |
21 | static void mdlInitializeSizes( SimStruct *S )
22 | {
23 | long board_base;
24 |
25 | ssSetNumSFcnParams( S, 0 );
26 | ssSetNumContStates( S, 0 );
27 | ssSetNumDiscStates( S, 0 );
28 | ssSetNumInputPorts( S, 1 );
29 | ssSetInputPortWidth( S, 0, 1 );
30 |
31 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
32 | ssSetNumOutputPorts( S, 1 );
33 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
34 |
35 | ssSetNumSampleTimes( S, 1 );
36 | ssSetNumRWork( S, 0 );
37 | ssSetNumIWork( S, 0 );
38 | ssSetNumPWork( S, 0 );
39 | ssSetNumModes( S, 0 );
40 | ssSetNumNonsampledZCs( S, 0 );
41 | ssSetOptions(S, 0);
42 |
43 | }
44 |
45 | static void mdlInitializeSampleTimes( SimStruct *S )
46 | {
47 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
48 | ssSetOffsetTime( S, 0, 0.0 );
49 | }
50 |
51 |
52 | static void mdlOutputs( SimStruct *S, int_T tid )
53 | {
54 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
55 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
56 |
57 |
58 |
59 | sw_count = sw_count + (*uPtrs[0]);
60 |
61 | modf(sw_count/4.0, &mod_sw);
62 |
63 | if (mod_sw < 2.5) // 0: manual; 1: ACC; 2: CACC; 3~1: ACC; 4~0: back to ACC
64 | y[0] = mod_sw;
65 | else
66 | y[0] = 1;
67 | }
68 |
69 | static void mdlTerminate( SimStruct *S )
70 | {
71 | }
72 |
73 | #ifdef MATLAB_MEX_FILE
74 | #include "simulink.c"
75 | #else
76 | #include "cg_sfun.h"
77 | #endif
78 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/follow/toggle_sw.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/follow/toggle_sw.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/SIZE.H:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/SIZE.H
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/cc_v_ref.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/cc_v_ref.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/coordination.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/coordination.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/dist_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/dist_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/dist_contr_n.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/dist_contr_n.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/gap_change.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/gap_change.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/readme.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/readme.c
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/run_dist.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/run_dist.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/sw_contr.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME sw_contr
8 | #define S_FUNCTION_LEVEL 2
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 |
13 |
14 | //double sport_2;
15 | static double cruise_2;
16 |
17 | static double salida_2;
18 |
19 |
20 |
21 |
22 | static void mdlInitializeSizes( SimStruct *S )
23 | {
24 | long board_base;
25 |
26 | ssSetNumSFcnParams( S, 0 );
27 | ssSetNumContStates( S, 0 );
28 | ssSetNumDiscStates( S, 0 );
29 | ssSetNumInputPorts( S, 1 );
30 | ssSetInputPortWidth( S, 0, 1 );
31 |
32 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
33 | ssSetNumOutputPorts( S, 1 );
34 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
35 |
36 | ssSetNumSampleTimes( S, 1 );
37 | ssSetNumRWork( S, 0 );
38 | ssSetNumIWork( S, 0 );
39 | ssSetNumPWork( S, 0 );
40 | ssSetNumModes( S, 0 );
41 | ssSetNumNonsampledZCs( S, 0 );
42 | ssSetOptions(S, 0);
43 |
44 | }
45 |
46 | static void mdlInitializeSampleTimes( SimStruct *S )
47 | {
48 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
49 | ssSetOffsetTime( S, 0, 0.0 );
50 | }
51 |
52 |
53 | static void mdlOutputs( SimStruct *S, int_T tid )
54 | {
55 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
56 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
57 |
58 |
59 | //sport_2 = *uPtrs[0]; // pre veh drive mode
60 | cruise_2 = *uPtrs[0]; // ACC button status: 0: manual; 1: ACC; 2: CACC
61 |
62 | salida_2 =0; // default: 0
63 |
64 | //if ((sport_2 > 0.5) && (sport_2 < 1.5) && (cruise_2 > 0.5) && (cruise_2 < 1.5)) // ( they both have value 1)
65 | if ((cruise_2 > 1.5) && (cruise_2 < 2.5)) // 0: manual; 1: PATH ACC; 2: PATH CACC
66 | {
67 | salida_2 =1; // activated only when both switches have value 1; otherwise, output 0
68 | }
69 |
70 |
71 | y[0] = salida_2;
72 |
73 | }
74 |
75 | static void mdlTerminate( SimStruct *S )
76 | {
77 | }
78 |
79 | #ifdef MATLAB_MEX_FILE
80 | #include "simulink.c"
81 | #else
82 | #include "cg_sfun.h"
83 | #endif
84 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/sw_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/sw_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/sw_contr2.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 | #define S_FUNCTION_NAME sw_contr2
7 | #define S_FUNCTION_LEVEL 2
8 |
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 | //#include "size.h"
13 |
14 | //double sport;
15 | static double cruise;
16 | //double sportp;
17 | static double cruisep;
18 |
19 | static double salida;
20 |
21 |
22 |
23 |
24 | static void mdlInitializeSizes( SimStruct *S )
25 | {
26 | long board_base;
27 |
28 | ssSetNumSFcnParams( S, 0 );
29 | ssSetNumContStates( S, 0 );
30 | ssSetNumDiscStates( S, 0 );
31 | ssSetNumInputPorts( S, 1 );
32 | ssSetInputPortWidth( S, 0, 2 );
33 |
34 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
35 | ssSetNumOutputPorts( S, 1 );
36 | ssSetOutputPortWidth( S, 0, 1 );
37 |
38 | ssSetNumSampleTimes( S, 1 );
39 | ssSetNumRWork( S, 0 );
40 | ssSetNumIWork( S, 0 );
41 | ssSetNumPWork( S, 0 );
42 | ssSetNumModes( S, 0 );
43 | ssSetNumNonsampledZCs( S, 0 );
44 | ssSetOptions(S, 0);
45 |
46 | }
47 |
48 | static void mdlInitializeSampleTimes( SimStruct *S )
49 | {
50 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
51 | ssSetOffsetTime( S, 0, 0.0 );
52 | }
53 |
54 | static void mdlOutputs( SimStruct *S, int_T tid )
55 | {
56 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
57 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
58 |
59 | cruisep = *uPtrs[0]; // lead (1st) veh man des: 0: manual; 1: ACC; 2: CACC
60 | cruise = *uPtrs[1]; // Pre (3rd) veh man des: 0: manual; 1: ACC; 2: CACC
61 |
62 |
63 | salida =0; // default value
64 |
65 | if ( ((cruise > 1.5) && (cruise < 2.5)) && ((cruisep > 1.5) && (cruisep < 2.5)))
66 | {
67 | salida =1;
68 | }
69 |
70 |
71 | y[0] = salida;
72 |
73 | }
74 |
75 |
76 |
77 | static void mdlTerminate( SimStruct *S )
78 | {
79 | }
80 |
81 | #ifdef MATLAB_MEX_FILE
82 | #include "simulink.c"
83 | #else
84 | #include "cg_sfun.h"
85 | #endif
86 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/sw_contr2.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/sw_contr2.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/switch_RC.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/switch_RC.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/toggle_sw.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 |
8 | #define S_FUNCTION_NAME toggle_sw
9 | #define S_FUNCTION_LEVEL 2
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 |
14 |
15 |
16 | static double sw_count=0.0;
17 |
18 | static double mod_sw;
19 |
20 |
21 | static void mdlInitializeSizes( SimStruct *S )
22 | {
23 | long board_base;
24 |
25 | ssSetNumSFcnParams( S, 0 );
26 | ssSetNumContStates( S, 0 );
27 | ssSetNumDiscStates( S, 0 );
28 | ssSetNumInputPorts( S, 1 );
29 | ssSetInputPortWidth( S, 0, 1 );
30 |
31 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
32 | ssSetNumOutputPorts( S, 1 );
33 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
34 |
35 | ssSetNumSampleTimes( S, 1 );
36 | ssSetNumRWork( S, 0 );
37 | ssSetNumIWork( S, 0 );
38 | ssSetNumPWork( S, 0 );
39 | ssSetNumModes( S, 0 );
40 | ssSetNumNonsampledZCs( S, 0 );
41 | ssSetOptions(S, 0);
42 |
43 | }
44 |
45 | static void mdlInitializeSampleTimes( SimStruct *S )
46 | {
47 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
48 | ssSetOffsetTime( S, 0, 0.0 );
49 | }
50 |
51 |
52 | static void mdlOutputs( SimStruct *S, int_T tid )
53 | {
54 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
55 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
56 |
57 |
58 |
59 | sw_count = sw_count + (*uPtrs[0]);
60 |
61 | modf(sw_count/4.0, &mod_sw);
62 |
63 | if (mod_sw < 2.5) // 0: manual; 1: ACC; 2: CACC; 3~1: ACC; 4~0: back to ACC
64 | y[0] = mod_sw;
65 | else
66 | y[0] = 1;
67 | }
68 |
69 | static void mdlTerminate( SimStruct *S )
70 | {
71 | }
72 |
73 | #ifdef MATLAB_MEX_FILE
74 | #include "simulink.c"
75 | #else
76 | #include "cg_sfun.h"
77 | #endif
78 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/for-_all_3_veh/toggle_sw.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/for-_all_3_veh/toggle_sw.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/SIZE.H:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/SIZE.H
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/cc_v_ref.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/cc_v_ref.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/control.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/control.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/coordination.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/coordination.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/dist_cont.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/dist_cont.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/dist_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/dist_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/dist_contr_n.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/dist_contr_n.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/gap_change.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/gap_change.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kl_fb_3.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kl_fb_3
8 | #define S_FUNCTION_LEVEL 2
9 |
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 |
14 |
15 | static double id_in_3;
16 | static double sp_in_3;
17 |
18 | static double ref_3;
19 | static double ref_prev_3;
20 |
21 | static double kpl_3 = 0.1;
22 | static double kdl_3 = 0.05;
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S ) // standar def in simstruc.h
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 );
34 | ssSetInputPortWidth( S, 0, 2 );
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 );
38 | ssSetOutputPortWidth( S, 0, 1 );
39 |
40 | ssSetNumSampleTimes( S, 1 );
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME); // 0.05
53 | ssSetOffsetTime( S, 0, 0.0 );
54 | }
55 |
56 | static void mdlOutputs( SimStruct *S, int_T tid ) // standard name in simulink.c
57 | {
58 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
59 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
60 |
61 |
62 | id_in_3 = *uPtrs[0];
63 | sp_in_3 = *uPtrs[1];
64 |
65 | if (sp_in_3 < 6.0) // original: 4; ==> 6.0
66 | {
67 | sp_in_3 = 6.0;
68 | }
69 |
70 | ref_3 = id_in_3 - sp_in_3; // Gap differnce: (desired - measured) of the subject veh (i.e. 3rd veh) w.r.t to the leader
71 |
72 | y[0] = kpl_3 * ref_3 + kdl_3 * (ref_3-ref_prev_3); // P+D spd control only; distance regultion w.r.t. the leader
73 |
74 | ref_prev_3 = ref_3;
75 |
76 |
77 | }
78 |
79 |
80 | static void mdlTerminate( SimStruct *S ) // standard name in simulink.c
81 | {
82 | }
83 |
84 | #ifdef MATLAB_MEX_FILE
85 | #include "simulink.c"
86 | #else
87 | #include "cg_sfun.h"
88 | #endif
89 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kl_fb_3.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/kl_fb_3.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kl_fb_4.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kl_fb_4
8 | #define S_FUNCTION_LEVEL 2
9 |
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 | //#include "size.h"
14 |
15 | static double id_in_4;
16 | static double sp_in_4;
17 |
18 | static double ref_4;
19 | static double ref_prev_4;
20 |
21 | static double kpl_4 = 0.1;
22 | static double kdl_4 = 0.05;
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S )
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 );
34 | ssSetInputPortWidth( S, 0, 2 );
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 );
38 | ssSetOutputPortWidth( S, 0, 1 );
39 |
40 | ssSetNumSampleTimes( S, 1 );
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
53 | ssSetOffsetTime( S, 0, 0.0 );
54 | }
55 |
56 | static void mdlOutputs( SimStruct *S, int_T tid )
57 | {
58 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
59 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
60 |
61 |
62 | id_in_4 = *uPtrs[0];
63 | sp_in_4 = *uPtrs[1];
64 |
65 | if (sp_in_4 < 4)
66 | {
67 | sp_in_4 = 4;
68 | }
69 |
70 | ref_4 = id_in_4 - sp_in_4; // Gap differnce: (desired - measured) of the subject veh (i.e. 3rd veh) w.r.t to the leader
71 |
72 | y[0] = kpl_4 * ref_4 + kdl_4 * (ref_4-ref_prev_4); // P+D spd control only; distance regultion w.r.t. the leader
73 |
74 | ref_prev_4 = ref_4;
75 |
76 |
77 | }
78 |
79 | static void mdlTerminate( SimStruct *S )
80 | {
81 | }
82 |
83 | #ifdef MATLAB_MEX_FILE
84 | #include "simulink.c"
85 | #else
86 | #include "cg_sfun.h"
87 | #endif
88 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kl_fb_4.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/kl_fb_4.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kl_fb_5.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kl_fb_5
8 | #define S_FUNCTION_LEVEL 2
9 |
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 | //#include "size.h"
14 |
15 | static double id_in_5;
16 | static double sp_in_5;
17 |
18 | static double ref_5;
19 | static double ref_prev_5;
20 |
21 | static double kpl_5 = 0.1;
22 | static double kdl_5 = 0.05;
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S )
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 );
34 | ssSetInputPortWidth( S, 0, 2 );
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 );
38 | ssSetOutputPortWidth( S, 0, 1 );
39 |
40 | ssSetNumSampleTimes( S, 1 );
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
53 | ssSetOffsetTime( S, 0, 0.0 );
54 | }
55 |
56 | static void mdlOutputs( SimStruct *S, int_T tid )
57 | {
58 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
59 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
60 |
61 |
62 | id_in_5 = *uPtrs[0];
63 | sp_in_5 = *uPtrs[1];
64 |
65 | if (sp_in_5 < 4)
66 | {
67 | sp_in_5 = 4;
68 | }
69 |
70 | ref_5 = id_in_5 - sp_in_5; // Gap differnce: (desired - measured) of the subject veh (i.e. 3rd veh) w.r.t to the leader
71 |
72 | y[0] = kpl_5 * ref_5 + kdl_5 * (ref_5-ref_prev_5); // P+D spd control only; distance regultion w.r.t. the leader
73 |
74 | ref_prev_5 = ref_5;
75 |
76 |
77 | }
78 |
79 | static void mdlTerminate( SimStruct *S )
80 | {
81 | }
82 |
83 | #ifdef MATLAB_MEX_FILE
84 | #include "simulink.c"
85 | #else
86 | #include "cg_sfun.h"
87 | #endif
88 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kl_fb_5.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/kl_fb_5.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kp_fb.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME kp_fb // this need to be in each S-function
8 | #define S_FUNCTION_LEVEL 2 // this need to be in each S-function
9 |
10 |
11 | #include "simstruc.h" // A Matlab header file
12 | #include "math.h"
13 | //#include "size.h"
14 |
15 | static double id_in;
16 | static double sp_in;
17 |
18 | static double ref;
19 | static double ref_prev; // ref spd of previous veh
20 |
21 | static double kpp = 0.45; // Control Gain
22 | static double kdp = 0.25; // Control Gain
23 |
24 |
25 |
26 | static void mdlInitializeSizes( SimStruct *S ) // Simulink standard initialization function name
27 | {
28 | long board_base;
29 |
30 | ssSetNumSFcnParams( S, 0 );
31 | ssSetNumContStates( S, 0 );
32 | ssSetNumDiscStates( S, 0 );
33 | ssSetNumInputPorts( S, 1 ); // Number of input ports corresponding to the block
34 | ssSetInputPortWidth( S, 0, 2 ); // Number of parameters for the port: 2 input parameters
35 |
36 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
37 | ssSetNumOutputPorts( S, 1 ); // Number of input ports corresponding to the block
38 | ssSetOutputPortWidth( S, 0, 1 ); // Number of parameters for each port
39 |
40 | ssSetNumSampleTimes( S, 1 ); // 1 sample time
41 | ssSetNumRWork( S, 0 );
42 | ssSetNumIWork( S, 0 );
43 | ssSetNumPWork( S, 0 );
44 | ssSetNumModes( S, 0 );
45 | ssSetNumNonsampledZCs( S, 0 );
46 | ssSetOptions(S, 0);
47 |
48 | }
49 |
50 | static void mdlInitializeSampleTimes( SimStruct *S )
51 | {
52 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05, sample time specified for that parameter
53 | ssSetOffsetTime( S, 0, 0.0 ); // off-set time specified for each parameter
54 | }
55 |
56 |
57 | static void mdlOutputs( SimStruct *S, int_T tid ) // Simulink standard output function name
58 | {
59 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 ); // Simulink standard typeset for RT data reading
60 | real_T *y = ssGetOutputPortRealSignal( S, 0 ); // Simulink standard typeset
61 |
62 | // as specified above, 2 input parmeters
63 | id_in = *uPtrs[0]; // measured distance w.r.t. to front veh
64 | sp_in = *uPtrs[1]; // subject veh desired D_Gap
65 |
66 | if (sp_in < 6.0) // lower bound of desired D_Gap: original 4; ==> 6.0
67 | {
68 | sp_in = 6.0;
69 | }
70 |
71 | ref = id_in - sp_in; // Gap differnce: (desired - measured)
72 |
73 | y[0] = kpp * ref + kdp * (ref-ref_prev); // P+D spd control only; distance regultion
74 |
75 | ref_prev = ref;
76 |
77 |
78 | }
79 |
80 |
81 | static void mdlTerminate( SimStruct *S ) // this must be here
82 | {
83 | }
84 |
85 | #ifdef MATLAB_MEX_FILE
86 | #include "simulink.c"
87 | #else
88 | #include "cg_sfun.h"
89 | #endif
90 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/kp_fb.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/kp_fb.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/out_dat.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/out_dat.txt
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/readme.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/readme.c
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/run_dist.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/run_dist.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/simpleacc_param.m:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/simpleacc_param.m
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/sw_contr.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 | #define S_FUNCTION_NAME sw_contr
8 | #define S_FUNCTION_LEVEL 2
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 |
13 |
14 | //double sport_2;
15 | static double cruise_2;
16 |
17 | static double salida_2;
18 |
19 |
20 |
21 |
22 | static void mdlInitializeSizes( SimStruct *S )
23 | {
24 | long board_base;
25 |
26 | ssSetNumSFcnParams( S, 0 );
27 | ssSetNumContStates( S, 0 );
28 | ssSetNumDiscStates( S, 0 );
29 | ssSetNumInputPorts( S, 1 );
30 | ssSetInputPortWidth( S, 0, 1 );
31 |
32 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
33 | ssSetNumOutputPorts( S, 1 );
34 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
35 |
36 | ssSetNumSampleTimes( S, 1 );
37 | ssSetNumRWork( S, 0 );
38 | ssSetNumIWork( S, 0 );
39 | ssSetNumPWork( S, 0 );
40 | ssSetNumModes( S, 0 );
41 | ssSetNumNonsampledZCs( S, 0 );
42 | ssSetOptions(S, 0);
43 |
44 | }
45 |
46 | static void mdlInitializeSampleTimes( SimStruct *S )
47 | {
48 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME ); // 0.05
49 | ssSetOffsetTime( S, 0, 0.0 );
50 | }
51 |
52 |
53 | static void mdlOutputs( SimStruct *S, int_T tid )
54 | {
55 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
56 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
57 |
58 |
59 | //sport_2 = *uPtrs[0]; // pre veh drive mode
60 | cruise_2 = *uPtrs[0]; // ACC button status: 0: manual; 1: ACC; 2: CACC
61 |
62 | salida_2 =0; // default: 0
63 |
64 | //if ((sport_2 > 0.5) && (sport_2 < 1.5) && (cruise_2 > 0.5) && (cruise_2 < 1.5)) // ( they both have value 1)
65 | if ((cruise_2 > 1.5) && (cruise_2 < 2.5)) // 0: manual; 1: PATH ACC; 2: PATH CACC
66 | {
67 | salida_2 =1; // activated only when both switches have value 1; otherwise, output 0
68 | }
69 |
70 |
71 | y[0] = salida_2;
72 |
73 | }
74 |
75 | static void mdlTerminate( SimStruct *S )
76 | {
77 | }
78 |
79 | #ifdef MATLAB_MEX_FILE
80 | #include "simulink.c"
81 | #else
82 | #include "cg_sfun.h"
83 | #endif
84 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/sw_contr.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/sw_contr.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/sw_contr2.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 | #define S_FUNCTION_NAME sw_contr2
7 | #define S_FUNCTION_LEVEL 2
8 |
9 |
10 | #include "simstruc.h"
11 | #include "math.h"
12 | //#include "size.h"
13 |
14 | //double sport;
15 | static double cruise;
16 | //double sportp;
17 | static double cruisep;
18 |
19 | static double salida;
20 |
21 |
22 |
23 |
24 | static void mdlInitializeSizes( SimStruct *S )
25 | {
26 | long board_base;
27 |
28 | ssSetNumSFcnParams( S, 0 );
29 | ssSetNumContStates( S, 0 );
30 | ssSetNumDiscStates( S, 0 );
31 | ssSetNumInputPorts( S, 1 );
32 | ssSetInputPortWidth( S, 0, 2 );
33 |
34 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
35 | ssSetNumOutputPorts( S, 1 );
36 | ssSetOutputPortWidth( S, 0, 1 );
37 |
38 | ssSetNumSampleTimes( S, 1 );
39 | ssSetNumRWork( S, 0 );
40 | ssSetNumIWork( S, 0 );
41 | ssSetNumPWork( S, 0 );
42 | ssSetNumModes( S, 0 );
43 | ssSetNumNonsampledZCs( S, 0 );
44 | ssSetOptions(S, 0);
45 |
46 | }
47 |
48 | static void mdlInitializeSampleTimes( SimStruct *S )
49 | {
50 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
51 | ssSetOffsetTime( S, 0, 0.0 );
52 | }
53 |
54 | static void mdlOutputs( SimStruct *S, int_T tid )
55 | {
56 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
57 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
58 |
59 | cruisep = *uPtrs[0]; // lead (1st) veh man des: 0: manual; 1: ACC; 2: CACC
60 | cruise = *uPtrs[1]; // Pre (3rd) veh man des: 0: manual; 1: ACC; 2: CACC
61 |
62 |
63 | salida =0; // default value
64 |
65 | if ( ((cruise > 1.5) && (cruise < 2.5)) && ((cruisep > 1.5) && (cruisep < 2.5)))
66 | {
67 | salida =1;
68 | }
69 |
70 |
71 | y[0] = salida;
72 |
73 | }
74 |
75 |
76 |
77 | static void mdlTerminate( SimStruct *S )
78 | {
79 | }
80 |
81 | #ifdef MATLAB_MEX_FILE
82 | #include "simulink.c"
83 | #else
84 | #include "cg_sfun.h"
85 | #endif
86 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/sw_contr2.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/sw_contr2.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/switch_RC.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/switch_RC.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/thcal.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/thcal.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/thcal_low_spd.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/thcal_low_spd.c
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/toggle_sw.c:
--------------------------------------------------------------------------------
1 | /**************************************************************************
2 | *
3 | * Copyright (c) 1996,1997,2015 Regents of the University of California
4 | *
5 | **************************************************************************/
6 |
7 |
8 | #define S_FUNCTION_NAME toggle_sw
9 | #define S_FUNCTION_LEVEL 2
10 |
11 | #include "simstruc.h"
12 | #include "math.h"
13 |
14 |
15 |
16 | static double sw_count=0.0;
17 |
18 | static double mod_sw;
19 |
20 |
21 | static void mdlInitializeSizes( SimStruct *S )
22 | {
23 | long board_base;
24 |
25 | ssSetNumSFcnParams( S, 0 );
26 | ssSetNumContStates( S, 0 );
27 | ssSetNumDiscStates( S, 0 );
28 | ssSetNumInputPorts( S, 1 );
29 | ssSetInputPortWidth( S, 0, 1 );
30 |
31 | ssSetInputPortDirectFeedThrough( S, 0, 1 );
32 | ssSetNumOutputPorts( S, 1 );
33 | ssSetOutputPortWidth( S, 0, 1 ); // changed from 2 to 1 due removal of SPRTSMODESW
34 |
35 | ssSetNumSampleTimes( S, 1 );
36 | ssSetNumRWork( S, 0 );
37 | ssSetNumIWork( S, 0 );
38 | ssSetNumPWork( S, 0 );
39 | ssSetNumModes( S, 0 );
40 | ssSetNumNonsampledZCs( S, 0 );
41 | ssSetOptions(S, 0);
42 |
43 | }
44 |
45 | static void mdlInitializeSampleTimes( SimStruct *S )
46 | {
47 | ssSetSampleTime( S, 0, INHERITED_SAMPLE_TIME );
48 | ssSetOffsetTime( S, 0, 0.0 );
49 | }
50 |
51 |
52 | static void mdlOutputs( SimStruct *S, int_T tid )
53 | {
54 | InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs( S, 0 );
55 | real_T *y = ssGetOutputPortRealSignal( S, 0 );
56 |
57 |
58 |
59 | sw_count = sw_count + (*uPtrs[0]);
60 |
61 | modf(sw_count/4.0, &mod_sw);
62 |
63 | if (mod_sw < 2.5) // 0: manual; 1: ACC; 2: CACC; 3~1: ACC; 4~0: back to ACC
64 | y[0] = mod_sw;
65 | else
66 | y[0] = 1;
67 | }
68 |
69 | static void mdlTerminate( SimStruct *S )
70 | {
71 | }
72 |
73 | #ifdef MATLAB_MEX_FILE
74 | #include "simulink.c"
75 | #else
76 | #include "cg_sfun.h"
77 | #endif
78 |
--------------------------------------------------------------------------------
/CACC-CARMA/CACC/src/project/lead/toggle_sw.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CACC/src/project/lead/toggle_sw.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/.gitignore:
--------------------------------------------------------------------------------
1 | # Object files
2 | *.o
3 | *.ko
4 | *.obj
5 | *.elf
6 |
7 | # Precompiled Headers
8 | *.gch
9 | *.pch
10 |
11 | # Libraries
12 | *.lib
13 | *.a
14 | *.la
15 | *.lo
16 |
17 | # Shared objects (inc. Windows DLLs)
18 | *.dll
19 | *.so
20 | *.so.*
21 | *.dylib
22 |
23 | # Executables
24 | *.exe
25 | *.out
26 | *.app
27 | *.i*86
28 | *.x86_64
29 | *.hex
30 |
31 | # Debug files
32 | *.dSYM/
33 |
34 | microautobox/bld
35 | microautobox/cache
36 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/CarmaPlatform.prj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | This is a Simulink Project
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/README.md:
--------------------------------------------------------------------------------
1 | # CarmaPlatform-MAB
2 | Microautobox II code for Cooperative Adaptive Cruise Control
3 |
4 | Contains the necessary Simulink models, .mat data files, and C S-Functions to
5 | build the Cooperative Adaptive Cruise Control software for 2012-2013 Cadillac
6 | SRX.
7 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/docs/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/docs/.gitignore
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/docs/CACC Software Installation Instructions.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/docs/CACC Software Installation Instructions.docx
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/EncodeBSM.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/adapter/c_src/EncodeBSM.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/EncodeBSM_bus.h:
--------------------------------------------------------------------------------
1 | /* Generated by S-function Builder */
2 | #ifndef _ENCODEBSM_BUS_H_
3 | #define _ENCODEBSM_BUS_H_
4 | /* Read only - STARTS */
5 | #include "tmwtypes.h"
6 |
7 |
8 |
9 |
10 | #ifndef _DEFINED_TYPEDEF_FOR_BasicSafetyMessage_
11 | #define _DEFINED_TYPEDEF_FOR_BasicSafetyMessage_
12 | typedef struct {
13 | uint8_T caccFlags_bitmask;
14 | real32_T setSpeed_m_s;
15 | real32_T throtPos_percent;
16 | real32_T lclPN_mm;
17 | real32_T lclPE_mm;
18 | real32_T lclPD_mm;
19 | real32_T roll_deg;
20 | real32_T pitch_deg;
21 | real32_T yaw_deg;
22 | real32_T hPosAcry_m;
23 | real32_T vPosAcry_m;
24 | real32_T frwdVel_m_s;
25 | real32_T rightVel_m_s;
26 | real32_T downVel_m_s;
27 | real32_T velAcc_m_s;
28 | int16_T frwdAcc_mm_s_s;
29 | int16_T rightAcc_mm_s_s;
30 | int16_T dwnAcc_mm_s_s;
31 | uint8_T grpID;
32 | uint8_T grpSize;
33 | uint8_T grpMode;
34 | uint8_T grpManDes;
35 | uint8_T grpManID;
36 | uint8_T vehID;
37 | uint8_T frntCutIn;
38 | uint8_T vehGrpPos;
39 | uint8_T vehFltMode;
40 | uint8_T vehManDes;
41 | uint8_T vehManID;
42 | uint8_T distToPVeh_m;
43 | real32_T relSpdPVeh_m_s;
44 | uint8_T distToLVeh_m;
45 | real32_T relSpdLVeh_m_s;
46 | real32_T desTGapPVeh_s;
47 | real32_T desTGapLVeh_s;
48 | uint8_T estDisPVeh_m;
49 | uint8_T estDisLVeh_m;
50 | uint8_T desSpeed_m_s;
51 | uint16_T desTrq_N_m;
52 | uint8_T msgID;
53 | uint8_T msgCnt;
54 | uint32_T id;
55 | uint16_T secMark_ms;
56 | real32_T lat_deg;
57 | real32_T lon_deg;
58 | real32_T elev_m;
59 | real32_T semi_major_accuracy_m;
60 | real32_T semi_minor_accuracy_m;
61 | real32_T semi_major_accuracy_orientation_deg;
62 | real32_T speed_m_s;
63 | uint8_T transmission_enum;
64 | real32_T heading_deg;
65 | real32_T angle_deg;
66 | real32_T vertical_acceleration_g;
67 | real32_T lat_acceleration_m_s_s;
68 | real32_T long_acceleration_m_s_s;
69 | real32_T yaw_rate_deg_s;
70 | uint8_T wheelBrakes_bitmask;
71 | boolean_T wheelBrakesUnavailable;
72 | uint8_T tractionControlState_enum;
73 | uint8_T anti_lock_brake_status_enum;
74 | uint8_T stability_control_status_enum;
75 | uint8_T brake_boost_enum;
76 | uint8_T auxiliary_brakes_status_enum;
77 | uint32_T vehicle_height_cm;
78 | uint32_T vehicle_width_cm;
79 | uint8_T userDE1;
80 | uint8_T userDE2;
81 | uint8_T userDE3;
82 | uint8_T userDE4;
83 | uint8_T userDE5;
84 | } BasicSafetyMessage;
85 | #endif
86 |
87 | /* Read only - ENDS */
88 |
89 |
90 | #endif
91 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/ParseBSM.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/adapter/c_src/ParseBSM.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/ParseBSM_bus.h:
--------------------------------------------------------------------------------
1 | /* Generated by S-function Builder */
2 | #ifndef _PARSEBSM_BUS_H_
3 | #define _PARSEBSM_BUS_H_
4 | /* Read only - STARTS */
5 | #include "tmwtypes.h"
6 |
7 |
8 |
9 |
10 | #ifndef _DEFINED_TYPEDEF_FOR_BasicSafetyMessage_
11 | #define _DEFINED_TYPEDEF_FOR_BasicSafetyMessage_
12 | typedef struct {
13 | uint8_T caccFlags_bitmask;
14 | real32_T setSpeed_m_s;
15 | real32_T throtPos_percent;
16 | real32_T lclPN_mm;
17 | real32_T lclPE_mm;
18 | real32_T lclPD_mm;
19 | real32_T roll_deg;
20 | real32_T pitch_deg;
21 | real32_T yaw_deg;
22 | real32_T hPosAcry_m;
23 | real32_T vPosAcry_m;
24 | real32_T frwdVel_m_s;
25 | real32_T rightVel_m_s;
26 | real32_T downVel_m_s;
27 | real32_T velAcc_m_s;
28 | int16_T frwdAcc_mm_s_s;
29 | int16_T rightAcc_mm_s_s;
30 | int16_T dwnAcc_mm_s_s;
31 | uint8_T grpID;
32 | uint8_T grpSize;
33 | uint8_T grpMode;
34 | uint8_T grpManDes;
35 | uint8_T grpManID;
36 | uint8_T vehID;
37 | uint8_T frntCutIn;
38 | uint8_T vehGrpPos;
39 | uint8_T vehFltMode;
40 | uint8_T vehManDes;
41 | uint8_T vehManID;
42 | uint8_T distToPVeh_m;
43 | real32_T relSpdPVeh_m_s;
44 | uint8_T distToLVeh_m;
45 | real32_T relSpdLVeh_m_s;
46 | real32_T desTGapPVeh_s;
47 | real32_T desTGapLVeh_s;
48 | uint8_T estDisPVeh_m;
49 | uint8_T estDisLVeh_m;
50 | uint8_T desSpeed_m_s;
51 | uint16_T desTrq_N_m;
52 | uint8_T msgID;
53 | uint8_T msgCnt;
54 | uint32_T id;
55 | uint16_T secMark_ms;
56 | real32_T lat_deg;
57 | real32_T lon_deg;
58 | real32_T elev_m;
59 | real32_T semi_major_accuracy_m;
60 | real32_T semi_minor_accuracy_m;
61 | real32_T semi_major_accuracy_orientation_deg;
62 | real32_T speed_m_s;
63 | uint8_T transmission_enum;
64 | real32_T heading_deg;
65 | real32_T angle_deg;
66 | real32_T vertical_acceleration_g;
67 | real32_T lat_acceleration_m_s_s;
68 | real32_T long_acceleration_m_s_s;
69 | real32_T yaw_rate_deg_s;
70 | uint8_T wheelBrakes_bitmask;
71 | boolean_T wheelBrakesUnavailable;
72 | uint8_T tractionControlState_enum;
73 | uint8_T anti_lock_brake_status_enum;
74 | uint8_T stability_control_status_enum;
75 | uint8_T brake_boost_enum;
76 | uint8_T auxiliary_brakes_status_enum;
77 | uint32_T vehicle_height_cm;
78 | uint32_T vehicle_width_cm;
79 | uint8_T userDE1;
80 | uint8_T userDE2;
81 | uint8_T userDE3;
82 | uint8_T userDE4;
83 | uint8_T userDE5;
84 | } BasicSafetyMessage;
85 | #endif
86 |
87 | /* Read only - ENDS */
88 |
89 |
90 | #endif
91 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/SFB__EncodeBSM__SFB.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/adapter/c_src/SFB__EncodeBSM__SFB.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/SFB__ParseBSM__SFB.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/adapter/c_src/SFB__ParseBSM__SFB.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/bsm.h:
--------------------------------------------------------------------------------
1 | /* TOPR 5 BSM Struct Header
2 | *
3 | * Defines the BSM struct type for usage by other components in the BSM
4 | * system.
5 | */
6 |
7 | #ifndef __BSM_HEADER__
8 | #define __BSM_HEADER__
9 | #include "tmwtypes.h"
10 |
11 | typedef struct {
12 | // BSM Message
13 | uint8_T msgID;
14 |
15 | // BSM BLOB payload
16 | uint8_T msgCnt;
17 | uint32_T id;
18 | uint16_T secMark;
19 | int32_T lat;
20 | int32_T lon; // Called "long" in standard, but renamed to avoid keyword
21 | uint16_T elev;
22 | uint32_T accuracy;
23 | uint16_T speed;
24 | uint16_T heading;
25 | uint8_T angle;
26 | uint8_T accelSet[7];
27 | uint16_T brakes;
28 | uint8_T size[3];
29 |
30 | // CACC Data Extension
31 |
32 | uint8_T flags;
33 | uint16_T setSpeed;
34 | uint8_T throtPos;
35 | float lclPN;
36 | float lclPE;
37 | float lclPD;
38 | int16_T roll;
39 | int16_T pitch;
40 | int16_T yaw;
41 | float hPosAcry;
42 | float vPosAcry;
43 | float fwrdVel;
44 | float rightVel;
45 | float downVel;
46 | float velAcc;
47 | int16_T fwrdAcc;
48 | int16_T rightAcc;
49 | int16_T dwnAcc;
50 |
51 | uint8_T grpID;
52 | uint8_T grpSize;
53 | uint8_T grpMode;
54 | uint8_T grpManDes;
55 | uint8_T grpManID;
56 | uint8_T vehID;
57 | uint8_T frntCutIn;
58 | uint8_T vehGrpPos;
59 | uint8_T vehFltMode;
60 | uint8_T vehManDes;
61 | uint8_T vehManID;
62 | uint8_T distToPVeh;
63 | uint8_T relSpdPVeh;
64 | uint8_T distToLVeh;
65 | uint8_T relSpdLVeh;
66 | uint8_T desTGapPVeh;
67 | uint8_T desTGapLVeh;
68 | uint8_T estDisPVeh;
69 | uint8_T estDisLVeh;
70 | uint8_T desSpd;
71 | uint16_T desTrq;
72 |
73 | // Optional CaccData fields for user defined elements
74 | uint8_T userDE1;
75 | uint8_T userDE2;
76 | uint8_T userDE3;
77 | uint8_T userDE4;
78 | uint8_T userDE5;
79 | } BSM;
80 |
81 | #endif
82 |
83 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/bsm_encoder.h:
--------------------------------------------------------------------------------
1 | /* TOPR 5 BSM Encoder Header
2 | * Defines the types used by the BSM encoder as well as providing function
3 | * definitions for encoding functions.
4 | */
5 |
6 | #ifndef __BSM_ENCODER_H__
7 | #define __BSM_ENCODER_H__
8 |
9 | #include "tmwtypes.h"
10 | #include "bsm.h"
11 |
12 | #define BSM_MSG_ID 2
13 | #define BSM_BLOB_SIZE 38
14 | #define CACC_DATA_SIZE 169
15 | #define BSM_DATA_BUFFER_SIZE 1472
16 | #define CACC_DATA_BUFFER_SIZE 200
17 |
18 | // ASN.1 BSM Tag Numbers
19 | #define TOP_LEVEL_TAG 16
20 | #define MSG_ID_TAG 0
21 | #define BSM_BLOB_TAG 1
22 | #define CACC_DATA_TAG 2
23 |
24 | typedef struct {
25 | uint8_T buf[BSM_DATA_BUFFER_SIZE];
26 | uint32_T length;
27 | } EncodedBSM;
28 |
29 | EncodedBSM encodeBSM(BSM);
30 | uint8_T* encodeBSMBlob(uint8_T*, uint8_T, uint32_T, BSM);
31 | uint8_T* encodeCaccData(uint8_T*, uint8_T, uint32_T, BSM);
32 |
33 | #endif
34 |
35 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/bsm_parser.h:
--------------------------------------------------------------------------------
1 | #ifndef BSM_PARSER_H
2 | #define BSM_PARSER_H
3 |
4 | #include "bsm.h"
5 | #include "tmwtypes.h"
6 |
7 | BSM parseBasicSafetyMessage(uint8_T*, uint32_T);
8 |
9 | #endif
10 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/bsm_validator.h:
--------------------------------------------------------------------------------
1 | /* TOPR 5 CARMA Platform Basic Safety Message Parser Header
2 | *
3 | * Simulink S-Function source file for converting a byte array to the parsed
4 | * values of the BSM. Validates messages as a whole, only outputting for
5 | * well-formatted messages. Parses BSM Part I data as well as CACC extension
6 | * data defined by PATH for TOPR5. Exposes all output fields as a Simulink.Bus
7 | * object.
8 | */
9 |
10 | #ifndef BSM_VALIDATOR_HEADER
11 | #define BSM_VALIDATOR_HEADER
12 |
13 | #include
14 | #include "bsm.h"
15 |
16 |
17 | // BSM Field Validation Functions
18 | int validateBsmMsgID(uint8_t);
19 | int validateBsmId(uint32_t);
20 | int validateBsmSecMark(uint16_t);
21 | int validateBsmLat(int32_t);
22 | int validateBsmLon(int32_t);
23 | int validateBsmElev(uint16_t);
24 | int validateBsmAccuracy(uint32_t);
25 | int validateBsmSpeedAndTransmission(uint16_t);
26 | int validateBsmHeading(uint16_t);
27 | int validateBsmAngle(uint8_t);
28 | int validateBsmAccelSet(uint8_t*);
29 | int validateBsmBrakes(uint16_t);
30 | int validateBsmSize(uint8_t*);
31 |
32 | int validateBsm(BSM);
33 |
34 | #endif
35 |
36 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/der_decoder.h:
--------------------------------------------------------------------------------
1 | /* Abstract Syntax Notation ver. 1 Distinguished Encoding Rules Decoder Header
2 | *
3 | * Provides the necessary types, functions, and datastructures to process DER
4 | * formatted data, such as messages defined for Connected Vehicle Applications
5 | * in J2735.
6 | *
7 | * Kyle Rush 2015 for FHWA TOPR 5
8 | */
9 |
10 | #include "tmwtypes.h"
11 |
12 | typedef struct {
13 | uint8_T class;
14 | uint8_T constructed;
15 | uint32_T tag;
16 | uint32_T length;
17 | uint8_T* value;
18 | } AsnObject;
19 |
20 |
21 | AsnObject parseAsnObject(uint8_T*, uint32_T*);
22 | uint32_T parseTagField(uint8_T*, uint32_T*);
23 | uint32_T parseLengthField(uint8_T*, uint32_T*);
24 |
25 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/der_encoder.h:
--------------------------------------------------------------------------------
1 | /* Abstract Syntax Notation ver. 1 Distinguished Encoding Rules Encoder Header
2 | *
3 | * Provides the necessary types, functions, and datastructures to encode DER
4 | * compliant byte arrays, intended for use formatting Basic Safety Message
5 | * packets as defined in J2735.
6 | *
7 | * Kyle Rush 2015 for FHWA TOPR 5
8 | */
9 |
10 | #ifndef __DER_ENCODER_H__
11 | #define __DER_ENCODER_H__
12 |
13 | #include "tmwtypes.h"
14 | #include
15 |
16 | // ASN.1 Identifier bitmasks
17 | #define CLASS_CONSTRUCTED 0x20
18 | #define CLASS_PRIMITIVE 0x0
19 |
20 | #define CLASS_UNIVERSAL 0x0
21 | #define CLASS_APPLICATION 0x40
22 | #define CLASS_CONTEXT_SPECIFIC 0x80
23 | #define CLASS_PRIVATE 0xC0
24 |
25 | uint8_T* encodeU8(uint8_T*, uint8_T, uint32_T, uint8_T);
26 | uint8_T* encodeU16(uint8_T*, uint8_T, uint32_T, uint16_T);
27 | uint8_T* encodeU32(uint8_T*, uint8_T, uint32_T, uint32_T);
28 |
29 | uint8_T* encodeI16(uint8_T*, uint8_T, uint32_T, int16_T);
30 | uint8_T* encodeI32(uint8_T*, uint8_T, uint32_T, int32_T);
31 |
32 | uint8_T* encodeF32(uint8_T*, uint8_T, uint32_T, float);
33 |
34 | uint8_T* encodeU8Arr(uint8_T*, uint8_T, uint32_T, uint8_T*, uint32_T);
35 |
36 | uint8_T* encodeSequence(uint8_T*, uint8_T, uint32_T, uint32_T);
37 |
38 | uint8_T* encodeLength(uint8_T*, uint32_T);
39 | uint8_T* encodeTagNumber(uint8_T*, uint32_T);
40 |
41 | extern const uint8_T U8_LENGTH;
42 | extern const uint8_T U16_LENGTH;
43 | extern const uint8_T U32_LENGTH;
44 | extern const uint8_T I16_LENGTH;
45 | extern const uint8_T I32_LENGTH;
46 | extern const uint8_T F32_LENGTH;
47 |
48 | #define LENGTH_LENGTH 1
49 | #define TAG_LENGTH 1
50 |
51 | #endif
52 |
53 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/adapter/c_src/rtwmakecfg.m:
--------------------------------------------------------------------------------
1 | function makeInfo=rtwmakecfg()
2 | %RTWMAKECFG.m adds include and source directories to rtw make files.
3 | % makeInfo=RTWMAKECFG returns a structured array containing
4 | % following field:
5 | % makeInfo.includePath - cell array containing additional include
6 | % directories. Those directories will be
7 | % expanded into include instructions of Simulink
8 | % Coder generated make files.
9 | %
10 | % makeInfo.sourcePath - cell array containing additional source
11 | % directories. Those directories will be
12 | % expanded into rules of Simulink Coder generated
13 | % make files.
14 | makeInfo.includePath = {};
15 | makeInfo.sourcePath = {};
16 | makeInfo.linkLibsObjs = {};
17 |
18 | %
19 |
20 | sfBuilderBlocksByMaskType = find_system(bdroot,'FollowLinks','on','LookUnderMasks','on','MaskType','S-Function Builder');
21 | sfBuilderBlocksByCallback = find_system(bdroot,'OpenFcn','sfunctionwizard(gcbh)');
22 | sfBuilderBlocksDeployed = find_system(bdroot,'BlockType','S-Function','SFunctionDeploymentMode','on');
23 | sfBuilderBlocks = {sfBuilderBlocksByMaskType{:} sfBuilderBlocksByCallback{:} sfBuilderBlocksDeployed{:}};
24 | sfBuilderBlocks = unique(sfBuilderBlocks);
25 | if isempty(sfBuilderBlocks)
26 | return;
27 | end
28 | for idx = 1:length(sfBuilderBlocks)
29 | sfBuilderBlockNameMATFile{idx} = get_param(sfBuilderBlocks{idx},'FunctionName');
30 | sfBuilderBlockNameMATFile{idx} = ['.' filesep 'SFB__' char(sfBuilderBlockNameMATFile{idx}) '__SFB.mat'];
31 | end
32 | sfBuilderBlockNameMATFile = unique(sfBuilderBlockNameMATFile);
33 | for idx = 1:length(sfBuilderBlockNameMATFile)
34 | if exist(sfBuilderBlockNameMATFile{idx})
35 | loadedData = load(sfBuilderBlockNameMATFile{idx});
36 | if isfield(loadedData,'SFBInfoStruct')
37 | makeInfo = UpdateMakeInfo(makeInfo,loadedData.SFBInfoStruct);
38 | clear loadedData;
39 | end
40 | end
41 | end
42 |
43 | function updatedMakeInfo = UpdateMakeInfo(makeInfo,SFBInfoStruct)
44 | updatedMakeInfo = {};
45 | if isfield(makeInfo,'includePath')
46 | if isfield(SFBInfoStruct,'includePath')
47 | updatedMakeInfo.includePath = {makeInfo.includePath{:} SFBInfoStruct.includePath{:}};
48 | else
49 | updatedMakeInfo.includePath = {makeInfo.includePath{:}};
50 | end
51 | end
52 | if isfield(makeInfo,'sourcePath')
53 | if isfield(SFBInfoStruct,'sourcePath')
54 | updatedMakeInfo.sourcePath = {makeInfo.sourcePath{:} SFBInfoStruct.sourcePath{:}};
55 | else
56 | updatedMakeInfo.sourcePath = {makeInfo.sourcePath{:}};
57 | end
58 | end
59 | if isfield(makeInfo,'linkLibsObjs')
60 | if isfield(SFBInfoStruct,'additionalLibraries')
61 | updatedMakeInfo.linkLibsObjs = {makeInfo.linkLibsObjs{:} SFBInfoStruct.additionalLibraries{:}};
62 | else
63 | updatedMakeInfo.linkLibsObjs = {makeInfo.linkLibsObjs{:}};
64 | end
65 | end
66 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/add_paths.m:
--------------------------------------------------------------------------------
1 | proj = simulinkproject;
2 | addpath(strcat(proj.RootFolder, '/src/platform'),...
3 | strcat(proj.RootFolder, '/src/adapter'),...
4 | strcat(proj.RootFolder, '/src/adapter/models'),...
5 | strcat(proj.RootFolder, '/src/adapter/c_src'),...
6 | strcat(proj.RootFolder, '/src/data_files'),...
7 | strcat(proj.RootFolder, '/src/utilities'),...
8 | strcat(proj.RootFolder, '/src/test'),...
9 | strcat(proj.RootFolder, '/src/project'),...
10 | strcat(proj.RootFolder, '/src'));
11 |
12 | Simulink.fileGenControl('set',...
13 | 'CacheFolder', strcat(proj.RootFolder, '/cache'), ...
14 | 'CodeGenFolder', strcat(proj.RootFolder, '/bld'), ...
15 | 'createDir', true);
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/data_files/AccelCommandMode.m:
--------------------------------------------------------------------------------
1 | classdef AccelCommandMode < Simulink.IntEnumType
2 | enumeration
3 | ACC_Disable(0)
4 | WrenchEffort(1)
5 | SpeedControl(2)
6 | end
7 | methods (Static = true)
8 | function retVal = getDescription()
9 | retVal = 'Acceration Command Modes';
10 | end
11 | function retVal = getDefaultValue()
12 | retVal = AccelCommandMode.ACC_Disable;
13 | end
14 | function retVal = addClassNameToEnumNames()
15 | retVal = true;
16 | end
17 | end
18 | end
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/data_files/accel_command_struct.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/data_files/accel_command_struct.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/data_files/dsrc_data.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/data_files/dsrc_data.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/data_files/fusion_object_struct.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/data_files/fusion_object_struct.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/data_files/light_command_struct.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/data_files/light_command_struct.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/data_files/memory_struct.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/data_files/memory_struct.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/utilities/eth_bit_decoder_sfcn.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/utilities/eth_bit_decoder_sfcn.c
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/utilities/eth_bit_decoder_sfcn.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/utilities/eth_bit_decoder_sfcn.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/utilities/eth_bit_encoder_sfcn.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/utilities/eth_bit_encoder_sfcn.c
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/utilities/eth_bit_encoder_sfcn.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/utilities/eth_bit_encoder_sfcn.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/utilities/eth_decode32_sfcn.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/utilities/eth_decode32_sfcn.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaMab/src/utilities/eth_encode32_sfcn.mexw64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaMab/src/utilities/eth_encode32_sfcn.mexw64
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/.gitignore:
--------------------------------------------------------------------------------
1 | # Object files
2 | *.o
3 | *.ko
4 | *.obj
5 | *.elf
6 |
7 | # Precompiled Headers
8 | *.gch
9 | *.pch
10 |
11 | # Libraries
12 | *.lib
13 | *.a
14 | *.la
15 | *.lo
16 |
17 | # Shared objects (inc. Windows DLLs)
18 | *.dll
19 | *.so
20 | *.so.*
21 | *.dylib
22 |
23 | # Executables
24 | *.exe
25 | *.out
26 | *.app
27 | *.i*86
28 | *.x86_64
29 | *.hex
30 |
31 | # Debug files
32 | *.dSYM/
33 |
34 | microautobox/bld
35 | microautobox/cache
36 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/arada/orig_bsm.txt:
--------------------------------------------------------------------------------
1 | 30518001028126094f010000a85c07b2e81d2e4389de1fd3ffffffffe00170807f000307d1817fff0800000000a21aa10f820101a30a83080000000000000000a20780027fff810164a308800100b203840100
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/arada/pinpoint:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/arada/pinpoint
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/arada/saxton:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/arada/saxton
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/arada/udp_client_x86:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/arada/udp_client_x86
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/data_files/memory_struct.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/data_files/memory_struct.mat
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/cfg/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/cfg/.gitignore
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/docs/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/docs/.gitignore
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/src/c/pinpoint_consumer/handlers.h:
--------------------------------------------------------------------------------
1 | /** CONFIDENTIAL - do not disclose, distribute, or alter without express permission by TORC Robotics.
2 | All use subject to express agreement only. No implied use or license.
3 |
4 | Software copyrights by TORC Robotics, LLC as of initial publish date.
5 |
6 | Unless required by applicable law or agreed in writing, use of software is on an "AS IS" BASIS,
7 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8 | */
9 |
10 | #ifndef PINPOINT_HANDLERS_H
11 | #define PINPOINT_HANDLERS_H
12 |
13 | #include "socket_includes.h"
14 | #include
15 | #include
16 |
17 | // Function Prototypes
18 | extern BOOL handle_udp_message(uint8_t* const udp_recv_buf, const SOCKET udp_socket, struct sockaddr_in const udp_server);
19 | extern BOOL handle_tcp_message(uint8_t* const tcp_recv_buf, const SOCKET tcp_socket, FILE * const global_pose_out, FILE * const local_pose_out, FILE * const velocity_out, FILE * const accel_out, const int mab_sockfd, const struct sockaddr_in remote_sockaddr);
20 | extern BOOL handle_error(const uint8_t code);
21 | extern BOOL handle_status_message(const uint8_t condition, const uint16_t code);
22 |
23 | /**
24 | * Structure to hold a pinpoint local pose message
25 | */
26 | struct PinPointLocalPose {
27 | uint64_t time; // Microseconds since 1970
28 | double north; // Northing (m)
29 | double east; // Easting (m)
30 | double down; // Downing (m)
31 | float roll; // Roll (deg)
32 | float pitch; // Pitch (deg)
33 | float yaw; // Yaw (deg)
34 | };
35 |
36 | /**
37 | * Structure to hold a pinpoint global pose message
38 | */
39 | struct PinPointGlobalPose {
40 | uint64_t time; // Microseconds since 1970
41 | double latitude; // Latitude (deg)
42 | double longitude; // Longitude (deg)
43 | double altitude; // altitude (m)
44 | float roll; // Roll (deg)
45 | float pitch; // Pitch (deg)
46 | float yaw; // Yaw (deg)
47 | };
48 |
49 | /**
50 | * Structure to hold a pinpoint velocity message
51 | */
52 | struct PinPointVelocity {
53 | uint64_t time; // Microseconds since 1970
54 | float forward_vel; // Forward (m/s)
55 | float right_vel; // Right (m/s)
56 | float down_vel; // Down (m/s)
57 | float roll_rate; // Roll (deg/s)
58 | float pitch_rate; // Pitch (deg/s)
59 | float yaw_rate; // Yaw (deg/s)
60 | };
61 |
62 | struct PinPointAcceleration {
63 | uint64_t time; // Microseconds since 1970
64 | float forward; // Forward (m/s/s)
65 | float right; // Right (m/s/s)
66 | float down; // Down (m/s/s)
67 | };
68 | #endif
69 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/src/c/pinpoint_consumer/mab_pinpoint_interface:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/src/c/pinpoint_consumer/mab_pinpoint_interface
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/src/c/pinpoint_consumer/makefile:
--------------------------------------------------------------------------------
1 | CC=gcc
2 | CFLAGS = -Wall -Wswitch-default -Wextra -Wunreachable-code -Wshadow -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wstrict-aliasing=2 -Wdouble-promotion -Wcast-align -Wwrite-strings
3 | SOURCE_FILES = main.c handlers.c pinpoint_utility_functions.c
4 | HEADER_FILES = handlers.h unpack_macros.h socket_includes.h pinpoint_utility_functions.h
5 | TARGET = mab_pinpoint_interface
6 |
7 | ifeq ($(OS),Windows_NT)
8 | TARGET := $(TARGET).exe
9 | CFLAGS += -lws2_32
10 | endif
11 |
12 | $(TARGET): makefile $(SOURCE_FILES) $(HEADER_FILES)
13 | $(CC) $(SOURCE_FILES) $(CFLAGS) -o $@
14 |
15 | clean:
16 | rm -rf $(TARGET) $(TARGET).exe
17 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/src/c/pinpoint_consumer/pinpoint_utility_functions.h:
--------------------------------------------------------------------------------
1 | /** CONFIDENTIAL - do not disclose, distribute, or alter without express permission by TORC Robotics.
2 | All use subject to express agreement only. No implied use or license.
3 |
4 | Software copyrights by TORC Robotics, LLC as of initial publish date.
5 |
6 | Unless required by applicable law or agreed in writing, use of software is on an "AS IS" BASIS,
7 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8 | */
9 |
10 | #ifndef PINPOINT_UTILITY_FUNCTIONS_H
11 | #define PINPOINT_UTILITY_FUNCTIONS_H
12 |
13 | #include "socket_includes.h"
14 | #include
15 |
16 | extern BOOL create_udp_socket(SOCKET *udp_socket, struct sockaddr_in *udp_server, uint16_t port);
17 | extern BOOL create_tcp_connection(SOCKET *tcp_socket, const char* ip_address, uint16_t port);
18 | extern char const* get_status_condition(uint8_t condition);
19 | extern uint32_t get_message_size(uint8_t size_length, SOCKET _socket);
20 | extern int cleanup(void);
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/src/c/pinpoint_consumer/socket_includes.h:
--------------------------------------------------------------------------------
1 | /** CONFIDENTIAL - do not disclose, distribute, or alter without express permission by TORC Robotics.
2 | All use subject to express agreement only. No implied use or license.
3 |
4 | Software copyrights by TORC Robotics, LLC as of initial publish date.
5 |
6 | Unless required by applicable law or agreed in writing, use of software is on an "AS IS" BASIS,
7 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8 | */
9 |
10 | #ifndef SOCKET_INCLUDES_H
11 | #define SOCKET_INCLUDES_H
12 |
13 | #if defined(_WIN32)
14 |
15 | #define WIN32_LEAN_AND_MEAN
16 |
17 | #include
18 | #include
19 |
20 | #define GET_SOCK_ERRNO WSAGetLastError()
21 | #define WOULD_BLOCK_ERROR WSAEWOULDBLOCK
22 |
23 | #if defined(_MSC_VER)
24 | // Need to link with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
25 | #pragma comment (lib, "Ws2_32.lib")
26 | #pragma comment (lib, "Mswsock.lib")
27 | #pragma comment (lib, "AdvApi32.lib")
28 | #endif
29 |
30 | #elif defined(__linux)
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include
40 | #include
41 | #include
42 |
43 | // Function for getting the error number if it calls
44 | #define GET_SOCK_ERRNO errno
45 | #define WOULD_BLOCK_ERROR EAGAIN
46 |
47 | #define SOCKET int
48 | #define BOOL int
49 | #define TRUE 1
50 | #define FALSE 0
51 |
52 | #define INVALID_SOCKET -1
53 | #define INVALID_HANDLE_VALUE NULL
54 | #define SOCKET_ERROR -1
55 |
56 | #define ioctlsocket(s, i, m) ioctl(s, i, m)
57 | #define closesocket(s) close(s)
58 |
59 | #endif
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/.gitignore:
--------------------------------------------------------------------------------
1 | logs
2 | .project
3 | .classpath
4 | .settings
5 | gradle.properties
6 | .gradle
7 | *~
8 | myClock.bin
9 | /*.tar.gz
10 |
11 | # ignore build directories
12 | build
13 | target
14 |
15 | # ignore Intellij project files and dirs
16 | *.ipr
17 | *.iws
18 | *.iml
19 | .idea
20 | /src/ruby/*
21 | !/src/ruby/*.rb
22 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/IConsumerInitializer.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i;
2 |
3 |
4 | import java.util.concurrent.Callable;
5 |
6 | public interface IConsumerInitializer extends Callable {
7 | }
8 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/V2IServer.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i;
2 |
3 | import com.leidos.v2i.config.V2IApplicationContext;
4 | import com.leidos.v2i.config.AppConfig;
5 | import com.leidos.v2i.logger.ILogger;
6 | import com.leidos.v2i.logger.LoggerManager;
7 | import com.leidos.v2i.services.V2IService;
8 |
9 | import org.joda.time.DateTime;
10 | import org.joda.time.format.DateTimeFormat;
11 | import org.joda.time.format.DateTimeFormatter;
12 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
13 | import org.springframework.boot.SpringApplication;
14 | import org.springframework.context.ConfigurableApplicationContext;
15 | import org.springframework.context.annotation.ComponentScan;
16 |
17 | import java.io.IOException;
18 |
19 | @ComponentScan
20 | @EnableAutoConfiguration
21 | public class V2IServer {
22 |
23 | public static void main(String[] args) {
24 | ConfigurableApplicationContext context = SpringApplication.run(V2IServer.class, args);
25 |
26 | // set our context for non spring managed classes
27 | V2IApplicationContext.getInstance().setApplicationContext(context);
28 | AppConfig config = V2IApplicationContext.getInstance().getAppConfig();
29 |
30 | //SimulatedDviExecutorService service = context.getBean(SimulatedDviExecutorService.class);
31 | V2IService service = context.getBean(V2IService.class);
32 | V2IApplicationContext.getInstance().setService(service);
33 |
34 | DateTime now = new DateTime();
35 | DateTimeFormatter fmt = DateTimeFormat.forPattern("YYYYMMddHHmmss");
36 | String logName = fmt.print(now);
37 |
38 | LoggerManager.setOutputFile(config.getProperty("log.path") + logName + ".log");
39 | LoggerManager.setRealTimeOutput(config.getLogRealTimeOutput());
40 | ILogger logger = LoggerManager.getLogger(V2IServer.class);
41 |
42 | logger.infof("TAG", "####### V2I server started ########");
43 | try {
44 | LoggerManager.writeToDisk();
45 | }
46 | catch(IOException ioe) {
47 | System.err.println("Error writing log to disk: " + ioe.getMessage());
48 | }
49 |
50 | service.start();
51 |
52 | }
53 | }
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/appcommon/utils/UnpackUtils.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.appcommon.utils;
2 |
3 | import java.nio.ByteBuffer;
4 | import java.nio.ByteOrder;
5 |
6 | /**
7 | * Utilities to unpack bytes to help deal with signed and unsigned data
8 | *
9 | */
10 | public class UnpackUtils {
11 |
12 | private UnpackUtils() {
13 | }
14 |
15 | private static class UnpackUtilsHolder {
16 | private static final UnpackUtils _instance = new UnpackUtils();
17 | }
18 |
19 | public static UnpackUtils getInstance()
20 | {
21 | return UnpackUtilsHolder._instance;
22 | }
23 |
24 |
25 | public int unpack8(byte theByte) {
26 | return (int) theByte;
27 | }
28 |
29 |
30 | public int unpackU8(byte theByte) {
31 | return (int) theByte & 0xFF;
32 | }
33 |
34 |
35 | public int unpack16(byte[] bytes) {
36 | if (bytes.length != 2) {
37 | return 0;
38 | }
39 |
40 | short shortValue = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getShort();
41 | return (int) shortValue;
42 | }
43 |
44 |
45 |
46 | public int unpackU16(byte[] bytes) {
47 | if (bytes.length != 2) {
48 | return 0;
49 | }
50 |
51 | short shortValue = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getShort();
52 | int intValue = (int) shortValue & 0xFFFF;
53 |
54 | return intValue;
55 | }
56 |
57 |
58 | public int unpack24(byte[] bytes) {
59 | if (bytes.length != 3) {
60 | return 0;
61 | }
62 |
63 | // Shift each byte to its proper position and OR it into the integer.
64 | int value = ((int)bytes[2]) << 16;
65 | value |= ((int)bytes[1]) << 8;
66 | value |= bytes[0];
67 |
68 | return value;
69 | }
70 |
71 |
72 |
73 | public int unpack32(byte[] bytes) {
74 |
75 | if (bytes.length != 4) {
76 | return 0;
77 | }
78 |
79 | int intValue = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getInt();
80 |
81 | return intValue;
82 | }
83 |
84 |
85 |
86 | public long unpackU32(byte[] bytes) {
87 |
88 | if (bytes.length != 4) {
89 | return 0;
90 | }
91 |
92 | int intValue = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getInt();
93 |
94 | return (long) intValue & 0xFFFFFFFFL;
95 | }
96 |
97 | public long unpackU32BigEndian(byte[] bytes) {
98 |
99 | if (bytes.length != 4) {
100 | return 0;
101 | }
102 |
103 | int intValue = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN).getInt();
104 |
105 | return (long) intValue & 0xFFFFFFFFL;
106 | }
107 |
108 |
109 | }
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/appcommon/version/VehicleApplicationVersion.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.appcommon.version;
2 |
3 | public class VehicleApplicationVersion {
4 |
5 | private static final String ID = "v2iServer 1.3-RC1";
6 |
7 | public String getFullId() {
8 | return ID;
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/config/AppConfig.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.context.annotation.PropertySource;
5 | import org.springframework.core.env.Environment;
6 |
7 | import javax.inject.Inject;
8 | import java.util.Map;
9 |
10 | /**
11 | * AppConfig using v2i.properties instead of application.properties
12 | *
13 | * Provide a mechanism for external configuration via a v2i.properties outside the jar in the current directory.
14 | *
15 | * Using a v2i.properties file in the same directory as the jar overrides the default properties set inside the jar.
16 | */
17 | @Configuration
18 | @PropertySource( value = { "classpath:/v2i.properties", "file:v2i.properties" }, ignoreResourceNotFound = true )
19 | public class AppConfig {
20 | @Inject
21 | Environment env;
22 |
23 | Map properties;
24 |
25 | public int getIntValue(String property) {
26 | String value = env.getProperty(property);
27 | return Integer.parseInt(value);
28 | }
29 |
30 | public String getProperty(String name) {
31 | return env.getProperty(name);
32 | }
33 |
34 | /**
35 | * Returns provided default value if property is not in properties file
36 | *
37 | * @param property
38 | * @param defaultValue
39 | * @return int
40 | */
41 | public int getDefaultIntValue(String property, int defaultValue) {
42 | String value = env.getProperty(property);
43 | if (value == null) {
44 | return defaultValue;
45 | }
46 |
47 | int result = 0;
48 | try {
49 | result = Integer.parseInt(value);
50 | }
51 | catch(Exception e) {}
52 |
53 | return result;
54 | }
55 |
56 |
57 | public int getPeriodicDelay() {
58 | return getIntValue("periodicDelay");
59 | }
60 |
61 | public int getUiRefresh() {
62 | return getIntValue("uiRefresh");
63 | }
64 |
65 | public String getGpsHost() {
66 | return env.getProperty("gps.host");
67 | }
68 |
69 | public int getGpsPort() {
70 | return getIntValue("gps.port");
71 | }
72 |
73 | public int getGpsUdpPort() {
74 | return getIntValue("gps.udpport");
75 | }
76 |
77 | public boolean getLogRealTimeOutput() { return getBooleanValue("log.stdout"); }
78 |
79 |
80 | public boolean getBooleanValue(String property) {
81 | boolean bValue = false;
82 |
83 | String value = getProperty(property);
84 | if (value == null || value.isEmpty()) {
85 | bValue = false;
86 | }
87 | else {
88 | bValue = Boolean.parseBoolean(value);
89 | }
90 |
91 | return bValue;
92 | }
93 |
94 | @Override
95 | public String toString() {
96 | return "AppConfig [ gps.host:" + getGpsHost() +
97 | " gps.port:" + getGpsPort() +
98 | " periodicDelay:" + getPeriodicDelay() +
99 | " ]";
100 | }
101 | }
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/config/V2IApplicationContext.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.config;
2 |
3 | import com.leidos.v2i.services.V2IService;
4 | import org.springframework.beans.BeansException;
5 | import org.springframework.context.ApplicationContext;
6 | import org.springframework.context.ApplicationContextAware;
7 |
8 | /**
9 | * Wrapper to always return a reference to the Spring Application Context from
10 | * within non-Spring enabled beans. Unlike Spring MVC's WebApplicationContextUtils
11 | * we do not need a reference to the Servlet context for this. All we need is
12 | * for this bean to be initialized during application startup.
13 | */
14 | public class V2IApplicationContext implements ApplicationContextAware {
15 |
16 | private static ApplicationContext CONTEXT;
17 | V2IService service;
18 |
19 | private V2IApplicationContext() {
20 | }
21 |
22 | private static class V2IApplicationContextHolder {
23 | private static final V2IApplicationContext _instance = new V2IApplicationContext();
24 | }
25 |
26 | public static V2IApplicationContext getInstance()
27 | {
28 | return V2IApplicationContextHolder._instance;
29 | }
30 |
31 |
32 | /**
33 | * This method is called from within the SpeedControl once it is
34 | * done starting up, it will stick a reference to the app context into this bean.
35 | * @param context a reference to the ApplicationContext.
36 | */
37 | public void setApplicationContext(ApplicationContext context) throws BeansException {
38 | CONTEXT = context;
39 | }
40 |
41 | /**
42 | * get the ApplicationContext
43 | *
44 | * @return
45 | */
46 | public ApplicationContext getApplicationContext() {
47 | return CONTEXT;
48 | }
49 |
50 | /**
51 | * Provide access to spring beans through non-spring managed classes
52 | *
53 | * @param tClass
54 | * @param
55 | * @return
56 | * @throws org.springframework.beans.BeansException
57 | */
58 | public T getBean(Class tClass) throws BeansException {
59 | return CONTEXT.getBean(tClass);
60 | }
61 |
62 | /**
63 | * Directly acquire AppConfig
64 | *
65 | * @return
66 | */
67 | public AppConfig getAppConfig() {
68 | return getBean(AppConfig.class);
69 | }
70 |
71 | public void setService(V2IService service) {
72 | this.service = service;
73 | }
74 |
75 | public V2IService getService() {
76 | return service;
77 | }
78 | }
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/config/WebSocketConfig.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.messaging.simp.config.MessageBrokerRegistry;
5 | import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
6 | import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
7 | import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
8 |
9 | @Configuration
10 | @EnableWebSocketMessageBroker
11 | public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
12 |
13 | @Override
14 | public void configureMessageBroker(MessageBrokerRegistry config) {
15 | config.enableSimpleBroker("/topic");
16 | config.setApplicationDestinationPrefixes("/app");
17 | }
18 |
19 | @Override
20 | public void registerStompEndpoints(StompEndpointRegistry registry) {
21 | registry.addEndpoint("/dvi").withSockJS();
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/consumers/gps/GpsScheduleMessage.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.consumers.gps;
2 |
3 | // See docs 8.2.6 scheduleMessage
4 |
5 | import java.util.Arrays;
6 |
7 | /**
8 | * GpsScheduleMessage
9 | *
10 | * A request to have the pinpoint provide output for the various method calls on a scheduled basis.
11 | *
12 | */
13 | public class GpsScheduleMessage {
14 |
15 | public static final byte ID_GET_GLOBAL_POSE = 0x07;
16 | public static final byte ID_GET_FILTER_ACCURACY = 0x06;
17 | public static final byte ID_GET_LOCAL_POSE = 0x09;
18 | public static final byte ID_GET_VELOCITY_STATE = 0x0B;
19 | public static final byte ID_GET_BODY_ACCELERATION = 0x12;
20 |
21 | // the list of messages/method ids to send with a scheduleMessage
22 | // we are using this value for both methodId and scheduleId
23 | public static final byte[] messages = { ID_GET_FILTER_ACCURACY, ID_GET_GLOBAL_POSE, ID_GET_LOCAL_POSE,
24 | ID_GET_VELOCITY_STATE, ID_GET_BODY_ACCELERATION };
25 |
26 | private static final int INDEX_SCHEDULE_ID = 3;
27 | private static final int INDEX_METHOD_ID = 12;
28 | private static final int INDEX_MS = 4;
29 | private static final int INDEX_OFFSET = 8;
30 |
31 | // client packet sent to server to request global pose, used as template to modify method id. We will use
32 | // this same value for schedule id to ensure unique
33 | private final static byte[] GPS_SCHEDULE_MESSAGE = {
34 | (byte) 0x91, // invoke protocol message with return, one-bye size field
35 | 0x03, // schedule message message id
36 | 0x0F, // payload length - 15 bytes
37 | 0x01, // giving it a schedule id
38 | (byte) 0x32, // 50 ms
39 | 0x00,
40 | 0x00,
41 | 0x00,
42 | 0x00, // schedule offset, none???
43 | 0x00,
44 | 0x00,
45 | 0x00,
46 | 0x07, // getGlobalPose method ID
47 | 0x00, // method parameter size, none????
48 | 0x00,
49 | 0x00,
50 | 0x00,
51 | 0x01 // get data as TCP, 0 = UDP
52 | // parameters, if they exist
53 | };
54 |
55 | private byte[] message;
56 |
57 | GpsScheduleMessage(byte methodId, byte ms, byte offset) {
58 | this.message = Arrays.copyOf(GPS_SCHEDULE_MESSAGE, GPS_SCHEDULE_MESSAGE.length);
59 | message[INDEX_METHOD_ID] = methodId;
60 | message[INDEX_SCHEDULE_ID] = methodId;
61 | message[INDEX_MS] = ms;
62 | message[INDEX_OFFSET] = offset;
63 | }
64 |
65 | public int getMethodId() {
66 | return (int) message[INDEX_METHOD_ID];
67 | }
68 |
69 | public byte[] getBytes() {
70 | return message;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/logger/LogEntry.java:
--------------------------------------------------------------------------------
1 | package com.leidos.v2i.logger;
2 |
3 | import org.joda.time.DateTime;
4 | import org.joda.time.format.DateTimeFormat;
5 | import org.joda.time.format.DateTimeFormatter;
6 |
7 | /**
8 | * Created by rushk1 on 10/9/2014.
9 | */
10 | public class LogEntry {
11 | public static enum Level {
12 | DATA,
13 | ERROR,
14 | WARN,
15 | INFO,
16 | DEBUG
17 | }
18 |
19 | public Level getLevel() {
20 | return level;
21 | }
22 |
23 | public String getTag() {
24 | return tag;
25 | }
26 |
27 | public String getMessage() {
28 | return message;
29 | }
30 |
31 | public Long getTimestamp() {
32 | return timestamp;
33 | }
34 |
35 | public Object getContents() {
36 | return contents;
37 | }
38 |
39 | public Class