├── 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 | 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 | 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 | 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 | 6 | 7 | -------------------------------------------------------------------------------- /CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/add_paths.m.type.File.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/carma_platform.mdl.type.File.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/data_files.type.File.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 6 | 7 | -------------------------------------------------------------------------------- /CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/platform.type.File.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 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 | 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 | 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 | 6 | 7 | -------------------------------------------------------------------------------- /CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/project.type.File.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 6 | 7 | -------------------------------------------------------------------------------- /CACC-CARMA/CACC/.SimulinkProject/Root.type.Files/src.type.File/utilities.type.File.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 getOrigin() { 40 | return origin; 41 | } 42 | 43 | public String getNotes() { 44 | return notes; 45 | } 46 | 47 | private Level level; 48 | 49 | public LogEntry(Level level, String tag, String message, Long timestamp, Object contents, Class origin) { 50 | this.level = level; 51 | this.tag = tag; 52 | this.message = message; 53 | this.timestamp = timestamp; 54 | this.contents = contents; 55 | this.origin = origin; 56 | } 57 | 58 | private String tag, message; 59 | private Long timestamp; 60 | private Object contents; 61 | private Class origin; 62 | protected String notes; 63 | 64 | 65 | @Override 66 | /** 67 | * This method is not only to be used for debugging and console output purposes, but also controls the output format 68 | * of the log message when written to file. This behavior may change in the future if necessary. 69 | */ 70 | public String toString() { 71 | DateTime dt = new DateTime(timestamp); 72 | DateTimeFormatter fmt = DateTimeFormat.forPattern("HH:mm:ss.SSS"); 73 | return fmt.print(dt) + "\t" + padAndTruncate(level.toString(), 6) + "\t" + 74 | padAndTruncate(origin.getSimpleName(), 25) + "\t" + 75 | padAndTruncate(tag, 6) + "\t" + message; 76 | } 77 | 78 | /** 79 | * Formats a string to a fixed length, padding it with spaces if it's too short or truncating it with ... if it's 80 | * too long. 81 | * @param in The string to be processed 82 | * @param length The fixed length the input string must adhere to 83 | * @return The processed string trucated or padded as needed 84 | */ 85 | private String padAndTruncate(String in, int length) { 86 | if (in.length() < length) { 87 | // Right-pad the string to meet the length requirement 88 | return String.format("%1$-" + length + "s", in); 89 | } else if (in.length() > length) { 90 | return in.substring(0, length - 3) + "..."; 91 | } else { 92 | return in; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/logger/LogListener.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.logger; 2 | 3 | /** 4 | * Created by rushk1 on 10/9/2014. 5 | */ 6 | public interface LogListener { 7 | /** 8 | * Takes in a {@link com.leidos.v2i.logger.LogEntry} that has been flagged as relevant by LogListener#checkEntry. 9 | * @param in The relevant LogEntry 10 | */ 11 | public void newLogEntryCallback(LogEntry in); 12 | } 13 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/rest/V2IParameterController.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.rest; 2 | 3 | import com.leidos.v2i.config.AppConfig; 4 | import com.leidos.v2i.logger.ILogger; 5 | import com.leidos.v2i.logger.LoggerManager; 6 | import com.leidos.v2i.rest.response.AjaxResponse; 7 | import com.leidos.v2i.rest.response.ParametersResponse; 8 | import com.leidos.v2i.state.V2IParameters; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | 15 | @RestController 16 | public class V2IParameterController { 17 | 18 | @Autowired 19 | AppConfig appConfig; 20 | 21 | private static ILogger logger = LoggerManager.getLogger(V2IParameterController.class); 22 | 23 | @RequestMapping("/setParameters") 24 | public AjaxResponse setParameters(@RequestParam(value="caccIntent", required=true) boolean caccIntent) { 25 | 26 | boolean result = true; 27 | 28 | String statusMessage = "Setting caccIntent: " + caccIntent; 29 | logger.info("REST", statusMessage); 30 | 31 | V2IParameters parameters = V2IParameters.getInstance(); 32 | 33 | try { 34 | parameters.setCaccIntent(caccIntent); 35 | } 36 | catch(Exception e) { 37 | result = false; 38 | statusMessage = "Error setting V2I Parameters: " + e.getMessage(); 39 | } 40 | 41 | return new AjaxResponse(result, statusMessage); 42 | 43 | } 44 | 45 | 46 | @RequestMapping("/getParameters") 47 | public AjaxResponse getParameters() { 48 | 49 | boolean result = true; 50 | boolean caccIntent = false; 51 | 52 | V2IParameters parameters = V2IParameters.getInstance(); 53 | 54 | caccIntent = parameters.getCaccIntent(); 55 | String statusMessage = "Getting caccIntent: " + caccIntent; 56 | logger.info("REST", statusMessage); 57 | 58 | return new ParametersResponse(result, statusMessage, caccIntent); 59 | 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/rest/response/AjaxResponse.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.rest.response; 2 | 3 | 4 | public class AjaxResponse { 5 | 6 | private boolean result; 7 | private String serverMessage; 8 | 9 | public AjaxResponse(boolean result, String serverMessage) { 10 | this.result = result; 11 | this.serverMessage = serverMessage; 12 | } 13 | 14 | public boolean getResult() { return result; } 15 | 16 | public String getServerMessage() { return serverMessage; } 17 | } 18 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/rest/response/ParametersResponse.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.rest.response; 2 | 3 | public class ParametersResponse extends AjaxResponse { 4 | 5 | private boolean caccIntent; 6 | 7 | public ParametersResponse(boolean result, String serverMessage, boolean caccIntent) { 8 | super(result, serverMessage); 9 | this.caccIntent = caccIntent; 10 | } 11 | 12 | public boolean getCaccIntent() { 13 | return caccIntent; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/state/AppState.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.state; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: ferenced 6 | * Date: 8/16/15 7 | * Time: 11:57 AM 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | public enum AppState { 11 | // EMAIL: There is actually a 5-state enumeration “flag” that indicates which state the vehicle is in: manual, factory ACC, PATH CC, PATH ACC, PATH CACC. 12 | MANUAL, 13 | FACTORY_ACC, 14 | PATH_CC, 15 | PATH_ACC, 16 | PATH_CACC; 17 | 18 | public byte[] getAsByteArray() { 19 | byte[] result = new byte[1]; 20 | result[0] = (byte) this.ordinal(); 21 | return result; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/state/V2IParameters.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.state; 2 | 3 | import com.leidos.v2i.config.V2IApplicationContext; 4 | import com.leidos.v2i.services.V2IService; 5 | import org.joda.time.DateTime; 6 | import org.joda.time.format.DateTimeFormat; 7 | import org.joda.time.format.DateTimeFormatter; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | public class V2IParameters { 12 | private static Logger logger = LoggerFactory.getLogger(V2IParameters.class); 13 | 14 | /** 15 | * caccState indicates what state we are in based on BSM from MAB 16 | */ 17 | private AppState caccState = AppState.MANUAL; 18 | 19 | /** 20 | * caccIntent indicates whether the user DESIRED to enter CACC state. Simply a user toggle flag that does not 21 | * mandate specific AppState, that is to be determined by PATH 22 | */ 23 | private boolean caccIntent = false; 24 | private double gap = 1.6; 25 | private double minGap = 0.6; 26 | 27 | private static final byte[] CACC_ON = { 0x01 }; 28 | private static final byte[] CACC_OFF = { 0x00 }; 29 | 30 | private V2IService v2iService; 31 | 32 | private V2IParameters() { 33 | } 34 | 35 | private static class V2IParametersHolder { 36 | private static final V2IParameters _instance = new V2IParameters(); 37 | } 38 | 39 | public static V2IParameters getInstance() 40 | { 41 | return V2IParametersHolder._instance; 42 | } 43 | 44 | public AppState getCaccState() { 45 | return caccState; 46 | } 47 | 48 | public void setCaccState(AppState state) { 49 | this.caccState = state; 50 | } 51 | 52 | public boolean getCaccIntent() { 53 | return caccIntent; 54 | } 55 | 56 | public void setCaccIntent(boolean flag) { 57 | this.caccIntent = flag; 58 | if (v2iService != null) { 59 | v2iService.sendCommandToMab(getCaccIntentAsArray()); 60 | } 61 | } 62 | 63 | public double getGap() { 64 | return gap; 65 | } 66 | 67 | /** 68 | * We are sending 0x01 ON or 0x00 OFF to MAB to indicate user INTENT for CACC state 69 | * 70 | * @return 71 | */ 72 | public byte[] getCaccIntentAsArray() { 73 | if (getCaccIntent()) { 74 | return CACC_ON; 75 | } 76 | 77 | return CACC_OFF; 78 | } 79 | 80 | public void setGap(double gap) { 81 | this.gap = gap; 82 | } 83 | 84 | public int getCaccStateOrdinal() { 85 | return caccState.ordinal(); 86 | } 87 | 88 | public byte[] getCaccStateAsArray() { 89 | return caccState.getAsByteArray(); 90 | } 91 | 92 | public void setService(V2IService service) { 93 | this.v2iService = service; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/java/com/leidos/v2i/ui/UiMessage.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.ui; 2 | 3 | import com.leidos.v2i.logger.ILogger; 4 | import com.leidos.v2i.logger.LoggerManager; 5 | 6 | /** 7 | * Created with IntelliJ IDEA. 8 | * User: ferenced 9 | * Date: 8/18/15 10 | * Time: 12:01 AM 11 | * 12 | * This class represents a UI message sent to the client via WebSockets. It is converted to JSON. 13 | * 14 | */ 15 | public class UiMessage { 16 | 17 | private static ILogger logger = LoggerManager.getLogger(UiMessage.class); 18 | 19 | private int caccState; 20 | private int brakeIndicator; 21 | 22 | /** 23 | * 24 | * @param caccState enum ordinal of AppState 25 | * @param brakeIndicator > 0, make noise 26 | */ 27 | public UiMessage(int caccState, int brakeIndicator) { 28 | this.caccState = caccState; 29 | this.brakeIndicator = brakeIndicator; 30 | } 31 | 32 | public int getCaccState() { 33 | return caccState; 34 | } 35 | 36 | public int getBrakeIndicator() { 37 | return brakeIndicator; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "UIMessage [ caccState=" + caccState + 43 | ", brakeIndicator=" + brakeIndicator + 44 | " ]"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/Brake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/Brake.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/BrakeBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/BrakeBackground.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/ButtonOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/ButtonOff.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/ButtonOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/ButtonOn.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/FactoryAccState.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/FactoryAccState.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/ManualState.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/ManualState.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/PathACCState.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/PathACCState.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/PathCACCState.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/PathCACCState.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/PathCCState.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/PathCCState.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/cacc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/images/cacc.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vehicle to Infrastructure Server 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 |
39 | 40 | 41 | 44 | 45 |
46 | 47 | 48 | 49 |

Request CACC state:

50 | 51 | 52 | 53 | 54 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/js/audio-fix.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with IntelliJ IDEA. 3 | * User: ferenced 4 | * Date: 8/20/15 5 | * Time: 2:35 PM 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | // also, see load at bottom of v2i.js 10 | 11 | function mediaPlaybackRequiresUserGesture() { 12 | // test if play() is ignored when not called from an input event handler 13 | var video = document.createElement('video'); 14 | video.play(); 15 | return video.paused; 16 | } 17 | 18 | function removeBehaviorsRestrictions() { 19 | for (var i = 0; i < audioElements.length; i++) { 20 | audioElements[i].load(); 21 | } 22 | 23 | window.removeEventListener('keydown', removeBehaviorsRestrictions); 24 | window.removeEventListener('mousedown', removeBehaviorsRestrictions); 25 | window.removeEventListener('touchstart', removeBehaviorsRestrictions); 26 | } 27 | 28 | function playSound(sound) { 29 | for (var key in sounds) { 30 | sounds[key].pause(); 31 | } 32 | 33 | sounds[sound].load(); 34 | sounds[sound].play(); 35 | } 36 | 37 | //module.exports = { 38 | // playSound: playSound 39 | //}; 40 | 41 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/js/connect.js: -------------------------------------------------------------------------------- 1 | 2 | var stompClient = null; 3 | var bConnected = false; 4 | 5 | function setConnected(connected) { 6 | bConnected = connected; 7 | } 8 | 9 | 10 | function connect() { 11 | var socket = new SockJS('/dvi'); 12 | stompClient = Stomp.over(socket); 13 | stompClient.connect({}, function(frame) { 14 | setConnected(true); 15 | console.log('Connected: ' + frame); 16 | stompClient.subscribe('/topic/dvitopic', function(uiMessageResponse){ 17 | var uiMessageObject = JSON.parse(uiMessageResponse.body); 18 | displayUiMessage(uiMessageObject); 19 | }); 20 | }); 21 | 22 | } 23 | 24 | function disconnect() { 25 | stompClient.disconnect(); 26 | setConnected(false); 27 | console.log("Disconnected"); 28 | 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/js/v2iAjax.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with IntelliJ IDEA. 3 | * User: ferenced 4 | * Date: 8/4/15 5 | * Time: 6:50 PM 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | 10 | function _V2IAjax() {} 11 | 12 | var V2IAjax = new _V2IAjax(); 13 | 14 | _V2IAjax.prototype.caccIntent=false; 15 | _V2IAjax.prototype.caccState = 0; 16 | _V2IAjax.prototype.gap = .6; 17 | 18 | /** 19 | * setParameters ajax 20 | */ 21 | _V2IAjax.prototype.ajaxSetParameters = function () { 22 | "use strict"; 23 | 24 | //var operatingSpeed = $( "#operatingSpeedId" ).val(); 25 | var caccIntent = !_V2IAjax.prototype.caccIntent; 26 | var gap = _V2IAjax.prototype.gap 27 | 28 | var request = $.ajax({ 29 | url : "setParameters", 30 | dataType : "json", 31 | type : "post", 32 | data : { 33 | caccIntent : caccIntent 34 | } 35 | }); 36 | 37 | 38 | request.done(function(response, textStatus, jqXHR) { 39 | if ( response.result ) { 40 | //setDviStatusMessage(response.serverMessage); 41 | _V2IAjax.prototype.caccIntent = caccIntent; 42 | setOnOffButton(_V2IAjax.prototype.caccIntent); 43 | } 44 | 45 | }); 46 | 47 | request.fail(function(jqXHR, textStatus, errorThrown) { 48 | var prefix = "An error occurred setting v2i parameters: "; 49 | var statusMessage = prefix.concat(textStatus); 50 | alert(statusMessage); 51 | }); 52 | 53 | 54 | } 55 | 56 | /** 57 | * getParameters ajax 58 | */ 59 | _V2IAjax.prototype.ajaxGetParameters = function () { 60 | "use strict"; 61 | 62 | var request = $.ajax({ 63 | url : "getParameters", 64 | dataType : "json", 65 | type : "post", 66 | data : { 67 | } 68 | }); 69 | 70 | 71 | request.done(function(response, textStatus, jqXHR) { 72 | if ( response.result ) { 73 | setOnOffButton(response.caccIntent); 74 | _V2IAjax.prototype.caccIntent = response.caccIntent; 75 | //setDviStatusMessage(response.serverMessage); 76 | } 77 | 78 | }); 79 | 80 | request.fail(function(jqXHR, textStatus, errorThrown) { 81 | var prefix = "An error occurred setting v2i parameters: "; 82 | var statusMessage = prefix.concat(textStatus); 83 | alert(statusMessage); 84 | }); 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/animated-overlay.gif -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/css/ui-lightness/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/opensource/jquery/flot/css/flot-examples.css: -------------------------------------------------------------------------------- 1 | * { padding: 0; margin: 0; vertical-align: top; } 2 | 3 | body { 4 | /*background: url(background.png) repeat-x;*/ 5 | font: 18px/1.5em "proxima-nova", Helvetica, Arial, sans-serif; 6 | } 7 | 8 | a { color: #069; } 9 | a:hover { color: #28b; } 10 | 11 | h2 { 12 | margin-top: 15px; 13 | font: normal 32px "omnes-pro", Helvetica, Arial, sans-serif; 14 | } 15 | 16 | h3 { 17 | margin-left: 30px; 18 | font: normal 26px "omnes-pro", Helvetica, Arial, sans-serif; 19 | color: #666; 20 | } 21 | 22 | p { 23 | margin-top: 10px; 24 | } 25 | 26 | button { 27 | font-size: 18px; 28 | padding: 1px 7px; 29 | } 30 | 31 | input { 32 | font-size: 18px; 33 | } 34 | 35 | input[type=checkbox] { 36 | margin: 7px; 37 | } 38 | 39 | #header { 40 | position: relative; 41 | width: 900px; 42 | margin: auto; 43 | } 44 | 45 | #header h2 { 46 | margin-left: 10px; 47 | vertical-align: middle; 48 | font-size: 42px; 49 | font-weight: bold; 50 | text-decoration: none; 51 | color: #000; 52 | } 53 | 54 | #content { 55 | width: 880px; 56 | margin: 0 auto; 57 | padding: 10px; 58 | } 59 | 60 | #footer { 61 | margin-top: 25px; 62 | margin-bottom: 10px; 63 | text-align: center; 64 | font-size: 12px; 65 | color: #999; 66 | } 67 | 68 | .demo-container { 69 | box-sizing: border-box; 70 | width: 850px; 71 | height: 450px; 72 | padding: 20px 15px 15px 15px; 73 | margin: 15px auto 30px auto; 74 | border: 1px solid #ddd; 75 | background: #fff; 76 | background: linear-gradient(#f6f6f6 0, #fff 50px); 77 | background: -o-linear-gradient(#f6f6f6 0, #fff 50px); 78 | background: -ms-linear-gradient(#f6f6f6 0, #fff 50px); 79 | background: -moz-linear-gradient(#f6f6f6 0, #fff 50px); 80 | background: -webkit-linear-gradient(#f6f6f6 0, #fff 50px); 81 | box-shadow: 0 3px 10px rgba(0,0,0,0.15); 82 | -o-box-shadow: 0 3px 10px rgba(0,0,0,0.1); 83 | -ms-box-shadow: 0 3px 10px rgba(0,0,0,0.1); 84 | -moz-box-shadow: 0 3px 10px rgba(0,0,0,0.1); 85 | -webkit-box-shadow: 0 3px 10px rgba(0,0,0,0.1); 86 | } 87 | 88 | .demo-placeholder { 89 | width: 100%; 90 | height: 100%; 91 | font-size: 14px; 92 | line-height: 1.2em; 93 | } 94 | 95 | .legend table { 96 | border-spacing: 5px; 97 | } -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/sounds/warning.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/static/sounds/warning.wav -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/templates/driverView.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Glidepath - Driver View 5 | 6 | 7 | 8 | HELLO WORLD 9 | 10 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/main/resources/v2i.properties: -------------------------------------------------------------------------------- 1 | #----- 2 | #----- MISC 3 | #----- 4 | udp.timeout=10 5 | 6 | #----- 7 | #----- MAB 8 | #----- 9 | mab.host=192.168.88.21 10 | # test vm 11 | #mab.host=192.168.56.101 12 | mab.gps.port=5000 13 | mab.dsrc.inport=5001 14 | mab.dsrc.outport=5001 15 | mab.command.port=5002 16 | mab.status.port=8534 17 | 18 | #----- 19 | #----- Pinpoint 20 | #----- 21 | # turner lab caddy LOCAL 22 | gps.host=192.168.88.29 23 | 24 | # REMOTE turner lab glidepath 166.143.153.184 REMOTE 25 | #gps.host=166.143.153.184 26 | 27 | # turner lab caddy 192.168.88.29 28 | 29 | gps.port=9501 30 | gps.udpport=8123 31 | 32 | # GPS method frequency in ms, used with pinpoint scheduleMessage calls 33 | gps.frequency=50 34 | 35 | #----- 36 | #----- ASD 37 | #----- 38 | asd.host=192.168.88.40 39 | # test vm 40 | #asd.host=192.168.56.101 41 | asd.inport=8522 42 | asd.outport=8523 43 | asd.maxpacketsize=1472 44 | 45 | #----- 46 | #----- UI 47 | #----- 48 | 49 | # duration, min frequency in ms between UI messages 50 | ui.duration=500 51 | 52 | 53 | #----- 54 | #----- Logger 55 | #----- 56 | # path to log file - we are generating a date filename appended to path 57 | log.path=/opt/v2i/logs/ 58 | # set min log level ERROR, WARN, INFO, DEBUG 59 | log.level=DEBUG 60 | log.stdout=true 61 | 62 | #----- 63 | #----- DEBUG 64 | #----- 65 | # setting any of these to 0 will not start that component 66 | dsrc.enable=1 67 | gps.enable=1 68 | command.enable=1 -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/src/test/java/com/leidos/v2i/state/AppStateTester.java: -------------------------------------------------------------------------------- 1 | package com.leidos.v2i.state; 2 | 3 | import com.google.common.primitives.Bytes; 4 | import com.leidos.v2i.logger.ILogger; 5 | import org.junit.Before; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | 9 | import java.nio.ByteBuffer; 10 | import java.util.Arrays; 11 | 12 | import static org.junit.Assert.*; 13 | 14 | /** 15 | * Created with IntelliJ IDEA. 16 | * User: ferenced 17 | * Date: 8/16/15 18 | * Time: 1:53 PM 19 | */ 20 | public class AppStateTester { 21 | 22 | //@Test 23 | public void testState() { 24 | 25 | byte[] validateArray = { 0x04 }; 26 | 27 | AppState state = AppState.PATH_CACC; 28 | 29 | byte[] arrayState = state.getAsByteArray(); 30 | assertFalse(arrayState == validateArray ); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/linux_host/v2iServer/testdata/gpsSaxton.csv: -------------------------------------------------------------------------------- 1 | 38.957198, -77.145701 2 | 38.957169, -77.145942 3 | 38.956973, -77.146195 4 | 38.956743, -77.146280 5 | 38.956606, -77.146334 6 | 38.956460, -77.146398 7 | 38.956343, -77.146436 8 | 38.956155, -77.146500 9 | 38.956051, -77.146538 10 | 38.955821, -77.146624 11 | 38.955663, -77.146677 12 | 38.955458, -77.146763 13 | 38.955292, -77.146828 14 | 38.955146, -77.146983 15 | 38.955083, -77.147230 16 | 38.955050, -77.147514 17 | 38.955000, -77.147707 18 | 38.954966, -77.148072 19 | 38.954941, -77.148324 20 | 38.954924, -77.148560 21 | 38.954895, -77.148807 22 | 38.954895, -77.149091 23 | 38.954962, -77.149327 24 | 38.955058, -77.149606 25 | 38.955146, -77.149848 -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/LICENSE: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that 2 | the following conditions are met: 3 | 4 | Redistributions of source code must retain the above copyright notice, this list of conditions and the 5 | following disclaimer. 6 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 7 | following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 10 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 11 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 12 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 13 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 14 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 15 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 16 | DAMAGE. 17 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/README.md: -------------------------------------------------------------------------------- 1 | Software taken from git (https://github.com/ebroecker/canmatrix),and modified on 7/24/2015 by Scott at TORC 2 | 3 | This piece of Software mainly helps to interprete several kinds of description formats for can-communication. 4 | Some of these formats can be written also. There is some german Documentation at http://eduard-broecker.de/Software/canmatrix.html 5 | 6 | As a sideeffect, this software helps to convert between can-matrix-description formats. 7 | 8 | Therefor this software includes a "Python Can Matrix Object" which describes the Can-Communication (Boardunits, Frames, Signals, Values, ...) 9 | 10 | There are some import- and some export-functions for this object. 11 | 12 | Import-File-Formats: 13 | .dbc (candb / Vector) 14 | .dbf (Busmaster) 15 | .kcd (kayak) 16 | .arxml (autosar) 17 | .xls (xls-import is missing byteorder-information in usual .xls-can-matrixes, works with .xls-file generated by canmatrix-converter) 18 | .sym (PEAK format - added by Scott at TORC) 19 | 20 | Export-File-Formats: 21 | .dbc 22 | .dbf 23 | .kcd 24 | .xls 25 | .json 26 | .arxml (very basic implementation) 27 | 28 | Thus Currently partly working (x = validated): 29 | * convert .dbc -> .kcd x 30 | * convert .dbc -> .dbf x 31 | * convert .dbc -> .xls x 32 | * convert .dbc -> .json x 33 | * convert .dbf -> .kcd 34 | * convert .dbf -> .dbf 35 | * convert .dbf -> .kcd 36 | * convert .dbf -> .xls 37 | * convert .kcd -> .kcd 38 | * convert .kcd -> .dbf 39 | * convert .kcd -> .dbc 40 | * convert .kcd -> .xls 41 | * convert .arxml -> .dbc x 42 | * convert .arxml -> .dbf 43 | * convert .arxml -> .kcd 44 | * convert .arxml -> .xls x 45 | * convert .xls(x) -> .kcd 46 | * convert .xls(x) -> .dbf 47 | * convert .xls(x) -> .dbc 48 | * convert .xls(x) -> .xls 49 | * convert .sym(x) -> .dbc (tested a little bit) 50 | 51 | 52 | 53 | * generate Busmaster Simulation out of .dbf/.dbc/.arxml 54 | 55 | 56 | DISCLAIMER: 57 | This is 'couchware', this software is coded on the couch while watching TV. 58 | Thus, the quality is very bad! 59 | DON'T USE IT FOR ANY SERIOUS WORK ON CARS! 60 | 61 | 62 | Formatspecific: 63 | * generate Busmaster Simulation out of .kcd will never work, because default-framedata missing 64 | 65 | 66 | For a Windows you need python and lxml library for python. 67 | I use "active python" and installed lxml-package from active 68 | lxml is nedded for .arxml and .kcd support 69 | 70 | after download and with python in your path, you should be able to use: 71 | 72 | ./convert.py some-matrix.dbc some-matrix.dbf 73 | 74 | ./convert.py some-matrix.arxml some-matrix.dbc 75 | 76 | ... 77 | 78 | 79 | Have Fun, 80 | feel free to contact me for any suggestions 81 | Eduard 82 | 83 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/TODO.md: -------------------------------------------------------------------------------- 1 | 2 | library/canmatrix.py 3 | : Definitions should be imported with disassembling not as complete string 4 | 5 | library/exportarxml.py 6 | Well, ..., this is the first attempt to export a arxml-file; I did this without reading any spec; 7 | recievers of signals are missing 8 | : insert Speed - if possible 9 | : TRANSFER-PROPERTY: PENDING??? 10 | : TRANSFER-PROPERTY: PENDING??? 11 | 12 | library/importarxml.py 13 | Well, ..., this is the first attempt to import a arxml-file; I did this without reading any spec; 14 | : use diagAddress for frame-classification 15 | : Support for multiple Bus-Definitions 16 | 17 | 18 | library/importdbc.py 19 | support for: VERSION, NS, BS_, SIG_VALTYPE_, BA_DEF_REL == BA_DEF_??, BA_DEF_DEF_REL_ = BA_DEF_DEF_ ?? 20 | 21 | 22 | library/importdbf.py 23 | support for [START_PARAM_NODE_RX_SIG] 24 | support for [START_PARAM_NODE_TX_MSG] 25 | 26 | 27 | library/importkcd.py 28 | baudrate missing 29 | name save 30 | defaults for CAN-Simulation missing 31 | LabelGroup not supported 32 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/compare.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import library.importany as im 3 | from library.compare import * 4 | import sys 5 | import codecs 6 | 7 | #Copyright (c) 2013, Eduard Broecker 8 | #All rights reserved. 9 | # 10 | #Redistribution and use in source and binary forms, with or without modification, are permitted provided that 11 | # the following conditions are met: 12 | # 13 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the 14 | # following disclaimer. 15 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | # following disclaimer in the documentation and/or other materials provided with the distribution. 17 | # 18 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 19 | #WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | #PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 21 | #DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 25 | #DAMAGE. 26 | 27 | if len(sys.argv) < 3: 28 | sys.stderr.write('Usage: sys.argv[0] matrix1 matrix2\n') 29 | sys.stderr.write('matrixX can be any of *.dbc|*.dbf|*.kcd|*.arxml\n') 30 | sys.exit(1) 31 | 32 | matrix1 = sys.argv[1] 33 | matrix2 = sys.argv[2] 34 | 35 | print("Importing " + matrix1 + " ... ") 36 | db1 = im.importany(matrix1) 37 | print("%d Frames found" % (db1._fl._list.__len__())) 38 | 39 | print("Importing " + matrix2 + " ... ") 40 | db2 = im.importany(matrix2) 41 | print("%d Frames found" % (db2._fl._list.__len__())) 42 | 43 | 44 | print("\n\n") 45 | 46 | 47 | def dumpResult(res, depth = 0): 48 | if res._type is not None and res._result != "equal": 49 | for i in range(0,depth): 50 | print(" ",) 51 | print(res._type + " " + res._result + " ",) 52 | if hasattr(res._ref, '_name'): 53 | print(res._ref._name) 54 | else: 55 | print(" ") 56 | if res._changes is not None and res._changes[0] is not None and res._changes[1] is not None: 57 | for i in range(0,depth): 58 | print(" ",) 59 | print("old: " + str(res._changes[0].encode('ascii','replace')) + " new: " + str(res._changes[1].encode('ascii','replace'))) 60 | for child in res._children: 61 | dumpResult(child, depth+1) 62 | 63 | ignore = {} 64 | #ignore["ATTRIBUTE"] = "*" 65 | #ignore["DEFINE"] = "*" 66 | obj = compareDb(db1, db2, ignore) 67 | dumpResult(obj) 68 | 69 | 70 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/convert.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import library.exportall as ex 3 | import library.importall as im 4 | import library.canmatrix as cm 5 | import sys 6 | 7 | #Copyright (c) 2013, Eduard Broecker 8 | #All rights reserved. 9 | # 10 | #Redistribution and use in source and binary forms, with or without modification, are permitted provided that 11 | # the following conditions are met: 12 | # 13 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the 14 | # following disclaimer. 15 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | # following disclaimer in the documentation and/or other materials provided with the distribution. 17 | # 18 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 19 | #WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | #PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 21 | #DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 25 | #DAMAGE. 26 | 27 | if len(sys.argv) < 3: 28 | sys.stderr.write('Usage: sys.argv[0] import-file export-file\n') 29 | sys.stderr.write('import-file: *.dbc|*.dbf|*.kcd|*.arxml|*.sym\n') 30 | sys.stderr.write('export-file: *.dbc|*.dbf|*.kcd|*.json\n') 31 | sys.exit(1) 32 | 33 | infile = sys.argv[1] 34 | outfile = sys.argv[2] 35 | 36 | print("Importing " + infile + " ... ") 37 | if infile[-3:] == 'dbc': 38 | db = im.importDbc(infile) 39 | elif infile[-3:] == 'dbf': 40 | db = im.importDbf(infile) 41 | elif infile[-3:] == 'kcd': 42 | db = im.importKcd(infile) 43 | elif infile[-3:] == 'xls' or infile[-4:] == 'xlsx' : 44 | db = im.importXls(infile) 45 | elif infile[-5:] == 'arxml': 46 | db = im.importArxml(infile) 47 | elif infile[-3:] == 'sym': 48 | db = im.importSym(infile) 49 | else: 50 | sys.stderr.write('\nFile not recognized: ' + infile + "\n") 51 | print("done\n") 52 | 53 | print("%d Frames found" % (db._fl._list.__len__())) 54 | 55 | print("Exporting " + outfile + " ... ") 56 | 57 | if outfile[-3:] == 'dbc': 58 | db = ex.exportDbc(db, outfile) 59 | elif outfile[-3:] == 'dbf': 60 | db = ex.exportDbf(db, outfile) 61 | elif outfile[-3:] == 'kcd': 62 | db = ex.exportKcd(db, outfile) 63 | elif outfile[-3:] == 'xls': 64 | db = ex.exportXls(db, outfile) 65 | elif outfile[-4:] == 'json': 66 | db = ex.exportJson(db, outfile) 67 | else: 68 | sys.stderr.write('File not recognized: ' + infile + "\n") 69 | print("done") 70 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/exampleMerge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # importany laed alle verfuegbaren importfilter 3 | from library.copy import * 4 | import library.importany as im 5 | import library.exportall as ex 6 | #fuer Fileio: 7 | import sys 8 | 9 | # 10 | # Einlesen der Quell-Matritzen 11 | # 12 | 13 | # Importieren einer CAN-Matrix (*.dbc, *.dbf, *.kcd, *.arxml) 14 | db1 = im.importany("aa.dbc") 15 | # Importieren einer 2. CAN-Matrix (*.dbc, *.dbf, *.kcd, *.arxml) 16 | db2 = im.importany("aa.dbc") 17 | 18 | # 19 | # Ziel-Matrix anlegen 20 | # 21 | 22 | db3 = CanMatrix() 23 | 24 | # 25 | # Hier kann die neue Can-Matrix 'Programmiert' werden: 26 | # ----------------------------------------------------- 27 | # 28 | 29 | #Kopiere ID 1234 aus der 2. K-Matrix in die Zielmatrix 30 | copyFrame(1234, db2, db3) 31 | 32 | #Kopiere Frame "Engine_123" aus der 1. K-Matrix in die Zielmatrix 33 | copyFrame("Engine_123", db1, db3) 34 | 35 | #Kopiere ECU "Gateway" aus der 1. K-Matrix (mit allen zugehoerigen Frames) in die Zielmatrix 36 | copyBUwithFrames("Gateway", db1, db3) 37 | 38 | # 39 | # ----------------------------------------------------- 40 | # 41 | 42 | 43 | # 44 | # 45 | # Exportieren der neuen matrix z.B. als dbc: 46 | # 47 | 48 | ex.exportDbc(db3, "ziel.dbc") 49 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/library/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/utils/canmatrix/library/__init__.py -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/library/canmatrixGenerateJS.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/CarmaSecondary/utils/canmatrix/library/canmatrixGenerateJS.py -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/library/exportJson.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from library.canmatrix import * 4 | import codecs 5 | import json 6 | 7 | #Copyright (c) 2013, Eduard Broecker 8 | #All rights reserved. 9 | # 10 | #Redistribution and use in source and binary forms, with or without modification, are permitted provided that 11 | # the following conditions are met: 12 | # 13 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the 14 | # following disclaimer. 15 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 16 | # following disclaimer in the documentation and/or other materials provided with the distribution. 17 | # 18 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 19 | #WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | #PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 21 | #DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 25 | #DAMAGE. 26 | 27 | # 28 | # this script exports json-files from a canmatrix-object 29 | # json-files are the can-matrix-definitions of the CANard-project (https://github.com/ericevenchick/CANard) 30 | 31 | 32 | def exportJson(db, filename): 33 | dbfExportEncoding = 'iso-8859-1' 34 | f = open(filename,"w") 35 | exportArray = [] 36 | 37 | for bo in db._fl._list: 38 | signals = {} 39 | for signal in bo._signals: 40 | signals[signal._startbit]= {"name" : signal._name, "bit_length" : signal._signalsize, "factor":signal._factor, "offset":signal._offset} 41 | 42 | exportArray.append({"name" : bo._name, "id" : hex(bo._Id), "signals": signals }) 43 | 44 | json.dump({"messages" : exportArray}, f, sort_keys=True, indent=4, separators=(',', ': ')) 45 | 46 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/library/exportall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from exportdbc import * 3 | from exportdbf import * 4 | #from exportar import * 5 | from exportJson import * 6 | 7 | try: 8 | from exportkcd import * 9 | except: 10 | print "no kcd-export-support, some dependencys missing... " 11 | 12 | try: 13 | from exportxls import * 14 | except: 15 | print "no xls-export-support, some dependencys missing... " 16 | 17 | #Copyright (c) 2013, Eduard Broecker 18 | #All rights reserved. 19 | # 20 | #Redistribution and use in source and binary forms, with or without modification, are permitted provided that 21 | # the following conditions are met: 22 | # 23 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the 24 | # following disclaimer. 25 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 26 | # following disclaimer in the documentation and/or other materials provided with the distribution. 27 | # 28 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 29 | #WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 | #PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 31 | #DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 32 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 33 | #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 35 | #DAMAGE. 36 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/library/importall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from importdbc import * 3 | from importdbf import * 4 | 5 | try: 6 | from importarxml import * 7 | except: 8 | print "no arxml-import-support, some dependencys missing... " 9 | 10 | try: 11 | from importkcd import * 12 | except: 13 | print "no kcd-import-support, some dependencys missing... " 14 | 15 | try: 16 | from importxls import * 17 | except: 18 | print "no xls-import-support, some dependencys missing... " 19 | 20 | # try: 21 | from importsym import * 22 | # except: 23 | # print "no sym-import-support, some dependencys missing... " 24 | 25 | 26 | #Copyright (c) 2013, Eduard Broecker 27 | #All rights reserved. 28 | # 29 | #Redistribution and use in source and binary forms, with or without modification, are permitted provided that 30 | # the following conditions are met: 31 | # 32 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the 33 | # following disclaimer. 34 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 35 | # following disclaimer in the documentation and/or other materials provided with the distribution. 36 | # 37 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 38 | #WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 39 | #PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 40 | #DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 41 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 42 | #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 43 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 44 | #DAMAGE. 45 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/library/importany.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import importall as im 3 | 4 | #Copyright (c) 2013, Eduard Broecker 5 | #All rights reserved. 6 | # 7 | #Redistribution and use in source and binary forms, with or without modification, are permitted provided that 8 | # the following conditions are met: 9 | # 10 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | # following disclaimer. 12 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | # following disclaimer in the documentation and/or other materials provided with the distribution. 14 | # 15 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 16 | #WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 17 | #PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 18 | #DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 21 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 22 | #DAMAGE. 23 | 24 | def importany(filename): 25 | db = None 26 | if filename[-3:] == 'dbc': 27 | db = im.importDbc(filename) 28 | elif filename[-3:] == 'dbf': 29 | db = im.importDbf(filename) 30 | elif filename[-3:] == 'kcd': 31 | db = im.importKcd(filename) 32 | elif filename[-3:] == 'xls' or filename[-4:] == 'xlsx' : 33 | db = im.importXls(filename) 34 | elif filename[-5:] == 'arxml': 35 | db = im.importArxml(filename) 36 | elif filename[-5:] == '.sym': 37 | db = im.importSym(filename) 38 | return db 39 | 40 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/srx_command.sym: -------------------------------------------------------------------------------- 1 | FormatVersion=5.0 // Do not edit! 2 | Title="Untitled" 3 | 4 | {ENUMS} 5 | enum AccelCommandMode(0="ACC_Disable", // Disable ACC system 6 | 1="WrenchEffort", // Wrench Effort Command 7 | 2="SpeedControl", // Robotic Speed Control 8 | 3="RESERVED") 9 | 10 | {SENDRECEIVE} 11 | 12 | [AccelerationControl] 13 | ID=100h 14 | DLC=8 15 | Var="Command Counter" unsigned 0,2 16 | Var="Override Enabled" bit 2,1 17 | Var="Command Mode" AccelCommandMode 3,2 18 | Var="Speed Control" unsigned 24,16 /u:km/h 19 | Var="Wrench Effort" unsigned 8,16 -m /u:% /f:0.025 /o:-100 20 | Var="Max Accel" unsigned 40,16 /u:(km/h)/s 21 | Var=Checksum unsigned 56,8 22 | 23 | -------------------------------------------------------------------------------- /CACC-CARMA/CarmaSecondary/utils/canmatrix/todo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm TODO.md 3 | 4 | for i in */*.py 5 | do grep -l TODO $i >> TODO.md 6 | grep TODO $i | sed -e "s/^\ +//" -e "s/TODO//" -e "s/#//" >> TODO.md 7 | echo "\n\n" >> TODO.md 8 | done 9 | -------------------------------------------------------------------------------- /CACC-CARMA/FHWA Connected Vehicle Research Platform User's Guide.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-CARMA/FHWA Connected Vehicle Research Platform User's Guide.docx -------------------------------------------------------------------------------- /CACC-VISSIM/ATTRIBUTION.txt: -------------------------------------------------------------------------------- 1 | Key contributors to the development of the CACC VISSIM Algorithm 2.0 2 | 3 | Development of the 2.0 algorithm and the documentation include: 4 | 5 | Leidos Inc. : Peng "Patrick" Su 6 | NJIT Department of Civil Engineering: Joyoung Lee 7 | 8 | The developers also wish to acknowledge several contributors to this study: 9 | 10 | Federal Highway Administration: Taylor Lochrane, Daniel Dailey -------------------------------------------------------------------------------- /CACC-VISSIM/CACC_COM_Controller/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace CACCManGUI 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CACC-VISSIM/Instruction.txt: -------------------------------------------------------------------------------- 1 | Steps to run the CACC VISSIM 2.0 Algorithm 2 | 3 | 1) Compile the Type101DriverModel and Type104DriverModel into DLL files. 4 | either 32 or 64 bit, depending on the PTV VISSIM version. 5 | 2) Open the I-66_wb_dedicatedcacclane_2.inpx, change the driver models of vehicle 6 | type 101 and 104 to the compiled DLL files in step 1). 7 | 3) Design your own simulation scenarios, and modify the scenarios_template.csv file. 8 | 9 | Metadata of scenarios_template.csv: 10 | 11 | GPVOL%: Inflation rate of General-Purpose demand 12 | HOVVol%: Inflation rate of HOV demand 13 | CACCMP_GP: CACC market penetration of general-purpose vehicles 14 | CACCMP_HOV: CACC market penetration of HOV vehicles 15 | Toggle: Just use 2. This is for debugging purposes. 16 | #Max Platoon Size: Maximum platoon size. CACCHWLong is used for the platoon head. 17 | CACCHWShort: Headway among vehicles within a platoon 18 | CACCHWLong: Headway between leading platoon tail and following platoon head. 19 | LeadingCriticalGap: Lane-changing critical gap between the ego and leading vehicle 20 | LaggingCriticalGap: Lane-changing critical gap between the ego and lagging vehicle 21 | LeadingSpdDiff: Lane-changing max speed differential between the ego and leading vehicle 22 | LaggingSpdDiff: Lane-changing max speed differential between the ego and lagging vehicle 23 | 4) Use the CACC_COM_Controller (Visual Studio 2013) to start the simulations. 24 | Select "Multi-Scenario Mode", 25 | Specify the path of the needed files (inpx, layx, csv, etc) 26 | Change simulation time, replications and random speed. 27 | Click "Run" -------------------------------------------------------------------------------- /CACC-VISSIM/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Licensed under the PTV VISSIM 6.22 or newer, and Microsoft Visual Studio 2013. You may not use these codes except in compliance with the License. 2 | You may obtain a copy of the License at http://vision-traffic.ptvgroup.com/en-us/products/ptv-vissim/ and 3 | https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx 4 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, 5 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions 6 | and limitations under the License. -------------------------------------------------------------------------------- /CACC-VISSIM/README.txt: -------------------------------------------------------------------------------- 1 | Open Source Overview 2 | ============================ 3 | CACC VISSIM 2.0 Algorithm is designed to simulate close-spaced CACC platoons in VISSIM using the COM interface and VISSIM API. 4 | This application can be used to evaluate the operational benefits of having a dedicated CACC lane on freeway. 5 | Need Visual Studio 2013 and VISSIM version 6.22 or newer (both 32 and 64 bit versions work) to run the algorithm. 6 | 7 | License information 8 | ------------------- 9 | No license needed. 10 | 11 | 12 | System Requirements 13 | ------------------------- 14 | 15 | The CACC VISSIM 2.0 Algorithm can run on most standard Window based computers with 16 | Pentium core processers, with at least two gigabits of RAM and at least 100 MB of drive space. 17 | Performance of the software will be based on the computing power and available RAM in 18 | the system. Larger datasets can require much larger space requirements depending on the 19 | amount of data being read into the software. 20 | 21 | The CACC VISSIM 2.0 Algorithm was developed using C# (VISSIM COM code) and C++ (VISSIM API code). 22 | Currently this application only runs on Windows operating systems, due to limitations of VISSIM. 23 | 24 | Documentation 25 | ------------- 26 | 27 | Please refer to the Instruction.txt for guidance of running the algorithm. 28 | 29 | Web sites 30 | --------- 31 | The CACC VISSIM 1.0 Algorithm is distributed through the USDOT's JPO Open Source Application Development Portal (OSADP) 32 | http://itsforge.net/ 33 | 34 | Application support email (limited): pengsu9@gmail.com 35 | -------------------------------------------------------------------------------- /CACC-VISSIM/RELEASE-NOTES.txt: -------------------------------------------------------------------------------- 1 | Whenever a new software version is released, a Release Note is generated to provide the necessary information about bug fixes, new features, workarounds, known issues etc. 2 | 3 | RELEASE-NOTES.txt should include some of the following sections: 4 | 5 | - Release note identifier (name, date, version #) 6 | CACC VISSIM Algorithm, March 21 2016, Version 2.0 7 | 8 | 9 | - What's New 10 | First release 11 | 12 | 13 | - System Requirements (third-party platforms / modules / etc with version numbers / dates) 14 | 15 | The CACC VISSIM Algorithm 2.0 can run on most standard Window based computers with 16 | Pentium core processers, with at least two gigabits of RAM and at least 100 MB of drive space. 17 | Performance of the software will be based on the computing power and available RAM in 18 | the system. Larger datasets can require much larger space requirements depending on the 19 | amount of data being read into the software. 20 | Third party platforms: PTV VISSIM 6.22 32 or 64 bit 21 | Microsoft Visual Studio 2013 22 | 23 | 24 | - Features and changes (new features, defects corrected, caveats etc) 25 | First release 26 | 27 | Got rid of the platoon self-organization logic, and replaced with a simpler platoon distapching 28 | logic (in the DriverModel 101) 29 | 30 | - Outstanding issues (unresolved defects, workarounds, installation issues etc) 31 | 32 | 33 | - Installation guide (how to obtain and install) 34 | Compile the 101 and 104 driver models to DLL files, either 32 or 64 bit, based on the installed VISSIM version. 35 | Design the simulation scenarios and modify the scenario.csv file accordingly 36 | Run the COM controller 37 | More detailed info, please refer to the instruction.txt file. 38 | 39 | 40 | - Known Issues 41 | VISSIM's lane changing module cannot be easily modified without causing some bad visual effects. You may see the 42 | CACC vehicles' turning lights on and they keep on wobbling from side to side in the managed lane. 43 | 44 | 45 | - Troubleshooting 46 | pengsu9@gmail.com 47 | 48 | - FAQ 49 | 50 | 51 | - Other Resources and Links -------------------------------------------------------------------------------- /CACC-VISSIM/Type101DriverModel/DriverModel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-VISSIM/Type101DriverModel/DriverModel.h -------------------------------------------------------------------------------- /CACC-VISSIM/Type104DriverModel/DriverModel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-VISSIM/Type104DriverModel/DriverModel.h -------------------------------------------------------------------------------- /CACC-VISSIM/VISSIM Model Calibration Results_WB.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OSADP/CACC/4e648304b614445a92646112a94f617b12fdb6b0/CACC-VISSIM/VISSIM Model Calibration Results_WB.docx -------------------------------------------------------------------------------- /CACC-VISSIM/scenario_template.csv: -------------------------------------------------------------------------------- 1 | ID, GPVOL(%),HOVVol(%),CACCMP_GP,CACCMP_HOV,Toggle,#Max Platoon Size,CACCHWShort,CACCHWLong,LeadingCriticalGap,LaggingCriticalGap,LeadingSpdDiff,LaggingSpdDiff 2 | 0,100,100,0,0,2,5,0.8,2,0.6,0.8,10,10 3 | 1,140,0,2.5,0,2,5,0.8,2,0.6,0.8,10,10 4 | 2,140,0,5,0,2,5,0.8,2,0.6,0.8,10,10 5 | 3,140,0,7.5,0,2,5,0.8,2,0.6,0.8,10,10 6 | 4,140,0,10,0,2,5,0.8,2,0.6,0.8,10,10 7 | 5,140,0,12.5,0,2,5,0.8,2,0.6,0.8,10,10 8 | 6,140,0,15,0,2,5,0.8,2,0.6,0.8,10,10 9 | 7,140,0,20,0,2,5,0.8,2,0.6,0.8,10,10 10 | 8,140,0,25,0,2,5,0.8,2,0.6,0.8,10,10 11 | 9,140,0,30,0,2,5,0.8,2,0.6,0.8,10,10 12 | 10,140,0,35,0,2,5,0.8,2,0.6,0.8,10,10 13 | 11,140,0,40,0,2,5,0.8,2,0.6,0.8,10,10 14 | 12,140,0,45,0,2,5,0.8,2,0.6,0.8,10,10 15 | 13,140,0,40,0,2,3,0.8,2,0.6,0.8,10,10 16 | 14,140,0,40,0,2,5,0.8,2,0.6,0.8,10,10 17 | 15,140,0,40,0,2,7,0.8,2,0.6,0.8,10,10 18 | 16,140,0,40,0,2,9,0.8,2,0.6,0.8,10,10 19 | 17,140,0,40,0,2,5,0.6,2,0.6,0.8,10,10 20 | 18,140,0,40,0,2,5,0.7,2,0.6,0.8,10,10 21 | 19,140,0,40,0,2,5,0.8,2,0.6,0.8,10,10 22 | 20,140,0,40,0,2,5,0.9,2,0.6,0.8,10,10 23 | 21,140,0,40,0,2,5,1,2,0.6,0.8,10,10 24 | 22,140,0,40,0,2,5,1.1,2,0.6,0.8,10,10 25 | 23,140,0,40,0,2,5,0.8,1.2,0.4,0.6,10,10 26 | 24,140,0,40,0,2,5,0.8,1.4,0.5,0.7,10,10 27 | 25,140,0,40,0,2,5,0.8,1.6,0.6,0.8,10,10 28 | 26,140,0,40,0,2,5,0.8,1.8,0.6,0.9,10,10 29 | 27,140,0,40,0,2,5,0.8,2,0.6,1,10,10 30 | 28,140,0,40,0,2,5,0.8,2.2,0.6,1,10,10 31 | 29,140,0,40,0,2,5,0.8,2,0.4,0.6,20,20 32 | 30,140,0,40,0,2,5,0.8,2,0.5,0.8,15,15 33 | 31,140,0,40,0,2,5,0.8,2,0.6,1,10,10 34 | 32,140,0,40,0,2,5,0.8,2,0.7,1.2,5,5 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Open Source Overview 2 | ============================ 3 | CACC VISSIM 2.0 Algorithm is designed to simulate close-spaced CACC platoons in VISSIM using the COM interface and VISSIM API. 4 | This application can be used to evaluate the operational benefits of having a dedicated CACC lane on freeway. 5 | Need Visual Studio 2013 and VISSIM version 6.22 or newer (both 32 and 64 bit versions work) to run the algorithm. 6 | 7 | License information 8 | ------------------- 9 | No license needed. 10 | 11 | 12 | System Requirements 13 | ------------------------- 14 | 15 | The CACC VISSIM 2.0 Algorithm can run on most standard Window based computers with 16 | Pentium core processers, with at least two gigabits of RAM and at least 100 MB of drive space. 17 | Performance of the software will be based on the computing power and available RAM in 18 | the system. Larger datasets can require much larger space requirements depending on the 19 | amount of data being read into the software. 20 | 21 | The CACC VISSIM 2.0 Algorithm was developed using C# (VISSIM COM code) and C++ (VISSIM API code). 22 | Currently this application only runs on Windows operating systems, due to limitations of VISSIM. 23 | 24 | Documentation 25 | ------------- 26 | 27 | Please refer to the Instruction.txt for guidance of running the algorithm. 28 | 29 | Web sites 30 | --------- 31 | The CACC VISSIM 1.0 Algorithm is distributed through the USDOT's JPO Open Source Application Development Portal (OSADP) 32 | http://itsforge.net/ 33 | 34 | Application support email (limited): pengsu9@gmail.com 35 | --------------------------------------------------------------------------------