### Package Installation Source: https://github.com/autowarefoundation/autoware_universe/blob/main/system/autoware_diagnostic_graph_aggregator/CMakeLists.txt Configures the package to install configuration files, examples, and launch files to the share directory. ```cmake ament_auto_package(INSTALL_TO_SHARE config example launch) ``` -------------------------------- ### Package Installation Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_euclidean_cluster/CMakeLists.txt Configures the ament package to install launch, config, and test directories to the share location. ```cmake autoware_ament_auto_package(INSTALL_TO_SHARE launch config test ) ``` -------------------------------- ### Project Setup and Package Definition Source: https://github.com/autowarefoundation/autoware_universe/blob/main/control/autoware_spheric_collision_detector/CMakeLists.txt Initializes the CMake project and defines the package name. This is a standard starting point for any CMake project. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_spheric_collision_detector) ``` -------------------------------- ### Install Package Resources Source: https://github.com/autowarefoundation/autoware_universe/blob/main/sensing/autoware_cuda_pointcloud_preprocessor/CMakeLists.txt Installs launch files and configuration directories to the share directory of the package. Also installs the shared library for the preprocessor. ```cmake install(DIRECTORY launch config DESTINATION share/${PROJECT_NAME} ) install( TARGETS cuda_pointcloud_preprocessor_lib LIBRARY DESTINATION lib ) ``` -------------------------------- ### Package Installation Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/autoware_trajectory_validator/CMakeLists.txt Configures the package for installation, including installing configuration files to the share directory. ```cmake autoware_ament_auto_package( INSTALL_TO_SHARE config ) ``` -------------------------------- ### Package Installation Source: https://github.com/autowarefoundation/autoware_universe/blob/main/system/autoware_topic_state_monitor/CMakeLists.txt Installs the launch files to the share directory of the package. ```cmake ament_auto_package(INSTALL_TO_SHARE launch ) ``` -------------------------------- ### Installing Test Configuration and Launch Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/simulator/autoware_fault_injection/CMakeLists.txt Installs configuration and launch files for testing to the share directory. This makes them available when the package is installed. ```cmake install(DIRECTORY test/config test/launch DESTINATION share/${PROJECT_NAME}/ ) ``` -------------------------------- ### Install Launch and Config Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_ground_segmentation_cuda/CMakeLists.txt Installs launch and configuration directories to the share directory of the package. ```cmake ################################################################################ # Install install(DIRECTORY launch config DESTINATION share/${PROJECT_NAME} ) ``` -------------------------------- ### Installing Headers Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/perception_utils/CMakeLists.txt Installs the include directory to the destination 'include'. ```cmake install( DIRECTORY include/ DESTINATION include ) ``` -------------------------------- ### Install Package Launch and Config Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_image_projection_based_fusion/CMakeLists.txt Configures the package to install launch and config directories to the share directory. This ensures that launch files and configuration assets are available after installation. ```cmake autoware_ament_auto_package(INSTALL_TO_SHARE launch config ) ``` -------------------------------- ### Install Libraries Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_lidar_frnet/CMakeLists.txt Installs the main library and the CUDA library to the 'lib' destination. ```cmake install( TARGETS ${PROJECT_NAME}_lib TARGETS ${PROJECT_NAME}_cuda_lib DESTINATION lib ) ``` -------------------------------- ### Install Launch Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/simulator/autoware_carla_interface/CMakeLists.txt Installs launch files into the share//launch directory. ```cmake install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/) ``` -------------------------------- ### Install Package Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_tensorrt_bevformer/CMakeLists.txt Installs the 'src', 'launch', and 'config' directories to the share directory of the package, and installs the TensorRT ops library. This makes the package's resources available at runtime. ```cmake install(DIRECTORY src launch config DESTINATION share/${PROJECT_NAME}) install(TARGETS ${TENSORRT_OPS_TARGET} LIBRARY DESTINATION lib) ``` -------------------------------- ### Install Launch Directory Source: https://github.com/autowarefoundation/autoware_universe/blob/main/sensing/autoware_pointcloud_preprocessor/CMakeLists.txt Installs the launch directory to the share directory of the package. ```cmake install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/ ) ``` -------------------------------- ### Install Configuration Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/simulator/autoware_carla_interface/CMakeLists.txt Installs configuration files into the share//config directory. ```cmake install(DIRECTORY config DESTINATION share/${PROJECT_NAME}/) ``` -------------------------------- ### Package and Install Launch Files Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/autoware_trajectory_selector/CMakeLists.txt Configures the package to install launch files into the share directory. ```cmake autoware_ament_auto_package( INSTALL_TO_SHARE launch ) ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/planning_validator/autoware_planning_validator_intersection_collision_checker/CMakeLists.txt Sets up the minimum CMake version, project name, and finds necessary Autoware packages. Exports plugin descriptions. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_planning_validator_intersection_collision_checker) find_package(autoware_cmake REQUIRED) autoware_package() pluginlib_export_plugin_description_file(autoware_planning_validator plugins.xml) ``` -------------------------------- ### Sensor-Specific Configuration Examples Source: https://github.com/autowarefoundation/autoware_universe/blob/main/sensing/autoware_pointcloud_preprocessor/docs/polar-voxel-outlier-filter.md Examples of sensor-specific configurations for different LiDAR setups, including long-range highway, urban short-range, high-resolution near-field, and environmental monitoring. ```yaml # Long-range highway LiDAR visibility_estimation_max_range_m: 200.0 visibility_estimation_max_secondary_voxel_count: 500 radial_resolution_m: 0.5 voxel_points_threshold: 2 visibility_estimation_only: false ``` ```yaml # Urban short-range LiDAR visibility_estimation_max_range_m: 20.0 visibility_estimation_max_secondary_voxel_count: 500 radial_resolution_m: 0.5 voxel_points_threshold: 2 visibility_estimation_only: false ``` ```yaml # High-resolution near-field processing visibility_estimation_max_range_m: 20.0 visibility_estimation_max_secondary_voxel_count: 500 radial_resolution_m: 0.5 azimuth_resolution_rad: 0.0175 # ~1 degree elevation_resolution_rad: 0.0175 # ~1 degree visibility_estimation_only: false ``` ```yaml # Environmental monitoring only visibility_estimation_max_range_m: 50.0 visibility_estimation_max_secondary_voxel_count: 500 radial_resolution_m: 1.0 # Coarser resolution for performance visibility_estimation_only: true # Diagnostics only ``` -------------------------------- ### Project and Package Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/planning_validator/autoware_planning_validator_rear_collision_checker/CMakeLists.txt Sets up the CMake minimum version, project name, and package information. It also exports plugin descriptions. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_planning_validator_rear_collision_checker) find_package(autoware_cmake REQUIRED) autoware_package() pluginlib_export_plugin_description_file(autoware_planning_validator plugins.xml) ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/autowarefoundation/autoware_universe/blob/main/control/autoware_autonomous_emergency_braking/CMakeLists.txt Initializes the CMake project and finds necessary packages like autoware_cmake and PCL. Includes system headers. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_autonomous_emergency_braking) find_package(autoware_cmake REQUIRED) autoware_package() find_package(PCL REQUIRED) include_directories( include SYSTEM ${PCL_INCLUDE_DIRS} ) ``` -------------------------------- ### Dependency and Package Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_raindrop_cluster_filter/CMakeLists.txt Finds required autoware packages and sets up the package for installation. This ensures all necessary libraries and build configurations are available. ```cmake # find dependencies find_package(autoware_cmake REQUIRED) find_package(autoware_agnocast_wrapper REQUIRED) autoware_package() ``` -------------------------------- ### Project and Package Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/localization/autoware_pose_estimator_arbiter/CMakeLists.txt Sets the minimum CMake version, defines the project name, and finds necessary autoware packages. This is a standard starting point for an autoware package. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_pose_estimator_arbiter) ``` ```cmake find_package(autoware_cmake REQUIRED) autoware_package() ``` -------------------------------- ### Package Installation Source: https://github.com/autowarefoundation/autoware_universe/blob/main/e2e/autoware_tensorrt_vad/CMakeLists.txt Configures the installation of package data, including launch files and configuration files, to the share directory. ```cmake ament_auto_package( INSTALL_TO_SHARE launch config ) ``` -------------------------------- ### Variable Indexing for QP Problem Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/autoware_trajectory_optimizer/docs/continuous_jerk_filter.md Defines the starting indices for different types of variables used in the quadratic programming problem setup. These indices are crucial for correctly mapping variables within the optimization problem. ```cpp IDX_B0 = 0; // Start of b variables (velocity squared) IDX_A0 = N; // Start of a variables (acceleration) IDX_DELTA0 = 2N; // Start of delta variables (velocity slack) IDX_SIGMA0 = 3N; // Start of sigma variables (acceleration slack) IDX_GAMMA0 = 4N; // Start of gamma variables (jerk slack) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/simulator/autoware_fault_injection/CMakeLists.txt Initializes the CMake project and sets the minimum required version. This is standard for all CMake projects. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_fault_injection) ``` -------------------------------- ### Setup Learning-Based Vehicle Model Source: https://github.com/autowarefoundation/autoware_universe/blob/main/simulator/autoware_learning_based_vehicle_model/README.md Initialize the vehicle model by defining sub-models with their Python module paths, optional parameter files, and class names. Then, define the system's state and input names, automatically generate connections, and set the time step. ```C++ InterconnectedModel vehicle; // Example of model descriptors std::tuple model_descriptor_1 = { (char*)"path_to_python_module_with_model_class_1", (char*)nullptr, // If no param file is needed you can pass 'nullptr' (char*)"ModelClass1" }; std::tuple model_descriptor_2 = { (char*)"path_to_python_module_with_model_class_2", (char*)"/path_to/param_file", (char*)"ModelClass2" // Name of the python class. Needs to use the interface from 'Assumptions' }; // Create sub-models based on descriptors vehicle.addSubmodel(model_descriptor_1); vehicle.addSubmodel(model_descriptor_2); // Define STATE and INPUT names of the system std::vector state_names = {(char*)"STATE_NAME_1", (char*)"STATE_NAME_2"}; std::vector input_names = {(char*)"INPUT_NAME_1", (char*)"INPUT_NAME_2"}; // Automatically connect sub-systems with model input vehicle.generateConnections(input_names, state_names); // Set the time step of the model vehicle.dtSet(dt); ``` -------------------------------- ### Package Installation Configuration Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_simple_object_merger/CMakeLists.txt Configures the package for installation, specifying files to be installed in the share directory. ```cmake # Package autoware_ament_auto_package( INSTALL_TO_SHARE config launch ) ``` -------------------------------- ### Package Installation Configuration Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/motion_velocity_planner/autoware_motion_velocity_obstacle_velocity_limiter_module/CMakeLists.txt Configures the package for installation, specifying that the 'config' directory should be installed to the share directory. ```cmake ament_auto_package( INSTALL_TO_SHARE config ) ``` -------------------------------- ### Package Installation Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_traffic_light_classifier/CMakeLists.txt Configures the package to install launch files, configuration files, and test data to the share directory. ```cmake ament_auto_package(INSTALL_TO_SHARE launch config test/test_data ) ``` -------------------------------- ### Install PyTorch Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_shape_estimation/README.md Installs PyTorch and torchvision within the activated conda environment. Uses the pytorch channel for installation. ```bash conda install pytorch torchvision -c pytorch ``` -------------------------------- ### Package Installation Configuration Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/behavior_path_planner/autoware_behavior_path_direction_change_module/CMakeLists.txt Configures the package for installation, specifically setting the installation directory for configuration files to the share directory. ```cmake ament_auto_package(INSTALL_TO_SHARE config) ``` -------------------------------- ### Install Image Assets Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_traffic_light_visualization/CMakeLists.txt Installs the 'images/' directory to the share directory of the installed package. This ensures that image assets are available at runtime. ```cmake install( DIRECTORY images/ DESTINATION share/${PROJECT_NAME}/images ) ``` -------------------------------- ### Package Installation Source: https://github.com/autowarefoundation/autoware_universe/blob/main/control/autoware_autonomous_emergency_braking/CMakeLists.txt Configures the package to install launch files and configuration files to the share directory. ```cmake ament_auto_package( INSTALL_TO_SHARE launch config ) ``` -------------------------------- ### Install mmpretrain from Source Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_traffic_light_classifier/README.md Clones the mmpretrain repository, navigates into the directory, and installs it using pip. This method ensures the latest version is used. ```bash cd ~/ git clone https://github.com/open-mmlab/mmpretrain.git cd mmpretrain pip install -U openmim && mim install -e . ``` -------------------------------- ### Launch Diagnostic Graph Aggregator Example Source: https://github.com/autowarefoundation/autoware_universe/blob/main/system/autoware_diagnostic_graph_aggregator/README.md Launches the diagnostic graph aggregator with example configurations. Ensure example launch files are available. ```bash ros2 launch autoware_diagnostic_graph_aggregator example-main.launch.xml ``` -------------------------------- ### Project and Package Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_object_merger/CMakeLists.txt Sets the minimum CMake version and project name, then finds and packages autoware specific components. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_object_merger) find_package(autoware_cmake REQUIRED) autoware_package() ``` -------------------------------- ### Autoware Package Installation Configuration Source: https://github.com/autowarefoundation/autoware_universe/blob/main/simulator/autoware_fault_injection/CMakeLists.txt Configures the autoware_package to install shared resources like config and launch files. This ensures these files are available after installation. ```cmake ament_auto_package( INSTALL_TO_SHARE config launch ) ``` -------------------------------- ### Basic CMake Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_multi_object_tracker/CMakeLists.txt Sets the minimum CMake version and project name. Includes necessary Autoware and ROS 2 packages. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_multi_object_tracker) find_package(autoware_cmake REQUIRED) autoware_package() find_package(tf2 REQUIRED) find_package(tf2_geometry_msgs REQUIRED) ``` -------------------------------- ### Install Dependencies Source: https://github.com/autowarefoundation/autoware_universe/blob/main/control/autoware_smart_mpc_trajectory_follower/README.md Install necessary Python packages for the Smart MPC Trajectory Follower. It's recommended to perform this installation within a virtual environment. ```bash pip3 install numba==0.58.1 GPy ``` -------------------------------- ### Fetch and Build Examples with matplotlibcpp17 Source: https://github.com/autowarefoundation/autoware_universe/blob/main/planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/CMakeLists.txt Conditionally builds examples if BUILD_EXAMPLES is enabled. It fetches matplotlibcpp17, adds executables for example files, and links against matplotlibcpp17. ```cmake include(FetchContent) FetchContent_Declare( matplotlibcpp17 GIT_REPOSITORY https://github.com/soblin/matplotlibcpp17.git GIT_TAG master ) FetchContent_MakeAvailable(matplotlibcpp17) file(GLOB_RECURSE example_files examples/*.cpp) foreach(example_file ${example_files}) get_filename_component(example_name ${example_file} NAME_WE) ament_auto_add_executable(${example_name} ${example_file}) target_include_directories(${example_name} SYSTEM INTERFACE matplotlibcpp17::matplotlibcpp17) set_source_files_properties(${example_file} PROPERTIES COMPILE_FLAGS -Wno-error -Wno-attributes -Wno-unused-parameter) target_link_libraries(${example_name} matplotlibcpp17::matplotlibcpp17) endforeach() ``` -------------------------------- ### Autoware Package Installation Configuration Source: https://github.com/autowarefoundation/autoware_universe/blob/main/examples/autoware_diagnostic_graph_test_examples/CMakeLists.txt Configures the installation of package data to the share directory. This is typically used to install data files required by the package at runtime. ```cmake ament_auto_package(INSTALL_TO_SHARE data) ``` -------------------------------- ### Basic CMake Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/perception_utils/CMakeLists.txt Sets the minimum CMake version and project name. Includes Autoware-specific CMake functions. ```cmake cmake_minimum_required(VERSION 3.14) project(perception_utils) find_package(autoware_cmake REQUIRED) autoware_package() ``` -------------------------------- ### Project and Dependency Setup Source: https://github.com/autowarefoundation/autoware_universe/blob/main/perception/autoware_probabilistic_occupancy_grid_map/CMakeLists.txt Initializes the CMake project and finds necessary Autoware, CUDA, Eigen, and PCL packages. ```cmake cmake_minimum_required(VERSION 3.14) project(autoware_probabilistic_occupancy_grid_map) find_package(autoware_cmake REQUIRED) autoware_package() find_package(CUDA) find_package(eigen3_cmake_module REQUIRED) find_package(Eigen3 REQUIRED) find_package(PCL REQUIRED) ```