#!/bin/bash

cd /opt/ros/jazzy
source /opt/ros/jazzy/setup.bash
source /opt/ros/jazzy/install/local_setup.bash

ln -s /ros2-vedrus/vedrus /opt/ros/jazzy/vedrus
ln -s /ros2-vedrus/vedrus_interfaces /opt/ros/jazzy/vedrus_interfaces

ln -s /ros2-vedrus/yolov8_rknn /opt/ros/jazzy/yolov8_rknn
ln -s /ros2-vedrus/yolov8_nvidia /opt/ros/jazzy/yolov8_nvidia
ln -s /ros2-vedrus/yolov8_interfaces /opt/ros/jazzy/yolov8_interfaces

ln -s /ros2-vedrus/hmc5883ldriver /opt/ros/jazzy/hmc5883ldriver

# почему-то собираются только по одному. Потом разберусь
colcon build --packages-ignore ament_lint ament_flake8 ament_pep257 ament_copyright --symlink-install --packages-select vedrus
colcon build --packages-ignore gtest_vendor gtest gmock_vendor ament_cppcheck ament_lint ament_package ament_cmake_core ament_flake8 ament_cmake_export_definitions ament_cmake_export_include_directories ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_include_directories ament_cmake_libraries ament_cmake_python ament_cmake_version ament_pep257 ament_cmake_export_dependencies ament_cmake_export_interfaces ament_cmake_export_targets ament_cmake_target_dependencies ament_cmake_test ament_copyright ament_cmake_gtest ament_cmake_pytest ament_cpplint ament_index_python ament_lint_auto ament_lint_cmake ament_xmllint domain_coordinator ament_cmake_gen_version_h ament_cmake_gmock ament_cmake_lint_cmake rosidl_cli rpyutils ament_cmake ament_cmake_copyright ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_flake8 ament_cmake_pep257 ament_cmake_xmllint uncrustify_vendor ament_uncrustify ament_cmake_uncrustify ament_lint_common ament_cmake_ros fastrtps_cmake_module python_cmake_module rosidl_adapter rosidl_typesupport_interface rosidl_parser rcutils rosidl_generator_type_description rosidl_pycommon rcpputils rosidl_cmake rosidl_generator_c rosidl_runtime_c rosidl_dynamic_typesupport rosidl_runtime_cpp rosidl_typesupport_introspection_c rmw rosidl_generator_cpp rosidl_typesupport_fastrtps_cpp rosidl_typesupport_introspection_cpp rosidl_typesupport_fastrtps_c rosidl_typesupport_c rosidl_generator_py rosidl_typesupport_cpp rosidl_core_generators rosidl_core_runtime builtin_interfaces unique_identifier_msgs service_msgs action_msgs rosidl_default_generators rosidl_default_runtime --symlink-install --packages-select vedrus_interfaces # std_msgs

#colcon build --packages-ignore ament_lint ament_flake8 ament_pep257 ament_copyright --symlink-install --packages-select yolov8_rknn
colcon build --packages-ignore ament_lint ament_flake8 ament_pep257 ament_copyright --symlink-install --packages-select yolov8_nvidia
colcon build --packages-ignore gtest_vendor gtest gmock_vendor ament_cppcheck ament_lint ament_package ament_cmake_core ament_flake8 ament_cmake_export_definitions ament_cmake_export_include_directories ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_include_directories ament_cmake_libraries ament_cmake_python ament_cmake_version ament_pep257 ament_cmake_export_dependencies ament_cmake_export_interfaces ament_cmake_export_targets ament_cmake_target_dependencies ament_cmake_test ament_copyright ament_cmake_gtest ament_cmake_pytest ament_cpplint ament_index_python ament_lint_auto ament_lint_cmake ament_xmllint domain_coordinator ament_cmake_gen_version_h ament_cmake_gmock ament_cmake_lint_cmake rosidl_cli rpyutils ament_cmake ament_cmake_copyright ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_flake8 ament_cmake_pep257 ament_cmake_xmllint uncrustify_vendor ament_uncrustify ament_cmake_uncrustify ament_lint_common ament_cmake_ros fastrtps_cmake_module python_cmake_module rosidl_adapter rosidl_typesupport_interface rosidl_parser rcutils rosidl_generator_type_description rosidl_pycommon rcpputils rosidl_cmake rosidl_generator_c rosidl_runtime_c rosidl_dynamic_typesupport rosidl_runtime_cpp rosidl_typesupport_introspection_c rmw rosidl_generator_cpp rosidl_typesupport_fastrtps_cpp rosidl_typesupport_introspection_cpp rosidl_typesupport_fastrtps_c rosidl_typesupport_c rosidl_generator_py rosidl_typesupport_cpp rosidl_core_generators rosidl_core_runtime builtin_interfaces unique_identifier_msgs service_msgs action_msgs rosidl_default_generators rosidl_default_runtime std_msgs --symlink-install --packages-select yolov8_interfaces

#colcon build --packages-ignore ament_cppcheck ament_cpplint ament_lint_cmake ament_package ament_xmllint ament_cmake_core ament_cmake_export_definitions ament_cmake_export_include_directories ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_include_directories ament_cmake_libraries ament_cmake_python ament_cmake_version ament_cmake_export_dependencies ament_cmake_export_interfaces ament_cmake_export_targets ament_cmake_target_dependencies ament_cmake_test ament_cmake_lint_cmake ament_lint_auto ament_cmake_copyright ament_cmake_gen_version_h ament_cmake ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_flake8 ament_cmake_pep257 ament_cmake_xmllint uncrustify_vendor ament_uncrustify ament_cmake_uncrustify ament_lint_common --symlink-install --packages-select mpu9250driver
#colcon build --packages-ignore ament_cppcheck ament_cpplint ament_lint_cmake ament_package ament_xmllint ament_cmake_core ament_cmake_export_definitions ament_cmake_export_include_directories ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_include_directories ament_cmake_libraries ament_cmake_python ament_cmake_version ament_cmake_export_dependencies ament_cmake_export_interfaces ament_cmake_export_targets ament_cmake_target_dependencies ament_cmake_test ament_cmake_lint_cmake ament_lint_auto ament_cmake_copyright ament_cmake_gen_version_h ament_cmake ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_flake8 ament_cmake_pep257 ament_cmake_xmllint uncrustify_vendor ament_uncrustify ament_cmake_uncrustify ament_lint_common --symlink-install --packages-select mpu6050driver
colcon build --packages-ignore ament_cppcheck ament_cpplint ament_lint_cmake ament_package ament_xmllint ament_cmake_core ament_cmake_export_definitions ament_cmake_export_include_directories ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_include_directories ament_cmake_libraries ament_cmake_python ament_cmake_version ament_cmake_export_dependencies ament_cmake_export_interfaces ament_cmake_export_targets ament_cmake_target_dependencies ament_cmake_test ament_cmake_lint_cmake ament_lint_auto ament_cmake_copyright ament_cmake_gen_version_h ament_cmake ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_flake8 ament_cmake_pep257 ament_cmake_xmllint uncrustify_vendor ament_uncrustify ament_cmake_uncrustify ament_lint_common --symlink-install --packages-select hmc5883ldriver
