├── .github └── workflows │ └── ccpp.yml ├── .gitignore ├── .gitmodules ├── BUILD ├── CPPLINT.cfg ├── LICENSE ├── README.md ├── WORKSPACE.in ├── apollo.sh ├── cyber ├── BUILD ├── README.md ├── base │ ├── BUILD │ ├── atomic_hash_map.h │ ├── atomic_hash_map_test.cc │ ├── atomic_rw_lock.h │ ├── atomic_rw_lock_test.cc │ ├── bounded_queue.h │ ├── bounded_queue_test.cc │ ├── concurrent_object_pool.h │ ├── for_each.h │ ├── for_each_test.cc │ ├── macros.h │ ├── object_pool.h │ ├── object_pool_test.cc │ ├── reentrant_rw_lock.h │ ├── rw_lock_guard.h │ ├── signal.h │ ├── signal_test.cc │ ├── thread_pool.h │ ├── thread_safe_queue.h │ ├── unbounded_queue.h │ ├── unbounded_queue_test.cc │ └── wait_strategy.h ├── binary.h ├── blocker │ ├── BUILD │ ├── blocker.h │ ├── blocker_manager.cc │ ├── blocker_manager.h │ ├── blocker_manager_test.cc │ ├── blocker_test.cc │ ├── intra_reader.h │ └── intra_writer.h ├── class_loader │ ├── BUILD │ ├── class_loader.cc │ ├── class_loader.h │ ├── class_loader_manager.cc │ ├── class_loader_manager.h │ ├── class_loader_register_macro.h │ ├── class_loader_test.cc │ ├── test │ │ ├── BUILD │ │ ├── base.h │ │ ├── plugin1.cc │ │ └── plugin2.cc │ └── utility │ │ ├── class_factory.cc │ │ ├── class_factory.h │ │ ├── class_loader_utility.cc │ │ └── class_loader_utility.h ├── common │ ├── BUILD │ ├── environment.h │ ├── environment_test.cc │ ├── file.cc │ ├── file.h │ ├── file_test.cc │ ├── global_data.cc │ ├── global_data.h │ ├── log.h │ ├── log_test.cc │ ├── macros.h │ ├── macros_test.cc │ ├── time_conversion.h │ ├── types.h │ └── util.h ├── component │ ├── BUILD │ ├── component.h │ ├── component_base.h │ ├── component_test.cc │ ├── timer_component.cc │ ├── timer_component.h │ └── timer_component_test.cc ├── conf │ ├── compute_sched.conf │ ├── compute_sched_choreography.conf │ ├── compute_sched_classic.conf │ ├── control_sched.conf │ ├── control_sched_choreography.conf │ ├── control_sched_classic.conf │ ├── cyber.pb.conf │ ├── dreamview_sched.conf │ ├── example_sched_choreography.conf │ ├── example_sched_classic.conf │ └── sensor_sched.conf ├── croutine │ ├── BUILD │ ├── croutine.cc │ ├── croutine.h │ ├── croutine_test.cc │ ├── detail │ │ ├── routine_context.cc │ │ ├── routine_context.h │ │ ├── swap.S │ │ ├── swap_aarch64.S │ │ └── swap_x86_64.S │ └── routine_factory.h ├── cyber.cc ├── cyber.h ├── data │ ├── BUILD │ ├── cache_buffer.h │ ├── cache_buffer_test.cc │ ├── channel_buffer.h │ ├── channel_buffer_test.cc │ ├── data_dispatcher.h │ ├── data_dispatcher_test.cc │ ├── data_notifier.h │ ├── data_visitor.h │ ├── data_visitor_base.h │ ├── data_visitor_test.cc │ └── fusion │ │ ├── all_latest.h │ │ ├── all_latest_test.cc │ │ └── data_fusion.h ├── doxy-docs │ ├── Doxyfile │ ├── Makefile │ ├── build_doxy_sphinx.sh │ ├── environment.yml │ ├── make.bat │ └── source │ │ ├── CyberRT_API_for_Developers.md │ │ ├── CyberRT_Developer_Tools.md │ │ ├── CyberRT_Docker.md │ │ ├── CyberRT_FAQs.md │ │ ├── CyberRT_Migration_Guide.md │ │ ├── CyberRT_Python_API.md │ │ ├── CyberRT_Quick_Start.md │ │ ├── api │ │ ├── cppapi.rst │ │ ├── cppapi_index.rst │ │ ├── pythonapi.rst │ │ └── pythonapi_index.rst │ │ ├── conf.py │ │ ├── cyberrt_api_for_developers.md │ │ ├── cyberrt_developer_tools.md │ │ ├── cyberrt_faqs.md │ │ ├── cyberrt_migration_guide.md │ │ ├── cyberrt_quick_start.md │ │ ├── images │ │ ├── cyber_monitor.png │ │ ├── cyber_visualizer1.png │ │ ├── cyber_visualizer2.png │ │ ├── cyber_visualizer3.png │ │ └── cyber_visualizer4.png │ │ ├── index.rst │ │ └── python_api_tutorial.md ├── event │ ├── BUILD │ ├── perf_event.h │ ├── perf_event_cache.cc │ └── perf_event_cache.h ├── examples │ ├── BUILD │ ├── common_component_example │ │ ├── BUILD │ │ ├── common.dag │ │ ├── common.launch │ │ ├── common_component_example.cc │ │ └── common_component_example.h │ ├── listener.cc │ ├── paramserver.cc │ ├── proto │ │ ├── BUILD │ │ └── examples.proto │ ├── record.cc │ ├── service.cc │ ├── talker.cc │ └── timer_component_example │ │ ├── BUILD │ │ ├── timer.dag │ │ ├── timer.launch │ │ ├── timer_component_example.cc │ │ └── timer_component_example.h ├── init.cc ├── init.h ├── io │ ├── BUILD │ ├── example │ │ ├── tcp_echo_client.cc │ │ ├── tcp_echo_server.cc │ │ ├── udp_echo_client.cc │ │ └── udp_echo_server.cc │ ├── poll_data.h │ ├── poll_handler.cc │ ├── poll_handler.h │ ├── poller.cc │ ├── poller.h │ ├── poller_test.cc │ ├── session.cc │ └── session.h ├── logger │ ├── BUILD │ ├── async_logger.cc │ ├── async_logger.h │ ├── async_logger_test.cc │ ├── log_file_object.cc │ ├── log_file_object.h │ ├── log_file_object_test.cc │ ├── logger.cc │ ├── logger.h │ ├── logger_test.cc │ ├── logger_util.cc │ ├── logger_util.h │ └── logger_util_test.cc ├── mainboard │ ├── mainboard.cc │ ├── module_argument.cc │ ├── module_argument.h │ ├── module_controller.cc │ └── module_controller.h ├── message │ ├── BUILD │ ├── intra_message.cc │ ├── intra_message.h │ ├── message_header.h │ ├── message_header_test.cc │ ├── message_traits.h │ ├── message_traits_test.cc │ ├── protobuf_factory.cc │ ├── protobuf_factory.h │ ├── protobuf_factory_test.cc │ ├── protobuf_traits.h │ ├── py_message.h │ ├── py_message_traits.h │ ├── raw_message.h │ ├── raw_message_test.cc │ └── raw_message_traits.h ├── node │ ├── BUILD │ ├── node.cc │ ├── node.h │ ├── node_channel_impl.h │ ├── node_channel_impl_test.cc │ ├── node_service_impl.h │ ├── node_test.cc │ ├── reader.h │ ├── reader_base.h │ ├── reader_test.cc │ ├── writer.h │ ├── writer_base.h │ ├── writer_reader_test.cc │ └── writer_test.cc ├── parameter │ ├── BUILD │ ├── parameter.cc │ ├── parameter.h │ ├── parameter_client.cc │ ├── parameter_client.h │ ├── parameter_client_test.cc │ ├── parameter_server.cc │ ├── parameter_server.h │ ├── parameter_server_test.cc │ ├── parameter_service_names.h │ └── parameter_test.cc ├── proto │ ├── BUILD │ ├── __init__.py │ ├── choreography_conf.proto │ ├── classic_conf.proto │ ├── component_conf.proto │ ├── cyber_conf.proto │ ├── dag_conf.proto │ ├── parameter.proto │ ├── perception.proto │ ├── perf_conf.proto │ ├── proto_desc.proto │ ├── qos_profile.proto │ ├── record.proto │ ├── role_attributes.proto │ ├── run_mode_conf.proto │ ├── scheduler_conf.proto │ ├── topology_change.proto │ ├── transport_conf.proto │ └── unit_test.proto ├── py_wrapper │ ├── BUILD │ ├── cyber_init_wrap.cc │ ├── cyber_node_wrap.cc │ ├── cyber_parameter_wrap.cc │ ├── cyber_record_wrap.cc │ ├── cyber_time_wrap.cc │ ├── cyber_timer_wrap.cc │ ├── cyber_topology_manager_wrap.cc │ ├── py_cyber.cc │ ├── py_cyber.h │ ├── py_cyber_test.cc │ ├── py_init.cc │ ├── py_init.h │ ├── py_init_test.cc │ ├── py_node.h │ ├── py_parameter.cc │ ├── py_parameter.h │ ├── py_record.cc │ ├── py_record.h │ ├── py_record_test.cc │ ├── py_time.cc │ ├── py_time.h │ ├── py_timer.cc │ ├── py_timer.h │ ├── py_topology_manager.h │ └── test │ │ ├── test_init.cc │ │ ├── test_node.cc │ │ └── test_record.cc ├── python │ ├── README.md │ ├── cyber_py │ │ ├── __init__.py │ │ ├── cyber.py │ │ ├── cyber_py3.py │ │ ├── cyber_time.py │ │ ├── cyber_time_py3.py │ │ ├── cyber_timer.py │ │ ├── cyber_timer_py3.py │ │ ├── examples │ │ │ ├── BUILD │ │ │ ├── client.py │ │ │ ├── listener.py │ │ │ ├── parameter.py │ │ │ ├── py_listener.cc │ │ │ ├── py_service.cc │ │ │ ├── py_talker.cc │ │ │ ├── record.py │ │ │ ├── record_channel_info.py │ │ │ ├── record_trans.py │ │ │ ├── service.py │ │ │ ├── talker.py │ │ │ ├── time.py │ │ │ └── timer.py │ │ ├── parameter.py │ │ ├── record.py │ │ ├── record_py3.py │ │ ├── test │ │ │ ├── test_cyber.py │ │ │ ├── test_cyber_time.py │ │ │ ├── test_cyber_timer.py │ │ │ ├── test_init.py │ │ │ ├── test_parameter.py │ │ │ └── test_record.py │ │ └── topology_manager.py │ └── cyber_py3 │ │ ├── BUILD │ │ ├── __init__.py │ │ ├── cyber.py │ │ ├── cyber_time.py │ │ ├── cyber_timer.py │ │ ├── examples │ │ ├── client.py │ │ ├── listener.py │ │ ├── parameter.py │ │ ├── record.py │ │ ├── record_channel_info.py │ │ ├── record_trans.py │ │ ├── service.py │ │ ├── talker.py │ │ ├── time.py │ │ └── timer.py │ │ ├── parameter.py │ │ ├── record.py │ │ └── test │ │ ├── test_cyber.py │ │ ├── test_cyber_time.py │ │ ├── test_cyber_timer.py │ │ ├── test_init.py │ │ ├── test_parameter.py │ │ └── test_record.py ├── record │ ├── BUILD │ ├── file │ │ ├── record_file_base.cc │ │ ├── record_file_base.h │ │ ├── record_file_integration_test.cc │ │ ├── record_file_reader.cc │ │ ├── record_file_reader.h │ │ ├── record_file_test.cc │ │ ├── record_file_writer.cc │ │ ├── record_file_writer.h │ │ └── section.h │ ├── header_builder.cc │ ├── header_builder.h │ ├── record_base.h │ ├── record_message.h │ ├── record_reader.cc │ ├── record_reader.h │ ├── record_reader_test.cc │ ├── record_viewer.cc │ ├── record_viewer.h │ ├── record_viewer_test.cc │ ├── record_writer.cc │ └── record_writer.h ├── scheduler │ ├── BUILD │ ├── common │ │ ├── cv_wrapper.h │ │ ├── mutex_wrapper.h │ │ ├── pin_thread.cc │ │ ├── pin_thread.h │ │ └── pin_thread_test.cc │ ├── policy │ │ ├── choreography_context.cc │ │ ├── choreography_context.h │ │ ├── classic_context.cc │ │ ├── classic_context.h │ │ ├── scheduler_choreography.cc │ │ ├── scheduler_choreography.h │ │ ├── scheduler_classic.cc │ │ └── scheduler_classic.h │ ├── processor.cc │ ├── processor.h │ ├── processor_context.cc │ ├── processor_context.h │ ├── processor_test.cc │ ├── scheduler.cc │ ├── scheduler.h │ ├── scheduler_choreo_test.cc │ ├── scheduler_classic_test.cc │ ├── scheduler_factory.cc │ ├── scheduler_factory.h │ ├── scheduler_policy_test.cc │ └── scheduler_test.cc ├── service │ ├── BUILD │ ├── client.h │ ├── client_base.h │ ├── service.h │ └── service_base.h ├── service_discovery │ ├── BUILD │ ├── communication │ │ ├── participant_listener.cc │ │ ├── participant_listener.h │ │ ├── subscriber_listener.cc │ │ └── subscriber_listener.h │ ├── container │ │ ├── graph.cc │ │ ├── graph.h │ │ ├── graph_test.cc │ │ ├── multi_value_warehouse.cc │ │ ├── multi_value_warehouse.h │ │ ├── multi_value_warehouse_test.cc │ │ ├── single_value_warehouse.cc │ │ ├── single_value_warehouse.h │ │ ├── single_value_warehouse_test.cc │ │ ├── warehouse_base.h │ │ └── warehouse_test.cc │ ├── role │ │ ├── role.cc │ │ ├── role.h │ │ └── role_test.cc │ ├── specific_manager │ │ ├── channel_manager.cc │ │ ├── channel_manager.h │ │ ├── channel_manager_test.cc │ │ ├── manager.cc │ │ ├── manager.h │ │ ├── node_manager.cc │ │ ├── node_manager.h │ │ ├── node_manager_test.cc │ │ ├── service_manager.cc │ │ ├── service_manager.h │ │ └── service_manager_test.cc │ ├── topology_manager.cc │ ├── topology_manager.h │ └── topology_manager_test.cc ├── setup.bash ├── state.cc ├── state.h ├── sysmo │ ├── BUILD │ ├── sysmo.cc │ ├── sysmo.h │ └── sysmo_test.cc ├── task │ ├── BUILD │ ├── task.h │ ├── task_manager.cc │ ├── task_manager.h │ └── task_test.cc ├── time │ ├── BUILD │ ├── duration.cc │ ├── duration.h │ ├── duration_test.cc │ ├── rate.cc │ ├── rate.h │ ├── time.cc │ ├── time.h │ └── time_test.cc ├── timer │ ├── BUILD │ ├── timer.cc │ ├── timer.h │ ├── timer_bucket.h │ ├── timer_task.cc │ ├── timer_task.h │ ├── timer_test.cc │ ├── timing_wheel.cc │ └── timing_wheel.h ├── tools │ ├── cyber_channel │ │ └── cyber_channel │ ├── cyber_launch │ │ └── cyber_launch │ ├── cyber_monitor │ │ ├── BUILD │ │ ├── cyber_topology_message.cc │ │ ├── cyber_topology_message.h │ │ ├── general_channel_message.cc │ │ ├── general_channel_message.h │ │ ├── general_message.cc │ │ ├── general_message.h │ │ ├── general_message_base.cc │ │ ├── general_message_base.h │ │ ├── main.cc │ │ ├── renderable_message.cc │ │ ├── renderable_message.h │ │ ├── screen.cc │ │ └── screen.h │ ├── cyber_node │ │ └── cyber_node │ ├── cyber_recorder │ │ ├── BUILD │ │ ├── info.cc │ │ ├── info.h │ │ ├── main.cc │ │ ├── player │ │ │ ├── play_param.h │ │ │ ├── play_task.cc │ │ │ ├── play_task.h │ │ │ ├── play_task_buffer.cc │ │ │ ├── play_task_buffer.h │ │ │ ├── play_task_consumer.cc │ │ │ ├── play_task_consumer.h │ │ │ ├── play_task_producer.cc │ │ │ ├── play_task_producer.h │ │ │ ├── player.cc │ │ │ └── player.h │ │ ├── recorder.cc │ │ ├── recorder.h │ │ ├── recoverer.cc │ │ ├── recoverer.h │ │ ├── spliter.cc │ │ └── spliter.h │ ├── cyber_service │ │ └── cyber_service │ └── cyber_tools_auto_complete.bash └── transport │ ├── BUILD │ ├── common │ ├── common_test.cc │ ├── endpoint.cc │ ├── endpoint.h │ ├── endpoint_test.cc │ ├── identity.cc │ ├── identity.h │ └── identity_test.cc │ ├── dispatcher │ ├── dispatcher.cc │ ├── dispatcher.h │ ├── dispatcher_test.cc │ ├── intra_dispatcher.cc │ ├── intra_dispatcher.h │ ├── intra_dispatcher_test.cc │ ├── rtps_dispatcher.cc │ ├── rtps_dispatcher.h │ ├── rtps_dispatcher_test.cc │ ├── shm_dispatcher.cc │ ├── shm_dispatcher.h │ └── shm_dispatcher_test.cc │ ├── message │ ├── history.h │ ├── history_attributes.h │ ├── listener_handler.h │ ├── message_info.cc │ ├── message_info.h │ ├── message_info_test.cc │ └── message_test.cc │ ├── qos │ ├── qos_profile_conf.cc │ └── qos_profile_conf.h │ ├── receiver │ ├── hybrid_receiver.h │ ├── intra_receiver.h │ ├── receiver.h │ ├── rtps_receiver.h │ └── shm_receiver.h │ ├── rtps │ ├── attributes_filler.cc │ ├── attributes_filler.h │ ├── participant.cc │ ├── participant.h │ ├── rtps_test.cc │ ├── sub_listener.cc │ ├── sub_listener.h │ ├── underlay_message.cc │ ├── underlay_message.h │ ├── underlay_message_type.cc │ └── underlay_message_type.h │ ├── shm │ ├── block.cc │ ├── block.h │ ├── condition_notifier.cc │ ├── condition_notifier.h │ ├── condition_notifier_test.cc │ ├── multicast_notifier.cc │ ├── multicast_notifier.h │ ├── notifier_base.h │ ├── notifier_factory.cc │ ├── notifier_factory.h │ ├── posix_segment.cc │ ├── posix_segment.h │ ├── readable_info.cc │ ├── readable_info.h │ ├── segment.cc │ ├── segment.h │ ├── segment_factory.cc │ ├── segment_factory.h │ ├── shm_conf.cc │ ├── shm_conf.h │ ├── state.cc │ ├── state.h │ ├── xsi_segment.cc │ └── xsi_segment.h │ ├── transceiver │ ├── hybrid_transceiver_test.cc │ ├── intra_transceiver_test.cc │ ├── rtps_transceiver_test.cc │ └── shm_transceiver_test.cc │ ├── transmitter │ ├── hybrid_transmitter.h │ ├── intra_transmitter.h │ ├── rtps_transmitter.h │ ├── shm_transmitter.h │ └── transmitter.h │ ├── transport.cc │ ├── transport.h │ └── transport_test.cc ├── docker ├── build │ ├── README.md │ ├── build_cyber.sh │ ├── build_dev.sh │ ├── build_geek.sh │ ├── build_geek_release.sh │ ├── cyber.aarch64.dockerfile │ ├── cyber.aarch64.sh │ ├── cyber.x86_64.dockerfile │ ├── cyber.x86_64.sh │ ├── cyber.x86_64_release.dockerfile │ ├── dev.x86_64.dockerfile │ └── installers │ │ ├── FastRTPS_1.5.0.patch │ │ ├── apriltag.diff │ │ ├── install_adolc.sh │ │ ├── install_adv_plat.sh │ │ ├── install_apriltag.sh │ │ ├── install_bazel.sh │ │ ├── install_bazel_packages.sh │ │ ├── install_bosfs.sh │ │ ├── install_conda.sh │ │ ├── install_fast-rtps.sh │ │ ├── install_ffmpeg.sh │ │ ├── install_gflags_glog.sh │ │ ├── install_glew.sh │ │ ├── install_google_styleguide.sh │ │ ├── install_gpu_caffe.sh │ │ ├── install_ipopt.sh │ │ ├── install_libjsonrpc-cpp.sh │ │ ├── install_nlopt.sh │ │ ├── install_node.sh │ │ ├── install_opencv4.0.0_Nano.sh │ │ ├── install_opencv4.1.sh │ │ ├── install_osqp.sh │ │ ├── install_ota.sh │ │ ├── install_pcl.sh │ │ ├── install_poco.sh │ │ ├── install_protobuf.sh │ │ ├── install_python_modules.sh │ │ ├── install_python_pcl.sh │ │ ├── install_python_pcl_1.8_vtk6.3.diff │ │ ├── install_qp_oases.sh │ │ ├── install_qt.sh │ │ ├── install_realsense.sh │ │ ├── install_supervisor.sh │ │ ├── install_undistort.sh │ │ ├── install_user.sh │ │ ├── install_yarn.sh │ │ ├── paddlepaddle_gpu-1.5.2-cp36-cp36m-linux_aarch64.whl │ │ ├── post_install.sh │ │ ├── py27_conda.yaml │ │ ├── py27_requirements.txt │ │ ├── py37_conda.yaml │ │ ├── py3_requrements.txt │ │ └── qt-noninteractive.qs ├── scripts │ ├── README.md │ ├── clean_resources.sh │ ├── commit_push.sh │ ├── commit_push_release.sh │ ├── cyber_into.sh │ ├── cyber_start.sh │ ├── dev_start_gdb_server.sh │ ├── into_geek.sh │ ├── into_geek_release.sh │ ├── start_geek.sh │ └── start_geek_release.sh └── setup_host │ ├── README.md │ ├── cleanup_resources.sh │ ├── etc │ └── udev │ │ └── rules.d │ │ ├── 51-nooploop.rules │ │ ├── 99-arduino.rules │ │ ├── 99-realsense-libusb.rules │ │ ├── 99-serial.rules │ │ ├── 99-usbtty.rules │ │ └── 99-webcam.rules │ ├── install_docker.sh │ └── setup_host.sh ├── images ├── red.jpg └── system.png ├── modules ├── common │ ├── BUILD │ ├── conf │ │ └── global.conf │ ├── curve_fitting.h │ ├── global_gflags.cc │ ├── global_gflags.h │ ├── proto │ │ ├── BUILD │ │ ├── error_code.proto │ │ ├── geometry.proto │ │ ├── header.proto │ │ └── pnc_point.proto │ ├── uart.cc │ └── uart.h ├── control │ ├── BUILD │ ├── README.md │ ├── chassis_component.cc │ ├── chassis_component.h │ ├── conf │ │ ├── chassis.conf │ │ └── control.conf │ ├── control_component.cc │ ├── control_component.h │ ├── control_reference_gen.cc │ ├── dag │ │ ├── calibration.dag │ │ ├── chassis.dag │ │ └── control.dag │ ├── launch │ │ ├── calibration.launch │ │ ├── chassis.launch │ │ └── control.launch │ ├── proto │ │ ├── BUILD │ │ ├── chassis.proto │ │ └── control.proto │ └── tools │ │ ├── BUILD │ │ ├── control_calibration.cc │ │ ├── control_calibration.h │ │ ├── pose_listener.cc │ │ ├── pose_reader.cc │ │ └── teleop.cc ├── data │ ├── image_base │ │ ├── 1_Color.png │ │ ├── 2_Color.png │ │ ├── 3_Color.png │ │ └── 4_Color.png │ ├── pose.dat │ └── pose.out ├── examples │ ├── BUILD │ ├── camera.cc │ ├── dag │ │ └── example.dag │ ├── example_component.cc │ ├── example_component.h │ ├── hello-greet.cc │ ├── hello-greet.h │ ├── hello-world.cc │ ├── launch │ │ └── example.launch │ ├── listener.cc │ ├── paramserver.cc │ ├── performance_listener.cc │ ├── performance_talker.cc │ ├── proto │ │ ├── BUILD │ │ └── examples.proto │ ├── record.cc │ ├── service.cc │ └── talker.cc ├── localization │ ├── BUILD │ ├── apriltag_component.cc │ ├── apriltag_component.h │ ├── conf │ │ ├── apriltag.conf │ │ └── localization.conf │ ├── dag │ │ ├── apriltag.dag │ │ └── localization.dag │ ├── launch │ │ ├── apriltag.launch │ │ └── localization.launch │ ├── localization_component.cc │ ├── localization_component.h │ ├── map.cc │ └── proto │ │ ├── BUILD │ │ ├── apriltag.proto │ │ └── localization.proto ├── monitor │ ├── BUILD │ ├── dag │ │ └── monitor.dag │ ├── launch │ │ └── monitor.launch │ ├── monitor_component.cc │ ├── monitor_component.h │ ├── proto │ │ ├── BUILD │ │ └── status.proto │ └── realsense_monitor.cc ├── perception │ ├── BUILD │ ├── conf │ │ └── perception.conf │ ├── dag │ │ └── perception.dag │ ├── euclidean_cluster.cc │ ├── euclidean_cluster.h │ ├── euclidean_segmentation.cc │ ├── gpu_euclidean_clustering.cu │ ├── gpu_euclidean_clustering.h │ ├── launch │ │ └── perception.launch │ ├── pcd_read_test.cc │ ├── pcl_utils.cc │ ├── perception_component.cc │ ├── perception_component.h │ ├── proto │ │ ├── BUILD │ │ ├── perception.proto │ │ ├── perception_label_box.proto │ │ └── perception_obstacle.proto │ └── testdata │ │ ├── 102.pcd │ │ ├── add_cloud.pcd │ │ └── table_scene_lms400.pcd ├── planning │ ├── common │ │ ├── graph.cc │ │ └── search.cc │ ├── conf │ │ └── glags.conf │ ├── planning_component.cc │ ├── planning_component.h │ ├── potential_field.cc │ ├── potential_field.h │ └── proto │ │ ├── lane.proto │ │ └── planning.proto ├── sensors │ ├── BUILD │ ├── README.md │ ├── conf │ │ ├── d435i_stream_profiles.conf │ │ ├── exercise_one.conf │ │ ├── exercise_two.conf │ │ ├── nooploop.conf │ │ ├── realsense.conf │ │ ├── t265_calibration_odometry.json │ │ └── t265_stream_profiles.conf │ ├── dag │ │ ├── exercise_one.dag │ │ ├── exercise_two.dag │ │ ├── nooploop.dag │ │ └── realsense.dag │ ├── launch │ │ ├── exercise_one.launch │ │ ├── exercise_two.launch │ │ ├── nooploop.launch │ │ └── realsense.launch │ ├── nooploop │ │ ├── BUILD │ │ ├── main.c │ │ ├── ncommon.cc │ │ ├── ncommon.h │ │ ├── nlink_linktrack_anchor_frame0.cc │ │ ├── nlink_linktrack_anchor_frame0.h │ │ ├── nlink_linktrack_node_frame0.cc │ │ ├── nlink_linktrack_node_frame0.h │ │ ├── nlink_linktrack_node_frame1.cc │ │ ├── nlink_linktrack_node_frame1.h │ │ ├── nlink_linktrack_node_frame2.cc │ │ ├── nlink_linktrack_node_frame2.h │ │ ├── nlink_linktrack_tag_frame0.cc │ │ └── nlink_linktrack_tag_frame0.h │ ├── nooploop_component.cc │ ├── nooploop_component.h │ ├── proto │ │ ├── BUILD │ │ ├── mobileye.proto │ │ ├── nooploop.proto │ │ ├── pointcloud.proto │ │ ├── radar.proto │ │ ├── sensor_image.proto │ │ ├── sensors.proto │ │ └── ultrasonic_radar.proto │ ├── realsense.cc │ ├── realsense.h │ ├── realsense │ │ ├── BUILD │ │ ├── device_base.h │ │ ├── realsense_d435.cc │ │ ├── realsense_d435.h │ │ ├── realsense_d435i.cc │ │ ├── realsense_d435i.h │ │ ├── realsense_t265.cc │ │ └── realsense_t265.h │ ├── realsense_component.cc │ ├── realsense_component.h │ ├── realsense_motion.h │ └── tools │ │ ├── BUILD │ │ ├── image_save.cc │ │ ├── opencv_gpu.cc │ │ └── rs_connection_check.cc └── tools │ └── visualizer │ ├── BUILD │ ├── abstract_camera.cc │ ├── abstract_camera.h │ ├── channel_reader.h │ ├── fixedaspectratiowidget.cc │ ├── fixedaspectratiowidget.h │ ├── free_camera.cc │ ├── free_camera.h │ ├── grid.cc │ ├── grid.h │ ├── images │ ├── app.ico │ ├── closeimage.png │ ├── grid.png │ ├── image.png │ ├── images.png │ ├── no_image.png │ ├── pause.png │ ├── play.png │ └── pointcloud.png │ ├── main.cc │ ├── main_window.cc │ ├── main_window.h │ ├── msg_dialog.cc │ ├── msg_dialog.h │ ├── plane.cc │ ├── plane.h │ ├── pointcloud.cc │ ├── pointcloud.h │ ├── radarpoints.cc │ ├── radarpoints.h │ ├── renderable_object.cc │ ├── renderable_object.h │ ├── res.qrc │ ├── scene_camera_dialog.cc │ ├── scene_camera_dialog.h │ ├── scene_viewer.cc │ ├── scene_viewer.h │ ├── shaders │ ├── grid.vert │ ├── grid_pointcloud.frag │ ├── pointcloud.vert │ ├── radarpoints.frag │ ├── radarpoints.vert │ ├── video_image_plane.frag │ └── video_image_plane.vert │ ├── target_camera.cc │ ├── target_camera.h │ ├── texture.cc │ ├── texture.h │ ├── treewidget.cc │ ├── treewidget.h │ ├── uis │ ├── main_window.ui │ ├── msg_dialog.ui │ ├── scene_camera_dialog.ui │ └── video_images_dialog.ui │ ├── video_image_viewer.cc │ ├── video_image_viewer.h │ ├── video_images_dialog.cc │ └── video_images_dialog.h ├── scripts ├── apollo_base.sh ├── calibration.sh ├── chassis.sh ├── clang-format.sh ├── control.sh ├── docker_adduser.sh ├── exercise1.sh ├── exercise2.sh ├── exercise3.sh ├── exercise4.sh ├── exercise5.sh ├── exercise6.sh ├── exercise7.sh ├── exercise8.sh ├── exercise9.sh ├── jupyter.sh ├── localization.sh ├── monitor.sh ├── nooploop.sh ├── perception.sh ├── planning.sh ├── realsense.sh ├── realsense_exercise1.sh ├── realsense_exercise2.sh ├── realsense_monitor.sh └── teleop.sh ├── third_party ├── ACKNOWLEDGEMENT.txt ├── BUILD ├── apriltag.BUILD ├── benchmark.BUILD ├── eigen.BUILD ├── fastrtps.BUILD ├── gflags.BUILD ├── glew.BUILD ├── glfw.BUILD ├── glog.BUILD ├── google_styleguide.BUILD ├── gtest.BUILD ├── opencv.BUILD ├── osqp.BUILD ├── pcl.BUILD ├── python27.BUILD ├── python3.BUILD ├── qt.BUILD ├── realsense.BUILD ├── tensorrt.BUILD ├── tf2 │ ├── BUILD │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── geometry2_0.5.16_tf2.patch │ ├── include │ │ ├── geometry_msgs │ │ │ └── transform_stamped.h │ │ ├── tf2 │ │ │ ├── LinearMath │ │ │ │ ├── Matrix3x3.h │ │ │ │ ├── MinMax.h │ │ │ │ ├── QuadWord.h │ │ │ │ ├── Quaternion.h │ │ │ │ ├── Scalar.h │ │ │ │ ├── Transform.h │ │ │ │ └── Vector3.h │ │ │ ├── buffer_core.h │ │ │ ├── convert.h │ │ │ ├── exceptions.h │ │ │ ├── impl │ │ │ │ ├── convert.h │ │ │ │ └── utils.h │ │ │ ├── time.h │ │ │ ├── time_cache.h │ │ │ ├── transform_datatypes.h │ │ │ ├── transform_storage.h │ │ │ └── utils.h │ │ └── tf2_msgs │ │ │ └── tf2_error.h │ ├── index.rst │ ├── mainpage.dox │ ├── package.xml │ ├── src │ │ ├── buffer_core.cpp │ │ ├── cache.cpp │ │ ├── static_cache.cpp │ │ └── time.cpp │ └── test │ │ ├── CMakeLists.txt │ │ ├── cache_unittest.cpp │ │ ├── simple_tf2_core.cpp │ │ ├── speed_2_test.cpp │ │ ├── speed_test.cpp │ │ └── static_cache_test.cpp └── vtk.BUILD └── tools ├── BUILD ├── bazel.rc ├── cpplint.bzl ├── platforms └── BUILD └── qt.bzl /.github/workflows/ccpp.yml: -------------------------------------------------------------------------------- 1 | name: Geek Style 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-18.04 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: docker pull and build 13 | run: bash docker/scripts/start_geek.sh 14 | - name: docker exec 15 | run: docker exec -u $USER geek_dev_$USER bash -c "./apollo.sh build" 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Bazel 2 | bazel-* 3 | /Debug/ 4 | *.pyc 5 | *genrule.log 6 | WORKSPACE 7 | # temporary files 8 | *.swp 9 | *.swo 10 | .DS_Store 11 | # generated files 12 | generated_data_warehouse.conf 13 | modules/common/data/ssl_keys 14 | 15 | # Eclipse IDE files 16 | .project 17 | .cproject 18 | .settings 19 | .classpath 20 | 21 | # IntelliJ files 22 | .idea 23 | 24 | # Vscode files 25 | .vscode 26 | 27 | # atom.io files 28 | *.gch 29 | 30 | # Logs. 31 | *.stdout 32 | *.stderr 33 | nohup.out 34 | *.bak 35 | *.csv.result 36 | 37 | # Editor configs 38 | .ycm_extra_conf.py 39 | 40 | # third_party 41 | 42 | # Data 43 | /data 44 | 45 | # Doxygen 46 | docs/doxygen 47 | 48 | # python proto 49 | py_proto 50 | cyber/python/cyber/proto/ 51 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "modules/exercises"] 2 | path = modules/exercises 3 | url = git@github.com:for-geeks/playground.git 4 | -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | 5 | exports_files([ 6 | "CPPLINT.cfg", 7 | ]) 8 | -------------------------------------------------------------------------------- /CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | # Stop searching for additional config files. 2 | set noparent 3 | 4 | # Disable a warning about C++ features that were not in the original 5 | # C++11 specification (and so might not be well-supported). 6 | filter=-build/c++11 7 | 8 | # Disable header_guard warning 9 | # Consider using #pragma once instead 10 | filter=-build/header_guard 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Geekstyle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Geek Car, An Autonomous Application Based On Cyber RT 2 | 3 | ![Action Status](https://github.com/for-geeks/geek-car/workflows/Geek%20Style/badge.svg) 4 | 5 | 6 | 7 | ## Architecture 8 | 9 | 10 | 11 | ## Environment Setup 12 | 13 | ### Code Clone 14 | 15 | 1. Clone main codes: `git clone git@github.com:for-geeks/geek-car.git` 16 | 2. Update submodule: 17 | ```bash 18 | git submodule init 19 | git submodule update 20 | ``` 21 | ### Installation 22 | Let's Install Basical Library and Tools: 23 | 24 | ARM Platform : 25 | 26 | ```bash 27 | sudo bash docker/build/cyber.aarch64.sh 28 | ``` 29 | X86 Platform: 30 | 31 | ```bash 32 | sudo bash docker/build/cyber.x86_64.sh 33 | ``` 34 | 35 | ## Build Geek car 36 | 37 | ```bash 38 | bash apollo.sh build 39 | ``` 40 | 41 | ## Have a try 42 | 43 | More details about teminal. 44 | 45 | More details about develop toolschain you can find here:[CyberRT_Developer_Tools](https://github.com/ApolloAuto/apollo/blob/master/docs/cyber/CyberRT_Developer_Tools.md) 46 | 47 | 48 | ## Copyright and License 49 | Geekcar is provided under the MIT License. 50 | -------------------------------------------------------------------------------- /cyber/base/for_each_test.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | #include "cyber/base/for_each.h" 17 | 18 | #include 19 | #include 20 | #include "gtest/gtest.h" 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | namespace base { 25 | 26 | TEST(ForEachTest, base) { 27 | std::vector vec; 28 | FOR_EACH(i, 0, 100) { vec.push_back(i); } 29 | EXPECT_EQ(100, vec.size()); 30 | 31 | int index = 0; 32 | FOR_EACH(it, vec.begin(), vec.end()) { EXPECT_EQ(index++, *it); } 33 | 34 | FOR_EACH(i, 0, 'a') { EXPECT_GT('a', i); } 35 | } 36 | 37 | } // namespace base 38 | } // namespace cyber 39 | } // namespace apollo 40 | -------------------------------------------------------------------------------- /cyber/binary.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_BINARY_H_ 18 | #define CYBER_BINARY_H_ 19 | 20 | #include 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | class Binary { 25 | public: 26 | static std::string GetName() { return GetNameRef(); } 27 | static void SetName(const std::string& name) { GetNameRef() = name; } 28 | static std::string& GetNameRef() { 29 | static std::string binary_name; 30 | return binary_name; 31 | } 32 | }; 33 | } // namespace cyber 34 | } // namespace apollo 35 | 36 | #endif // CYBER_BINARY_H_ 37 | -------------------------------------------------------------------------------- /cyber/blocker/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "blocker_manager", 7 | srcs = ["blocker_manager.cc"], 8 | hdrs = ["blocker_manager.h"], 9 | deps = [ 10 | ":blocker", 11 | ], 12 | ) 13 | 14 | cc_test( 15 | name = "blocker_manager_test", 16 | size = "small", 17 | srcs = ["blocker_manager_test.cc"], 18 | deps = [ 19 | "//cyber", 20 | "//cyber/proto:unit_test_cc_proto", 21 | "@com_google_googletest//:gtest_main", 22 | ], 23 | ) 24 | 25 | cc_library( 26 | name = "blocker", 27 | hdrs = ["blocker.h"], 28 | ) 29 | 30 | cc_test( 31 | name = "blocker_test", 32 | size = "small", 33 | srcs = ["blocker_test.cc"], 34 | deps = [ 35 | "//cyber", 36 | "//cyber/proto:unit_test_cc_proto", 37 | "@com_google_googletest//:gtest_main", 38 | ], 39 | ) 40 | 41 | cc_library( 42 | name = "intra_reader", 43 | hdrs = ["intra_reader.h"], 44 | deps = [ 45 | ":blocker_manager", 46 | ], 47 | ) 48 | 49 | cc_library( 50 | name = "intra_writer", 51 | hdrs = ["intra_writer.h"], 52 | deps = [ 53 | ":blocker_manager", 54 | ], 55 | ) 56 | 57 | cpplint() 58 | -------------------------------------------------------------------------------- /cyber/class_loader/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "class_loader", 7 | srcs = [ 8 | "class_loader.cc", 9 | "utility/class_factory.cc", 10 | "utility/class_loader_utility.cc", 11 | ], 12 | hdrs = [ 13 | "class_loader.h", 14 | "class_loader_register_macro.h", 15 | "utility/class_factory.h", 16 | "utility/class_loader_utility.h", 17 | ], 18 | deps = [ 19 | "//cyber:init", 20 | "//cyber/common:log", 21 | "//third_party:PocoFoundation", 22 | ], 23 | ) 24 | 25 | cc_library( 26 | name = "class_loader_manager", 27 | srcs = ["class_loader_manager.cc"], 28 | hdrs = ["class_loader_manager.h"], 29 | deps = [ 30 | ":class_loader", 31 | ], 32 | ) 33 | 34 | cc_test( 35 | name = "class_loader_test", 36 | size = "small", 37 | srcs = ["class_loader_test.cc"], 38 | data = [ 39 | "//cyber/class_loader/test:plugin1", 40 | "//cyber/class_loader/test:plugin2", 41 | ], 42 | deps = [ 43 | "//cyber", 44 | "//cyber/class_loader/test:base", 45 | "//cyber/proto:unit_test_cc_proto", 46 | "@com_google_googletest//:gtest", 47 | ], 48 | ) 49 | 50 | cpplint() 51 | -------------------------------------------------------------------------------- /cyber/class_loader/test/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "base", 7 | hdrs = ["base.h"], 8 | ) 9 | 10 | cc_library( 11 | name = "plugin1", 12 | srcs = ["plugin1.cc"], 13 | deps = [ 14 | ":base", 15 | "//cyber/class_loader:class_loader_manager", 16 | ], 17 | ) 18 | 19 | cc_library( 20 | name = "plugin2", 21 | srcs = ["plugin2.cc"], 22 | deps = [ 23 | ":base", 24 | "//cyber/class_loader:class_loader_manager", 25 | ], 26 | ) 27 | 28 | cpplint() 29 | -------------------------------------------------------------------------------- /cyber/class_loader/test/base.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 201 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #pragma once 18 | 19 | class Base { 20 | public: 21 | virtual void DoSomething() = 0; 22 | virtual ~Base() {} 23 | }; 24 | -------------------------------------------------------------------------------- /cyber/common/log_test.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/common/log.h" 18 | 19 | #include "glog/logging.h" 20 | #include "gtest/gtest.h" 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | namespace common { 25 | 26 | TEST(LogTest, TestAll) { AINFO << "11111"; } 27 | 28 | } // namespace common 29 | } // namespace cyber 30 | } // namespace apollo 31 | -------------------------------------------------------------------------------- /cyber/common/util.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_COMMON_UTIL_H_ 18 | #define CYBER_COMMON_UTIL_H_ 19 | 20 | #include 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | namespace common { 25 | 26 | inline std::size_t Hash(const std::string& key) { 27 | return std::hash{}(key); 28 | } 29 | 30 | } // namespace common 31 | } // namespace cyber 32 | } // namespace apollo 33 | 34 | #endif // CYBER_COMMON_UTIL_H_ 35 | -------------------------------------------------------------------------------- /cyber/conf/compute_sched.conf: -------------------------------------------------------------------------------- 1 | compute_sched_classic.conf -------------------------------------------------------------------------------- /cyber/conf/control_sched.conf: -------------------------------------------------------------------------------- 1 | control_sched_classic.conf -------------------------------------------------------------------------------- /cyber/conf/control_sched_choreography.conf: -------------------------------------------------------------------------------- 1 | scheduler_conf { 2 | policy: "choreography" 3 | 4 | choreography_conf { 5 | processor_num: 2 6 | 7 | pool_processor_num: 2 8 | pool_affinity: "range" 9 | pool_cpuset: "12-15" 10 | 11 | tasks: [ 12 | { 13 | name: "control_/apollo/planning" 14 | processor: 0 15 | }, 16 | { 17 | name: "canbus_/apollo/control" 18 | processor: 0 19 | prio: 2 20 | } 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cyber/conf/control_sched_classic.conf: -------------------------------------------------------------------------------- 1 | scheduler_conf { 2 | policy: "classic" 3 | classic_conf { 4 | groups: [ 5 | { 6 | name: "control" 7 | processor_num: 8 8 | affinity: "range" 9 | cpuset: "8-15" 10 | processor_policy: "SCHED_OTHER" 11 | processor_prio: 0 12 | tasks: [ 13 | { 14 | name: "control_/apollo/planning" 15 | prio: 10 16 | }, 17 | { 18 | name: "canbus_/apollo/control" 19 | prio: 11 20 | } 21 | ] 22 | } 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /cyber/conf/cyber.pb.conf: -------------------------------------------------------------------------------- 1 | transport_conf { 2 | shm_conf { 3 | # "multicast" "condition" 4 | notifier_type: "condition" 5 | # "posix" "xsi" 6 | shm_type: "xsi" 7 | shm_locator { 8 | ip: "239.255.0.100" 9 | port: 8888 10 | } 11 | } 12 | participant_attr { 13 | lease_duration: 12 14 | announcement_period: 3 15 | domain_id_gain: 200 16 | port_base: 10000 17 | } 18 | communication_mode { 19 | same_proc: INTRA 20 | diff_proc: SHM 21 | diff_host: RTPS 22 | } 23 | resource_limit { 24 | max_history_depth: 1000 25 | } 26 | } 27 | 28 | run_mode_conf { 29 | run_mode: MODE_REALITY 30 | } 31 | 32 | scheduler_conf { 33 | routine_num: 100 34 | default_proc_num: 16 35 | } 36 | -------------------------------------------------------------------------------- /cyber/conf/dreamview_sched.conf: -------------------------------------------------------------------------------- 1 | 2 | scheduler_conf { 3 | policy: "classic" 4 | classic_conf { 5 | groups: [ 6 | { 7 | name: "dv" 8 | processor_num: 4 9 | affinity: "range" 10 | cpuset: "28-31" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cyber/conf/sensor_sched.conf: -------------------------------------------------------------------------------- 1 | 2 | scheduler_conf { 3 | policy: "classic" 4 | classic_conf { 5 | groups: [ 6 | { 7 | name: "sensors" 8 | processor_num: 64 9 | affinity: "range" 10 | cpuset: "1-8" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cyber/croutine/detail/swap.S: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | .globl ctx_swap 18 | .type ctx_swap, @function 19 | ctx_swap: 20 | pushq %rdi 21 | pushq %r12 22 | pushq %r13 23 | pushq %r14 24 | pushq %r15 25 | pushq %rbx 26 | pushq %rbp 27 | movq %rsp, (%rdi) 28 | 29 | movq (%rsi), %rsp 30 | popq %rbp 31 | popq %rbx 32 | popq %r15 33 | popq %r14 34 | popq %r13 35 | popq %r12 36 | popq %rdi 37 | ret 38 | -------------------------------------------------------------------------------- /cyber/croutine/detail/swap_aarch64.S: -------------------------------------------------------------------------------- 1 | .text 2 | .align 4 3 | .globl ctx_swap 4 | 5 | ctx_swap: 6 | stp x0, x30, [sp,#-16]! 7 | stp d8, d9, [sp,#-16]! 8 | stp d10, d11, [sp,#-16]! 9 | stp d12, d13, [sp,#-16]! 10 | stp d14, d15, [sp,#-16]! 11 | stp x1, x19, [sp,#-16]! 12 | stp x20, x21, [sp,#-16]! 13 | stp x22, x23, [sp,#-16]! 14 | stp x24, x25, [sp,#-16]! 15 | stp x26, x27, [sp,#-16]! 16 | stp x28, x29, [sp,#-16]! 17 | 18 | mov x3, sp 19 | str x3, [x0] 20 | 21 | ldr x3, [x1] 22 | mov sp, x3 23 | 24 | ldp x28, x29, [sp] 25 | ldp x26, x27, [sp,#16]! 26 | ldp x24, x25, [sp,#16]! 27 | ldp x22, x23, [sp,#16]! 28 | ldp x20, x21, [sp,#16]! 29 | ldp x1, x19, [sp,#16]! 30 | ldp d14, d15, [sp,#16]! 31 | ldp d12, d13, [sp,#16]! 32 | ldp d10, d11, [sp,#16]! 33 | ldp d8, d9, [sp,#16]! 34 | ldp x0, x30, [sp,#16]! 35 | 36 | add sp, sp, #16 37 | 38 | ret 39 | -------------------------------------------------------------------------------- /cyber/croutine/detail/swap_x86_64.S: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | .globl ctx_swap 18 | .type ctx_swap, @function 19 | ctx_swap: 20 | pushq %rdi 21 | pushq %r12 22 | pushq %r13 23 | pushq %r14 24 | pushq %r15 25 | pushq %rbx 26 | pushq %rbp 27 | movq %rsp, (%rdi) 28 | 29 | movq (%rsi), %rsp 30 | popq %rbp 31 | popq %rbx 32 | popq %r15 33 | popq %r14 34 | popq %r13 35 | popq %r12 36 | popq %rdi 37 | ret 38 | -------------------------------------------------------------------------------- /cyber/doxy-docs/Doxyfile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "Cyber RT Documents" 2 | XML_OUTPUT = xml 3 | INPUT = ../cyber.h ../init.h ../node ../record ../time ../timer ../component ../logger ../parameter ../service ../service_discovery ../python 4 | FILE_PATTERNS = *.h *.py 5 | RECURSIVE = YES 6 | GENERATE_LATEX = NO 7 | GENERATE_MAN = NO 8 | GENERATE_RTF = NO 9 | CASE_SENSE_NAMES = NO 10 | GENERATE_HTML = NO 11 | GENERATE_XML = YES 12 | RECURSIVE = YES 13 | QUIET = YES 14 | JAVADOC_AUTOBRIEF = YES 15 | WARN_IF_UNDOCUMENTED = NO 16 | MACRO_EXPANSION = YES 17 | PREDEFINED = IN_DOXYGEN 18 | -------------------------------------------------------------------------------- /cyber/doxy-docs/build_doxy_sphinx.sh: -------------------------------------------------------------------------------- 1 | rm -rf xml/* 2 | doxygen Doxyfile 3 | rm -rf build/* 4 | sphinx-build -b html -d build/doctrees source build/html 5 | -------------------------------------------------------------------------------- /cyber/doxy-docs/environment.yml: -------------------------------------------------------------------------------- 1 | name: CyberRT 2 | 3 | channels: 4 | - conda-forge 5 | 6 | dependencies: 7 | - breathe 8 | - recommonmark 9 | -------------------------------------------------------------------------------- /cyber/doxy-docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /cyber/doxy-docs/source/api/cppapi_index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | C++ API 4 | ==================== 5 | 6 | Topological communication APIs is actually implemented in ``node`` and ``reader/writer`` and ``client/service``. 7 | 8 | .. toctree:: 9 | 10 | cppapi 11 | 12 | -------------------------------------------------------------------------------- /cyber/doxy-docs/source/api/pythonapi_index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | Python API 4 | ==================== 5 | 6 | Cyber RT provides the python interfaces for developers. 7 | 8 | .. toctree:: 9 | 10 | pythonapi 11 | 12 | -------------------------------------------------------------------------------- /cyber/doxy-docs/source/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | import subprocess 6 | 7 | import sphinx_rtd_theme 8 | 9 | 10 | on_rtd = os.environ.get('READTHEDOCS', None) == 'True' 11 | 12 | if on_rtd: 13 | subprocess.call('cd ..; doxygen', shell=True) 14 | 15 | 16 | html_theme = "sphinx_rtd_theme" 17 | 18 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 19 | 20 | 21 | def setup(app): 22 | app.add_stylesheet("main_stylesheet.css") 23 | 24 | 25 | extensions = ['breathe', 'recommonmark'] 26 | breathe_projects = {'Cyber RT Documents': '../xml'} 27 | templates_path = ['_templates'] 28 | html_static_path = ['_static'] 29 | source_suffix = { 30 | '.rst': 'restructuredtext', 31 | '.md': 'markdown', 32 | } 33 | master_doc = 'index' 34 | project = 'Cyber RT Documents' 35 | copyright = '2019, Apollo' 36 | author = 'Apollo Baidu' 37 | 38 | #html_logo = 'quantstack-white.svg' 39 | 40 | exclude_patterns = [] 41 | highlight_language = 'c++' 42 | pygments_style = 'sphinx' 43 | todo_include_todos = False 44 | htmlhelp_basename = 'CyberRTdoc' 45 | -------------------------------------------------------------------------------- /cyber/doxy-docs/source/images/cyber_monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/cyber/doxy-docs/source/images/cyber_monitor.png -------------------------------------------------------------------------------- /cyber/doxy-docs/source/images/cyber_visualizer1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/cyber/doxy-docs/source/images/cyber_visualizer1.png -------------------------------------------------------------------------------- /cyber/doxy-docs/source/images/cyber_visualizer2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/cyber/doxy-docs/source/images/cyber_visualizer2.png -------------------------------------------------------------------------------- /cyber/doxy-docs/source/images/cyber_visualizer3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/cyber/doxy-docs/source/images/cyber_visualizer3.png -------------------------------------------------------------------------------- /cyber/doxy-docs/source/images/cyber_visualizer4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/cyber/doxy-docs/source/images/cyber_visualizer4.png -------------------------------------------------------------------------------- /cyber/event/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "perf_event_cache", 7 | srcs = ["perf_event_cache.cc"], 8 | hdrs = ["perf_event_cache.h"], 9 | deps = [ 10 | ":perf_event", 11 | "//cyber:state", 12 | "//cyber/base:bounded_queue", 13 | "//cyber/common:global_data", 14 | "//cyber/common:log", 15 | "//cyber/common:macros", 16 | "//cyber/time", 17 | ], 18 | ) 19 | 20 | cc_library( 21 | name = "perf_event", 22 | hdrs = ["perf_event.h"], 23 | deps = [ 24 | "//cyber/common:global_data", 25 | ], 26 | ) 27 | 28 | cpplint() 29 | -------------------------------------------------------------------------------- /cyber/examples/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "talker", 7 | srcs = ["talker.cc"], 8 | deps = [ 9 | "//cyber", 10 | "//cyber/examples/proto:examples_cc_proto", 11 | ], 12 | ) 13 | 14 | cc_binary( 15 | name = "listener", 16 | srcs = ["listener.cc"], 17 | deps = [ 18 | "//cyber", 19 | "//cyber/examples/proto:examples_cc_proto", 20 | ], 21 | ) 22 | 23 | cc_binary( 24 | name = "paramserver", 25 | srcs = ["paramserver.cc"], 26 | deps = [ 27 | "//cyber", 28 | "//cyber/parameter", 29 | ], 30 | ) 31 | 32 | cc_binary( 33 | name = "service", 34 | srcs = ["service.cc"], 35 | deps = [ 36 | "//cyber", 37 | "//cyber/examples/proto:examples_cc_proto", 38 | ], 39 | ) 40 | 41 | cc_binary( 42 | name = "record", 43 | srcs = ["record.cc"], 44 | deps = [ 45 | "//cyber", 46 | "//cyber/proto:record_cc_proto", 47 | ], 48 | ) 49 | 50 | cpplint() 51 | -------------------------------------------------------------------------------- /cyber/examples/common_component_example/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "libcommon_component_example.so", 7 | linkopts = ["-shared"], 8 | linkstatic = False, 9 | deps = [":common_component_example_lib"], 10 | ) 11 | 12 | cc_library( 13 | name = "common_component_example_lib", 14 | srcs = ["common_component_example.cc"], 15 | hdrs = ["common_component_example.h"], 16 | deps = [ 17 | "//cyber", 18 | "//cyber/examples/proto:examples_cc_proto", 19 | ], 20 | ) 21 | 22 | cpplint() 23 | -------------------------------------------------------------------------------- /cyber/examples/common_component_example/common.dag: -------------------------------------------------------------------------------- 1 | # Define all coms in DAG streaming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/cyber/examples/common_component_example/libcommon_component_example.so" 4 | components { 5 | class_name : "CommonComponentSample" 6 | config { 7 | name : "common" 8 | readers { 9 | channel: "/apollo/prediction" 10 | } 11 | readers { 12 | channel: "/apollo/test" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cyber/examples/common_component_example/common.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | common 4 | /apollo/cyber/examples/common_component_example/common.dag 5 | common 6 | 7 | 8 | -------------------------------------------------------------------------------- /cyber/examples/common_component_example/common_component_example.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | #include "cyber/examples/common_component_example/common_component_example.h" 17 | 18 | bool CommonComponentSample::Init() { 19 | AINFO << "Commontest component init"; 20 | return true; 21 | } 22 | 23 | bool CommonComponentSample::Proc(const std::shared_ptr& msg0, 24 | const std::shared_ptr& msg1) { 25 | AINFO << "Start common component Proc [" << msg0->msg_id() << "] [" 26 | << msg1->msg_id() << "]"; 27 | return true; 28 | } 29 | -------------------------------------------------------------------------------- /cyber/examples/common_component_example/common_component_example.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | #include 17 | 18 | #include "cyber/component/component.h" 19 | #include "cyber/examples/proto/examples.pb.h" 20 | 21 | using apollo::cyber::Component; 22 | using apollo::cyber::ComponentBase; 23 | using apollo::cyber::examples::proto::Driver; 24 | 25 | class CommonComponentSample : public Component { 26 | public: 27 | bool Init() override; 28 | bool Proc(const std::shared_ptr& msg0, 29 | const std::shared_ptr& msg1) override; 30 | }; 31 | CYBER_REGISTER_COMPONENT(CommonComponentSample) 32 | -------------------------------------------------------------------------------- /cyber/examples/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "examples_cc_proto", 5 | deps = [ 6 | ":examples_proto", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "examples_proto", 12 | srcs = ["examples.proto"], 13 | ) 14 | -------------------------------------------------------------------------------- /cyber/examples/proto/examples.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.examples.proto; 4 | 5 | message SamplesTest1 { 6 | optional string class_name = 1; 7 | optional string case_name = 2; 8 | }; 9 | 10 | message Chatter { 11 | optional uint64 timestamp = 1; 12 | optional uint64 lidar_timestamp = 2; 13 | optional uint64 seq = 3; 14 | optional bytes content = 4; 15 | }; 16 | 17 | message Driver { 18 | optional string content = 1; 19 | optional uint64 msg_id = 2; 20 | optional uint64 timestamp = 3; 21 | }; 22 | -------------------------------------------------------------------------------- /cyber/examples/timer_component_example/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "libtimer_component_example.so", 7 | linkopts = ["-shared"], 8 | linkstatic = False, 9 | deps = [":timer_component_example_lib"], 10 | ) 11 | 12 | cc_library( 13 | name = "timer_component_example_lib", 14 | srcs = ["timer_component_example.cc"], 15 | hdrs = ["timer_component_example.h"], 16 | deps = [ 17 | "//cyber", 18 | "//cyber/examples/proto:examples_cc_proto", 19 | ], 20 | ) 21 | 22 | cpplint() 23 | -------------------------------------------------------------------------------- /cyber/examples/timer_component_example/timer.dag: -------------------------------------------------------------------------------- 1 | module_config { 2 | module_library : "/apollo/bazel-bin/cyber/examples/timer_component_example/libtimer_component_example.so" 3 | timer_components { 4 | class_name : "TimerComponentSample" 5 | config { 6 | name : "timer" 7 | interval : 10 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /cyber/examples/timer_component_example/timer.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | timer 4 | /apollo/cyber/examples/timer_component_example/timer.dag 5 | timer 6 | 7 | 8 | -------------------------------------------------------------------------------- /cyber/init.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_INIT_H_ 18 | #define CYBER_INIT_H_ 19 | 20 | #include "cyber/common/log.h" 21 | #include "cyber/state.h" 22 | 23 | namespace apollo { 24 | namespace cyber { 25 | 26 | bool Init(const char* binary_name); 27 | void Clear(); 28 | 29 | } // namespace cyber 30 | } // namespace apollo 31 | 32 | #endif // CYBER_INIT_H_ 33 | -------------------------------------------------------------------------------- /cyber/message/intra_message.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/message/intra_message.h" 18 | -------------------------------------------------------------------------------- /cyber/message/intra_message.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_MESSAGE_INTRA_MESSAGE_H_ 18 | #define CYBER_MESSAGE_INTRA_MESSAGE_H_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace apollo { 25 | namespace cyber { 26 | namespace message { 27 | 28 | class IntraMessage {}; 29 | 30 | } // namespace message 31 | } // namespace cyber 32 | } // namespace apollo 33 | 34 | #endif // CYBER_MESSAGE_INTRA_MESSAGE_H_ 35 | -------------------------------------------------------------------------------- /cyber/proto/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # **************************************************************************** 3 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 4 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # **************************************************************************** 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /cyber/proto/choreography_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | message ChoreographyTask { 6 | optional string name = 1; 7 | optional int32 processor = 2; 8 | optional uint32 prio = 3 [default = 1]; 9 | } 10 | 11 | message ChoreographyConf { 12 | optional uint32 choreography_processor_num = 1; 13 | optional string choreography_affinity = 2; 14 | optional string choreography_processor_policy = 3; 15 | optional int32 choreography_processor_prio = 4; 16 | optional string choreography_cpuset = 5; 17 | optional uint32 pool_processor_num = 6; 18 | optional string pool_affinity = 7; 19 | optional string pool_processor_policy = 8; 20 | optional int32 pool_processor_prio = 9; 21 | optional string pool_cpuset = 10; 22 | repeated ChoreographyTask tasks = 11; 23 | } 24 | -------------------------------------------------------------------------------- /cyber/proto/classic_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | message ClassicTask { 6 | optional string name = 1; 7 | optional uint32 prio = 2 [default = 1]; 8 | optional string group_name = 3; 9 | } 10 | 11 | message SchedGroup { 12 | required string name = 1 [default = "default_grp"]; 13 | optional uint32 processor_num = 2; 14 | optional string affinity = 3; 15 | optional string cpuset = 4; 16 | optional string processor_policy = 5; 17 | optional int32 processor_prio = 6 [default = 0]; 18 | repeated ClassicTask tasks = 7; 19 | } 20 | 21 | message ClassicConf { 22 | repeated SchedGroup groups = 1; 23 | } 24 | -------------------------------------------------------------------------------- /cyber/proto/component_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | import "cyber/proto/qos_profile.proto"; 6 | 7 | message ReaderOption { 8 | optional string channel = 1; 9 | optional QosProfile qos_profile = 10 | 2; // depth: used to define capacity of processed messages 11 | optional uint32 pending_queue_size = 3 12 | [default = 1]; // used to define capacity of unprocessed messages 13 | } 14 | 15 | message ComponentConfig { 16 | optional string name = 1; 17 | optional string config_file_path = 2; 18 | optional string flag_file_path = 3; 19 | repeated ReaderOption readers = 4; 20 | } 21 | 22 | message TimerComponentConfig { 23 | optional string name = 1; 24 | optional string config_file_path = 2; 25 | optional string flag_file_path = 3; 26 | optional uint32 interval = 4; // In milliseconds. 27 | } 28 | -------------------------------------------------------------------------------- /cyber/proto/cyber_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | import "cyber/proto/scheduler_conf.proto"; 6 | import "cyber/proto/transport_conf.proto"; 7 | import "cyber/proto/run_mode_conf.proto"; 8 | import "cyber/proto/perf_conf.proto"; 9 | 10 | message CyberConfig { 11 | optional SchedulerConf scheduler_conf = 1; 12 | optional TransportConf transport_conf = 2; 13 | optional RunModeConf run_mode_conf = 3; 14 | optional PerfConf perf_conf = 4; 15 | } 16 | -------------------------------------------------------------------------------- /cyber/proto/dag_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | import "cyber/proto/component_conf.proto"; 6 | 7 | message ComponentInfo { 8 | optional string class_name = 1; 9 | optional ComponentConfig config = 2; 10 | } 11 | 12 | message TimerComponentInfo { 13 | optional string class_name = 1; 14 | optional TimerComponentConfig config = 2; 15 | } 16 | 17 | message ModuleConfig { 18 | optional string module_library = 1; 19 | repeated ComponentInfo components = 2; 20 | repeated TimerComponentInfo timer_components = 3; 21 | } 22 | 23 | message DagConfig { 24 | repeated ModuleConfig module_config = 1; 25 | } 26 | -------------------------------------------------------------------------------- /cyber/proto/parameter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | enum ParamType { 6 | NOT_SET = 0; 7 | BOOL = 1; 8 | INT = 2; 9 | DOUBLE = 3; 10 | STRING = 4; 11 | PROTOBUF = 5; 12 | } 13 | 14 | message Param { 15 | optional string name = 1; 16 | optional ParamType type = 2; 17 | optional string type_name = 3; 18 | oneof oneof_value { 19 | bool bool_value = 4; 20 | int64 int_value = 5; 21 | double double_value = 6; 22 | string string_value = 7; 23 | } 24 | optional bytes proto_desc = 8; 25 | } 26 | 27 | message NodeName { 28 | optional string value = 1; 29 | } 30 | 31 | message ParamName { 32 | optional string value = 1; 33 | } 34 | 35 | message BoolResult { 36 | optional bool value = 1; 37 | } 38 | 39 | message Params { 40 | repeated Param param = 1; 41 | } 42 | -------------------------------------------------------------------------------- /cyber/proto/perception.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | message Perception { 6 | message Header { 7 | optional uint64 timestamp = 1; 8 | } 9 | optional Header header = 1; 10 | optional uint64 msg_id = 2; 11 | optional double result = 3; 12 | }; 13 | -------------------------------------------------------------------------------- /cyber/proto/perf_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | enum PerfType { 6 | SCHED = 1; 7 | TRANSPORT = 2; 8 | DATA_CACHE = 3; 9 | ALL = 4; 10 | } 11 | 12 | message PerfConf { 13 | optional bool enable = 1 [default = false]; 14 | optional PerfType type = 2 [default = ALL]; 15 | } 16 | -------------------------------------------------------------------------------- /cyber/proto/proto_desc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | message ProtoDesc { 6 | optional bytes desc = 1; 7 | repeated ProtoDesc dependencies = 2; 8 | } 9 | -------------------------------------------------------------------------------- /cyber/proto/qos_profile.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | enum QosHistoryPolicy { 6 | HISTORY_SYSTEM_DEFAULT = 0; 7 | HISTORY_KEEP_LAST = 1; 8 | HISTORY_KEEP_ALL = 2; 9 | }; 10 | 11 | enum QosReliabilityPolicy { 12 | RELIABILITY_SYSTEM_DEFAULT = 0; 13 | RELIABILITY_RELIABLE = 1; 14 | RELIABILITY_BEST_EFFORT = 2; 15 | }; 16 | 17 | enum QosDurabilityPolicy { 18 | DURABILITY_SYSTEM_DEFAULT = 0; 19 | DURABILITY_TRANSIENT_LOCAL = 1; 20 | DURABILITY_VOLATILE = 2; 21 | }; 22 | 23 | message QosProfile { 24 | optional QosHistoryPolicy history = 1 [default = HISTORY_KEEP_LAST]; 25 | optional uint32 depth = 2 [default = 1]; // capacity of history 26 | optional uint32 mps = 3 [default = 0]; // messages per second 27 | optional QosReliabilityPolicy reliability = 4 28 | [default = RELIABILITY_RELIABLE]; 29 | optional QosDurabilityPolicy durability = 5 [default = DURABILITY_VOLATILE]; 30 | }; -------------------------------------------------------------------------------- /cyber/proto/role_attributes.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | import "cyber/proto/qos_profile.proto"; 6 | 7 | message SocketAddr { 8 | optional string ip = 1; // dotted decimal 9 | optional uint32 port = 2; 10 | }; 11 | 12 | message RoleAttributes { 13 | optional string host_name = 1; 14 | optional string host_ip = 2; 15 | optional int32 process_id = 3; 16 | optional string node_name = 4; 17 | optional uint64 node_id = 5; // hash value of node_name 18 | // especially for WRITER and READER 19 | optional string channel_name = 6; 20 | optional uint64 channel_id = 7; // hash value of channel_name 21 | optional string message_type = 8; 22 | optional bytes proto_desc = 9; 23 | optional uint64 id = 10; 24 | optional QosProfile qos_profile = 11; 25 | optional SocketAddr socket_addr = 12; // reserved for socket communication 26 | // especially for SERVER and CLIENT 27 | optional string service_name = 13; 28 | optional uint64 service_id = 14; // hash value of service_name 29 | }; 30 | -------------------------------------------------------------------------------- /cyber/proto/run_mode_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | enum RunMode { 6 | MODE_REALITY = 0; 7 | MODE_SIMULATION = 1; 8 | } 9 | 10 | message RunModeConf { 11 | optional RunMode run_mode = 1 [default = MODE_REALITY]; 12 | } 13 | -------------------------------------------------------------------------------- /cyber/proto/scheduler_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | import "cyber/proto/classic_conf.proto"; 6 | import "cyber/proto/choreography_conf.proto"; 7 | 8 | message InnerThread { 9 | optional string name = 1; 10 | optional string cpuset = 2; 11 | optional string policy = 3; 12 | optional uint32 prio = 4 [default = 1]; 13 | } 14 | 15 | message SchedulerConf { 16 | optional string policy = 1; 17 | optional uint32 routine_num = 2; 18 | optional uint32 default_proc_num = 3; 19 | optional string process_level_cpuset = 4; 20 | repeated InnerThread threads = 5; 21 | optional ClassicConf classic_conf = 6; 22 | optional ChoreographyConf choreography_conf = 7; 23 | } 24 | -------------------------------------------------------------------------------- /cyber/proto/topology_change.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | import "cyber/proto/role_attributes.proto"; 6 | 7 | enum ChangeType { 8 | CHANGE_NODE = 1; 9 | CHANGE_CHANNEL = 2; 10 | CHANGE_SERVICE = 3; 11 | CHANGE_PARTICIPANT = 4; 12 | }; 13 | 14 | enum OperateType { 15 | OPT_JOIN = 1; 16 | OPT_LEAVE = 2; 17 | }; 18 | 19 | enum RoleType { 20 | ROLE_NODE = 1; 21 | ROLE_WRITER = 2; 22 | ROLE_READER = 3; 23 | ROLE_SERVER = 4; 24 | ROLE_CLIENT = 5; 25 | ROLE_PARTICIPANT = 6; 26 | }; 27 | 28 | message ChangeMsg { 29 | optional uint64 timestamp = 1; 30 | optional ChangeType change_type = 2; 31 | optional OperateType operate_type = 3; 32 | optional RoleType role_type = 4; 33 | optional RoleAttributes role_attr = 5; 34 | }; 35 | -------------------------------------------------------------------------------- /cyber/proto/transport_conf.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | enum OptionalMode { 6 | HYBRID = 0; 7 | INTRA = 1; 8 | SHM = 2; 9 | RTPS = 3; 10 | } 11 | 12 | message ShmMulticastLocator { 13 | optional string ip = 1; 14 | optional uint32 port = 2; 15 | }; 16 | 17 | message ShmConf { 18 | optional string notifier_type = 1; 19 | optional string shm_type = 2; 20 | optional ShmMulticastLocator shm_locator = 3; 21 | }; 22 | 23 | message RtpsParticipantAttr { 24 | optional int32 lease_duration = 1 [default = 12]; 25 | optional int32 announcement_period = 2 [default = 3]; 26 | optional uint32 domain_id_gain = 3 [default = 200]; 27 | optional uint32 port_base = 4 [default = 10000]; 28 | }; 29 | 30 | message CommunicationMode { 31 | optional OptionalMode same_proc = 1 [default = INTRA]; // INTRA SHM RTPS 32 | optional OptionalMode diff_proc = 2 [default = SHM]; // SHM RTPS 33 | optional OptionalMode diff_host = 3 [default = RTPS]; // RTPS 34 | }; 35 | 36 | message ResourceLimit { 37 | optional uint32 max_history_depth = 1 [default = 1000]; 38 | }; 39 | 40 | message TransportConf { 41 | optional ShmConf shm_conf = 1; 42 | optional RtpsParticipantAttr participant_attr = 2; 43 | optional CommunicationMode communication_mode = 3; 44 | optional ResourceLimit resource_limit = 4; 45 | }; 46 | -------------------------------------------------------------------------------- /cyber/proto/unit_test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.cyber.proto; 4 | 5 | message UnitTest { 6 | optional string class_name = 1; 7 | optional string case_name = 2; 8 | }; 9 | 10 | message Chatter { 11 | optional uint64 timestamp = 1; 12 | optional uint64 lidar_timestamp = 2; 13 | optional uint64 seq = 3; 14 | optional bytes content = 4; 15 | }; 16 | 17 | message ChatterBenchmark { 18 | optional uint64 stamp = 1; 19 | optional uint64 seq = 2; 20 | optional string content = 3; 21 | } 22 | -------------------------------------------------------------------------------- /cyber/py_wrapper/py_init_test.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/py_wrapper/py_init.h" 18 | 19 | #include 20 | #include 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | 25 | TEST(PyInitTest, test_init) { 26 | EXPECT_TRUE(py_init("py_init_test")); 27 | EXPECT_TRUE(py_ok()); 28 | 29 | py_shutdown(); 30 | EXPECT_TRUE(py_is_shutdown()); 31 | } 32 | 33 | } // namespace cyber 34 | } // namespace apollo 35 | -------------------------------------------------------------------------------- /cyber/py_wrapper/test/test_init.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include 18 | 19 | #include "cyber/cyber.h" 20 | #include "cyber/py_wrapper/py_node.h" 21 | #include "gtest/gtest.h" 22 | 23 | TEST(CyberInitTest, test_init) { 24 | EXPECT_TRUE(apollo::cyber::OK()); 25 | EXPECT_TRUE(apollo::cyber::IsShutdown()); 26 | } 27 | 28 | int main(int argc, char** argv) { 29 | apollo::cyber::Init(argv[0]); 30 | testing::InitGoogleTest(&argc, argv); 31 | return RUN_ALL_TESTS(); 32 | } 33 | -------------------------------------------------------------------------------- /cyber/python/README.md: -------------------------------------------------------------------------------- 1 | # Python Wrapper for Cyber RT 2 | 3 | ## Usage 4 | 5 | Make sure you have built Apollo successfully, which should also have added 6 | `/apollo/cyber/python` to the PYTHONPATH for you. Then in Python code: 7 | 8 | ```python 9 | import sys 10 | 11 | from cyber_py3 import cyber 12 | 13 | 14 | cyber.init() 15 | 16 | if not cyber.ok(): 17 | print('Well, something is wrong.') 18 | sys.exit(1) 19 | 20 | # Do your job here. 21 | cyber.shutdown() 22 | ``` 23 | 24 | Learn more usage from the [examples](cyber_py3/examples/) and 25 | [tests](cyber_py3/test/). 26 | 27 | ## Work with Python2? 28 | 29 | Firstly, it's not recommended, as Python2 is deprecated since 30 | [Jan 1, 2020](https://pythonclock.org). We also deprioritized maintaining the 31 | Python2 Wrapper. 32 | 33 | Similar to the Python 3 wrapper, but just import things from the cyber_py 34 | module. Everything should work the same. 35 | 36 | ```python 37 | import sys 38 | 39 | from cyber_py import cyber 40 | 41 | 42 | cyber.init() 43 | 44 | if not cyber.ok(): 45 | print('Well, something is wrong.') 46 | sys.exit(1) 47 | 48 | # Do your job here. 49 | cyber.shutdown() 50 | ``` 51 | 52 | Learn more usage from the [examples](cyber_py/examples/) and 53 | [tests](cyber_py/test/). 54 | -------------------------------------------------------------------------------- /cyber/python/cyber_py/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | # **************************************************************************** 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # **************************************************************************** 18 | 19 | import sys 20 | 21 | 22 | if sys.version_info[0] >= 3: 23 | sys.stderr.write(''' 24 | You are running Python3 while importing Python2 Cyber wrapper! 25 | Please change to "import cyber_py3.xyz" accordingly.\n''') 26 | sys.exit(1) 27 | -------------------------------------------------------------------------------- /cyber/python/cyber_py/examples/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "py_talker", 7 | srcs = ["py_talker.cc"], 8 | deps = [ 9 | "//cyber", 10 | "//cyber/proto:unit_test_cc_proto", 11 | "//cyber/py_wrapper:py_cyber", 12 | ], 13 | ) 14 | 15 | cc_binary( 16 | name = "py_listener", 17 | srcs = ["py_listener.cc"], 18 | deps = [ 19 | "//cyber", 20 | "//cyber/proto:unit_test_cc_proto", 21 | "//cyber/py_wrapper:py_cyber", 22 | ], 23 | ) 24 | 25 | cc_binary( 26 | name = "py_service", 27 | srcs = ["py_service.cc"], 28 | deps = [ 29 | "//cyber", 30 | "//cyber/proto:unit_test_cc_proto", 31 | "//cyber/py_wrapper:py_cyber", 32 | ], 33 | ) 34 | 35 | cpplint() 36 | -------------------------------------------------------------------------------- /cyber/python/cyber_py/test/test_init.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | # **************************************************************************** 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # **************************************************************************** 18 | # -*- coding: utf-8 -*- 19 | """Module for test init.""" 20 | 21 | import unittest 22 | 23 | from cyber_py import cyber 24 | 25 | 26 | class TestInit(unittest.TestCase): 27 | 28 | """ 29 | Class for init unit test. 30 | """ 31 | 32 | def test_init(self): 33 | """ 34 | Test cyber. 35 | """ 36 | self.assertTrue(cyber.init()) 37 | self.assertTrue(cyber.ok()) 38 | cyber.shutdown() 39 | self.assertTrue(cyber.is_shutdown()) 40 | 41 | if __name__ == '__main__': 42 | unittest.main() 43 | -------------------------------------------------------------------------------- /cyber/python/cyber_py3/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | py_library( 4 | name = "record", 5 | srcs = ["record.py"] 6 | ) 7 | -------------------------------------------------------------------------------- /cyber/python/cyber_py3/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # **************************************************************************** 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # **************************************************************************** 18 | 19 | import sys 20 | 21 | 22 | if sys.version_info[0] < 3: 23 | sys.stderr.write(''' 24 | You are running Python2 while importing Python3 Cyber wrapper! 25 | Please change to "import cyber_py.xyz" accordingly.\n''') 26 | sys.exit(1) 27 | -------------------------------------------------------------------------------- /cyber/python/cyber_py3/test/test_init.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # **************************************************************************** 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # **************************************************************************** 18 | # -*- coding: utf-8 -*- 19 | """Module for test init.""" 20 | 21 | import unittest 22 | 23 | from cyber_py3 import cyber 24 | 25 | 26 | class TestInit(unittest.TestCase): 27 | 28 | """ 29 | Class for init unit test. 30 | """ 31 | 32 | def test_init(self): 33 | """ 34 | Test cyber. 35 | """ 36 | self.assertTrue(cyber.init()) 37 | self.assertTrue(cyber.ok()) 38 | cyber.shutdown() 39 | self.assertTrue(cyber.is_shutdown()) 40 | 41 | 42 | if __name__ == '__main__': 43 | unittest.main() 44 | -------------------------------------------------------------------------------- /cyber/record/file/section.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_RECORD_FILE_SECTION_H_ 18 | #define CYBER_RECORD_FILE_SECTION_H_ 19 | 20 | namespace apollo { 21 | namespace cyber { 22 | namespace record { 23 | 24 | struct Section { 25 | proto::SectionType type; 26 | int64_t size; 27 | }; 28 | 29 | } // namespace record 30 | } // namespace cyber 31 | } // namespace apollo 32 | 33 | #endif // CYBER_RECORD_FILE_SECTION_H_ 34 | -------------------------------------------------------------------------------- /cyber/scheduler/common/cv_wrapper.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_SCHEDULER_COMMON_CV_WRAPPER_H_ 18 | #define CYBER_SCHEDULER_COMMON_CV_WRAPPER_H_ 19 | 20 | #include 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | namespace scheduler { 25 | 26 | class CvWrapper { 27 | public: 28 | CvWrapper& operator=(const CvWrapper& other) = delete; 29 | std::condition_variable& Cv() { return cv_; } 30 | 31 | private: 32 | mutable std::condition_variable cv_; 33 | }; 34 | 35 | } // namespace scheduler 36 | } // namespace cyber 37 | } // namespace apollo 38 | 39 | #endif // CYBER_SCHEDULER_COMMON_CV_WRAPPER_H_ 40 | -------------------------------------------------------------------------------- /cyber/scheduler/common/mutex_wrapper.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_SCHEDULER_COMMON_MUTEX_WRAPPER_H_ 18 | #define CYBER_SCHEDULER_COMMON_MUTEX_WRAPPER_H_ 19 | 20 | #include 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | namespace scheduler { 25 | 26 | class MutexWrapper { 27 | public: 28 | MutexWrapper& operator=(const MutexWrapper& other) = delete; 29 | std::mutex& Mutex() { return mutex_; } 30 | 31 | private: 32 | mutable std::mutex mutex_; 33 | }; 34 | 35 | } // namespace scheduler 36 | } // namespace cyber 37 | } // namespace apollo 38 | 39 | #endif // CYBER_SCHEDULER_COMMON_MUTEX_WRAPPER_H_ 40 | -------------------------------------------------------------------------------- /cyber/scheduler/processor_context.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/scheduler/processor_context.h" 18 | 19 | namespace apollo { 20 | namespace cyber { 21 | namespace scheduler { 22 | 23 | void ProcessorContext::Shutdown() { stop_.store(true); } 24 | 25 | } // namespace scheduler 26 | } // namespace cyber 27 | } // namespace apollo 28 | -------------------------------------------------------------------------------- /cyber/service/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "client", 7 | hdrs = ["client.h"], 8 | deps = [ 9 | ":client_base", 10 | ], 11 | ) 12 | 13 | cc_library( 14 | name = "client_base", 15 | hdrs = ["client_base.h"], 16 | ) 17 | 18 | cc_library( 19 | name = "service", 20 | hdrs = ["service.h"], 21 | deps = [ 22 | ":service_base", 23 | "//cyber/scheduler", 24 | ], 25 | ) 26 | 27 | cc_library( 28 | name = "service_base", 29 | hdrs = ["service_base.h"], 30 | ) 31 | 32 | cpplint() 33 | -------------------------------------------------------------------------------- /cyber/state.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/state.h" 18 | 19 | #include 20 | 21 | namespace apollo { 22 | namespace cyber { 23 | 24 | namespace { 25 | std::atomic g_cyber_state; 26 | } 27 | 28 | State GetState() { return g_cyber_state.load(); } 29 | 30 | void SetState(const State& state) { g_cyber_state.store(state); } 31 | 32 | } // namespace cyber 33 | } // namespace apollo 34 | -------------------------------------------------------------------------------- /cyber/sysmo/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_test( 6 | name = "sysmo_test", 7 | size = "small", 8 | srcs = ["sysmo_test.cc"], 9 | deps = [ 10 | "//cyber:cyber_core", 11 | "//cyber/scheduler:scheduler_factory", 12 | "@com_google_googletest//:gtest_main", 13 | ], 14 | ) 15 | 16 | cc_library( 17 | name = "sysmo", 18 | srcs = ["sysmo.cc"], 19 | hdrs = ["sysmo.h"], 20 | deps = [ 21 | "//cyber/scheduler:scheduler_factory", 22 | ], 23 | ) 24 | 25 | cpplint() 26 | -------------------------------------------------------------------------------- /cyber/task/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "task", 7 | hdrs = ["task.h"], 8 | deps = [ 9 | ":task_manager", 10 | ], 11 | ) 12 | 13 | cc_test( 14 | name = "task_test", 15 | size = "small", 16 | srcs = ["task_test.cc"], 17 | deps = [ 18 | "//cyber:cyber_core", 19 | "@com_google_googletest//:gtest_main", 20 | ], 21 | ) 22 | 23 | cc_library( 24 | name = "task_manager", 25 | srcs = ["task_manager.cc"], 26 | hdrs = ["task_manager.h"], 27 | deps = [ 28 | "//cyber/scheduler:scheduler_factory", 29 | ], 30 | ) 31 | 32 | cpplint() 33 | -------------------------------------------------------------------------------- /cyber/time/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "time", 7 | srcs = ["time.cc"], 8 | hdrs = ["time.h"], 9 | deps = [ 10 | ":duration", 11 | "//cyber/common", 12 | ], 13 | ) 14 | 15 | cc_test( 16 | name = "time_test", 17 | size = "small", 18 | srcs = ["time_test.cc"], 19 | deps = [ 20 | "//cyber:cyber_core", 21 | "@com_google_googletest//:gtest_main", 22 | ], 23 | ) 24 | 25 | cc_library( 26 | name = "rate", 27 | srcs = ["rate.cc"], 28 | hdrs = ["rate.h"], 29 | deps = [ 30 | ":duration", 31 | ":time", 32 | "//cyber/common", 33 | ], 34 | ) 35 | 36 | cc_library( 37 | name = "duration", 38 | srcs = ["duration.cc"], 39 | hdrs = ["duration.h"], 40 | deps = [ 41 | "//cyber/common", 42 | ], 43 | ) 44 | 45 | cc_test( 46 | name = "duration_test", 47 | size = "small", 48 | srcs = ["duration_test.cc"], 49 | deps = [ 50 | "//cyber:cyber_core", 51 | "@com_google_googletest//:gtest_main", 52 | ], 53 | ) 54 | 55 | cpplint() 56 | -------------------------------------------------------------------------------- /cyber/timer/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "timer", 7 | srcs = ["timer.cc"], 8 | hdrs = ["timer.h"], 9 | deps = [ 10 | ":timing_wheel", 11 | "//cyber/common:global_data", 12 | ], 13 | ) 14 | 15 | cc_library( 16 | name = "timer_task", 17 | hdrs = ["timer_task.h"], 18 | ) 19 | 20 | cc_library( 21 | name = "timer_bucket", 22 | hdrs = ["timer_bucket.h"], 23 | deps = [ 24 | ":timer_task", 25 | ], 26 | ) 27 | 28 | cc_library( 29 | name = "timing_wheel", 30 | srcs = ["timing_wheel.cc"], 31 | hdrs = ["timing_wheel.h"], 32 | deps = [ 33 | ":timer_bucket", 34 | "//cyber/task", 35 | "//cyber/time", 36 | "//cyber/time:duration", 37 | "//cyber/time:rate", 38 | ], 39 | ) 40 | 41 | cc_test( 42 | name = "timer_test", 43 | size = "small", 44 | timeout = "moderate", 45 | srcs = ["timer_test.cc"], 46 | deps = [ 47 | "//cyber:cyber_core", 48 | "//cyber:init", 49 | "@com_google_googletest//:gtest_main", 50 | ], 51 | ) 52 | 53 | cpplint() 54 | -------------------------------------------------------------------------------- /cyber/timer/timer_task.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/timer/timer_task.h" 18 | 19 | #include "cyber/task/task.h" 20 | 21 | namespace apollo { 22 | namespace cyber { 23 | 24 | void TimerTask::Fire(bool async) { 25 | if (status_ != INIT) { 26 | return; 27 | } 28 | if (oneshot_) // not repeat. so always on ready 29 | status_ = EXPIRED; 30 | if (async) { 31 | cyber::Async(handler_); 32 | } else { 33 | handler_(); 34 | } 35 | } 36 | 37 | bool TimerTask::Cancel() { 38 | if (State() != INIT) { 39 | return false; 40 | } 41 | status_ = CANCELED; 42 | return true; 43 | } 44 | } // namespace cyber 45 | } // namespace apollo 46 | -------------------------------------------------------------------------------- /cyber/transport/dispatcher/dispatcher.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/transport/dispatcher/dispatcher.h" 18 | 19 | namespace apollo { 20 | namespace cyber { 21 | namespace transport { 22 | 23 | Dispatcher::Dispatcher() : is_shutdown_(false) {} 24 | 25 | Dispatcher::~Dispatcher() { Shutdown(); } 26 | 27 | void Dispatcher::Shutdown() { 28 | is_shutdown_.store(true); 29 | ADEBUG << "Shutdown"; 30 | } 31 | 32 | bool Dispatcher::HasChannel(uint64_t channel_id) { 33 | return msg_listeners_.Has(channel_id); 34 | } 35 | 36 | } // namespace transport 37 | } // namespace cyber 38 | } // namespace apollo 39 | -------------------------------------------------------------------------------- /cyber/transport/dispatcher/intra_dispatcher.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/transport/dispatcher/intra_dispatcher.h" 18 | 19 | namespace apollo { 20 | namespace cyber { 21 | namespace transport { 22 | 23 | IntraDispatcher::IntraDispatcher() { chain_.reset(new ChannelChain()); } 24 | 25 | IntraDispatcher::~IntraDispatcher() {} 26 | 27 | } // namespace transport 28 | } // namespace cyber 29 | } // namespace apollo 30 | -------------------------------------------------------------------------------- /cyber/transport/shm/segment_factory.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #ifndef CYBER_TRANSPORT_SHM_SEGMENT_FACTORY_H_ 18 | #define CYBER_TRANSPORT_SHM_SEGMENT_FACTORY_H_ 19 | 20 | #include "cyber/transport/shm/segment.h" 21 | 22 | namespace apollo { 23 | namespace cyber { 24 | namespace transport { 25 | 26 | class SegmentFactory { 27 | public: 28 | static SegmentPtr CreateSegment(uint64_t channel_id); 29 | }; 30 | 31 | } // namespace transport 32 | } // namespace cyber 33 | } // namespace apollo 34 | 35 | #endif // CYBER_TRANSPORT_SHM_SEGMENT_FACTORY_H_ 36 | -------------------------------------------------------------------------------- /cyber/transport/shm/state.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "cyber/transport/shm/state.h" 18 | 19 | namespace apollo { 20 | namespace cyber { 21 | namespace transport { 22 | 23 | State::State(const uint64_t& ceiling_msg_size) 24 | : ceiling_msg_size_(ceiling_msg_size) {} 25 | 26 | State::~State() {} 27 | 28 | } // namespace transport 29 | } // namespace cyber 30 | } // namespace apollo 31 | -------------------------------------------------------------------------------- /docker/build/README.md: -------------------------------------------------------------------------------- 1 | # Docker image build process 2 | 3 | ## Usage 4 | 5 | Simply run 6 | ```bash 7 | ./build_dev.sh ./dev.x86_64.dockerfile 8 | ``` 9 | 10 | ## Add new installer 11 | 12 | The best practice of a new installer would be: 13 | 14 | 1. Well tested. 15 | 16 | Of course. Make it work, and don't break other installers, such as 17 | incompatible versions of libraries. 18 | 19 | 1. Standalone. 20 | 21 | Have minimum assumption about the basement, which means, you can depend on 22 | the base image and installers/pre_install.sh. Other than that, you should 23 | install all the dependencies in your own installer. 24 | 25 | 1. Thin. 26 | 27 | It will generate a new layer in the final image, so please keep it as thin as 28 | possible. For example, clean up all intermediate files: 29 | 30 | ```bash 31 | wget xxx.zip 32 | # Unzip, make, make install 33 | rm -fr xxx.zip xxx 34 | ``` 35 | 36 | 1. Cross-architecture. 37 | 38 | It would be awesome to work perfectly for different architectures such as X86 39 | and ARM. 40 | -------------------------------------------------------------------------------- /docker/build/build_dev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Usage: 20 | # ./build_dev.sh ./dev.x86_64.dockerfile 21 | DOCKERFILE=$1 22 | 23 | 24 | CONTEXT="$(dirname "${BASH_SOURCE[0]}")" 25 | 26 | REPO=apolloauto/apollo 27 | ARCH=$(uname -m) 28 | TIME=$(date +%Y%m%d_%H%M) 29 | 30 | TAG="${REPO}:dev-${ARCH}-${TIME}" 31 | 32 | # Fail on first error. 33 | set -e 34 | docker build -t ${TAG} -f ${DOCKERFILE} ${CONTEXT} 35 | echo "Built new image ${TAG}" 36 | -------------------------------------------------------------------------------- /docker/build/cyber.x86_64_release.dockerfile: -------------------------------------------------------------------------------- 1 | FROM geekstyle/geek_lite:geek_lite-x86_64-18.04-20200425_1848 2 | 3 | LABEL version="1.0" 4 | 5 | ENV DEBIAN_FRONTEND=noninteractive 6 | 7 | RUN adduser --disabled-password --gecos '' geek 8 | 9 | WORKDIR /geek-car 10 | -------------------------------------------------------------------------------- /docker/build/installers/install_apriltag.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | echo "Build and install apriltag 3" 25 | 26 | git clone https://github.com/mickeyouyou/apriltag 27 | pushd apriltag 28 | # git apply ../apriltag.diff 29 | cmake . 30 | make install 31 | popd 32 | rm -fr apriltag 33 | -------------------------------------------------------------------------------- /docker/build/installers/install_bosfs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | # Prepare 25 | apt-get update -y 26 | apt-get install -y \ 27 | automake \ 28 | autotools-dev \ 29 | g++ \ 30 | libcurl4-openssl-dev \ 31 | libfuse-dev \ 32 | libssl-dev \ 33 | make \ 34 | uuid-dev 35 | PACKAGE="bosfs-1.0.0.9.tar.gz" 36 | wget http://sdk.bce.baidu.com/console-sdk/${PACKAGE} 37 | tar zxf ${PACKAGE} 38 | 39 | # Build and install. 40 | pushd bosfs-1.0.0 41 | bash build.sh 42 | popd 43 | 44 | # Clean 45 | rm -fr ${PACKAGE} bosfs-1.0.0 46 | -------------------------------------------------------------------------------- /docker/build/installers/install_fast-rtps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | set -e 20 | 21 | cd "$(dirname "${BASH_SOURCE[0]}")" 22 | 23 | git clone https://github.com/eProsima/Fast-RTPS.git 24 | pushd Fast-RTPS 25 | git checkout origin/release/1.5.0 26 | git submodule init 27 | git submodule update 28 | patch -p1 < ../FastRTPS_1.5.0.patch 29 | mkdir -p build && cd build 30 | cmake -DEPROSIMA_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr/local/fast-rtps ../ 31 | make -j 8 32 | make install 33 | popd 34 | -------------------------------------------------------------------------------- /docker/build/installers/install_google_styleguide.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | REPO="https://github.com/google/styleguide.git" 23 | COMMIT="159b4c81bbca97a9ca00f1195a37174388398a67" 24 | DIR="/home/tmp/google_styleguide" 25 | 26 | git clone "${REPO}" "${DIR}" 27 | pushd "${DIR}" 28 | git reset --hard "${COMMIT}" 29 | rm -fr .git 30 | popd 31 | -------------------------------------------------------------------------------- /docker/build/installers/install_libjsonrpc-cpp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget https://apollocache.blob.core.windows.net/apollo-cache/libjsonrpc-cpp.tar.gz 25 | tar zxf libjsonrpc-cpp.tar.gz 26 | mv libjsonrpc-cpp/bin/* /usr/local/bin/ 27 | mv libjsonrpc-cpp/include/* /usr/local/include/ 28 | mv libjsonrpc-cpp/lib/* /usr/local/lib/ 29 | 30 | # Clean up. 31 | rm -fr libjsonrpc-cpp* 32 | -------------------------------------------------------------------------------- /docker/build/installers/install_nlopt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz 25 | tar xzf nlopt-2.4.2.tar.gz 26 | pushd nlopt-2.4.2 27 | ./configure --enable-shared 28 | make -j8 29 | make install 30 | popd 31 | 32 | # Clean up. 33 | rm -fr nlopt-2.4.2.tar.gz nlopt-2.4.2 34 | rm /usr/local/lib/libnlopt.a 35 | rm /usr/local/lib/libnlopt.la 36 | -------------------------------------------------------------------------------- /docker/build/installers/install_node.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget https://github.com/tj/n/archive/v2.1.0.tar.gz 25 | tar xzf v2.1.0.tar.gz 26 | pushd n-2.1.0 27 | make install 28 | n 8.0.0 29 | popd 30 | 31 | # Clean up. 32 | rm -fr v2.1.0.tar.gz n-2.1.0 33 | -------------------------------------------------------------------------------- /docker/build/installers/install_opencv4.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | git clone https://github.com/JetsonHacksNano/buildOpenCV 3 | 4 | pushd buildOpenCV 5 | 6 | ./buildOpenCV.sh |& tee openCV_build.log 7 | 8 | popd 9 | -------------------------------------------------------------------------------- /docker/build/installers/install_ota.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget https://apollocache.blob.core.windows.net/apollo-docker/ota_security.tar.gz 25 | tar xzf ota_security.tar.gz 26 | pushd ota_security 27 | bash ota_server_deploy.sh root 28 | popd 29 | 30 | # Clean up. 31 | rm -fr ota_security.tar.gz ota_security 32 | -------------------------------------------------------------------------------- /docker/build/installers/install_protobuf.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz 25 | tar xzf protobuf-cpp-3.3.0.tar.gz 26 | 27 | pushd protobuf-3.3.0 28 | ./configure --prefix=/usr 29 | make -j8 30 | make install 31 | popd 32 | 33 | # Clean up. 34 | rm -fr protobuf-cpp-3.3.0.tar.gz protobuf-3.3.0 35 | -------------------------------------------------------------------------------- /docker/build/installers/install_python_pcl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | set -e 20 | 21 | cd "$(dirname "${BASH_SOURCE[0]}")" 22 | 23 | git clone https://github.com/strawlab/python-pcl.git 24 | pushd python_pcl 25 | git apply install_python_pcl_1.8_vtk6.3.diff 26 | python setup.py build_ext -i 27 | python install 28 | popd 29 | -------------------------------------------------------------------------------- /docker/build/installers/install_qp_oases.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget https://github.com/ApolloAuto/qp-oases/archive/v3.2.1-1.tar.gz 25 | tar xzf v3.2.1-1.tar.gz 26 | 27 | pushd qp-oases-3.2.1-1 28 | mkdir bin 29 | make -j8 CPPFLAGS="-Wall -pedantic -Wshadow -Wfloat-equal -O3 -Wconversion \ 30 | -Wsign-conversion -fPIC -DLINUX -DSOLVER_NONE \ 31 | -D__NO_COPYRIGHT__" 32 | cp bin/libqpOASES.so /usr/local/lib 33 | cp -r include/* /usr/local/include 34 | popd 35 | 36 | # Clean up. 37 | rm -fr v3.2.1-1.tar.gz qp-oases-3.2.1-1 38 | -------------------------------------------------------------------------------- /docker/build/installers/install_supervisor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | apt-get -y update && \ 23 | apt-get install -y supervisor 24 | 25 | # Add supervisord config file 26 | echo_supervisord_conf > /etc/supervisord.conf 27 | 28 | # Clean up. 29 | apt-get clean && rm -rf /var/lib/apt/lists/* 30 | -------------------------------------------------------------------------------- /docker/build/installers/install_undistort.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | cd "$(dirname "${BASH_SOURCE[0]}")" 23 | 24 | wget https://apollocache.blob.core.windows.net/apollo-docker/undistort.tar.gz 25 | tar xzf undistort.tar.gz 26 | mkdir -p /usr/local/apollo 27 | mv undistort /usr/local/apollo/ 28 | 29 | # Clean up. 30 | rm -fr undistort.tar.gz 31 | -------------------------------------------------------------------------------- /docker/build/installers/install_user.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | USER_NAME=apollo 23 | 24 | adduser --disabled-password --gecos '' ${USER_NAME} 25 | usermod -aG sudo ${USER_NAME} 26 | echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 27 | 28 | echo """ 29 | ulimit -c unlimited 30 | source /apollo/scripts/apollo_base.sh 31 | """ >> /home/${USER_NAME}/.bashrc 32 | -------------------------------------------------------------------------------- /docker/build/installers/install_yarn.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 23 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 24 | apt-get update -y 25 | apt-get install -y yarn 26 | 27 | # Clean up. 28 | apt-get clean && rm -rf /var/lib/apt/lists/* 29 | rm -fr /etc/apt/sources.list.d/yarn.list 30 | -------------------------------------------------------------------------------- /docker/build/installers/paddlepaddle_gpu-1.5.2-cp36-cp36m-linux_aarch64.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/docker/build/installers/paddlepaddle_gpu-1.5.2-cp36-cp36m-linux_aarch64.whl -------------------------------------------------------------------------------- /docker/build/installers/post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Fail on first error. 20 | set -e 21 | 22 | # Create required soft links. 23 | ln -rs /usr/lib/libprofiler.so.0 /usr/lib/libprofiler.so 24 | ln -rs /usr/lib/libtcmalloc_and_profiler.so.4 /usr/lib/libtcmalloc_and_profiler.so 25 | # https://stackoverflow.com/questions/25193161/chfn-pam-system-error-intermittently-in-docker-hub-builds 26 | ln -s -f /bin/true /usr/bin/chfn 27 | 28 | -------------------------------------------------------------------------------- /docker/build/installers/py27_conda.yaml: -------------------------------------------------------------------------------- 1 | name: py27 2 | dependencies: 3 | - python=2.7 4 | - numpy=1.8.2 # required by adu/ros-base 5 | - h5py=2.3.0 # latest version compatible with numpy 1.8.2; can also use 2.5.0 with pip 6 | - pip 7 | - pip: 8 | - astropy==1.2.2 # anaconda says 0.4.1 is the latest version compatible with numpy 1.8.2, but not mature enough 9 | - glog 10 | - grpcio==1.4.0 11 | - grpcio-tools==1.4.0 12 | - protobuf==3.4.0 # version 3.2.0 actually gives some parsing errors on the original protos 13 | - python-gflags 14 | - utm 15 | - jupyter 16 | - keyboard 17 | -------------------------------------------------------------------------------- /docker/build/installers/py27_requirements.txt: -------------------------------------------------------------------------------- 1 | # To use these python tools, you need to install dependencies with command: 2 | # sudo apt-get install python-numpy python-scipy python-matplotlib 3 | # sudo pip install -r py27_requirements.txt 4 | 5 | # system utils 6 | supervisor 7 | 8 | # Google infras. 9 | glog 10 | grpcio-tools == 1.2.0 11 | protobuf == 3.1 12 | python-gflags 13 | 14 | # Web utils. 15 | flask 16 | flask-cors 17 | requests >= 2.18 18 | simplejson 19 | 20 | # ROS env. 21 | PyYAML 22 | 23 | # Python tools 24 | pyproj 25 | shapely 26 | 27 | keyboard 28 | opencv-python -------------------------------------------------------------------------------- /docker/build/installers/py37_conda.yaml: -------------------------------------------------------------------------------- 1 | name: py37 2 | dependencies: 3 | - python = 3.7 4 | - pip 5 | 6 | # Google open infra 7 | - absl-py 8 | - protobuf 9 | 10 | # Web 11 | - requests 12 | - jupyter 13 | -------------------------------------------------------------------------------- /docker/build/installers/py3_requrements.txt: -------------------------------------------------------------------------------- 1 | # To use these python tools, you need to install dependencies with command: 2 | # sudo apt-get install python-numpy python-scipy python-matplotlib 3 | # sudo pip install -r py27_requirements.txt 4 | 5 | # Google infras. 6 | glog 7 | protobuf == 3.1 8 | python-gflags 9 | 10 | # Web utils. 11 | flask 12 | flask-cors 13 | #requests >= 2.18 14 | simplejson 15 | jupyter 16 | 17 | # Python tools 18 | pyproj == 1.9.6 19 | shapely 20 | 21 | # Data format 22 | PyYAML 23 | h5py 24 | pypcd 25 | pytz 26 | utm 27 | #scipy 28 | #numpy 29 | opencv-python 30 | 31 | 32 | 33 | # PaddlePaddle 34 | requests>=2.20.0 35 | numpy>=1.12 36 | #protobuf>=3.1.0 37 | matplotlib<=2.2.4 ; python_version<"3.6" 38 | scipy>=0.19.0, <=1.2.1 ; python_version<"3.5" 39 | nltk>=3.2.2, <=3.4 ; python_version<"3.5" 40 | matplotlib ; python_version>="3.6" 41 | scipy ; python_version>="3.5" 42 | nltk ; python_version>="3.5" 43 | rarfile 44 | Pillow 45 | graphviz 46 | six 47 | funcsigs 48 | pyyaml 49 | decorator 50 | prettytable 51 | -------------------------------------------------------------------------------- /docker/scripts/clean_resources.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: 4 | # ./clean_resources.sh 5 | 6 | if [ ! -z ${DOCKER_IMG} ]; then 7 | echo "This script is expected to be run on host instead of the container." 8 | echo "Please exit." 9 | exit 1 10 | fi 11 | 12 | # Credit to https://stackoverflow.com/questions/38118791/can-t-delete-docker-image-with-dependent-child-images 13 | echo "Cleanup containers..." 14 | docker rm $(docker ps -qa --no-trunc --filter "status=exited") 15 | 16 | echo "Cleanup images..." 17 | docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 18 | 19 | echo "Cleanup volumes..." 20 | docker volume rm $(docker volume ls -qf dangling=true) 21 | 22 | #echo "Cleanup images not used" 23 | # docker rmi geekstyle/geek_lite:geek_pcl -------------------------------------------------------------------------------- /docker/scripts/commit_push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: 4 | # ./build_geek_pcl.sh geek.Dockerfile 5 | # Commit 6 | # docker commit 5a69f1c7051c geekstyle/geek_lite:geek_lite-${ARCH}-18.04-${TIME} 7 | 8 | REPO=geekstyle/geek_lite 9 | ARCH=$(uname -m) 10 | TIME=$(date +%Y%m%d_%H%M) 11 | 12 | TAG="${REPO}:geek_lite-${ARCH}-18.04-${TIME}" 13 | 14 | CONTAINER_ID=$(docker ps | grep geek_dev_${USER}| awk '{print $1}') 15 | 16 | docker commit "$CONTAINER_ID" "$TAG" 17 | # docker tag "$TAG" "$RELEASE_NAME" 18 | docker stop "$CONTAINER_ID" 19 | 20 | # Please provide credential if you want to login automatically. 21 | DOCKER_USER="" 22 | DOCKER_PASSWORD="" 23 | if [ ! -z "${DOCKER_PASSWORD}" ]; then 24 | docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTRY} 25 | fi 26 | 27 | docker push ${TAG} -------------------------------------------------------------------------------- /docker/scripts/commit_push_release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: 4 | # ./build_geek_release.sh geek.Dockerfile 5 | # Commit 6 | # docker commit 5a69f1c7051c geekstyle/geek_lite:geek-release-${ARCH}-18.04-${TIME} 7 | 8 | REPO=geekstyle/geek_lite 9 | ARCH=$(uname -m) 10 | TIME=$(date +%Y%m%d_%H%M) 11 | 12 | TAG="${REPO}:geek-release-${ARCH}-18.04-${TIME}" 13 | 14 | CONTAINER_ID=$(docker ps | grep geek_release_${USER}| awk '{print $1}') 15 | 16 | docker commit "$CONTAINER_ID" "$TAG" 17 | # docker tag "$TAG" "$RELEASE_NAME" 18 | docker stop "$CONTAINER_ID" 19 | 20 | # Please provide credential if you want to login automatically. 21 | DOCKER_USER="" 22 | DOCKER_PASSWORD="" 23 | if [ ! -z "${DOCKER_PASSWORD}" ]; then 24 | docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTRY} 25 | fi 26 | 27 | docker push ${TAG} -------------------------------------------------------------------------------- /docker/scripts/into_geek.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | xhost +local:root 1>/dev/null 2>&1 4 | docker exec \ 5 | -u $USER \ 6 | -it geek_dev_$USER \ 7 | /bin/bash 8 | xhost -local:root 1>/dev/null 2>&1 9 | -------------------------------------------------------------------------------- /docker/scripts/into_geek_release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | xhost +local:root 1>/dev/null 2>&1 4 | docker exec \ 5 | -u geek \ 6 | -it geek_release_$USER \ 7 | /bin/bash 8 | xhost -local:root 1>/dev/null 2>&1 9 | -------------------------------------------------------------------------------- /docker/setup_host/README.md: -------------------------------------------------------------------------------- 1 | # Setup HOST 2 | 3 | ## One-time setup 4 | 5 | You need to run the `setup_host.sh` at least once for a new HOST environment. 6 | -------------------------------------------------------------------------------- /docker/setup_host/cleanup_resources.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2018 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | if [ ! -z ${DOCKER_IMG} ]; then 20 | echo "This script is expected to be run on host instead of the container." 21 | echo "Please exit." 22 | exit 1 23 | fi 24 | 25 | # Credit to https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430 26 | echo "Cleanup containers..." 27 | docker rm $(docker ps -qa --no-trunc --filter "status=exited") 28 | 29 | echo "Cleanup images..." 30 | docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 31 | 32 | echo "Cleanup volumes..." 33 | docker volume rm $(docker volume ls -qf dangling=true) 34 | -------------------------------------------------------------------------------- /docker/setup_host/etc/udev/rules.d/51-nooploop.rules: -------------------------------------------------------------------------------- 1 | ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60",ATTRS{serial}=="b2f4043f48b6e7118609b350d4b43ea0", OWNER="apollo", GROUP="apollo", MODE="0777", SYMLINK+="nooploop" 2 | -------------------------------------------------------------------------------- /docker/setup_host/etc/udev/rules.d/99-serial.rules: -------------------------------------------------------------------------------- 1 | # need to test 2 | 3 | #SUBSYSTEM=="tty" ATTRS{manufacturer}=="Arduino*" SYMLINK+="arduino%n" 4 | 5 | # SUBSYSTEM=="tty" ATTRS{product}=="Olimex AVR-ISP500" SYMLINK+="stk500-programmer%n" 6 | 7 | #the unshielded FTDI cables have difficulty running at full speed 8 | KERNEL=="ttyACM[0-9]*" SUBSYSTEM=="tty", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0004", SYMLINK+="ttyArduino", OWNER="geek-car", GROUP="geek-car" 9 | KERNEL=="ttyACM[0-9]*" SUBSYSTEM=="tty", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="0002", SYMLINK+="ttyArduino", OWNER="geek-car", GROUP="geek-car" 10 | KERNEL=="ttyACM[0-9]*" SUBSYSTEM=="tty", ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0002", SYMLINK+="ttyArduino", OWNER="geek-car", GROUP="geek-car" 11 | -------------------------------------------------------------------------------- /docker/setup_host/etc/udev/rules.d/99-usbtty.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="0", MODE="0666", SYMLINK+="novatel0", OWNER="apollo", GROUP="apollo" 2 | SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="1", MODE="0666", SYMLINK+="novatel1", OWNER="apollo", GROUP="apollo" 3 | SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="2", MODE="0666", SYMLINK+="novatel2", OWNER="apollo", GROUP="apollo" 4 | -------------------------------------------------------------------------------- /docker/setup_host/etc/udev/rules.d/99-webcam.rules: -------------------------------------------------------------------------------- 1 | # This file was automatically generated by the /lib/udev/write_net_rules 2 | # program, run by the persistent-net-generator.rules rules file. 3 | # 4 | # You can modify it, as long as you keep each rule on a single 5 | # line, and change only the value of the NAME= key. 6 | 7 | SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{name}=="AR023ZWDR(Rev[0-9][0-9][0-9]s)", MODE="0666", SYMLINK+="camera/obstacle", OWNER="apollo", GROUP="apollo" 8 | SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{name}=="AR023ZWDR(Rev[0-9][0-9][0-9])", MODE="0666", SYMLINK+="camera/trafficlights", OWNER="apollo", GROUP="apollo" 9 | SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{name}=="AR023ZWDR(Rev[0-9][0-9][0-9]F12)", MODE="0666", SYMLINK+="camera/lanemark", OWNER="apollo", GROUP="apollo" 10 | -------------------------------------------------------------------------------- /images/red.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/images/red.jpg -------------------------------------------------------------------------------- /images/system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/images/system.png -------------------------------------------------------------------------------- /modules/common/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "global_gflags", 7 | srcs = [ 8 | "global_gflags.cc", 9 | ], 10 | hdrs = [ 11 | "global_gflags.h", 12 | ], 13 | copts = [ 14 | "-DMODULE_NAME=\\\"common\\\"", 15 | ], 16 | deps = [ 17 | "@com_github_gflags_gflags//:gflags", 18 | ], 19 | ) 20 | 21 | cc_library( 22 | name = "curve_fitting", 23 | srcs = ["curve_fitting.h"], 24 | copts = [ 25 | "-DMODULE_NAME=\\\"common\\\"", 26 | ], 27 | ) 28 | 29 | cc_library( 30 | name = "uart", 31 | srcs = ["uart.cc"], 32 | hdrs = ["uart.h"], 33 | copts = [ 34 | "-DMODULE_NAME=\\\"common\\\"", 35 | ], 36 | deps = [ 37 | "//cyber", 38 | ], 39 | ) 40 | 41 | cpplint() 42 | -------------------------------------------------------------------------------- /modules/common/conf/global.conf: -------------------------------------------------------------------------------- 1 | --image_export_dir=/home/geek-car/out_test -------------------------------------------------------------------------------- /modules/common/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "error_code_proto", 5 | deps = [ 6 | ":error_code_proto_lib", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "error_code_proto_lib", 12 | srcs = [ 13 | "error_code.proto", 14 | ], 15 | ) 16 | 17 | cc_proto_library( 18 | name = "header_proto", 19 | deps = [ 20 | ":header_proto_lib", 21 | ], 22 | ) 23 | 24 | proto_library( 25 | name = "header_proto_lib", 26 | srcs = [ 27 | "header.proto", 28 | ], 29 | deps = [ 30 | ":error_code_proto_lib", 31 | ], 32 | ) 33 | 34 | cc_proto_library( 35 | name = "geometry_proto", 36 | deps = [ 37 | ":geometry_proto_lib", 38 | ], 39 | ) 40 | 41 | proto_library( 42 | name = "geometry_proto_lib", 43 | srcs = [ 44 | "geometry.proto", 45 | ], 46 | ) 47 | 48 | cc_proto_library( 49 | name = "pnc_point_proto", 50 | deps = [ 51 | ":pnc_point_proto_lib", 52 | ], 53 | ) 54 | 55 | proto_library( 56 | name = "pnc_point_proto_lib", 57 | srcs = [ 58 | "pnc_point.proto", 59 | ], 60 | ) 61 | -------------------------------------------------------------------------------- /modules/common/proto/header.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.common; 4 | 5 | import "modules/common/proto/error_code.proto"; 6 | 7 | message Header { 8 | // Message publishing time in seconds. 9 | optional double timestamp_sec = 1; 10 | 11 | // Module name. 12 | optional string module_name = 2; 13 | 14 | // Sequence number for each message. Each module maintains its own counter for 15 | // sequence_num, always starting from 1 on boot. 16 | optional uint32 sequence_num = 3; 17 | 18 | // Lidar Sensor timestamp for nano-second. 19 | optional uint64 lidar_timestamp = 4; 20 | 21 | // Camera Sensor timestamp for nano-second. 22 | optional uint64 camera_timestamp = 5; 23 | 24 | // Radar Sensor timestamp for nano-second. 25 | optional uint64 radar_timestamp = 6; 26 | 27 | // data version 28 | optional uint32 version = 7 [default = 1]; 29 | 30 | optional StatusPb status = 8; 31 | 32 | optional string frame_id = 9; 33 | } 34 | -------------------------------------------------------------------------------- /modules/control/README.md: -------------------------------------------------------------------------------- 1 | # Control Module 2 | 3 | 4 | 1、给Arduino设备(`/dev/ttyACM0`)读取权限,只需要将用户比如apollo添加到用户组dialout: 5 | ```bash 6 | sudo usermod -aG dialout apollo 7 | ``` 8 | 9 | 10 | 可能遇到undefied symbol 的解决办法: 11 | 12 | ```bash 13 | nm -u *.so 14 | // 确定未定义的symbol 15 | ``` 16 | 17 | ```bash 18 | c++filt symbol 19 | ``` 20 | 21 | 查找对应未定义的内容; 22 | 23 | 24 | 参考: 25 | https://blog.csdn.net/stpeace/article/details/76561814 26 | https://medium.com/fcamels-notes/%E8%A7%A3%E6%B1%BA-linux-%E4%B8%8A-c-c-%E7%9A%84-undefined-symbol-%E6%88%96-undefined-reference-a80ee8f85425 -------------------------------------------------------------------------------- /modules/control/conf/chassis.conf: -------------------------------------------------------------------------------- 1 | --v=4 2 | --arduino_device_name=ttyArduino 3 | --speed_feedback=1 4 | -------------------------------------------------------------------------------- /modules/control/conf/control.conf: -------------------------------------------------------------------------------- 1 | --v=4 2 | --longitude_kp=8.0 3 | --longitude_ki=5.0 4 | --longitude_ff=4.0 5 | --offset=6.2 6 | -------------------------------------------------------------------------------- /modules/control/dag/calibration.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/control/tools/libcalibration_component.so" 4 | components { 5 | class_name : "CalibrationComponent" 6 | config { 7 | name: "calibration_component" 8 | readers: [ 9 | {channel:"/realsense/pose"}, 10 | {channel:"/chassis"}, 11 | {channel:"/control"} 12 | ] 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /modules/control/dag/chassis.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/control/libchassis_component.so" 4 | components { 5 | class_name : "ChassisComponent" 6 | config { 7 | name: "chassis_component" 8 | flag_file_path:"/apollo/modules/control/conf/chassis.conf" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /modules/control/dag/control.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/control/libcontrol_component.so" 4 | components { 5 | class_name : "ControlComponent" 6 | config { 7 | name: "control_component" 8 | flag_file_path:"/apollo/modules/control/conf/control.conf" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/control/launch/calibration.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | calibration_component 4 | ../modules/control/dag/calibration.dag 5 | calibration_component 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/control/launch/chassis.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | chassis_component 4 | /apollo/modules/control/dag/chassis.dag 5 | chassis_component 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/control/launch/control.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | control_component 4 | /apollo/modules/control/dag/control.dag 5 | control_component 6 | 7 | -------------------------------------------------------------------------------- /modules/control/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "control_cc_proto", 5 | deps = [ 6 | ":control_proto_lib", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "control_proto_lib", 12 | srcs = [ 13 | "chassis.proto", 14 | "control.proto", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /modules/control/proto/chassis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.control; 4 | 5 | message RangeMeasure { 6 | optional uint64 addr = 1; 7 | optional float distance = 2; 8 | } 9 | 10 | 11 | message Chassis { 12 | optional float steer_angle = 1; 13 | optional float throttle = 2; 14 | optional float speed = 3; 15 | optional float v_bat = 4; 16 | optional float nano_current = 5; 17 | optional float motor_current = 6; 18 | repeated RangeMeasure range_measure = 7; 19 | optional uint64 device_num = 8; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /modules/control/proto/control.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.control; 4 | 5 | message Control_Command { 6 | optional float steer_angle = 1; 7 | optional float throttle = 2; 8 | } 9 | 10 | message Control_Reference { 11 | optional float angular_speed = 1; 12 | optional float vehicle_speed = 2; 13 | } 14 | 15 | message Coefficient { 16 | optional double a = 1; 17 | optional double b = 2; 18 | optional double c = 3; 19 | } 20 | -------------------------------------------------------------------------------- /modules/data/image_base/1_Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/data/image_base/1_Color.png -------------------------------------------------------------------------------- /modules/data/image_base/2_Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/data/image_base/2_Color.png -------------------------------------------------------------------------------- /modules/data/image_base/3_Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/data/image_base/3_Color.png -------------------------------------------------------------------------------- /modules/data/image_base/4_Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/data/image_base/4_Color.png -------------------------------------------------------------------------------- /modules/data/pose.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/data/pose.dat -------------------------------------------------------------------------------- /modules/examples/dag/example.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "apollo_lite/bazel-bin/modules/example/libexample.so" 4 | components { 5 | class_name : "ExampleComponent" 6 | config { 7 | name: "example" 8 | readers { 9 | channel : "/realsense/pose" 10 | } 11 | reader { 12 | channel: " /realsense/raw_image" 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /modules/examples/example_component.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2019 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | #include "modules/examples/example_component.h" 17 | 18 | #include "cyber/class_loader/class_loader.h" 19 | #include "cyber/component/component.h" 20 | 21 | bool ExampleComponent::Init() { 22 | AINFO << "ExampleComponent Component Init"; 23 | return true; 24 | } 25 | 26 | bool ExampleComponent::Proc(const std::shared_ptr& msg0, 27 | const std::shared_ptr& msg1) { 28 | AINFO << "message from ExampleComponent::Proc()" 29 | << "msg0 is :" << msg0->DebugString() 30 | << "msg1 is :" << msg1->DebugString(); 31 | 32 | return true; 33 | } 34 | -------------------------------------------------------------------------------- /modules/examples/example_component.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2019 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | #include 17 | 18 | #include "cyber/class_loader/class_loader.h" 19 | #include "cyber/component/component.h" 20 | #include "modules/sensors/proto/sensors.pb.h" 21 | #include "modules/sensors/proto/sensor_image.pb.h" 22 | 23 | using apollo::cyber::Component; 24 | using apollo::sensors::Image; 25 | using apollo::sensors::Pose; 26 | 27 | class ExampleComponent : public Component { 28 | public: 29 | bool Init() override; 30 | bool Proc(const std::shared_ptr& msg0, 31 | const std::shared_ptr& msg1) override; 32 | }; 33 | 34 | CYBER_REGISTER_COMPONENT(ExampleComponent) 35 | -------------------------------------------------------------------------------- /modules/examples/launch/example.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | example 4 | examples/dag/example.dag 5 | example_component 6 | 7 | -------------------------------------------------------------------------------- /modules/examples/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "examples_cc_proto", 5 | deps = [ 6 | ":examples_proto", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "examples_proto", 12 | srcs = [ 13 | "examples.proto", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /modules/examples/proto/examples.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.examples.proto; 4 | 5 | message SamplesTest1 { 6 | optional string class_name = 1; 7 | optional string case_name = 2; 8 | }; 9 | 10 | message Chatter { 11 | optional uint64 timestamp = 1; 12 | optional uint64 lidar_timestamp = 2; 13 | optional uint64 seq = 3; 14 | optional bytes content = 4; 15 | }; 16 | 17 | message Driver { 18 | optional string content = 1; 19 | optional uint64 msg_id = 2; 20 | optional uint64 timestamp = 3; 21 | }; 22 | 23 | message Image { 24 | optional string frame_id = 2; 25 | optional double measurement_time = 3; 26 | 27 | optional uint32 height = 4; // image height, that is, number of rows 28 | optional uint32 width = 5; // image width, that is, number of columns 29 | 30 | optional string encoding = 6; 31 | optional uint32 step = 7; // Full row length in bytes 32 | optional bytes data = 8; // actual matrix data, size is (step * rows) 33 | } -------------------------------------------------------------------------------- /modules/localization/conf/apriltag.conf: -------------------------------------------------------------------------------- 1 | --tagsize=0.21 2 | --use_compressed_image_to_detect_tag=true 3 | -------------------------------------------------------------------------------- /modules/localization/conf/localization.conf: -------------------------------------------------------------------------------- 1 | --tagsize=0.21 2 | --use_compressed_image_to_detect_tag=true 3 | -------------------------------------------------------------------------------- /modules/localization/dag/apriltag.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "../bazel-bin/modules/localization/apriltag_component.so" 4 | components { 5 | class_name : "ApriltagComponent" 6 | config { 7 | name: "apriltag_component" 8 | flag_file_path:"../modules/localization/conf/apriltag.conf" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/localization/dag/localization.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "../bazel-bin/modules/localization/liblocalization_component.so" 4 | components { 5 | class_name : "LocalizationComponent" 6 | config { 7 | name: "localization_component" 8 | flag_file_path:"../modules/localization/conf/localization.conf" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/localization/launch/apriltag.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | apriltag_component 4 | ../modules/localization/dag/apriltag.dag 5 | apriltag_component 6 | 7 | -------------------------------------------------------------------------------- /modules/localization/launch/localization.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | localization_component 4 | ../modules/localization/dag/localization.dag 5 | localization_component 6 | 7 | -------------------------------------------------------------------------------- /modules/localization/localization_component.cc: -------------------------------------------------------------------------------- 1 | #include "modules/localization/localization_component.h" 2 | namespace apollo { 3 | namespace localization { 4 | 5 | bool LocalizationComponent::Init() { return true; } 6 | 7 | } // namespace localization 8 | } // namespace apollo 9 | -------------------------------------------------------------------------------- /modules/localization/localization_component.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "cyber/class_loader/class_loader.h" 5 | #include "cyber/component/component.h" 6 | 7 | namespace apollo { 8 | namespace localization { 9 | 10 | using apollo::cyber::Component; 11 | using apollo::cyber::Reader; 12 | using apollo::cyber::Writer; 13 | 14 | class LocalizationComponent : public Component<> { 15 | public: 16 | LocalizationComponent() = default; 17 | ~LocalizationComponent(); 18 | 19 | bool Init() override; 20 | 21 | private: 22 | }; 23 | CYBER_REGISTER_COMPONENT(LocalizationComponent); 24 | } // namespace localization 25 | } // namespace apollo 26 | -------------------------------------------------------------------------------- /modules/localization/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "localization_cc_proto", 5 | deps = [ 6 | ":localization_proto", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "localization_proto", 12 | srcs = [ 13 | "localization.proto", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /modules/localization/proto/apriltag.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.localization; 4 | /////////////////////////////////////////////////////////////// 5 | // User-configurable parameters. 6 | 7 | message ApriltagDetection { 8 | // How many threads should be used? 9 | optional uint32 threads = 1; 10 | optional float quad_decimate = 2 [default = 2.0]; 11 | optional float quad_sigma = 3 [default = 0.0]; 12 | optional uint32 refine_edges = 4 [default = 1]; 13 | optional double decode_sharpening = 5 [default = 0.25]; 14 | optional int32 debug = 6 [default = 0]; 15 | } -------------------------------------------------------------------------------- /modules/monitor/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "libmonitor_component.so", 7 | copts = [ 8 | "-DMODULE_NAME=\\\"monitor\\\"", 9 | ], 10 | linkshared = True, 11 | linkstatic = False, 12 | deps = [ 13 | ":monitor_component_lib", 14 | ], 15 | ) 16 | 17 | cc_library( 18 | name = "monitor_component_lib", 19 | srcs = ["monitor_component.cc"], 20 | hdrs = [ 21 | "monitor_component.h", 22 | ], 23 | copts = [ 24 | "-DMODULE_NAME=\\\"monitor\\\"", 25 | ], 26 | linkopts = [ 27 | "-lrealsense2", 28 | ], 29 | deps = [ 30 | "//cyber", 31 | "//modules/common:global_gflags", 32 | "//modules/monitor/proto:status_cc_proto", 33 | "//modules/sensors:realsense_api", 34 | "//modules/sensors/proto:sensors_cc_proto", 35 | ], 36 | ) 37 | 38 | cc_binary( 39 | name = "realsense_monitor", 40 | srcs = ["realsense_monitor.cc"], 41 | copts = [ 42 | "-DMODULE_NAME=\\\"monitor\\\"", 43 | ], 44 | deps = [ 45 | "//cyber", 46 | "//modules/common:global_gflags", 47 | "//modules/sensors/proto:sensors_cc_proto", 48 | ], 49 | ) 50 | 51 | cpplint() 52 | -------------------------------------------------------------------------------- /modules/monitor/dag/monitor.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "../bazel-bin/modules/monitor/libmonitor_component.so" 4 | components { 5 | class_name : "MonitorComponent" 6 | config { 7 | name: "monitor_component" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /modules/monitor/launch/monitor.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | monitor_component 4 | ../modules/monitor/dag/monitor.dag 5 | monitor_component 6 | respawn 7 | 8 | -------------------------------------------------------------------------------- /modules/monitor/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "status_cc_proto", 5 | deps = [ 6 | ":status_proto", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "status_proto", 12 | srcs = [ 13 | "status.proto", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /modules/monitor/proto/status.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.monitor; 4 | 5 | message Realsense { 6 | optional bool connection_status = 1; 7 | optional string message = 2; 8 | optional string serial_number = 3; 9 | } 10 | 11 | message Arduino { 12 | optional bool connection_status = 1; 13 | optional string message = 2; 14 | } 15 | 16 | message Status { 17 | optional Realsense realsense = 1; 18 | optional Arduino arduino = 2; 19 | } -------------------------------------------------------------------------------- /modules/perception/conf/perception.conf: -------------------------------------------------------------------------------- 1 | --leaf_size=0.001f 2 | --pcl_visualization=false 3 | --min_cluster_size=5 4 | --max_cluster_size=700 5 | --cluster_radius=0.10 -------------------------------------------------------------------------------- /modules/perception/dag/perception.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/perception/libperception_component.so" 4 | components { 5 | class_name : "PerceptionComponent" 6 | config { 7 | name: "perception_component" 8 | flag_file_path: "/apollo/modules/perception/conf/perception.conf" 9 | readers:[ 10 | { 11 | channel: "/realsense/point_cloud" 12 | } 13 | ] 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /modules/perception/launch/perception.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | perception_component 4 | /apollo/modules/perception/dag/perception.dag 5 | perception_component 6 | 7 | -------------------------------------------------------------------------------- /modules/perception/pcd_read_test.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | pcl::PointCloud::Ptr read_cloud_point( 5 | std::string const &file_path) { 6 | // Loading first scan. 7 | pcl::PointCloud::Ptr cloud(new pcl::PointCloud); 8 | if (pcl::io::loadPCDFile(file_path, *cloud) == -1) { 9 | PCL_ERROR("Couldn't read the pcd file\n"); 10 | return nullptr; 11 | } 12 | return cloud; 13 | } 14 | 15 | int main(int argc, char **argv) { 16 | auto target_cloud = read_cloud_point(argv[1]); 17 | std::cout << "Loaded " << target_cloud->size() << " data points from " 18 | << argv[1] << std::endl; 19 | 20 | std::cout << "Loaded " << target_cloud->width * target_cloud->height 21 | << " data points from test_pcd.pcd with the following fields: " 22 | << std::endl; 23 | for (size_t i = 0; i < target_cloud->points.size(); ++i) 24 | std::cout << " " << target_cloud->points[i].x << " " 25 | << target_cloud->points[i].y << " " << target_cloud->points[i].z 26 | << std::endl; 27 | 28 | return 0; 29 | } -------------------------------------------------------------------------------- /modules/perception/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "perception_cc_proto", 5 | deps = [ 6 | ":perception_proto_lib", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "perception_proto_lib", 12 | srcs = [ 13 | "perception.proto", 14 | "perception_obstacle.proto", 15 | ], 16 | deps = [ 17 | "//modules/common/proto:error_code_proto_lib", 18 | "//modules/common/proto:geometry_proto_lib", 19 | "//modules/common/proto:header_proto_lib", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /modules/perception/proto/perception.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.perception; 4 | 5 | message LaneInfo { 6 | optional Coefficient left_lane = 1; 7 | optional Coefficient right_lane = 2; 8 | optional Coefficient left_lane_view = 3; 9 | optional Coefficient right_lane_view = 4; 10 | } 11 | 12 | message Coefficient { 13 | optional double a = 1; 14 | optional double b = 2; 15 | optional double c = 3; 16 | } 17 | 18 | message Lane { 19 | optional int32 id = 1; 20 | } 21 | -------------------------------------------------------------------------------- /modules/perception/proto/perception_label_box.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.perception; 4 | 5 | import "modules/common/proto/header.proto"; 6 | 7 | message LBox2D { 8 | optional int32 xmin = 1; // in pixels. 9 | optional int32 ymin = 2; // in pixels. 10 | optional int32 xmax = 3; // in pixels. 11 | optional int32 ymax = 4; // in pixels. 12 | optional string label = 5; 13 | optional double probability =6; 14 | } 15 | 16 | message LBox2DList { 17 | optional apollo.common.Header header = 1; 18 | repeated LBox2D box = 2; 19 | } 20 | -------------------------------------------------------------------------------- /modules/perception/testdata/102.pcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/perception/testdata/102.pcd -------------------------------------------------------------------------------- /modules/perception/testdata/table_scene_lms400.pcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/perception/testdata/table_scene_lms400.pcd -------------------------------------------------------------------------------- /modules/planning/conf/glags.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/planning/conf/glags.conf -------------------------------------------------------------------------------- /modules/planning/potential_field.cc: -------------------------------------------------------------------------------- 1 | #include "modules/planning/potential_field.h" 2 | 3 | #include 4 | #include "modules/common/global_gflags.h" 5 | #include "modules/planning/proto/planning.proto" 6 | 7 | namespace apollo { 8 | namespace planning { 9 | 10 | const double GRID_SIZE = 0.05; // meters 11 | using apollo::planning::Point; 12 | 13 | PotentialField::PotentialField() {} 14 | 15 | void PotentialField::Plan(Point start, Point goal, 16 | std::vector obstacles) { 17 | if (start.empty() || goal.empty()) { 18 | AWARN << "START OR GOAL Point is empty"; 19 | return; 20 | } 21 | } 22 | 23 | void PotentialField::calcPotentialField() {} 24 | 25 | float PotentialField::calcAttractivePotential() { return 0.5 * KP; } 26 | 27 | float PotentialField::calcRepulsivePotential() {} 28 | 29 | } // namespace planning 30 | } // namespace apollo 31 | -------------------------------------------------------------------------------- /modules/planning/potential_field.h: -------------------------------------------------------------------------------- 1 | namespace apollo { 2 | namespace planning { 3 | 4 | // attractive potential gain 5 | const float KP = 5.0; 6 | // repulsive potential gain 7 | const float ETA = 100.0; 8 | 9 | class PotentialField { 10 | public: 11 | PotentialField(); 12 | void calcPotentialField(); 13 | float calcAttractivePotential(); 14 | float calcRepulsivePotential(); 15 | void Plan(); 16 | 17 | private: 18 | }; 19 | } // namespace planning 20 | } // namespace apollo 21 | -------------------------------------------------------------------------------- /modules/planning/proto/lane.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.planning; 4 | 5 | message Lane { 6 | optional Left left = 1; 7 | optional Right right = 2; 8 | } 9 | 10 | message Left { 11 | optional double l1 = 1; 12 | optional double l2 = 2; 13 | optional double l3 = 3; 14 | } 15 | 16 | message Right { 17 | optional double r1 = 1; 18 | optional double r2 = 2; 19 | optional double r3 = 3; 20 | } 21 | -------------------------------------------------------------------------------- /modules/planning/proto/planning.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.planning; 4 | 5 | message Trajectory { 6 | repeated Point point = 2; 7 | } 8 | 9 | message Point { 10 | // meters 11 | optional double x = 1; 12 | optional double y = 2; 13 | } 14 | 15 | message PlanningInfo { 16 | optional Point start_point = 1; 17 | optional Point end_point = 2; 18 | repeated Point obs_points = 3; 19 | } 20 | -------------------------------------------------------------------------------- /modules/sensors/README.md: -------------------------------------------------------------------------------- 1 | # Cyber Wrapper for Intel® RealSense™ Devices 2 | These are packages for using Intel RealSense cameras (D400 series SR300 camera and T265 Tracking Module) with Cyber. 3 | 4 | ## Installation Instructions 5 | 6 | The following instructions support Cyber , on **Ubuntu 18.04**. 7 | 8 | ## Realsense API 9 | https://github.com/IntelRealSense/librealsense/blob/master/doc/t265.md 10 | 11 | - Frame Management : https://github.com/IntelRealSense/librealsense/blob/master/doc/frame_lifetime.md 12 | - librealsense Error Handling Scheme : https://github.com/IntelRealSense/librealsense/blob/master/doc/error_handling.md -------------------------------------------------------------------------------- /modules/sensors/conf/d435i_stream_profiles.conf: -------------------------------------------------------------------------------- 1 | DEPTH,640,480,30,Z16,0 2 | INFRARED,640,480,30,Y8,1 3 | INFRARED,640,480,30,Y8,2 4 | COLOR,640,480,30,RGB8,0 5 | 6 | ACCEL,1,1,63,MOTION_XYZ32F 7 | GYRO,1,1,200,MOTION_XYZ32F -------------------------------------------------------------------------------- /modules/sensors/conf/exercise_one.conf: -------------------------------------------------------------------------------- 1 | #--flagfile=/apollo/modules/common/data/global_flagfile.txt 2 | --v=3 3 | --image_export_dir=/home/geek-car/out_test 4 | --odometry_file=/apollo/modules/sensors/conf/t265_calibration_odometry.json 5 | 6 | # channel 7 | --publish_color_image=true 8 | --publish_compressed_color_image=false 9 | --publish_depth_image=false 10 | --publish_point_cloud=false 11 | 12 | --publish_realsense_acc=false 13 | --publish_realsense_gyro=false 14 | 15 | --enable_point_cloud_transform=false 16 | --color_image_height=360 17 | --color_image_width=640 18 | --color_image_frequency=30 19 | --compress_rate=20 20 | 21 | --point_cloud_min_distance=0.15f 22 | --point_cloud_max_distance=2.f 23 | -------------------------------------------------------------------------------- /modules/sensors/conf/exercise_two.conf: -------------------------------------------------------------------------------- 1 | #--flagfile=/apollo/modules/common/data/global_flagfile.txt 2 | --v=3 3 | --image_export_dir=/home/geek-car/out_test 4 | --odometry_file=/apollo/modules/sensors/conf/t265_calibration_odometry.json 5 | 6 | # channel 7 | --publish_color_image=false 8 | --publish_compressed_color_image=true 9 | --publish_depth_image=false 10 | --publish_point_cloud=false 11 | 12 | --publish_realsense_acc=false 13 | --publish_realsense_gyro=false 14 | 15 | --enable_point_cloud_transform=false 16 | --color_image_height=360 17 | --color_image_width=640 18 | --color_image_frequency=30 19 | --compress_rate=20 20 | 21 | --point_cloud_min_distance=0.15f 22 | --point_cloud_max_distance=2.f 23 | -------------------------------------------------------------------------------- /modules/sensors/conf/nooploop.conf: -------------------------------------------------------------------------------- 1 | #--flagfile=/apollo/modules/common/data/global_flagfile.txt 2 | --v=3 3 | 4 | --nooploop_device_name=ttyUSB0 5 | 6 | --publish_tag_frame=true 7 | --publish_nooploop_acc=true 8 | --publish_nooploop_gyro=true 9 | -------------------------------------------------------------------------------- /modules/sensors/conf/realsense.conf: -------------------------------------------------------------------------------- 1 | #--flagfile=/apollo/modules/common/data/global_flagfile.txt 2 | --v=3 3 | --image_export_dir=/home/geek-car/out_test 4 | --odometry_file=/apollo/modules/sensors/conf/t265_calibration_odometry.json 5 | 6 | # Channel switch 7 | --publish_color_image=false 8 | --publish_compressed_color_image=true 9 | --publish_depth_image=false 10 | --publish_point_cloud=true 11 | --publish_realsense_acc=false 12 | --publish_realsense_gyro=false 13 | 14 | # Image flags 15 | --color_image_height=360 16 | --color_image_width=640 17 | --color_image_frequency=15 18 | --depth_image_height=240 19 | --depth_image_width=424 20 | --depth_image_frequency=30 21 | --compress_rate=20 22 | 23 | # enable to transform point cloud 24 | --enable_point_cloud_transform=true 25 | --angle_x=0 26 | --angle_y=0 27 | --angle_z=-0.261667 # 15° 28 | 29 | --leaf_size=0.005f 30 | 31 | --point_cloud_min_distance=0.15f 32 | --point_cloud_max_distance=2.0f 33 | 34 | --passthrough_y_min=-0.05f 35 | --passthrough_y_max=0.1f 36 | 37 | --temp_filter_alpha=0.4f 38 | --temp_filter_delta=20.f 39 | 40 | --save_pcd=false 41 | --pcl_visualization=false 42 | -------------------------------------------------------------------------------- /modules/sensors/conf/t265_calibration_odometry.json: -------------------------------------------------------------------------------- 1 | { 2 | "velocimeters": [ 3 | { 4 | "scale_and_alignment": [ 5 | 1.0, 6 | 0.0000000000000000, 7 | 0.0000000000000000, 8 | 0.0000000000000000, 9 | 1.0, 10 | 0.0000000000000000, 11 | 0.0000000000000000, 12 | 0.0000000000000000, 13 | 1.0 14 | ], 15 | "noise_variance": 0.004445126050420168, 16 | "extrinsics": { 17 | "T": [ 18 | -0.5059, 19 | -0.6294, 20 | -0.6873 21 | ], 22 | "T_variance": [ 23 | 9.999999974752427e-7, 24 | 9.999999974752427e-7, 25 | 9.999999974752427e-7 26 | ], 27 | "W": [ 28 | -1.1155, 29 | -1.1690, 30 | -1.2115 31 | ], 32 | "W_variance": [ 33 | 9.999999974752427e-5, 34 | 9.999999974752427e-5, 35 | 9.999999974752427e-5 36 | ] 37 | } 38 | } 39 | ] 40 | } 41 | 42 | -------------------------------------------------------------------------------- /modules/sensors/conf/t265_stream_profiles.conf: -------------------------------------------------------------------------------- 1 | COLOR,640,480,30,Y8,0 2 | 3 | ACCEL,1,1,63,MOTION_XYZ32F 4 | GYRO,1,1,200,MOTION_XYZ32F -------------------------------------------------------------------------------- /modules/sensors/dag/exercise_one.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/sensors/librealsense_component.so" 4 | components { 5 | class_name : "RealsenseComponent" 6 | config { 7 | name: "realsense_component" 8 | flag_file_path: "/apollo/modules/sensors/conf/exercise_one.conf" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/sensors/dag/exercise_two.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/sensors/librealsense_component.so" 4 | components { 5 | class_name : "RealsenseComponent" 6 | config { 7 | name: "realsense_component" 8 | flag_file_path: "/apollo/modules/sensors/conf/exercise_two.conf" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /modules/sensors/dag/nooploop.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/sensors/libnooploop_component.so" 4 | components { 5 | class_name : "NooploopComponent" 6 | config { 7 | name: "nooploop_component" 8 | flag_file_path: "/apollo/modules/sensors/conf/nooploop.conf" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /modules/sensors/dag/realsense.dag: -------------------------------------------------------------------------------- 1 | # Dag all comes in DAG streming. 2 | module_config { 3 | module_library : "/apollo/bazel-bin/modules/sensors/librealsense_component.so" 4 | components { 5 | class_name : "RealsenseComponent" 6 | config { 7 | name: "realsense_component" 8 | flag_file_path: "/apollo/modules/sensors/conf/realsense.conf" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /modules/sensors/launch/exercise_one.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | realsense_component 4 | /apollo/modules/sensors/dag/exercise_one.dag 5 | realsense_exercise1_component 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/sensors/launch/exercise_two.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | realsense_component 4 | /apollo/modules/sensors/dag/exercise_two.dag 5 | realsense_exercise2_component 6 | 7 | 8 | -------------------------------------------------------------------------------- /modules/sensors/launch/nooploop.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | nooploop_component 4 | /apollo/modules/sensors/dag/nooploop.dag 5 | nooploop_component 6 | 7 | -------------------------------------------------------------------------------- /modules/sensors/launch/realsense.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | realsense_component 4 | /apollo/modules/sensors/dag/realsense.dag 5 | realsense_component 6 | 7 | -------------------------------------------------------------------------------- /modules/sensors/nooploop/ncommon.h: -------------------------------------------------------------------------------- 1 | #ifndef NCOMMON_H 2 | #define NCOMMON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | enum LPSRole { 11 | kRoleNode, //!< 节点,通常代表所有类型 12 | kRoleAnchor, //!< 基站 13 | kRoleTag, //!< 标签 14 | kRoleConsole, //!< 监视器 15 | kRoleDTMaster, //!< DT 主机 16 | kRoleDTSlave, //!< DT 从机 17 | }; 18 | 19 | extern const float kVoltageMultiply_; 20 | extern const float kPosMultiply_; 21 | extern const float kDisMultiply_; 22 | extern const float kVelMultiply_; 23 | extern const float kAngleMultiply_; 24 | extern const float kRssiMultiply_; 25 | extern const float kEopMultiply_; 26 | 27 | typedef struct { 28 | uint8_t byteArray[3]; 29 | } NInt24; 30 | 31 | // 16进制字符串转数组,0-9 a-f A-F 32 | // 以外字符会直接跳过,前后两个字符组成一个字节,末尾不足一个字节时忽略 33 | int stringToHex(char *str, uint8_t *out); 34 | 35 | // int24 类型转换为 int32标准类型 36 | int32_t int24Value(NInt24 data); 37 | 38 | void int24ToFloat(NInt24 src[], float dst[], int arrayLength, float multiply); 39 | 40 | void int16ToFloat(int16_t src[], float dst[], int arrayLength, float multiply); 41 | 42 | void uint8ToFloat(uint8_t src[], float dst[], int arrayLength, float multiply); 43 | 44 | //根据传入的数据 data 及 总长度 45 | // length,进行和校验(校验和在最后一字节),成功返回1,否则0 46 | uint8_t verifyCheckSum(uint8_t *data, int32_t length); 47 | 48 | #endif // NCOMMON_H 49 | -------------------------------------------------------------------------------- /modules/sensors/nooploop/nlink_linktrack_node_frame0.cc: -------------------------------------------------------------------------------- 1 | #include "nlink_linktrack_node_frame0.h" 2 | 3 | NodeFrame0Data nodeFrame0Data_; 4 | 5 | void unpackNodeFrame0Data(uint8_t *byteArray) { 6 | const int framePartLength = 11; 7 | static uint8_t initNeeded = 1; 8 | if (initNeeded) { 9 | memset(nodeFrame0Data_.node, 0, sizeof(nodeFrame0Data_.node)); 10 | initNeeded = 0; 11 | 12 | assert(sizeof(nodeFrame0Data_.framePart) == framePartLength); 13 | } 14 | 15 | memcpy(&nodeFrame0Data_.framePart, byteArray, framePartLength); 16 | 17 | for (int i = 0, address = framePartLength; 18 | i < nodeFrame0Data_.framePart.validNodeQuantity; ++i) { 19 | uint8_t id = byteArray[address + 1]; 20 | uint16_t dataLength; 21 | memcpy(&dataLength, byteArray + address + 2, sizeof(dataLength)); 22 | const int currentNodeSize = 4 + dataLength; 23 | 24 | if (!nodeFrame0Data_.node[id]) { 25 | nodeFrame0Data_.node[id] = (Node0_t*)malloc(sizeof(Node0_t)); 26 | } 27 | memcpy(nodeFrame0Data_.node[id], byteArray + address, currentNodeSize); 28 | 29 | address += currentNodeSize; 30 | } 31 | 32 | // NodeFrame0Data data = nodeFrame0Data_; 33 | } 34 | 35 | uint8_t verifyNodeFrame0Data(uint8_t *byteArray, int32_t length) { 36 | if (byteArray[0] != 0x55 || byteArray[1] != 0x02) return 0; 37 | return verifyCheckSum(byteArray, length); 38 | } 39 | -------------------------------------------------------------------------------- /modules/sensors/nooploop/nlink_linktrack_node_frame0.h: -------------------------------------------------------------------------------- 1 | #ifndef NLINK_LINKTRACK_NODE_FRAME0_H 2 | #define NLINK_LINKTRACK_NODE_FRAME0_H 3 | 4 | #include "ncommon.h" 5 | #pragma pack(1) 6 | 7 | typedef struct { 8 | uint8_t header[2]; // 55 02 9 | uint16_t frameLength; 10 | uint8_t role; 11 | uint8_t id; 12 | uint8_t reserved[4]; 13 | uint8_t validNodeQuantity; //当前协议帧所包含的有效节点数量 14 | //········变长组 15 | // uint8_t sumCheck; 16 | } NLink_LinkTrack_Node_Frame0_Part; 17 | #pragma pack() 18 | 19 | typedef struct { 20 | uint8_t role; 21 | uint8_t id; 22 | uint16_t dataLength; 23 | // WARNING 请根据自身情况设置单个节点单次最大数传长度,上限参考 LinkTrack 24 | // Datasheet 25 | uint8_t data[100]; 26 | } Node0_t; 27 | 28 | typedef struct { 29 | //由于是变长协议,这里仅表示前面固定部分 30 | NLink_LinkTrack_Node_Frame0_Part framePart; 31 | //协议结构体中部分变量需要经过二次转化 32 | Node0_t *node[256]; 33 | } NodeFrame0Data; 34 | 35 | extern NodeFrame0Data nodeFrame0Data_; 36 | 37 | //解析传入的 byteArray(已校验) 38 | void unpackNodeFrame0Data(uint8_t *byteArray); 39 | 40 | //校验传入的 byteArray 41 | uint8_t verifyNodeFrame0Data(uint8_t *byteArray, int32_t length); 42 | 43 | #endif // NLINK_LINKTRACK_NODE_FRAME0_H 44 | -------------------------------------------------------------------------------- /modules/sensors/nooploop/nlink_linktrack_node_frame1.h: -------------------------------------------------------------------------------- 1 | #ifndef NLINK_LINKTRACK_NODE_FRAME1_H 2 | #define NLINK_LINKTRACK_NODE_FRAME1_H 3 | 4 | #include "ncommon.h" 5 | 6 | #pragma pack(1) 7 | 8 | typedef struct { 9 | uint8_t role; 10 | uint8_t id; 11 | NInt24 posTemp[3]; 12 | uint8_t reserved[9]; 13 | } RawNode1_t; 14 | 15 | typedef struct { 16 | uint8_t header[2]; // 55 03 17 | uint16_t frameLength; 18 | uint8_t role; 19 | uint8_t id; 20 | uint32_t systemTime; 21 | uint8_t reserved0[14]; 22 | uint16_t supplyVoltageTemp; 23 | 24 | uint8_t validNodeQuantity; //当前协议帧所包含的有效节点数量 25 | //········变长组 26 | // uint8_t sumCheck; 27 | } NLink_LinkTrack_Node_Frame1_Part; 28 | #pragma pack() 29 | 30 | typedef struct { 31 | uint8_t role; 32 | uint8_t id; 33 | float pos[3]; 34 | } Node1_t; 35 | 36 | typedef struct { 37 | //由于是变长协议,这里仅表示前面固定部分 38 | NLink_LinkTrack_Node_Frame1_Part framePart; 39 | //协议结构体中部分变量需要经过二次转化 40 | Node1_t *node[256]; 41 | float supplyVoltage; 42 | } NodeFrame1Data; 43 | 44 | extern NodeFrame1Data nodeFrame1Data_; 45 | 46 | //解析传入的 byteArray(已校验) 47 | void unpackNodeFrame1Data(uint8_t *byteArray); 48 | 49 | //校验传入的 byteArray 50 | uint8_t verifyNodeFrame1Data(uint8_t *byteArray, int32_t length); 51 | 52 | #endif // NLINK_LINKTRACK_NODE_FRAME1_H 53 | -------------------------------------------------------------------------------- /modules/sensors/proto/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_proto_library( 4 | name = "sensors_cc_proto", 5 | deps = [ 6 | ":sensors_proto", 7 | ], 8 | ) 9 | 10 | proto_library( 11 | name = "sensors_proto", 12 | srcs = [ 13 | "mobileye.proto", 14 | "nooploop.proto", 15 | "pointcloud.proto", 16 | "radar.proto", 17 | "sensor_image.proto", 18 | "sensors.proto", 19 | "ultrasonic_radar.proto", 20 | ], 21 | deps = [ 22 | "//modules/common/proto:error_code_proto_lib", 23 | "//modules/common/proto:geometry_proto_lib", 24 | "//modules/common/proto:header_proto_lib", 25 | ], 26 | ) 27 | -------------------------------------------------------------------------------- /modules/sensors/proto/nooploop.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package apollo.sensors; 3 | 4 | import "modules/common/proto/geometry.proto"; 5 | 6 | // Noolloop LTS product Protocol, more details you can found here: 7 | // www.nooploop.com/download/products/uwb/doc/LinkTrack_User_Manual_V1.1.pdf 8 | message TagFrame { 9 | optional uint32 tag_id = 1; 10 | optional uint32 network_system_time = 2; // ms 11 | optional apollo.common.Point3D pos = 3; 12 | optional apollo.common.Point3D eop = 4; 13 | optional apollo.common.Point3D vel = 5; 14 | optional apollo.common.Point3D angle = 6; 15 | optional apollo.common.Quaternion rotation = 7; 16 | optional float supply_voltage = 8; 17 | repeated DistanceAnchor2Tag dis = 9; 18 | } 19 | 20 | message EulerAngle { 21 | optional float roll = 1; 22 | optional float yaw = 2; 23 | optional float pitch = 3; 24 | } 25 | 26 | message DistanceAnchor2Tag { 27 | // optional uint32 anchor_id = 1; 28 | optional float distance = 1; 29 | } 30 | 31 | // gyro.hardware: online 32 | // gyro.work: normal 33 | // acc.hardware: online 34 | // acc.work: normal 35 | enum SensorStatus { 36 | NORMAL = 1; 37 | ERROR = 2; 38 | ONLINE = 3; 39 | } 40 | -------------------------------------------------------------------------------- /modules/sensors/proto/pointcloud.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package apollo.sensors; 3 | 4 | import "modules/common/proto/header.proto"; 5 | 6 | message PointXYZIT { 7 | optional float x = 1 [default = nan]; 8 | optional float y = 2 [default = nan]; 9 | optional float z = 3 [default = nan]; 10 | optional uint32 intensity = 4 [default = 0]; 11 | optional uint64 timestamp = 5 [default = 0]; 12 | } 13 | 14 | message PointCloud { 15 | optional apollo.common.Header header = 1; 16 | optional bool is_dense = 3; 17 | repeated PointXYZIT point = 4; 18 | optional double measurement_time = 5; 19 | optional uint32 width = 6; 20 | optional uint32 height = 7; 21 | } 22 | -------------------------------------------------------------------------------- /modules/sensors/proto/sensors.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.sensors; 4 | 5 | message RealSenseDeviceModel { 6 | enum DeviceModel { 7 | T265 = 0; 8 | D435I = 1; 9 | D435 = 2; 10 | } 11 | } 12 | 13 | message Pose { 14 | optional uint64 frame_no = 1; 15 | optional Point translation = 2; 16 | optional Point velocity = 3; // (in meter/sec) 17 | //(as represented in quaternion rotation, relative to initial position) 18 | optional Quaternion rotation = 4; 19 | optional Point angular_velocity = 5; //(in radians/sec) 20 | optional Point angular_acceleration = 6; //(in radians/sec^2) 21 | //(pose data confidence 0x0 - Failed, 22 | // 0x1 - Low, 0x2 - Medium, 0x3 - High) 23 | optional uint32 tracker_confidence = 7; 24 | //(pose data confidence 0x0 - Failed, 25 | // 0x1 - Low, 0x2 - Medium, 0x3 - High) 26 | optional uint32 mapper_confidence = 8; 27 | } 28 | 29 | message Acc { 30 | optional Point acc = 1; 31 | } 32 | 33 | message Gyro { 34 | optional Point gyro = 2; 35 | } 36 | 37 | message Point { 38 | // meters 39 | optional double x = 1; 40 | optional double y = 2; 41 | optional double z = 3; 42 | } 43 | 44 | message Quaternion { 45 | optional double x = 1; 46 | optional double y = 2; 47 | optional double z = 3; 48 | optional double w = 4; 49 | } -------------------------------------------------------------------------------- /modules/sensors/proto/ultrasonic_radar.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package apollo.sensors; 4 | 5 | import "modules/common/proto/header.proto"; 6 | 7 | message Ultrasonic { 8 | // 9 | // x axis 10 | // ^ 11 | // | 12 | // * | * 13 | // * | * 14 | // \ * | * / 15 | // \ * range(i) * / 16 | // \ | / 17 | // \ | / 18 | // \ | / 19 | // y axis \ | / 20 | // <--------------- 21 | // ooooooooooooo //ultrasonic radar front surface 22 | // 23 | // In every working cycle, each radar of the ultrasonic system 24 | // return a range to form a range array, 'ranges'. 25 | 26 | optional apollo.common.Header header = 1; 27 | repeated float ranges = 2; 28 | } 29 | -------------------------------------------------------------------------------- /modules/sensors/tools/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "rs_connection_check", 7 | srcs = ["rs_connection_check.cc"], 8 | linkopts = [ 9 | "-lrealsense2", 10 | ], 11 | deps = [ 12 | "//modules/common:global_gflags", 13 | ], 14 | ) 15 | 16 | cc_binary( 17 | name = "image_save", 18 | srcs = ["image_save.cc"], 19 | deps = [ 20 | "//cyber", 21 | "//modules/common:global_gflags", 22 | "//modules/sensors/proto:sensors_cc_proto", 23 | "@opencv", 24 | ], 25 | ) 26 | 27 | cpplint() 28 | -------------------------------------------------------------------------------- /modules/tools/visualizer/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools:cpplint.bzl", "cpplint") 2 | load("//tools:qt.bzl", "qt_cc_library") 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | cc_binary( 7 | name = "cyber_visualizer", 8 | includes = [ 9 | ".", 10 | ], 11 | linkopts = [ 12 | "-lfastrtps", 13 | "-lconsole_bridge", 14 | "-lprotobuf", 15 | "-lglog", 16 | "-lpthread", 17 | "-lGL", 18 | ], 19 | deps = [ 20 | ":visualizer_lib", 21 | ], 22 | ) 23 | 24 | # name, src, hdr, uis = [], res = [], normal_hdrs = [], deps = None 25 | qt_cc_library( 26 | name = "visualizer_lib", 27 | src = glob( 28 | ["*.cc"], 29 | ), 30 | copts = [ 31 | "-Imodules/sensors/proto", 32 | ], 33 | hdr = glob([ 34 | "*.h", 35 | ]), 36 | includes = [ 37 | ".", 38 | ], 39 | linkstatic = 1, 40 | res = glob([ 41 | "*.qrc", 42 | ]), 43 | uis = glob([ 44 | "uis/*.ui", 45 | ]), 46 | deps = [ 47 | "//cyber", 48 | "//modules/sensors/proto:sensors_cc_proto", 49 | "@qt//:qt_gui", 50 | ], 51 | ) 52 | 53 | cpplint() 54 | -------------------------------------------------------------------------------- /modules/tools/visualizer/images/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/app.ico -------------------------------------------------------------------------------- /modules/tools/visualizer/images/closeimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/closeimage.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/grid.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/image.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/images.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/no_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/no_image.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/pause.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/play.png -------------------------------------------------------------------------------- /modules/tools/visualizer/images/pointcloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/modules/tools/visualizer/images/pointcloud.png -------------------------------------------------------------------------------- /modules/tools/visualizer/msg_dialog.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "modules/tools/visualizer/msg_dialog.h" 18 | #include "modules/tools/visualizer/ui_msg_dialog.h" 19 | 20 | MessageDialog::MessageDialog(QWidget *parent) 21 | : QDialog(parent), ui_(new Ui::MessageDialog) { 22 | ui_->setupUi(this); 23 | } 24 | 25 | MessageDialog::~MessageDialog() { delete ui_; } 26 | 27 | void MessageDialog::setMessage(const QString &msg) { 28 | ui_->msgLabel->setText(msg); 29 | } 30 | -------------------------------------------------------------------------------- /modules/tools/visualizer/msg_dialog.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace Ui { 22 | class MessageDialog; 23 | } 24 | 25 | class MessageDialog : public QDialog { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit MessageDialog(QWidget* parent = nullptr); 30 | ~MessageDialog(); 31 | 32 | void setMessage(const QString& msg); 33 | void setMessage(const char* msg) { setMessage(QString(msg)); } 34 | 35 | private: 36 | Ui::MessageDialog* ui_; 37 | }; 38 | -------------------------------------------------------------------------------- /modules/tools/visualizer/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/app.ico 4 | images/closeimage.png 5 | images/grid.png 6 | images/image.png 7 | images/images.png 8 | images/no_image.png 9 | images/pause.png 10 | images/play.png 11 | images/pointcloud.png 12 | shaders/grid.vert 13 | shaders/grid_pointcloud.frag 14 | shaders/pointcloud.vert 15 | shaders/video_image_plane.frag 16 | shaders/video_image_plane.vert 17 | shaders/radarpoints.frag 18 | shaders/radarpoints.vert 19 | 20 | 21 | -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/grid.vert: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in vec2 vertPos; 20 | uniform mat4 mvp; 21 | uniform vec3 color; 22 | out vec3 Color; 23 | 24 | void main(void) 25 | { 26 | gl_Position = mvp * vec4(vertPos.x, 0.0, vertPos.y, 1.0); 27 | Color = color; 28 | } 29 | -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/grid_pointcloud.frag: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in vec3 Color; 20 | out vec4 FragColor; 21 | 22 | void main(void) 23 | { 24 | FragColor = vec4(Color, 1.0); 25 | } -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/pointcloud.vert: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in vec4 vertPos; 20 | uniform mat4 mvp; 21 | out vec3 Color; 22 | 23 | void main(void) 24 | { 25 | gl_Position = mvp * vec4(vertPos.xyz, 1.0); 26 | 27 | float g = smoothstep(0.0, 256, vertPos.w); 28 | float r = 0.0; 29 | float b = 0.0; 30 | 31 | if(g <= 0.25) 32 | { 33 | r = g * 4.0; 34 | g = 0.0; 35 | } 36 | if(g > 0.75) 37 | { 38 | g = 0.0; 39 | b = g * 4.0 - 3.0; 40 | } 41 | else 42 | { 43 | g = g + 0.35; 44 | } 45 | 46 | Color = vec3(r,g,b); 47 | } 48 | -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/radarpoints.frag: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in vec3 Color; 20 | out vec4 FragColor; 21 | 22 | void main(void) 23 | { 24 | FragColor = vec4(Color, 1.0); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/radarpoints.vert: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in vec3 vertPos; 20 | uniform mat4 mvp; 21 | uniform vec3 color; 22 | out vec3 Color; 23 | 24 | void main(void) 25 | { 26 | gl_Position = mvp * vec4(vertPos.x, 0.0, vertPos.y, 1.0); 27 | gl_PointSize = 2.8f; 28 | Color = color; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/video_image_plane.frag: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in mediump vec2 TexCoord; 20 | out mediump vec4 FragColor; 21 | 22 | uniform sampler2D texture; 23 | 24 | void main() { 25 | FragColor = texture2D(texture, TexCoord); 26 | } 27 | -------------------------------------------------------------------------------- /modules/tools/visualizer/shaders/video_image_plane.vert: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #version 130 18 | 19 | in vec2 vertPos; 20 | in vec2 texCoord; 21 | 22 | out vec2 TexCoord; 23 | 24 | void main() 25 | { 26 | gl_Position = vec4(vertPos.x, vertPos.y, 0.0, 1.0); 27 | TexCoord = vec2(texCoord.x, 1.0 - texCoord.y); 28 | } 29 | -------------------------------------------------------------------------------- /modules/tools/visualizer/treewidget.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | class TreeWidget : public QTreeWidget { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit TreeWidget(QWidget *parent = nullptr); 26 | ~TreeWidget() {} 27 | 28 | signals: 29 | void visibilityChanged(bool); 30 | 31 | protected: 32 | void resizeEvent(QResizeEvent *); 33 | bool event(QEvent *e); 34 | }; 35 | -------------------------------------------------------------------------------- /modules/tools/visualizer/video_images_dialog.cc: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #include "modules/tools/visualizer/video_images_dialog.h" 18 | #include "modules/tools/visualizer/ui_video_images_dialog.h" 19 | 20 | VideoImagesDialog::VideoImagesDialog(QWidget *parent) 21 | : QDialog(parent), ui(new Ui::VideoImagesDialog) { 22 | ui->setupUi(this); 23 | } 24 | 25 | VideoImagesDialog::~VideoImagesDialog() { delete ui; } 26 | 27 | int VideoImagesDialog::count(void) const { return ui->spinBox->value(); } 28 | -------------------------------------------------------------------------------- /modules/tools/visualizer/video_images_dialog.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright 2018 The Apollo Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace Ui { 22 | class VideoImagesDialog; 23 | } 24 | 25 | class VideoImagesDialog : public QDialog { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit VideoImagesDialog(QWidget *parent = nullptr); 30 | ~VideoImagesDialog(); 31 | 32 | int count(void) const; 33 | 34 | private: 35 | Ui::VideoImagesDialog *ui; 36 | }; 37 | -------------------------------------------------------------------------------- /scripts/clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2019 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | # Usage: 20 | # clang-format.sh 21 | 22 | TARGET=$1 23 | 24 | # Check tool. 25 | if [ ! -x "$(command -v clang-format)" ]; then 26 | echo "Installing clang-format..." 27 | sudo apt-get install -y clang-format 28 | fi 29 | 30 | # Format. 31 | if [ -f "${TARGET}" ]; then 32 | clang-format -i -style=Google "${TARGET}" 33 | else 34 | clang-format -i -style=Google \ 35 | $(find "${TARGET}" -type f | grep -e '\.h$' -e '\.cc$') 36 | fi 37 | -------------------------------------------------------------------------------- /scripts/exercise1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test for cyber 4 | 5 | function start() { 6 | bash /apollo/scripts/realsense_exercise1.sh 7 | bash /apollo/scripts/chassis.sh 8 | } 9 | 10 | function stop() { 11 | bash /apollo/scripts/chassis.sh stop 12 | bash /apollo/scripts/realsense_exercise1.sh stop 13 | } 14 | 15 | 16 | case $1 in 17 | start) 18 | stop 19 | start 20 | ;; 21 | stop) 22 | stop 23 | ;; 24 | *) 25 | start 26 | ;; 27 | esac -------------------------------------------------------------------------------- /scripts/exercise2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 2 4 | function start() { 5 | bash /apollo/scripts/realsense.sh 6 | } 7 | 8 | function stop() { 9 | bash /apollo/scripts/realsense.sh stop 10 | } 11 | 12 | case $1 in 13 | start) 14 | stop 15 | start 16 | ;; 17 | stop) 18 | stop 19 | ;; 20 | *) 21 | start 22 | ;; 23 | esac -------------------------------------------------------------------------------- /scripts/exercise3.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 3 lane detection 4 | function start() { 5 | bash /apollo/scripts/realsense.sh 6 | bash /apollo/scripts/chassis.sh 7 | } 8 | 9 | function stop() { 10 | bash /apollo/scripts/chassis.sh stop 11 | bash /apollo/scripts/realsense.sh stop 12 | } 13 | 14 | 15 | case $1 in 16 | start) 17 | stop 18 | start 19 | ;; 20 | stop) 21 | stop 22 | ;; 23 | *) 24 | start 25 | ;; 26 | esac -------------------------------------------------------------------------------- /scripts/exercise4.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 4 localization and apriltag 4 | function start() { 5 | bash /apollo/scripts/realsense.sh 6 | bash /apollo/scripts/localization.sh 7 | bash /apollo/scripts/chassis.sh 8 | } 9 | 10 | function stop() { 11 | bash /apollo/scripts/localization.sh stop 12 | bash /apollo/scripts/chassis.sh stop 13 | bash /apollo/scripts/realsense.sh stop 14 | } 15 | 16 | 17 | case $1 in 18 | start) 19 | stop 20 | start 21 | ;; 22 | stop) 23 | stop 24 | ;; 25 | *) 26 | start 27 | ;; 28 | esac 29 | -------------------------------------------------------------------------------- /scripts/exercise5.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 5 kalman filter 4 | function start() { 5 | bash /apollo/scripts/realsense.sh 6 | # apriltag localization 7 | # bash /apollo/scripts/localization.sh 8 | bash /apollo/scripts/nooploop.sh 9 | bash /apollo/scripts/chassis.sh 10 | } 11 | 12 | function stop() { 13 | # apriltag localization 14 | # bash /apollo/scripts/localization.sh stop 15 | bash /apollo/scripts/nooploop.sh stop 16 | bash /apollo/scripts/chassis.sh stop 17 | bash /apollo/scripts/realsense.sh stop 18 | } 19 | 20 | 21 | case $1 in 22 | start) 23 | stop 24 | start 25 | ;; 26 | stop) 27 | stop 28 | ;; 29 | *) 30 | start 31 | ;; 32 | esac -------------------------------------------------------------------------------- /scripts/exercise6.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test planning dwa 4 | function start() { 5 | bash /apollo/scripts/realsense.sh 6 | #bash /apollo/scripts/localization.sh 7 | bash /apollo/scripts/chassis.sh 8 | } 9 | 10 | function stop() { 11 | #bash /apollo/scripts/localization.sh stop 12 | bash /apollo/scripts/chassis.sh stop 13 | bash /apollo/scripts/realsense.sh stop 14 | } 15 | 16 | 17 | case $1 in 18 | start) 19 | stop 20 | start 21 | ;; 22 | stop) 23 | stop 24 | ;; 25 | *) 26 | start 27 | ;; 28 | esac 29 | -------------------------------------------------------------------------------- /scripts/exercise7.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 7 longitude control 4 | 5 | function start() { 6 | bash /apollo/scripts/chassis.sh 7 | } 8 | 9 | function stop() { 10 | bash /apollo/scripts/chassis.sh stop 11 | } 12 | 13 | 14 | case $1 in 15 | start) 16 | stop 17 | start 18 | ;; 19 | stop) 20 | stop 21 | ;; 22 | *) 23 | start 24 | ;; 25 | esac -------------------------------------------------------------------------------- /scripts/exercise8.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 8 lat control 4 | 5 | function start() { 6 | bash /apollo/scripts/realsense.sh 7 | bash /apollo/scripts/chassis.sh 8 | } 9 | 10 | function stop() { 11 | bash /apollo/scripts/chassis.sh stop 12 | bash /apollo/scripts/realsense.sh stop 13 | } 14 | 15 | 16 | case $1 in 17 | start) 18 | stop 19 | start 20 | ;; 21 | stop) 22 | stop 23 | ;; 24 | *) 25 | start 26 | ;; 27 | esac 28 | -------------------------------------------------------------------------------- /scripts/exercise9.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # test 9 intergrated all modules 4 | 5 | function start() { 6 | bash /apollo/scripts/realsense.sh 7 | bash /apollo/scripts/chassis.sh 8 | } 9 | 10 | function stop() { 11 | bash /apollo/scripts/chassis.sh stop 12 | bash /apollo/scripts/realsense.sh stop 13 | } 14 | 15 | 16 | case $1 in 17 | start) 18 | stop 19 | start 20 | ;; 21 | stop) 22 | stop 23 | ;; 24 | *) 25 | start 26 | ;; 27 | esac -------------------------------------------------------------------------------- /scripts/jupyter.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/for-geeks/geek-car/719620c8a1676565e18bc4f4420027385720dc3e/scripts/jupyter.sh -------------------------------------------------------------------------------- /scripts/realsense_monitor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2017 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | 20 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 21 | 22 | cd "${DIR}/.." 23 | 24 | ./bazel-bin/modules/monitor/realsense_monitor 25 | -------------------------------------------------------------------------------- /scripts/teleop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################### 4 | # Copyright 2017 The Apollo Authors. All Rights Reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ############################################################################### 18 | 19 | 20 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 21 | 22 | cd "${DIR}/.." 23 | 24 | ./bazel-bin/modules/control/tools/teleop 25 | -------------------------------------------------------------------------------- /third_party/apriltag.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "apriltag", 7 | srcs = glob([ 8 | "local/lib/libapriltag*", 9 | ]), 10 | hdrs = glob([ 11 | "local/include/apriltag/*.h", 12 | ]), 13 | includes = ["local/include/apriltag"], 14 | ) 15 | -------------------------------------------------------------------------------- /third_party/benchmark.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | exports_files(["LICENSE"]) 4 | 5 | cc_library( 6 | name = "benchmark", 7 | srcs = [ 8 | "src/arraysize.h", 9 | "src/benchmark.cc", 10 | "src/benchmark_api_internal.h", 11 | "src/benchmark_register.cc", 12 | "src/check.h", 13 | "src/colorprint.cc", 14 | "src/colorprint.h", 15 | "src/commandlineflags.cc", 16 | "src/commandlineflags.h", 17 | "src/complexity.cc", 18 | "src/complexity.h", 19 | "src/console_reporter.cc", 20 | "src/csv_reporter.cc", 21 | "src/cycleclock.h", 22 | "src/internal_macros.h", 23 | "src/json_reporter.cc", 24 | "src/log.h", 25 | "src/mutex.h", 26 | "src/re.h", 27 | "src/reporter.cc", 28 | "src/sleep.cc", 29 | "src/sleep.h", 30 | "src/stat.h", 31 | "src/string_util.cc", 32 | "src/string_util.h", 33 | "src/sysinfo.cc", 34 | "src/sysinfo.h", 35 | "src/timers.cc", 36 | "src/timers.h", 37 | ], 38 | hdrs = [ 39 | "include/benchmark/benchmark.h", 40 | "include/benchmark/benchmark_api.h", 41 | "include/benchmark/macros.h", 42 | "include/benchmark/reporter.h", 43 | ], 44 | defines = ["HAVE_POSIX_REGEX"], 45 | includes = ["include"], 46 | linkopts = ["-pthread"], 47 | visibility = ["//visibility:public"], 48 | ) 49 | -------------------------------------------------------------------------------- /third_party/eigen.BUILD: -------------------------------------------------------------------------------- 1 | # Eigen is a C++ template library for linear algebra: vectors, 2 | # matrices, and related algorithms. 3 | # 4 | # This is Eigen 3.2.10 5 | 6 | # This BUILD file is derived from 7 | # https://github.com/RobotLocomotion/drake/blob/master/tools/eigen.BUILD 8 | 9 | licenses([ 10 | # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. 11 | # We've taken special care to not reference any restricted code. 12 | "reciprocal", # MPL2 13 | "notice", # Portions BSD 14 | ]) 15 | 16 | exports_files(["COPYING.MPL2"]) 17 | 18 | cc_library( 19 | name = "eigen", 20 | hdrs = glob([ 21 | "Eigen/*", 22 | "Eigen/**/*.h", 23 | "unsupported/Eigen/*", 24 | "unsupported/Eigen/**/*.h", 25 | ]), 26 | defines = ["EIGEN_MPL2_ONLY"], 27 | includes = [ 28 | ".", 29 | "/usr/local/include", 30 | ], 31 | visibility = ["//visibility:public"], 32 | ) 33 | -------------------------------------------------------------------------------- /third_party/fastrtps.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "fastrtps", 3 | srcs = glob([ 4 | "lib/*.so.*", 5 | "lib/*.so", 6 | ]), 7 | includes = [ 8 | "include", 9 | ], 10 | visibility = ["//visibility:public"], 11 | ) 12 | -------------------------------------------------------------------------------- /third_party/gflags.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "gflags", 7 | includes = [ 8 | ".", 9 | ], 10 | linkopts = [ 11 | "-lgflags", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/glew.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "glew", 7 | includes = ["."], 8 | linkopts = [ 9 | "-L/usr/lib64", 10 | "-lGLEW", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/glfw.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "glfw", 7 | includes = ["."], 8 | linkopts = [ 9 | "-lglfw", 10 | "-lglapi", 11 | "-lglib-2.0", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/glog.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "glog", 7 | includes = [ 8 | ".", 9 | ], 10 | linkopts = [ 11 | "-L/usr/local/lib", 12 | "-lglog", 13 | "-lgflags", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /third_party/google_styleguide.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | # We can't set name="cpplint" here because that's the directory name so the 6 | # sandbox gets confused. We'll give it a private name with a public alias. 7 | py_binary( 8 | name = "cpplint_binary", 9 | srcs = ["cpplint/cpplint.py"], 10 | imports = ["cpplint"], 11 | main = "cpplint/cpplint.py", 12 | visibility = [], 13 | ) 14 | 15 | alias( 16 | name = "cpplint", 17 | actual = ":cpplint_binary", 18 | ) 19 | 20 | py_test( 21 | name = "cpplint_unittest", 22 | size = "small", 23 | srcs = ["cpplint/cpplint_unittest.py"], 24 | data = ["cpplint/cpplint_test_header.h"], 25 | deps = [ 26 | ":cpplint_py", 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /third_party/opencv.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | 6 | cc_library( 7 | name = "opencv", 8 | includes = ["."], 9 | linkopts = [ 10 | # "-L/usr/local/lib", 11 | "-lopencv_core", 12 | "-lopencv_highgui", 13 | "-lopencv_imgproc", 14 | "-lopencv_imgcodecs", 15 | "-lopencv_calib3d", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /third_party/osqp.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "osqp", 7 | include_prefix = "osqp", 8 | includes = [ 9 | ".", 10 | ], 11 | linkopts = [ 12 | "-L/usr/local/lib", 13 | "-Wl,-rpath,/usr/lib/x86_64-linux-gnu/", 14 | "-losqp", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /third_party/pcl.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_library( 6 | name = "pcl", 7 | defines = ["PCL_NO_PRECOMPILE"], 8 | includes = [ 9 | ".", 10 | ], 11 | linkopts = select( 12 | { 13 | ":x86_mode": [ 14 | "-L/usr/local/lib/", 15 | ], 16 | ":arm_mode": [ 17 | "-L/usr/lib/aarch64-linux-gnu/", 18 | ], 19 | }, 20 | no_match_error = "Please Build with an ARM or Linux x86_64 platform", 21 | ) + [ 22 | "-lboost_system", 23 | "-lpcl_common", 24 | "-lpcl_features", 25 | "-lpcl_filters", 26 | "-lpcl_io_ply", 27 | "-lpcl_io", 28 | "-lpcl_kdtree", 29 | "-lpcl_keypoints", 30 | "-lpcl_ml", 31 | "-lpcl_octree", 32 | "-lpcl_outofcore", 33 | "-lpcl_people", 34 | "-lpcl_recognition", 35 | "-lpcl_registration", 36 | "-lpcl_sample_consensus", 37 | "-lpcl_search", 38 | "-lpcl_segmentation", 39 | "-lpcl_stereo", 40 | "-lpcl_surface", 41 | "-lpcl_tracking", 42 | "-lpcl_visualization", 43 | ], 44 | ) 45 | 46 | config_setting( 47 | name = "x86_mode", 48 | values = {"cpu": "k8"}, 49 | ) 50 | 51 | config_setting( 52 | name = "arm_mode", 53 | values = {"cpu": "arm"}, 54 | ) 55 | -------------------------------------------------------------------------------- /third_party/python27.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "python27", 7 | srcs = select({ 8 | ":x86_mode": glob([ 9 | "lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so", 10 | ]), 11 | ":arm_mode": glob([ 12 | "lib/python2.7/config-aarch64-linux-gnu/libpython2.7.so", 13 | ]), 14 | }), 15 | hdrs = glob([ 16 | "include/python2.7/*.h", 17 | ]), 18 | includes = ["include/python2.7"], 19 | ) 20 | 21 | config_setting( 22 | name = "x86_mode", 23 | values = {"cpu": "k8"}, 24 | ) 25 | 26 | config_setting( 27 | name = "arm_mode", 28 | values = {"cpu": "arm"}, 29 | ) 30 | -------------------------------------------------------------------------------- /third_party/python3.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "python3", 7 | srcs = select({ 8 | ":x86_mode": glob([ 9 | "lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so", 10 | ]), 11 | ":arm_mode": glob([ 12 | "lib/python3.6/config-3.6m-aarch64-linux-gnu/libpython3.6.so", 13 | ]), 14 | }), 15 | hdrs = glob([ 16 | "include/python3.6/*.h", 17 | ]), 18 | includes = ["include/python3.6"], 19 | ) 20 | 21 | config_setting( 22 | name = "x86_mode", 23 | values = {"cpu": "k8"}, 24 | ) 25 | 26 | config_setting( 27 | name = "arm_mode", 28 | values = {"cpu": "arm"}, 29 | ) 30 | -------------------------------------------------------------------------------- /third_party/realsense.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | 6 | cc_library( 7 | name = "realsense", 8 | includes = ["."], 9 | linkopts = select( 10 | { 11 | ":x86_mode": [ 12 | "-L/usr/lib/x86_64-linux-gnu/", 13 | ], 14 | ":arm_mode": [ 15 | "-L/usr/lib/aarch64-linux-gnu/", 16 | ], 17 | }, 18 | no_match_error = "Please Build with an ARM or Linux x86_64 platform", 19 | ) + [ 20 | "-lrealsense2", 21 | ], 22 | ) 23 | 24 | 25 | config_setting( 26 | name = "x86_mode", 27 | values = {"cpu": "k8"}, 28 | ) 29 | 30 | config_setting( 31 | name = "arm_mode", 32 | values = {"cpu": "arm"}, 33 | ) 34 | -------------------------------------------------------------------------------- /third_party/tensorrt.BUILD: -------------------------------------------------------------------------------- 1 | # Eigen is a C++ template library for linear algebra: vectors, 2 | # matrices, and related algorithms. 3 | # 4 | # This is Eigen 3.2.10 5 | 6 | # This BUILD file is derived from 7 | # https://github.com/RobotLocomotion/drake/blob/master/tools/eigen.BUILD 8 | 9 | licenses([ 10 | # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. 11 | # We've taken special care to not reference any restricted code. 12 | "notice", # Portions BSD 13 | ]) 14 | 15 | cc_library( 16 | name = "tensorrt", 17 | includes = [ 18 | ".", 19 | "/usr/include/tensorrt", 20 | ], 21 | linkopts = [ 22 | "-L/usr/lib/x86_64-linux-gnu/", 23 | "-lnvcaffe_parser", 24 | "-lnvinfer", 25 | "-lnvinfer_plugin", 26 | "-lnvparsers", 27 | ], 28 | visibility = ["//visibility:public"], 29 | ) 30 | -------------------------------------------------------------------------------- /third_party/tf2/BUILD: -------------------------------------------------------------------------------- 1 | # JSON for Modern C++ 2 | package(default_visibility = ["//visibility:public"]) 3 | 4 | licenses(["notice"]) 5 | 6 | cc_library( 7 | name = "tf2", 8 | srcs = [ 9 | "src/buffer_core.cpp", 10 | "src/cache.cpp", 11 | "src/static_cache.cpp", 12 | "src/time.cpp", 13 | ], 14 | hdrs = glob([ 15 | "include/**/*.h", 16 | ]), 17 | includes = [ 18 | "include", 19 | ], 20 | linkopts = ["-lboost_signals -lboost_system -lboost_thread"], 21 | ) 22 | -------------------------------------------------------------------------------- /third_party/tf2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tf2) 3 | # set (CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/build/install CACHE STRING "" FORCE) 4 | # set (UNIT_TEST_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/tests CACHE STRING "" FORCE) 5 | # set(CMAKE_CXX_FLAGS "-std=c++11 -pthread -fPIE -fPIC -Wno-deprecated -pipe -W -Werror -Wall -g -O2" CACHE STRING "" FORCE) 6 | 7 | find_package(Boost REQUIRED COMPONENTS signals system thread) 8 | include_directories(include) 9 | 10 | # export user definitions 11 | #CPP Libraries 12 | add_library(tf2 SHARED src/cache.cpp src/buffer_core.cpp src/static_cache.cpp src/time.cpp) 13 | target_link_libraries(tf2 ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${console_bridge_LIBRARIES}) 14 | 15 | install(TARGETS ${PROJECT_NAME} 16 | DESTINATION third_party) 17 | 18 | install(TARGETS ${PROJECT_NAME} 19 | DESTINATION lib) 20 | 21 | install(DIRECTORY include 22 | DESTINATION ${CMAKE_INSTALL_PREFIX}) 23 | 24 | install(DIRECTORY include 25 | DESTINATION ${CMAKE_INSTALL_PREFIX}/third_party) 26 | 27 | # Tests 28 | add_subdirectory(test) 29 | -------------------------------------------------------------------------------- /third_party/tf2/index.rst: -------------------------------------------------------------------------------- 1 | tf2 2 | ===== 3 | 4 | This is the Python API reference of the tf2 package. 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | tf2 10 | 11 | Indices and tables 12 | ================== 13 | 14 | 15 | * :ref:`genindex` 16 | * :ref:`search` 17 | -------------------------------------------------------------------------------- /third_party/tf2/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | \b tf2 is the second generation of the tf library. 6 | 7 | This library implements the interface defined by tf2::BufferCore. 8 | 9 | There is also a Python wrapper with the same API that class this library using CPython bindings. 10 | 11 | \section codeapi Code API 12 | 13 | The main interface is through the tf2::BufferCore interface. 14 | 15 | It uses the exceptions in exceptions.h and the Stamped datatype 16 | in transform_datatypes.h. 17 | 18 | \section conversions Conversion Interface 19 | 20 | tf2 offers a templated conversion interface for external libraries to specify conversions between 21 | tf2-specific data types and user-defined data types. Various templated functions in tf2_ros use the 22 | conversion interface to apply transformations from the tf server to these custom datatypes. 23 | 24 | The conversion interface is defined in tf2/convert.h. 25 | 26 | Some packages that implement this interface: 27 | 28 | - tf2_bullet 29 | - tf2_eigen 30 | - tf2_geometry_msgs 31 | - tf2_kdl 32 | - tf2_sensor_msgs 33 | 34 | More documentation for the conversion interface is available on the ROS Wiki. 35 | 36 | **/ 37 | -------------------------------------------------------------------------------- /third_party/tf2/package.xml: -------------------------------------------------------------------------------- 1 | 2 | tf2 3 | 0.5.16 4 | 5 | tf2 is the second generation of the transform library, which lets 6 | the user keep track of multiple coordinate frames over time. tf2 7 | maintains the relationship between coordinate frames in a tree 8 | structure buffered in time, and lets the user transform points, 9 | vectors, etc between any two coordinate frames at any desired 10 | point in time. 11 | 12 | Tully Foote 13 | Eitan Marder-Eppstein 14 | Wim Meeussen 15 | Tully Foote 16 | BSD 17 | 18 | http://www.ros.org/wiki/tf2 19 | 20 | catkin 21 | 22 | libconsole-bridge-dev 23 | geometry_msgs 24 | rostime 25 | tf2_msgs 26 | 27 | libconsole-bridge-dev 28 | geometry_msgs 29 | rostime 30 | tf2_msgs 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /third_party/tf2/src/time.cpp: -------------------------------------------------------------------------------- 1 | #include "tf2/time.h" 2 | 3 | namespace tf2 { 4 | double time_to_sec(Time t) { return static_cast(t) / 1e9; } 5 | } 6 | -------------------------------------------------------------------------------- /third_party/tf2/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(tf2_test) 2 | ADD_DEFINITIONS(-Dprotected=public -Dprivate=public -DUNIT_TEST=1) 3 | 4 | add_executable(cache_unittest cache_unittest.cpp) 5 | target_link_libraries(cache_unittest 6 | gtest 7 | tf2 8 | ) 9 | 10 | # install(TARGETS cache_unittest 11 | # DESTINATION ${UNIT_TEST_INSTALL_PREFIX}) 12 | # 13 | add_executable(simple_tf2_core simple_tf2_core.cpp) 14 | target_link_libraries(simple_tf2_core 15 | gtest 16 | tf2 17 | ) 18 | 19 | # install(TARGETS simple_tf2_core 20 | # DESTINATION ${UNIT_TEST_INSTALL_PREFIX}) 21 | 22 | add_executable(tf2_speed_test speed_test.cpp) 23 | target_link_libraries(tf2_speed_test 24 | gtest 25 | tf2 26 | ) 27 | # 28 | # install(TARGETS tf2_speed_test 29 | # DESTINATION ${UNIT_TEST_INSTALL_PREFIX}) 30 | # 31 | 32 | add_executable(tf2_static_cache_test static_cache_test.cpp) 33 | target_link_libraries(tf2_static_cache_test 34 | gtest 35 | tf2 36 | ) 37 | 38 | # install(TARGETS tf2_static_cache_test 39 | # DESTINATION ${UNIT_TEST_INSTALL_PREFIX}) 40 | # 41 | add_executable(tf2_speed_2_test speed_2_test.cpp) 42 | target_link_libraries(tf2_speed_2_test 43 | gtest 44 | tf2 45 | ) 46 | 47 | # install(TARGETS tf2_speed_2_test 48 | # DESTINATION ${UNIT_TEST_INSTALL_PREFIX}) 49 | -------------------------------------------------------------------------------- /third_party/vtk.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) 4 | 5 | cc_library( 6 | name = "vtk", 7 | linkopts = [ 8 | "-L/usr/lib/x86_64-linux-gnu/", 9 | "-lvtkCommonCore-6.3", 10 | ], 11 | hdrs = glob([ 12 | "include/vtk-6.3/*.h", 13 | ]), 14 | includes = ["include/vtk-6.3"], 15 | ) 16 | -------------------------------------------------------------------------------- /tools/BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | -------------------------------------------------------------------------------- /tools/platforms/BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | default_visibility = ["//visibility:public"], 3 | ) 4 | 5 | config_setting( 6 | name = "aarch64", 7 | values = { 8 | "define": "ARCH=aarch64", 9 | }, 10 | ) 11 | 12 | config_setting( 13 | name = "x86_64", 14 | values = { 15 | "define": "ARCH=x86_64", 16 | }, 17 | ) 18 | 19 | config_setting( 20 | name = "use_gpu", 21 | values = { 22 | "define": "USE_GPU=true", 23 | }, 24 | ) 25 | 26 | config_setting( 27 | name = "use_esd_can", 28 | values = { 29 | "define": "CAN_CARD=esd_can", 30 | }, 31 | ) 32 | --------------------------------------------------------------------------------