From bc50227956d0c87041605f7f52025d10bcf2bdb3 Mon Sep 17 00:00:00 2001 From: Marina Moreira <67443181+marinagmoreira@users.noreply.github.com> Date: Thu, 28 Oct 2021 10:37:36 -0700 Subject: [PATCH] Catkinize astrobee (#282) * progress on catkenization; added tree to keep track * progress 13-11-2020 * progress, most of localization done * progress morning 19 nov * progress 21dec2020 * progress 22dec2020 * all but 9pkgs not compiling with catkin * everything compiling but dds * progress dds * Trying to get dds_ros_bridge working * merging develop in * progress commit dds_ros_bridge * trying to get dds_ros_bridge to compile * everything compiling * pointing at catkinized branch * everything compiling on a standalone vm * progress on nodelet includes * update with runtime libraries * removing tree * rviz plugin declared correctly * redid planner_qp build * bringing back centralized cmake folder * cross compiling working fully, install working except for dds_ros_bridge * cross compile install dds_ros_bridge working * fixing dds flag consistency and dependencies when normal building * fixing tests * converting packages under USE_ROS flag, testing command successful * make tests work for packages that are not built by default * fixing CI build for kinetic * updating media submodule * actually updating media submodules, remote was previously set to my fork * adding pre-compiled catkin package to the base package install * adding correct packaged, catkin tools * adding jsonloader compile and lua include fix * fixing message dependencies * replacing opencv big cmake with small definition and fixing headewrs for tools in marker_tracking * adding own message dependency * fixing test build * sourcing before asking for summary of tests * fixing library in dds_ros_bridge, taking out verbose mode of gazebo * fixing test summary path * data folder for tests were not being updated because of gitignore * updating install instructions * debian generation working * adding cmake_build_type flag * cleaning build before cross compiling * install all libraries * adding all the tools * adding nodelet dependency to epson_imu * adding library dependencies * fixing more library linkings * bumping up cmake min version * fixing armhf eigen alignment issues * fixing opencv problem * forgot && in docker * improving paths build instructions, fix test bug * adding own profile * add force in case profile already exists * removing catkin copy when only one file actually changed * adding the nodelet xml file * adding symlink for repeated tool instead of copying * defining workspace path instead of build * packaging astrobee-comm properly * removing export from package.xml * Update package.xml * adding dds flag to wdock * fixing release path in cmake * fix indentation * making sure all c++11 are now c++14 * use cp instead of rsync * reverting rate change * reverting weird spacings * taking out repeted jsonloader * reviewing code; suppressing symlink warnings; replacing having to list message names * adding build and install paths to cmake_prefix, such that the folders can be anywhere * adding catkin find_package to catkin2config * making catkin2 include part of toolchain file or in cmake prefix * fixing sourcing for dockerfile * removing unused cmake files --- .gitignore | 1 - CMakeLists.txt | 411 ----- astrobee/CMakeLists.txt | 39 +- astrobee/package.xml | 2 - .../scripts}/env_wrapper.sh | 0 behaviors/CMakeLists.txt | 24 - behaviors/arm/CMakeLists.txt | 86 +- behaviors/arm/package.xml | 2 + behaviors/dock/CMakeLists.txt | 91 +- behaviors/light_flow/CMakeLists.txt | 116 +- behaviors/perch/CMakeLists.txt | 92 +- behaviors/perch/src/perch_nodelet.cc | 5 + behaviors/states/CMakeLists.txt | 62 +- behaviors/states/nodelet_plugins.xml | 2 +- cmake/CATKIN_LICENSE | 28 - cmake/CreateLibrary.cmake | 83 - cmake/CreateMsgTargets.cmake | 83 - cmake/CreateToolTargets.cmake | 72 - cmake/{soracore => }/FindMiro.cmake | 0 cmake/FindOpenCV331.cmake | 41 + cmake/{soracore => }/FindRtiDds.cmake | 0 cmake/{soracore => }/FindSoracore.cmake | 0 .../GenerateMiroMakeParams.cmake | 0 cmake/{soracore => }/GenerateRtiDdsIdl.cmake | 0 cmake/{soracore => }/GetLibraryList.cmake | 0 .../GetPackageLibSearchPath.cmake | 0 cmake/InstallLaunchFiles.cmake | 22 - cmake/catkin/all.cmake | 206 --- cmake/catkin/assert.cmake | 22 - cmake/catkin/atomic_configure_file.cmake | 9 - cmake/catkin/catkinConfig.cmake.in | 117 -- cmake/catkin/catkin_add_env_hooks.cmake | 139 -- cmake/catkin/catkin_destinations.cmake | 59 - .../catkin/catkin_generate_environment.cmake | 146 -- cmake/catkin/catkin_install_python.cmake | 55 - cmake/catkin/catkin_libraries.cmake | 159 -- cmake/catkin/catkin_metapackage.cmake | 45 - cmake/catkin/catkin_package.cmake | 528 ------ cmake/catkin/catkin_package_xml.cmake | 69 - cmake/catkin/catkin_python_setup.cmake | 150 -- cmake/catkin/catkin_workspace.cmake | 122 -- cmake/catkin/debug_message.cmake | 16 - cmake/catkin/em/order_packages.cmake.em | 56 - cmake/catkin/em/pkg.pc.em | 8 - cmake/catkin/em_expand.cmake | 31 - cmake/catkin/empy.cmake | 39 - .../05.catkin-test-results.bat.develspace.in | 4 - .../05.catkin-test-results.sh.develspace.in | 4 - cmake/catkin/env-hooks/05.catkin_make.bash | 67 - .../env-hooks/05.catkin_make_isolated.bash | 65 - cmake/catkin/find_program_required.cmake | 9 - cmake/catkin/interrogate_setup_dot_py.py | 250 --- cmake/catkin/legacy.cmake | 3 - cmake/catkin/list_append_deduplicate.cmake | 16 - cmake/catkin/list_append_unique.cmake | 16 - .../list_insert_in_workspace_order.cmake | 35 - cmake/catkin/order_paths.py | 37 - cmake/catkin/parse_package_xml.py | 98 - cmake/catkin/platform/lsb.cmake | 28 - cmake/catkin/platform/ubuntu.cmake | 4 - cmake/catkin/platform/windows.cmake | 56 - cmake/catkin/python.cmake | 41 - cmake/catkin/safe_execute_process.cmake | 13 - cmake/catkin/shell.cmake | 17 - cmake/catkin/stamp.cmake | 13 - cmake/catkin/string_starts_with.cmake | 22 - cmake/catkin/templates/Doxyfile.in | 1630 ----------------- cmake/catkin/templates/__init__.py.in | 37 - cmake/catkin/templates/_setup_util.py.in | 287 --- .../catkin/templates/cfg-extras.context.py.in | 33 - cmake/catkin/templates/env-hook.context.py.in | 33 - cmake/catkin/templates/env.bat.in | 11 - cmake/catkin/templates/env.sh.in | 16 - .../templates/generate_cached_setup.py.in | 29 - .../templates/order_packages.context.py.in | 5 - cmake/catkin/templates/pkg.context.pc.in | 8 - .../templates/pkgConfig-version.cmake.in | 14 - cmake/catkin/templates/pkgConfig.cmake.in | 191 -- .../templates/python_distutils_install.bat.in | 17 - .../templates/python_distutils_install.sh.in | 28 - cmake/catkin/templates/relay.py.in | 4 - cmake/catkin/templates/rosinstall.in | 2 - .../templates/safe_execute_install.cmake.in | 5 - cmake/catkin/templates/script.bash.in | 4 - cmake/catkin/templates/script.in | 1 - cmake/catkin/templates/script.py.in | 5 - cmake/catkin/templates/script.sh.in | 4 - cmake/catkin/templates/setup.bash.in | 8 - cmake/catkin/templates/setup.bat.in | 59 - cmake/catkin/templates/setup.sh.in | 87 - cmake/catkin/templates/setup.zsh.in | 8 - .../test/catkin_download_test_data.cmake | 52 - cmake/catkin/test/download_checkmd5.py | 175 -- cmake/catkin/test/gtest.cmake | 139 -- cmake/catkin/test/nosetests.cmake | 117 -- cmake/catkin/test/run_tests.py | 44 - cmake/catkin/test/tests.cmake | 147 -- cmake/catkin/tools/bz2.cmake | 31 - cmake/catkin/tools/doxygen.cmake | 64 - cmake/catkin/tools/libraries.cmake | 22 - cmake/catkin/tools/rt.cmake | 45 - cmake/catkin/tools/threads.cmake | 31 - cmake/catkin/toplevel.cmake | 63 - cmake/catkin2Config.cmake | 24 +- cmake/package.xml | 37 - communications/CMakeLists.txt | 24 - communications/dds_msgs/CMakeLists.txt | 98 +- communications/dds_msgs/idl/CMakeLists.txt | 48 - communications/dds_msgs/package.xml | 21 + communications/dds_ros_bridge/CMakeLists.txt | 121 +- .../rapid_command_ros_command_plan.h | 2 +- ...apid_compressed_file_ros_compressed_file.h | 6 +- .../dds_ros_bridge/rapid_ekf_ros_ekf.h | 4 +- .../rapid_gs_data_ros_gs_data.h | 4 +- .../include/dds_ros_bridge/ros_agent_state.h | 6 +- .../include/dds_ros_bridge/ros_arm_state.h | 4 +- .../dds_ros_bridge/ros_battery_state.h | 6 +- .../ros_command_config_rapid_command_config.h | 2 +- .../dds_ros_bridge/ros_compressed_file_ack.h | 4 +- ...os_compressed_file_rapid_compressed_file.h | 4 +- .../include/dds_ros_bridge/ros_cpu_state.h | 6 +- .../include/dds_ros_bridge/ros_data_to_disk.h | 6 +- .../include/dds_ros_bridge/ros_disk_state.h | 6 +- .../dds_ros_bridge/ros_ekf_rapid_ekf.h | 4 +- .../include/dds_ros_bridge/ros_fault_config.h | 6 +- .../include/dds_ros_bridge/ros_fault_state.h | 4 +- .../dds_ros_bridge/ros_gnc_control_state.h | 4 +- .../dds_ros_bridge/ros_gnc_fam_cmd_state.h | 4 +- .../dds_ros_bridge/ros_guest_science.h | 8 +- .../include/dds_ros_bridge/ros_inertia.h | 4 +- .../include/dds_ros_bridge/ros_log_sample.h | 4 +- .../dds_ros_bridge/ros_odom_rapid_position.h | 4 +- .../dds_ros_bridge/ros_payload_state.h | 6 +- .../ros_plan_status_rapid_plan_status.h | 4 +- .../dds_ros_bridge/ros_pmc_cmd_state.h | 4 +- .../ros_telemetry_rapid_telemetry.h | 6 +- .../ros_zones_rapid_compressed_file.h | 4 +- communications/dds_ros_bridge/package.xml | 24 +- communications/ff_hw_msgs/CMakeLists.txt | 25 +- communications/ff_msgs/CMakeLists.txt | 32 +- debian/rules | 14 +- description/CMakeLists.txt | 35 - description/description/CMakeLists.txt | 4 + description/media | 2 +- doc/general_documentation/INSTALL.md | 42 +- doc/general_documentation/NASA_INSTALL.md | 51 +- external/CATKIN_IGNORE | 1 - external/CMakeLists.txt | 30 - gnc/CMakeLists.txt | 22 - gnc/ctl/CMakeLists.txt | 80 +- gnc/ctl/package.xml | 18 +- gnc/ekf/CMakeLists.txt | 68 +- gnc/ekf/package.xml | 18 +- gnc/fam/CMakeLists.txt | 76 +- gnc/fam/package.xml | 20 +- gnc/gnc_autocode/CMakeLists.txt | 75 +- gnc/gnc_autocode/package.xml | 29 + gnc/sim_wrapper/CMakeLists.txt | 93 +- gnc/sim_wrapper/package.xml | 20 +- hardware/eps_driver/CMakeLists.txt | 108 +- hardware/eps_driver/package.xml | 2 + hardware/epson_imu/CMakeLists.txt | 63 +- hardware/epson_imu/package.xml | 6 +- hardware/fam_cmd_i2c/CMakeLists.txt | 60 +- hardware/fam_cmd_i2c/package.xml | 2 + hardware/ff_serial/CMakeLists.txt | 56 +- hardware/flashlight/CMakeLists.txt | 114 +- hardware/flashlight/package.xml | 9 +- hardware/flycapture/CMakeLists.txt | 20 +- hardware/gpio/CMakeLists.txt | 42 +- hardware/i2c/CMakeLists.txt | 50 +- hardware/i2c/package.xml | 2 - hardware/is_camera/CMakeLists.txt | 71 +- hardware/is_camera/package.xml | 8 +- hardware/laser/CMakeLists.txt | 125 +- hardware/laser/package.xml | 13 +- hardware/perching_arm/CMakeLists.txt | 76 +- hardware/perching_arm/package.xml | 4 +- hardware/pico_driver/CMakeLists.txt | 95 +- hardware/pico_driver/package.xml | 6 +- hardware/pmc_actuator/CMakeLists.txt | 117 +- .../pmc_actuator_tool/pmc_actuator_tool.cc | 2 +- hardware/signal_lights/CMakeLists.txt | 101 +- hardware/smart_dock/CMakeLists.txt | 149 +- .../include/smart_dock/smart_dock_node.h | 4 +- hardware/smart_dock/package.xml | 33 + hardware/speed_cam/CMakeLists.txt | 82 +- hardware/speed_cam/package.xml | 8 +- hardware/temp_monitor/CMakeLists.txt | 78 +- hardware/temp_monitor/package.xml | 8 +- hardware/vive/CMakeLists.txt | 108 +- hardware/vive/package.xml | 4 +- localization/camera/CMakeLists.txt | 101 +- localization/camera/package.xml | 4 + localization/camera/test/test_camera_model.cc | 6 + .../camera/test/test_camera_params.cc | 6 + localization/camera/tools/undistort_image.cc | 6 +- localization/graph_localizer/CMakeLists.txt | 110 +- localization/graph_localizer/package.xml | 22 +- .../test_point_to_handrail_endpoint_factor.cc | 6 + .../test/test_point_to_line_factor.cc | 6 + .../test/test_point_to_line_segment_factor.cc | 6 + .../test/test_point_to_plane_factor.cc | 6 + .../test/test_rotation_factor.cc | 6 + .../test/test_rotation_factor_adder.cc | 6 + .../graph_localizer/test/test_silu.cc | 6 + localization/graph_optimizer/CMakeLists.txt | 65 +- localization/graph_optimizer/package.xml | 12 + .../ground_truth_localizer/CMakeLists.txt | 74 +- .../ground_truth_localizer/package.xml | 12 +- localization/handrail_detect/CMakeLists.txt | 62 +- localization/handrail_detect/package.xml | 2 - .../handrail_detect/src/handrail_detect.cc | 2 +- localization/imu_augmentor/CMakeLists.txt | 82 +- localization/imu_augmentor/package.xml | 13 +- localization/imu_integration/CMakeLists.txt | 64 +- localization/imu_integration/package.xml | 7 + localization/interest_point/CMakeLists.txt | 84 +- .../interest_point/test/test_matching.cc | 6 + localization/lk_optical_flow/CMakeLists.txt | 66 +- localization/lk_optical_flow/package.xml | 4 + .../localization_common/CMakeLists.txt | 76 +- localization/localization_common/package.xml | 8 + .../localization_manager/CMakeLists.txt | 58 +- .../localization_pipeline.h | 2 +- localization/localization_manager/package.xml | 2 + .../localization_measurements/CMakeLists.txt | 70 +- .../localization_measurements/package.xml | 6 + .../test/test_measurement_conversions.cc | 6 + .../test/test_plane.cc | 6 + localization/localization_node/CMakeLists.txt | 126 +- localization/localization_node/package.xml | 2 + localization/marker_tracking/CMakeLists.txt | 195 +- .../marker_tracking_node/marker_tracker.h | 0 .../marker_tracking_nodelet.h | 0 .../{ros => }/launch/body_tags.xml | 0 .../{ros => }/launch/dock_targets.m | 0 .../{ros => }/launch/granite_lab_tags.xml | 0 .../launch/granitetable_1280_960.xml | 0 .../{ros => }/launch/marker_tracking.launch | 0 .../launch/marker_tracking_overhead.launch | 0 .../{ros => }/launch/new_dock_targets.m | 0 .../{ros => }/nodelet_plugins.xml | 2 +- .../marker_tracking/{ros => }/package.xml | 8 +- .../marker_tracking/ros/CMakeLists.txt | 66 - .../src/{ => marker_tracking}/arconfigio.cc | 0 .../src/{ => marker_tracking}/arxmlio.cc | 0 .../{ => marker_tracking}/labelling_method.cc | 0 .../{ => marker_tracking}/marker_detector.cc | 0 .../marker_tracking_node}/marker_tracker.cc | 0 .../marker_tracking_nodelet.cc | 0 .../data/IMG_20141217_160451.small.opt.jpg | Bin .../data/IMG_20141217_160458.small.opt.jpg | Bin .../data/IMG_20141217_160509.small.opt.jpg | Bin .../{ros => }/test/data/ar_lab_tags.xml | 0 .../test/data/dock_xml_markers.config | 0 .../{ros => }/test/data/markers_sample.config | 0 .../{ros => }/test/test_arxmlio.cc | 6 + .../{ros => }/test/test_arxmlio.test | 0 .../test/test_marker_config_loader.cc | 6 + .../test/test_marker_config_loader.test | 0 .../{ros => }/test/test_marker_detector.cc | 12 +- .../{ros => }/test/test_marker_detector.test | 0 .../generate_ar_target.cc | 3 +- .../generate_multiscale_target.cc | 3 +- .../generate_svg_markers.cc | 2 +- .../identify_marker_in_image.cc | 7 +- .../marker_config2xml.cc | 0 .../markers_to_Kalibr.cc | 2 +- .../marker_tracking_node}/features_counter.py | 0 .../overhead_tracking_node.cc | 0 localization/sparse_mapping/CMakeLists.txt | 196 +- localization/sparse_mapping/package.xml | 6 +- localization/sparse_mapping/src/sparse_map.cc | 2 +- localization/sparse_mapping/src/tensor.cc | 2 +- .../sparse_mapping/test/test_build_db.cc | 6 + .../sparse_mapping/test/test_nvm_fileio.cc | 6 + .../sparse_mapping/test/test_registration.cc | 6 + .../test/test_registration.test | 2 +- .../sparse_mapping/test/test_reprojection.cc | 6 + .../sparse_mapping/test/test_sparse_map.cc | 6 + .../sparse_mapping/test/test_sparse_map.test | 2 +- localization/vive_localization/CMakeLists.txt | 92 +- localization/vive_localization/package.xml | 10 +- management/CMakeLists.txt | 25 - management/access_control/CMakeLists.txt | 57 +- management/access_control/package.xml | 4 + management/cpu_mem_monitor/CMakeLists.txt | 62 +- management/cpu_mem_monitor/package.xml | 9 +- management/data_bagger/CMakeLists.txt | 77 +- management/data_bagger/package.xml | 6 + management/disk_monitor/CMakeLists.txt | 65 +- management/disk_monitor/package.xml | 4 + management/executive/CMakeLists.txt | 152 +- management/executive/package.xml | 16 +- .../executive/tools/data_to_disk_pub.cc | 6 +- management/executive/tools/plan_pub.cc | 5 +- management/executive/tools/zones_pub.cc | 6 +- management/image_sampler/CMakeLists.txt | 67 +- management/image_sampler/package.xml | 6 + management/log_monitor/CMakeLists.txt | 53 +- management/log_monitor/package.xml | 11 - management/sys_monitor/CMakeLists.txt | 75 +- management/sys_monitor/package.xml | 4 + mobility/CMakeLists.txt | 13 - mobility/choreographer/CMakeLists.txt | 78 +- mobility/choreographer/package.xml | 16 +- mobility/framestore/CMakeLists.txt | 78 +- mobility/framestore/package.xml | 6 +- mobility/mapper/CMakeLists.txt | 96 +- mobility/mapper/package.xml | 12 +- mobility/mobility/CMakeLists.txt | 57 +- mobility/mobility/package.xml | 10 +- mobility/planner_qp/planner_qp/CMakeLists.txt | 107 +- mobility/planner_qp/planner_qp/package.xml | 5 + .../traj_opt_basic/CMakeLists.catkin | 35 - .../planner_qp/traj_opt_basic/CMakeLists.nasa | 33 - .../planner_qp/traj_opt_basic/CMakeLists.txt | 66 +- .../traj_opt_msgs/CMakeLists.catkin | 28 - .../planner_qp/traj_opt_msgs/CMakeLists.nasa | 26 - .../planner_qp/traj_opt_msgs/CMakeLists.txt | 40 +- .../planner_qp/traj_opt_pro/CMakeLists.catkin | 68 - .../planner_qp/traj_opt_pro/CMakeLists.nasa | 43 - .../planner_qp/traj_opt_pro/CMakeLists.txt | 100 +- .../planner_qp/traj_opt_ros/CMakeLists.catkin | 42 - .../planner_qp/traj_opt_ros/CMakeLists.nasa | 82 - .../planner_qp/traj_opt_ros/CMakeLists.txt | 101 +- mobility/planner_trapezoidal/CMakeLists.txt | 74 +- mobility/planner_trapezoidal/package.xml | 4 + scripts/build/build_debian.sh | 3 +- scripts/build/ubuntu_cross.cmake | 7 +- scripts/configure.sh | 350 ++-- scripts/docker/astrobee.Dockerfile | 11 +- scripts/docker/astrobee_base.Dockerfile | 2 +- scripts/docker/build.sh | 1 + scripts/docker/test_astrobee.Dockerfile | 5 +- scripts/setup/debians/update_release.sh | 2 +- scripts/setup/packages_base_bionic.lst | 2 + scripts/setup/packages_base_focal.lst | 2 + scripts/setup/packages_base_xenial.lst | 2 + shared/CMakeLists.txt | 24 - shared/config_reader/CMakeLists.txt | 56 +- shared/ff_common/CMakeLists.txt | 59 +- shared/ff_common/package.xml | 4 +- shared/ff_common/src/init.cc | 4 +- shared/ff_common/test/test_thread.cc | 6 + shared/ff_util/CMakeLists.txt | 108 +- shared/ff_util/include/ff_util/ff_action.h | 2 +- shared/ff_util/include/ff_util/ff_fsm.h | 2 +- shared/ff_util/include/ff_util/ff_service.h | 2 +- shared/ff_util/package.xml | 2 + .../ff_util/test/ff_action_active_timeout.cc | 2 +- .../ff_util/test/ff_action_cancel_own_goal.cc | 2 +- .../ff_util/test/ff_action_connect_timeout.cc | 2 +- .../test/ff_action_deadline_timeout.cc | 2 +- .../test/ff_action_nominal_behaviour.cc | 2 +- .../test/ff_action_preempt_others_goal.cc | 2 +- .../test/ff_action_preempt_own_goal.cc | 2 +- .../test/ff_action_response_timeout.cc | 2 +- shared/jsonloader/CMakeLists.txt | 133 +- shared/jsonloader/package.xml | 24 + shared/jsonloader/test/test_command.cxx | 6 + shared/jsonloader/test/test_command.test | 21 + shared/jsonloader/test/test_keepout.cxx | 6 + shared/jsonloader/test/test_keepout.test | 21 + shared/jsonloader/test/test_keepoutio.cxx | 8 +- shared/jsonloader/test/test_keepoutio.test | 21 + shared/jsonloader/test/test_plan.cxx | 8 +- .../jsonloader/test/test_plan.test | 17 +- shared/jsonloader/test/test_validation.cxx | 5 + shared/jsonloader/test/test_validation.test | 21 + shared/msg_conversions/CMakeLists.txt | 84 +- .../include/msg_conversions/msg_conversions.h | 4 +- shared/msg_conversions/package.xml | 8 + simulation/CMakeLists.txt | 603 +++--- simulation/package.xml | 6 + submodules/platform | 2 +- tools/CMakeLists.txt | 28 - tools/ekf_bag/CMakeLists.txt | 85 +- tools/ekf_bag/package.xml | 10 + tools/ekf_video/CMakeLists.txt | 59 +- tools/ekf_video/package.xml | 2 + tools/gds_helper/CMakeLists.txt | 6 +- tools/gnc_visualizer/CMakeLists.txt | 12 +- tools/gnc_visualizer/package.xml | 2 - tools/graph_bag/CMakeLists.txt | 111 +- tools/graph_bag/package.xml | 19 +- tools/imu_bias_tester/CMakeLists.txt | 79 +- tools/imu_bias_tester/package.xml | 14 +- .../localization_rviz_plugins/CMakeLists.txt | 60 +- tools/localization_rviz_plugins/package.xml | 4 + tools/rviz_visualizer/CMakeLists.txt | 56 +- tools/rviz_visualizer/package.xml | 5 +- tools/simulator/CMakeLists.txt | 20 - tools/simulator/arm_sim/CMakeLists.txt | 54 +- tools/simulator/arm_sim/package.xml | 4 +- tools/simulator/dock_sim/CMakeLists.txt | 54 +- tools/simulator/dock_sim/package.xml | 4 +- tools/simulator/eps_sim/CMakeLists.txt | 57 +- tools/simulator/eps_sim/package.xml | 2 + tools/visualeyez/CMakeLists.txt | 85 +- tools/visualeyez/package.xml | 4 + wdock/CMakeLists.txt | 104 +- wdock/include/wdock/wdock.h | 4 +- wdock/package.xml | 30 + 405 files changed, 7123 insertions(+), 9715 deletions(-) delete mode 100644 CMakeLists.txt rename {scripts/deploy => astrobee/scripts}/env_wrapper.sh (100%) delete mode 100644 behaviors/CMakeLists.txt delete mode 100644 cmake/CATKIN_LICENSE delete mode 100644 cmake/CreateLibrary.cmake delete mode 100644 cmake/CreateMsgTargets.cmake delete mode 100644 cmake/CreateToolTargets.cmake rename cmake/{soracore => }/FindMiro.cmake (100%) create mode 100644 cmake/FindOpenCV331.cmake rename cmake/{soracore => }/FindRtiDds.cmake (100%) rename cmake/{soracore => }/FindSoracore.cmake (100%) rename cmake/{soracore => }/GenerateMiroMakeParams.cmake (100%) rename cmake/{soracore => }/GenerateRtiDdsIdl.cmake (100%) rename cmake/{soracore => }/GetLibraryList.cmake (100%) rename cmake/{soracore => }/GetPackageLibSearchPath.cmake (100%) delete mode 100644 cmake/InstallLaunchFiles.cmake delete mode 100644 cmake/catkin/all.cmake delete mode 100644 cmake/catkin/assert.cmake delete mode 100644 cmake/catkin/atomic_configure_file.cmake delete mode 100644 cmake/catkin/catkinConfig.cmake.in delete mode 100644 cmake/catkin/catkin_add_env_hooks.cmake delete mode 100644 cmake/catkin/catkin_destinations.cmake delete mode 100644 cmake/catkin/catkin_generate_environment.cmake delete mode 100644 cmake/catkin/catkin_install_python.cmake delete mode 100644 cmake/catkin/catkin_libraries.cmake delete mode 100644 cmake/catkin/catkin_metapackage.cmake delete mode 100644 cmake/catkin/catkin_package.cmake delete mode 100644 cmake/catkin/catkin_package_xml.cmake delete mode 100644 cmake/catkin/catkin_python_setup.cmake delete mode 100644 cmake/catkin/catkin_workspace.cmake delete mode 100644 cmake/catkin/debug_message.cmake delete mode 100644 cmake/catkin/em/order_packages.cmake.em delete mode 100644 cmake/catkin/em/pkg.pc.em delete mode 100644 cmake/catkin/em_expand.cmake delete mode 100644 cmake/catkin/empy.cmake delete mode 100644 cmake/catkin/env-hooks/05.catkin-test-results.bat.develspace.in delete mode 100644 cmake/catkin/env-hooks/05.catkin-test-results.sh.develspace.in delete mode 100644 cmake/catkin/env-hooks/05.catkin_make.bash delete mode 100644 cmake/catkin/env-hooks/05.catkin_make_isolated.bash delete mode 100644 cmake/catkin/find_program_required.cmake delete mode 100644 cmake/catkin/interrogate_setup_dot_py.py delete mode 100644 cmake/catkin/legacy.cmake delete mode 100644 cmake/catkin/list_append_deduplicate.cmake delete mode 100644 cmake/catkin/list_append_unique.cmake delete mode 100644 cmake/catkin/list_insert_in_workspace_order.cmake delete mode 100644 cmake/catkin/order_paths.py delete mode 100755 cmake/catkin/parse_package_xml.py delete mode 100644 cmake/catkin/platform/lsb.cmake delete mode 100644 cmake/catkin/platform/ubuntu.cmake delete mode 100644 cmake/catkin/platform/windows.cmake delete mode 100644 cmake/catkin/python.cmake delete mode 100644 cmake/catkin/safe_execute_process.cmake delete mode 100644 cmake/catkin/shell.cmake delete mode 100644 cmake/catkin/stamp.cmake delete mode 100644 cmake/catkin/string_starts_with.cmake delete mode 100644 cmake/catkin/templates/Doxyfile.in delete mode 100644 cmake/catkin/templates/__init__.py.in delete mode 100755 cmake/catkin/templates/_setup_util.py.in delete mode 100644 cmake/catkin/templates/cfg-extras.context.py.in delete mode 100644 cmake/catkin/templates/env-hook.context.py.in delete mode 100644 cmake/catkin/templates/env.bat.in delete mode 100755 cmake/catkin/templates/env.sh.in delete mode 100644 cmake/catkin/templates/generate_cached_setup.py.in delete mode 100644 cmake/catkin/templates/order_packages.context.py.in delete mode 100644 cmake/catkin/templates/pkg.context.pc.in delete mode 100644 cmake/catkin/templates/pkgConfig-version.cmake.in delete mode 100644 cmake/catkin/templates/pkgConfig.cmake.in delete mode 100644 cmake/catkin/templates/python_distutils_install.bat.in delete mode 100755 cmake/catkin/templates/python_distutils_install.sh.in delete mode 100644 cmake/catkin/templates/relay.py.in delete mode 100644 cmake/catkin/templates/rosinstall.in delete mode 100644 cmake/catkin/templates/safe_execute_install.cmake.in delete mode 100755 cmake/catkin/templates/script.bash.in delete mode 100755 cmake/catkin/templates/script.in delete mode 100755 cmake/catkin/templates/script.py.in delete mode 100755 cmake/catkin/templates/script.sh.in delete mode 100644 cmake/catkin/templates/setup.bash.in delete mode 100644 cmake/catkin/templates/setup.bat.in delete mode 100644 cmake/catkin/templates/setup.sh.in delete mode 100644 cmake/catkin/templates/setup.zsh.in delete mode 100644 cmake/catkin/test/catkin_download_test_data.cmake delete mode 100755 cmake/catkin/test/download_checkmd5.py delete mode 100644 cmake/catkin/test/gtest.cmake delete mode 100644 cmake/catkin/test/nosetests.cmake delete mode 100755 cmake/catkin/test/run_tests.py delete mode 100644 cmake/catkin/test/tests.cmake delete mode 100644 cmake/catkin/tools/bz2.cmake delete mode 100644 cmake/catkin/tools/doxygen.cmake delete mode 100644 cmake/catkin/tools/libraries.cmake delete mode 100644 cmake/catkin/tools/rt.cmake delete mode 100644 cmake/catkin/tools/threads.cmake delete mode 100644 cmake/catkin/toplevel.cmake delete mode 100644 cmake/package.xml delete mode 100644 communications/CMakeLists.txt delete mode 100644 communications/dds_msgs/idl/CMakeLists.txt create mode 100644 communications/dds_msgs/package.xml delete mode 100644 description/CMakeLists.txt delete mode 100644 external/CATKIN_IGNORE delete mode 100644 external/CMakeLists.txt delete mode 100644 gnc/CMakeLists.txt create mode 100644 gnc/gnc_autocode/package.xml create mode 100644 hardware/smart_dock/package.xml rename localization/marker_tracking/{ros => }/include/marker_tracking_node/marker_tracker.h (100%) rename localization/marker_tracking/{ros => }/include/marker_tracking_node/marker_tracking_nodelet.h (100%) rename localization/marker_tracking/{ros => }/launch/body_tags.xml (100%) rename localization/marker_tracking/{ros => }/launch/dock_targets.m (100%) rename localization/marker_tracking/{ros => }/launch/granite_lab_tags.xml (100%) rename localization/marker_tracking/{ros => }/launch/granitetable_1280_960.xml (100%) rename localization/marker_tracking/{ros => }/launch/marker_tracking.launch (100%) rename localization/marker_tracking/{ros => }/launch/marker_tracking_overhead.launch (100%) rename localization/marker_tracking/{ros => }/launch/new_dock_targets.m (100%) rename localization/marker_tracking/{ros => }/nodelet_plugins.xml (84%) rename localization/marker_tracking/{ros => }/package.xml (80%) delete mode 100644 localization/marker_tracking/ros/CMakeLists.txt rename localization/marker_tracking/src/{ => marker_tracking}/arconfigio.cc (100%) rename localization/marker_tracking/src/{ => marker_tracking}/arxmlio.cc (100%) rename localization/marker_tracking/src/{ => marker_tracking}/labelling_method.cc (100%) rename localization/marker_tracking/src/{ => marker_tracking}/marker_detector.cc (100%) rename localization/marker_tracking/{ros/src => src/marker_tracking_node}/marker_tracker.cc (100%) rename localization/marker_tracking/{ros/src => src/marker_tracking_node}/marker_tracking_nodelet.cc (100%) rename localization/marker_tracking/{ros => }/test/data/IMG_20141217_160451.small.opt.jpg (100%) rename localization/marker_tracking/{ros => }/test/data/IMG_20141217_160458.small.opt.jpg (100%) rename localization/marker_tracking/{ros => }/test/data/IMG_20141217_160509.small.opt.jpg (100%) rename localization/marker_tracking/{ros => }/test/data/ar_lab_tags.xml (100%) rename localization/marker_tracking/{ros => }/test/data/dock_xml_markers.config (100%) rename localization/marker_tracking/{ros => }/test/data/markers_sample.config (100%) rename localization/marker_tracking/{ros => }/test/test_arxmlio.cc (92%) rename localization/marker_tracking/{ros => }/test/test_arxmlio.test (100%) rename localization/marker_tracking/{ros => }/test/test_marker_config_loader.cc (93%) rename localization/marker_tracking/{ros => }/test/test_marker_config_loader.test (100%) rename localization/marker_tracking/{ros => }/test/test_marker_detector.cc (87%) rename localization/marker_tracking/{ros => }/test/test_marker_detector.test (100%) rename localization/marker_tracking/tools/{ => marker_tracking}/generate_ar_target.cc (99%) rename localization/marker_tracking/tools/{ => marker_tracking}/generate_multiscale_target.cc (99%) rename localization/marker_tracking/tools/{ => marker_tracking}/generate_svg_markers.cc (99%) rename localization/marker_tracking/tools/{ => marker_tracking}/identify_marker_in_image.cc (92%) rename localization/marker_tracking/tools/{ => marker_tracking}/marker_config2xml.cc (100%) rename localization/marker_tracking/tools/{ => marker_tracking}/markers_to_Kalibr.cc (99%) rename localization/marker_tracking/{ros/tools => tools/marker_tracking_node}/features_counter.py (100%) rename localization/marker_tracking/{ros/tools => tools/marker_tracking_node}/overhead_tracking_node.cc (100%) delete mode 100644 management/CMakeLists.txt delete mode 100644 mobility/CMakeLists.txt delete mode 100644 mobility/planner_qp/traj_opt_basic/CMakeLists.catkin delete mode 100644 mobility/planner_qp/traj_opt_basic/CMakeLists.nasa delete mode 100644 mobility/planner_qp/traj_opt_msgs/CMakeLists.catkin delete mode 100644 mobility/planner_qp/traj_opt_msgs/CMakeLists.nasa delete mode 100644 mobility/planner_qp/traj_opt_pro/CMakeLists.catkin delete mode 100644 mobility/planner_qp/traj_opt_pro/CMakeLists.nasa delete mode 100644 mobility/planner_qp/traj_opt_ros/CMakeLists.catkin delete mode 100644 mobility/planner_qp/traj_opt_ros/CMakeLists.nasa delete mode 100644 shared/CMakeLists.txt create mode 100644 shared/jsonloader/package.xml create mode 100644 shared/jsonloader/test/test_command.test create mode 100644 shared/jsonloader/test/test_keepout.test create mode 100644 shared/jsonloader/test/test_keepoutio.test rename management/cpu_mem_monitor/test/test_init_cpu_monitor.test => shared/jsonloader/test/test_plan.test (62%) create mode 100644 shared/jsonloader/test/test_validation.test delete mode 100644 tools/CMakeLists.txt delete mode 100644 tools/simulator/CMakeLists.txt create mode 100644 wdock/package.xml diff --git a/.gitignore b/.gitignore index c874f89b61..82f212e91b 100644 --- a/.gitignore +++ b/.gitignore @@ -70,7 +70,6 @@ arm_build_release arm_build_debug armhf build_native -data doc/html doc/latex diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 7a4ce49830..0000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,411 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -cmake_minimum_required(VERSION 3.0) -project(Astrobee) - -set(ASTROBEE_VERSION 0.15.2) - -# Define our options -option(USE_CCACHE - "Use ccache to speed up compiling, at the cost of optimization" - ON) -option(USE_CTC - "Use cross compile toolchain for making ARM binaries" - OFF) -option(USE_ROS - "Build the ROS-dependent functionality." - ON) -option(USE_DDS - "Build the DDS-dependent functionality." - ON) -option(USE_STATIC_LIBS - "Build using static libraries. Will use lots of drive space." - OFF) -option(TEST_COVERAGE - "Build the code with code coverage options. Not compatible with USE_CTC." - OFF) -option(USE_DRIVERS - "Build the tools in the drivers directory." - ON) -option(IS_BAMBOO_BUILD - "The code is being built under the bamboo CI system" - OFF) -option(ENABLE_GPROF - "Enable compling with support for profiling wih gprof (the GNU Profiler)." - OFF) -option(ENABLE_GOOGLE_PROF - "Enable support for profiling wih pprof (the Google Profiler)." - OFF) -option(ENABLE_QP - "Enable support for the QP planner." - ON) -option(ENABLE_PICOFLEXX - "Enable support for building the PicoFlexx driver" - ON) -option(ENABLE_GAZEBO - "Enable support for building the Gazebo simulator" - ON) -option(ENABLE_VIVE - "Enable support for building the Vive drivers" - ON) -option(ENABLE_VIVE_SOLVER - "Enable support for building the Vive offline solver" - ON) -option(ENABLE_INTEGRATION_TESTING - "Build the integration tests if tests are active." - ON) -option(BUILD_LOC_RVIZ_PLUGINS - "Build the localization rviz plugins." - ON) - - -if ( "${CMAKE_VERSION}" VERSION_GREATER 3.0.0 ) - cmake_policy(SET CMP0045 OLD) - cmake_policy(SET CMP0046 OLD) -endif() - -set(ROS_FOUND FALSE) -if(DEFINED ENV{ROS_DISTRO}) - set(ROS_DISTRO $ENV{ROS_DISTRO}) - set(ROS_FOUND TRUE) -else() - message("ROS distro variable not set. Trying to figure it out...") - set(AVAILABLE_ROS_VERSIONS "melodic;kinetic;noetic") - set(ROS_FOUND FALSE) - foreach(version ${AVAILABLE_ROS_VERSIONS}) - if(NOT ROS_FOUND) - find_path(ROS_H ros.h PATHS /opt/ros/${version}/include/ros) - if(ROS_H) - set(ROS_DISTRO ${version}) - message("Found ros version ${ROS_DISTRO}") - set(ROS_FOUND TRUE) - endif() - endif() - endforeach() -endif() - -# Verify the user has the pre-commit hook -execute_process( - COMMAND cp scripts/git/pre-commit .git/hooks - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - ) - -# Let cmake know of our additional scripts -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/cmake") - -if (USE_CTC) - list(APPEND CMAKE_PREFIX_PATH "${ARM_CHROOT_DIR}/opt/ros/${ROS_DISTRO}") -else (USE_CTC) - list(APPEND CMAKE_PREFIX_PATH "/opt/ros/${ROS_DISTRO}") -endif (USE_CTC) - -# Enable RPATHs -set(CMAKE_SKIP_BUILD_RPATH FALSE) -set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -# The following works for then the binaries are not installed, but are -# ran from the build directory. -list(APPEND CMAKE_INSTALL_RPATH "$ORIGIN/../lib") -list(APPEND CMAKE_INSTALL_RPATH "/opt/ros/${ROS_DISTRO}/lib") - -# The following RPATHs work for when the binaries are installed -if (USE_CTC) - list(APPEND CMAKE_INSTALL_RPATH "/opt/rti/ndds/lib/$ENV{NDDSARCH}") - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) -else (USE_CTC) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -endif (USE_CTC) - -# If the user selected static libs .. set BUILD_SHARED_LIBS accordingly -if(USE_STATIC_LIBS) - set(BUILD_SHARED_LIBS OFF) -else(USE_STATIC_LIBS) - set(BUILD_SHARED_LIBS ON) -endif(USE_STATIC_LIBS) - -# Check that the compiler supports C++14 -include(CheckCXXCompilerFlag) -include(CheckCXXSourceCompiles) -CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) -CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) -if(COMPILER_SUPPORTS_CXX14) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") -elseif(COMPILER_SUPPORTS_CXX0X) - SET(LAMBDA_SRC "int main(int, char*[]) {int r = [] (int x) {return x;}(0); return r;}") - CHECK_CXX_SOURCE_COMPILES("${LAMBDA_SRC}" COMPILER_SUPPORTS_LAMBDAS) - if (NOT COMPILER_SUPPORTS_LAMBDAS) - message(SEND_ERROR "C++0x compiler doesn't support lambda functions.") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - endif() -else() - message(SEND_ERROR "Couldn't find compiler which supports C++14 or C++0X.") -endif() - -if (TEST_COVERAGE) - find_program(GCOV_PATH gcov) - if (NOT GCOV_PATH) - message(SEND_ERROR "Couldn't find gcov, but test coverage was opted for.") - endif() -endif() - -if (ENABLE_GPROF) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() - -# if we're compiling for native use ccache to speed things up -if (NOT USE_CTC) - if (USE_CCACHE) - find_program(CCACHE_EXECUTABLE ccache) - mark_as_advanced(CCACHE_EXECUTABLE) - if(CCACHE_EXECUTABLE) - foreach(LANG C CXX) - message(STATUS "Enabling ccache for ${LANG}") - set(CMAKE_${LANG}_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "") - endforeach() - endif() - endif (USE_CCACHE) -endif (NOT USE_CTC) - -# Enable OpenMP if we have it. (Ceres will use it .. maybe more of our -# products will use it later). -find_package(OpenMP) -if (OPENMP_FOUND) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -endif(OPENMP_FOUND) - -find_package(Glog REQUIRED) -find_package(Gflags REQUIRED) -ADD_DEFINITIONS(-DFREEFLYER_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE}) -enable_testing() - -if (USE_CTC) - find_program(LSB_RELEASE_EXEC lsb_release) - execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --codename OUTPUT_VARIABLE LSB_RELEASE_VERSION_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) - if("${LSB_RELEASE_VERSION_SHORT}" STREQUAL "bionic") - set(Protobuf_PROTOC_EXECUTABLE /usr/local/bin/protoc) - endif() -endif (USE_CTC) - -find_package(Protobuf REQUIRED) -if (NOT PROTOBUF_PROTOC_EXECUTABLE) - message(FATAL_ERROR "Could not find system's protoc executable") -endif (NOT PROTOBUF_PROTOC_EXECUTABLE) - -find_package(Ceres REQUIRED) - -find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS filesystem system iostreams thread program_options timer) -find_package(Eigen3 REQUIRED) -find_package(ZLIB) -find_package(Luajit20 REQUIRED) - -# Find OpenCV and fix a 3.3.1 bug -find_package(OpenCV 3 REQUIRED) -if (${OpenCV_VERSION} MATCHES "3.3.1") - foreach(__cvcomponent ${OpenCV_LIB_COMPONENTS}) - set (__original_cvcomponent ${__cvcomponent}) - if(NOT __cvcomponent MATCHES "^opencv_") - set(__cvcomponent opencv_${__cvcomponent}) - endif() - if (TARGET ${__cvcomponent}) - set_target_properties(${__cvcomponent} PROPERTIES - MAP_IMPORTED_CONFIG_DEBUG "" - MAP_IMPORTED_CONFIG_RELEASE "" - MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" - MAP_IMPORTED_CONFIG_MINSIZEREL "" - ) - endif() - endforeach(__cvcomponent) -endif() -if (USE_CTC) - foreach(__cvcomponent ${OpenCV_LIB_COMPONENTS}) - set(OpenCV_LIBS ${OpenCV_LIBS} "${OpenCV_INSTALL_PATH}/lib/arm-linux-gnueabihf/lib${__cvcomponent}3.so") - endforeach(__cvcomponent) -endif (USE_CTC) -set(OpenCV_LIBRARIES ${OpenCV_LIBS}) - -find_package(dbow2 REQUIRED) -find_package(Alvar REQUIRED) -find_package(GTSAM REQUIRED) -find_package(OpenMVG QUIET REQUIRED) -find_package(JsonCpp REQUIRED) -find_package(FFMPEG QUIET) # Optional -if (ENABLE_PICOFLEXX) - find_package(royale REQUIRED) -endif (ENABLE_PICOFLEXX) -# Find pkg-config supported libraries -if (ENABLE_VIVE) - find_package(USB REQUIRED) - find_package(JSONC REQUIRED) - find_package(ARGTABLE2 REQUIRED) - find_package(ZLIB REQUIRED) -endif (ENABLE_VIVE) - - -if (NOT USE_CTC) # pkg-config needs extra work to be used for cross compile - pkg_check_modules(YAMLCPP yaml-cpp) - if (YAMLCPP_FOUND) - set (YAMLCPP_INCLUDE_DIRS ${YAMLCPP_INCLUDEDIR}) - endif (YAMLCPP_FOUND) -endif (NOT USE_CTC) - -if(ENABLE_GOOGLE_PROF) - SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed -lprofiler -Wl,--as-needed") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG") -endif() - -if(USE_CTC) - set(BUILD_LOC_RVIZ_PLUGINS OFF) -endif() - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-local-typedefs -Wno-packed-bitfield-compat -std=c++14") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-local-typedefs -Wno-packed-bitfield-compat -std=c++14") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") - -# Set Architecture Specific Instructions -if (USE_CTC) - # Cross Compiling, armv7-a == Cortex A5, A7, A8 (Beagle Bone), A9 - # (Odroid), A12, A15 (Snapdragon-ish), A17 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv7-a -mtune=cortex-a9 -mfpu=neon -I${ARM_CHROOT_DIR}/usr/include/arm-linux-gnueabihf") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv7-a -mtune=cortex-a9 -mfpu=neon -I${ARM_CHROOT_DIR}/usr/include/arm-linux-gnueabihf") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-variable") -else (USE_CTC) - if (NOT IS_BAMBOO_BUILD) - if ((NOT USE_CCACHE) OR (NOT CCACHE_EXECUTABLE)) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mtune=native") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native") - endif () - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mno-avx") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-avx") - endif (NOT IS_BAMBOO_BUILD) -endif (USE_CTC) - -# Bring in catkin -if (USE_CTC) - # Catkin brings in GTest as a dependency. We don't want it because - # we have our own ... on top of that it doesn't build correctly for - # ARM. Our own unit tests however will continue to - # work. (non-catkin) - set(CATKIN_SKIP_TESTING ON) -endif (USE_CTC) -if (USE_ROS) - set(ENV{ROS_LANG_DISABLE} "genlisp:gennodejs:geneus:$ENV{ROS_LANG_DISABLE}") - - if (USE_CTC) - find_package(catkin2 COMPONENTS roscpp message_generation std_msgs geometry_msgs sensor_msgs cv_bridge image_transport tf tf2 tf2_ros rosbag nodelet) - else () - find_package(catkin2 COMPONENTS roscpp message_generation std_msgs geometry_msgs sensor_msgs cv_bridge image_transport tf tf2 tf2_ros rosbag nodelet rviz) - endif (USE_CTC) - - find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets) - - if (IS_BAMBOO_BUILD) - include(BambooFix) - endif() - - find_package(PCL REQUIRED COMPONENTS common) - find_package(Octomap MODULE REQUIRED) - #pkg_check_modules(OROCOS_KDL REQUIRED orocos_kdl) - if (USE_CTC) - set(OROCOS_KDL_LIBRARIES ${ARM_CHROOT_DIR}/opt/ros/${ROS_DISTRO}/lib/liborocos-kdl.so) - endif (USE_CTC) - set(catkin_FOUND ${catkin2_FOUND}) -endif(USE_ROS) - -if (USE_DDS) - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/soracore") - - if (USE_CTC) - set(SORACORE_ROOT_DIR ${ARM_CHROOT_DIR}/usr) - else (USE_CTC) - set(SORACORE_ROOT_DIR /usr) - endif (USE_CTC) - - set(MIRO_ROOT_DIR ${SORACORE_ROOT_DIR}) - - find_package(QtXml REQUIRED) - find_package(Miro REQUIRED) - find_package(RtiDds REQUIRED) - find_package(Soracore REQUIRED) -endif(USE_DDS) - -# Include Our CMake Functions -include(CreateLibrary) -include(CreateMsgTargets) -include(CreateRosTestTargets) -include(CreateTestTargets) -include(CreateToolTargets) -include(ExternalProjects) -include(FetchContent) -include(InstallLaunchFiles) - -add_subdirectory(external) - -if (TEST_COVERAGE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g --coverage") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage") - set(CMAKE_LIBS_COVERAGE "gcov") -endif() - -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - -# install the version.txt file when install target is run -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.txt - COMMAND ${CMAKE_COMMAND} - -D OUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/version.txt - -D ASTROBEE_VERSION=${ASTROBEE_VERSION} - -D GIT_MODULE_FILE="${CMAKE_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake" - -P ${CMAKE_SOURCE_DIR}/cmake/SetVersion.cmake) -add_custom_target(version DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.txt) -install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_CURRENT_BINARY_DIR}\" --target version)") -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.txt DESTINATION ${CMAKE_INSTALL_PREFIX} ) - -# install the env_wrapper.sh for running on astrobee -install(PROGRAMS scripts/deploy/env_wrapper.sh DESTINATION ${CMAKE_INSTALL_PREFIX} ) - -if (USE_ROS) - add_subdirectory(tools) - add_subdirectory(astrobee) - add_subdirectory(communications) - add_subdirectory(gnc) - add_subdirectory(mobility) - add_subdirectory(behaviors) - add_subdirectory(management) - add_subdirectory(description) - if (NOT USE_CTC AND ENABLE_GAZEBO) - add_subdirectory(simulation) - endif (NOT USE_CTC AND ENABLE_GAZEBO) -endif (USE_ROS) - -if (USE_DRIVERS) - add_subdirectory(hardware) -endif (USE_DRIVERS) - -add_subdirectory(shared) -add_subdirectory(localization) - -if (USE_DDS) - add_subdirectory(wdock) -endif (USE_DDS) - diff --git a/astrobee/CMakeLists.txt b/astrobee/CMakeLists.txt index 2d072feb1e..6768aef6e0 100644 --- a/astrobee/CMakeLists.txt +++ b/astrobee/CMakeLists.txt @@ -15,20 +15,57 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(astrobee) +set(ASTROBEE_VERSION 0.15.2) + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +# Verify the user has the pre-commit hook +execute_process( + COMMAND cp ../scripts/git/pre-commit ../.git/hooks + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp +) + catkin_package( CATKIN_DEPENDS roscpp ) +############# +## Install ## +############# + install(DIRECTORY config/ DESTINATION config) # resources will be installed separately # install(DIRECTORY resources/ DESTINATION resources) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) install(PROGRAMS scripts/apk_print_version.sh scripts/check_env.sh scripts/print_version.sh scripts/cpu_print_version.sh DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) + +# install the version.txt file when install target is run +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.txt + COMMAND ${CMAKE_COMMAND} + -D OUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/version.txt + -D ASTROBEE_VERSION=${ASTROBEE_VERSION} + -D GIT_MODULE_FILE="${CMAKE_SOURCE_DIR}/../cmake/GetGitRevisionDescription.cmake" + -P ${CMAKE_SOURCE_DIR}/../cmake/SetVersion.cmake) +add_custom_target(version DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.txt) +install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_CURRENT_BINARY_DIR}\" --target version)") +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.txt DESTINATION ${CMAKE_INSTALL_PREFIX} ) + +install(PROGRAMS scripts/env_wrapper.sh DESTINATION ${CMAKE_INSTALL_PREFIX} ) \ No newline at end of file diff --git a/astrobee/package.xml b/astrobee/package.xml index d4f7e90b5c..5549996fc5 100644 --- a/astrobee/package.xml +++ b/astrobee/package.xml @@ -14,9 +14,7 @@ Astrobee Flight Software catkin - ff_msgs roscpp - ff_msgs roscpp diff --git a/scripts/deploy/env_wrapper.sh b/astrobee/scripts/env_wrapper.sh similarity index 100% rename from scripts/deploy/env_wrapper.sh rename to astrobee/scripts/env_wrapper.sh diff --git a/behaviors/CMakeLists.txt b/behaviors/CMakeLists.txt deleted file mode 100644 index 41b13472bc..0000000000 --- a/behaviors/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(arm) -add_subdirectory(dock) -add_subdirectory(states) -add_subdirectory(light_flow) -add_subdirectory(perch) - - diff --git a/behaviors/arm/CMakeLists.txt b/behaviors/arm/CMakeLists.txt index ea201b11fc..179a5bb305 100644 --- a/behaviors/arm/CMakeLists.txt +++ b/behaviors/arm/CMakeLists.txt @@ -15,8 +15,22 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(arm) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + std_msgs + nodelet + ff_msgs + ff_hw_msgs + ff_util +) + catkin_package( LIBRARIES arm @@ -27,33 +41,59 @@ catkin_package( actionlib sensor_msgs ff_msgs + ff_hw_msgs ff_util ) -create_library( - TARGET - arm - LIBS - ${catkin_LIBRARIES} - ff_nodelet - config_server - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR - tools - LIBS - ${catkin_LIBRARIES} - ff_common - ff_nodelet - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs +# Declare C++ libraries +add_library(arm + src/arm_nodelet.cc ) +add_dependencies(arm ${catkin_EXPORTED_TARGETS}) +target_link_libraries(arm ${catkin_LIBRARIES}) + +## Declare a C++ executable: arm_tool +add_executable(arm_tool tools/arm_tool.cc) +add_dependencies(arm_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(arm_tool + arm gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS arm_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/arm_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/behaviors/arm/package.xml b/behaviors/arm/package.xml index cdb1f13dc2..bbd2b0aade 100644 --- a/behaviors/arm/package.xml +++ b/behaviors/arm/package.xml @@ -20,6 +20,7 @@ pluginlib sensor_msgs ff_msgs + ff_hw_msgs ff_util roscpp nodelet @@ -27,6 +28,7 @@ actionlib sensor_msgs ff_msgs + ff_hw_msgs ff_util diff --git a/behaviors/dock/CMakeLists.txt b/behaviors/dock/CMakeLists.txt index 41afe25811..dbb2aa8c96 100644 --- a/behaviors/dock/CMakeLists.txt +++ b/behaviors/dock/CMakeLists.txt @@ -15,8 +15,24 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(dock) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + geometry_msgs + tf2 + tf2_ros + tf2_geometry_msgs + ff_hw_msgs + ff_msgs + ff_util +) + catkin_package( LIBRARIES dock @@ -31,34 +47,55 @@ catkin_package( ff_util ) -create_library( - TARGET - dock - LIBS - ${catkin_LIBRARIES} - ff_nodelet - config_reader - msg_conversions - config_server - config_client - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs - ff_hw_msgs +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR - tools - LIBS - ${catkin_LIBRARIES} - ff_common - ff_nodelet - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs +# Declare C++ libraries +add_library(dock + src/dock_nodelet.cc ) +add_dependencies(dock ${catkin_EXPORTED_TARGETS}) +target_link_libraries(dock ${catkin_LIBRARIES}) + +## Declare a C++ executable: dock_tool +add_executable(dock_tool tools/dock_tool.cc) +add_dependencies(dock_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(dock_tool + dock gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS dock_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/dock_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/behaviors/light_flow/CMakeLists.txt b/behaviors/light_flow/CMakeLists.txt index 7f4a6b69f5..6e43285710 100644 --- a/behaviors/light_flow/CMakeLists.txt +++ b/behaviors/light_flow/CMakeLists.txt @@ -15,8 +15,21 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(light_flow) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_hw_msgs + ff_msgs + nodelet + ff_util +) + catkin_package( LIBRARIES light_flow @@ -29,54 +42,67 @@ catkin_package( pluginlib ) -create_library( - DIR src/light_flow - TARGET light_flow - DEPS - ff_msgs - ff_hw_msgs - LIBS - ${catkin_LIBRARIES} - ff_nodelet - ${JSONCPP_LIBRARIES} - INC - ${catkin_INCLUDE_DIRS} - ${JSONCPP_INCLUDE_DIRS} +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR - tools - LIBS - ${catkin_LIBRARIES} - ff_nodelet - ${JSONCPP_LIBRARIES} - light_flow - INC - ${catkin_INCLUDE_DIRS} - ${JSONCPP_INCLUDE_DIRS} - DEPS - ff_msgs - ff_hw_msgs - light_flow +# Declare C++ libraries +add_library(light_flow + src/light_flow/light_flow.cc ) +add_dependencies(light_flow ${catkin_EXPORTED_TARGETS}) +target_link_libraries(light_flow ${catkin_LIBRARIES}) -create_library( - DIR src/light_flow_nodelet - TARGET light_flow_nodelet - LIBS - ${catkin_LIBRARIES} - ${JSONCPP_LIBRARIES} - config_reader - ff_nodelet - light_flow - INC - ${catkin_INCLUDE_DIRS} - ${JSONCPP_INCLUDE_DIRS} - DEPS - ff_msgs - ff_hw_msgs - light_flow +# Declare C++ libraries +add_library(light_flow_nodelet + src/light_flow_nodelet/light_flow_nodelet.cc ) +add_dependencies(light_flow_nodelet ${catkin_EXPORTED_TARGETS}) +target_link_libraries(light_flow_nodelet light_flow ${catkin_LIBRARIES}) + +## Declare a C++ executable: inspection_tool +add_executable(light_flow_tool tools/light_flow_tool.cc) +add_dependencies(light_flow_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(light_flow_tool + light_flow gflags jsoncpp ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME}_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS light_flow_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/light_flow_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/behaviors/perch/CMakeLists.txt b/behaviors/perch/CMakeLists.txt index 5361a8810a..cb98d02e9a 100644 --- a/behaviors/perch/CMakeLists.txt +++ b/behaviors/perch/CMakeLists.txt @@ -15,8 +15,25 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(perch) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + geometry_msgs + tf2 + tf2_ros + tf2_geometry_msgs + ff_hw_msgs + ff_msgs + ff_util + localization_manager +) + catkin_package( LIBRARIES perch @@ -32,34 +49,55 @@ catkin_package( localization_manager ) -create_library( - TARGET - perch - LIBS - ${catkin_LIBRARIES} - ff_nodelet - config_reader - msg_conversions - config_server - config_client - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs - ff_hw_msgs +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR - tools - LIBS - ${catkin_LIBRARIES} - ff_common - ff_nodelet - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs +# Declare C++ libraries +add_library(perch + src/perch_nodelet.cc ) +add_dependencies(perch ${catkin_EXPORTED_TARGETS}) +target_link_libraries(perch ${catkin_LIBRARIES}) + +## Declare a C++ executable: inspection_tool +add_executable(perch_tool tools/perch_tool.cc) +add_dependencies(perch_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(perch_tool + perch gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS perch_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/perch_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/behaviors/perch/src/perch_nodelet.cc b/behaviors/perch/src/perch_nodelet.cc index 104d042935..5b895b3113 100644 --- a/behaviors/perch/src/perch_nodelet.cc +++ b/behaviors/perch/src/perch_nodelet.cc @@ -1031,6 +1031,11 @@ class PerchNodelet : public ff_util::FreeFlyerNodelet { int32_t err_; std::string err_msg_; std::string platform_name_; + + public: + // This fixes the Eigen aligment issue + // http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; PLUGINLIB_EXPORT_CLASS(perch::PerchNodelet, nodelet::Nodelet); diff --git a/behaviors/states/CMakeLists.txt b/behaviors/states/CMakeLists.txt index 528bce0e0b..5ae0152483 100644 --- a/behaviors/states/CMakeLists.txt +++ b/behaviors/states/CMakeLists.txt @@ -15,30 +15,66 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(states) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_hw_msgs + ff_msgs + ff_util +) + catkin_package( LIBRARIES states CATKIN_DEPENDS roscpp + nodelet ff_hw_msgs ff_msgs ff_util ) -create_library( - DIR src/states_nodelet - TARGET states_nodelet - LIBS - ${catkin_LIBRARIES} - config_reader - ff_nodelet - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs - ff_hw_msgs +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(states + src/states_nodelet/states_nodelet.cc +) +add_dependencies(states ${catkin_EXPORTED_TARGETS}) +target_link_libraries(states ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() \ No newline at end of file +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/behaviors/states/nodelet_plugins.xml b/behaviors/states/nodelet_plugins.xml index e323994948..b1a0737d23 100644 --- a/behaviors/states/nodelet_plugins.xml +++ b/behaviors/states/nodelet_plugins.xml @@ -1,4 +1,4 @@ - + Nodelet for the automatically switching between Astrobee signal states diff --git a/cmake/CATKIN_LICENSE b/cmake/CATKIN_LICENSE deleted file mode 100644 index 3f4820a5c2..0000000000 --- a/cmake/CATKIN_LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -CATKIN: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/cmake/CreateLibrary.cmake b/cmake/CreateLibrary.cmake deleted file mode 100644 index a7cf5983dd..0000000000 --- a/cmake/CreateLibrary.cmake +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -function(create_library) - cmake_parse_arguments( - library # Prefix of output variables - "" # List of Boolean Variables - "TARGET;DIR" # List of mono valued arguments - "LIBS;INC;DEPS;ADD_SRCS;EXCLUDE;DEFINES;OPTIONS" # List of Multi Value Arguments - ${ARGN} - ) - - # If no directory was given, assume all files in the src dir go in our library - if(NOT library_DIR) - SET(library_DIR src) - endif(NOT library_DIR) - - # Search for all the executables in tool dir - file(GLOB SRC_FILES_C "${library_DIR}/*.c") - file(GLOB SRC_FILES_CC "${library_DIR}/*.cc") - set(SRC_FILES ${SRC_FILES_C} ${SRC_FILES_CC}) - - # Sift through SRC_FILES and remove EXCLUDE - foreach(SRC ${SRC_FILES}) - foreach (TEST_SRC ${library_EXCLUDE}) - string(FIND ${SRC} ${TEST_SRC} POSITION) - if (${POSITION} GREATER -1) - list(REMOVE_ITEM SRC_FILES ${SRC}) - endif() - endforeach() - endforeach() - - # Some of our dependencies might be header only, their headers paths are not - # being added automatically like the targets listed in LIB. Here we'll do it - # manually. - if (library_DEPS) - foreach(DEP ${library_DEPS}) - get_target_property(INC ${DEP} INCLUDE_DIRECTORIES) - if (INC) - list(APPEND library_INC ${INC}) - endif (INC) - endforeach() - list(REMOVE_DUPLICATES library_INC) - endif (library_DEPS) - - add_library(${library_TARGET} - ${SRC_FILES} ${library_ADD_SRCS}) - target_include_directories(${library_TARGET} - PUBLIC ${library_INC} ${CMAKE_CURRENT_SOURCE_DIR}/include) - target_link_libraries(${library_TARGET} - ${library_LIBS} ${CMAKE_LIBS_COVERAGE}) - if (library_DEFINES) - target_compile_definitions(${library_TARGET} - PUBLIC ${library_DEFINES}) - endif (library_DEFINES) - if (library_OPTIONS) - target_compile_options(${library_TARGET} - PUBLIC ${library_OPTIONS}) - endif (library_OPTIONS) - if (NOT "${library_DEPS}" STREQUAL "") - add_dependencies(${library_TARGET} - ${library_DEPS}) - endif() - - install(TARGETS ${library_TARGET} DESTINATION lib) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ - DESTINATION include - FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") -endfunction() diff --git a/cmake/CreateMsgTargets.cmake b/cmake/CreateMsgTargets.cmake deleted file mode 100644 index 4f910d88dc..0000000000 --- a/cmake/CreateMsgTargets.cmake +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -function(create_msg_targets) - cmake_parse_arguments( - msg # Prefix of output variables - "" # List of boolean variables - "DIR;SDIR;ADIR" # List of mono valued arguments - "DEPS" # List of multi value arguments - ${ARGN}) - - if((NOT msg_DIR) AND (NOT msg_SDIR)) - message(WARNING "no msgs or srvs given to create_msg_targets") - return() - endif((NOT msg_DIR) AND (NOT msg_SDIR)) - - # Determine our module name - get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) - - # Search for all the messages to install - if(msg_DIR) - file(GLOB MSG_FILES ${msg_DIR}/*.msg) - - # The msgs to just be their name - foreach(SRC ${MSG_FILES}) - get_filename_component(NAME ${SRC} NAME) - list(APPEND MSG_FILE_NAMES ${NAME}) - endforeach() - - add_message_files(FILES ${MSG_FILE_NAMES}) - endif(msg_DIR) - - # Search for all the services to install - if(msg_SDIR) - file(GLOB SRV_FILES ${msg_SDIR}/*.srv) - - foreach(SRC ${SRV_FILES}) - get_filename_component(NAME ${SRC} NAME) - list(APPEND SRV_FILE_NAMES ${NAME}) - endforeach() - - add_service_files(FILES ${SRV_FILE_NAMES}) - endif(msg_SDIR) - - # Search for all the actions to install - if(msg_ADIR) - file(GLOB ACTION_FILES ${msg_ADIR}/*.action) - - foreach(SRC ${ACTION_FILES}) - get_filename_component(NAME ${SRC} NAME) - list(APPEND ACTION_FILE_NAMES ${NAME}) - endforeach() - - add_action_files(FILES ${ACTION_FILE_NAMES}) - endif(msg_ADIR) - - # Generate them - generate_messages(DEPENDENCIES ${msg_DEPS}) - - # Create a target that people can DEP to and find the headers - add_custom_target(${MODULE_NAME} - DEPENDS ${MODULE_NAME}_gencpp) - get_target_property(MSG_INC ${MODULE_NAME}_gencpp INCLUDE_DIRECTORIES) - set_target_properties(${MODULE_NAME} - PROPERTIES INCLUDE_DIRECTORIES ${MSG_INC}) - - # Make sure we install the package.xml so that it can be found later in the install directory - install(FILES package.xml DESTINATION share/${MODULE_NAME}) -endfunction(create_msg_targets) diff --git a/cmake/CreateToolTargets.cmake b/cmake/CreateToolTargets.cmake deleted file mode 100644 index 6f0eb3b8b7..0000000000 --- a/cmake/CreateToolTargets.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -function(create_tool_targets) - cmake_parse_arguments( - tool # Prefix of output variables - "" # List of boolean variables - "DIR" # List of mono valued arguments - "LIBS;INC;DEPS;EXCLUDE" # List of multi-value arguments - ${ARGN} - ) - - # Search for all the executables in tool dir - file(GLOB TOOL_SRC_FILES_C "${tool_DIR}/*.c") - file(GLOB TOOL_SRC_FILES_CC "${tool_DIR}/*.cc") - set(TOOL_SRC_FILES ${TOOL_SRC_FILES_C} ${TOOL_SRC_FILES_CC}) - - # Sift through SRC_FILES and remove EXCLUDE - foreach(SRC ${TOOL_SRC_FILES}) - foreach(TEST_SRC ${tool_EXCLUDE}) - string(FIND ${SRC} ${TEST_SRC} POSITION) - if (${POSITION} GREATER -1) - list(REMOVE_ITEM TOOL_SRC_FILES ${SRC}) - endif() - endforeach() - endforeach() - - # Determine our module name - get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) - - # Some of our dependencies might be header only, their headers paths are not - # being added automatically like the targets listed in LIB. Here we'll do it - # manually. - if (tool_DEPS) - foreach(DEP ${tool_DEPS}) - get_target_property(INC ${DEP} INCLUDE_DIRECTORIES) - if (INC) - list(APPEND tool_INC ${INC}) - endif (INC) - endforeach() - list(REMOVE_DUPLICATES tool_INC) - endif (tool_DEPS) - - # Link the executables! - foreach(filename ${TOOL_SRC_FILES}) - string(REGEX REPLACE ".(cc|c)$" "" execname ${filename}) - string(REGEX REPLACE "^[^ ]*/" "" execname ${execname}) - add_executable(${execname} ${filename}) - target_link_libraries(${execname} - LINK_PUBLIC ${tool_LIBS}) - target_include_directories(${execname} PUBLIC ${tool_INC}) - if (tool_DEPS) - add_dependencies(${execname} ${tool_DEPS}) - endif (tool_DEPS) - install(TARGETS ${execname} DESTINATION share/${PROJECT_NAME}) - install(TARGETS ${execname} DESTINATION bin) - endforeach() -endfunction() diff --git a/cmake/soracore/FindMiro.cmake b/cmake/FindMiro.cmake similarity index 100% rename from cmake/soracore/FindMiro.cmake rename to cmake/FindMiro.cmake diff --git a/cmake/FindOpenCV331.cmake b/cmake/FindOpenCV331.cmake new file mode 100644 index 0000000000..143cd9a47d --- /dev/null +++ b/cmake/FindOpenCV331.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2017, United States Government, as represented by the +# Administrator of the National Aeronautics and Space Administration. +# +# All rights reserved. +# +# The Astrobee platform is licensed under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# Find OpenCV and fix a 3.3.1 bug +find_package(OpenCV 3 REQUIRED) +if (USE_CTC) + if (${OpenCV_VERSION} MATCHES "3.3.1") + foreach(__cvcomponent ${OpenCV_LIB_COMPONENTS}) + set (__original_cvcomponent ${__cvcomponent}) + if(NOT __cvcomponent MATCHES "^opencv_") + set(__cvcomponent opencv_${__cvcomponent}) + endif() + if (TARGET ${__cvcomponent}) + set_target_properties(${__cvcomponent} PROPERTIES + MAP_IMPORTED_CONFIG_DEBUG "" + MAP_IMPORTED_CONFIG_RELEASE "" + MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" + MAP_IMPORTED_CONFIG_MINSIZEREL "" + ) + endif() + endforeach(__cvcomponent) + endif() + foreach(__cvcomponent ${OpenCV_LIB_COMPONENTS}) + set(OpenCV_LIBS ${OpenCV_LIBS} "${OpenCV_INSTALL_PATH}/lib/arm-linux-gnueabihf/lib${__cvcomponent}3.so") + endforeach(__cvcomponent) +endif (USE_CTC) +set(OpenCV_LIBRARIES ${OpenCV_LIBS}) \ No newline at end of file diff --git a/cmake/soracore/FindRtiDds.cmake b/cmake/FindRtiDds.cmake similarity index 100% rename from cmake/soracore/FindRtiDds.cmake rename to cmake/FindRtiDds.cmake diff --git a/cmake/soracore/FindSoracore.cmake b/cmake/FindSoracore.cmake similarity index 100% rename from cmake/soracore/FindSoracore.cmake rename to cmake/FindSoracore.cmake diff --git a/cmake/soracore/GenerateMiroMakeParams.cmake b/cmake/GenerateMiroMakeParams.cmake similarity index 100% rename from cmake/soracore/GenerateMiroMakeParams.cmake rename to cmake/GenerateMiroMakeParams.cmake diff --git a/cmake/soracore/GenerateRtiDdsIdl.cmake b/cmake/GenerateRtiDdsIdl.cmake similarity index 100% rename from cmake/soracore/GenerateRtiDdsIdl.cmake rename to cmake/GenerateRtiDdsIdl.cmake diff --git a/cmake/soracore/GetLibraryList.cmake b/cmake/GetLibraryList.cmake similarity index 100% rename from cmake/soracore/GetLibraryList.cmake rename to cmake/GetLibraryList.cmake diff --git a/cmake/soracore/GetPackageLibSearchPath.cmake b/cmake/GetPackageLibSearchPath.cmake similarity index 100% rename from cmake/soracore/GetPackageLibSearchPath.cmake rename to cmake/GetPackageLibSearchPath.cmake diff --git a/cmake/InstallLaunchFiles.cmake b/cmake/InstallLaunchFiles.cmake deleted file mode 100644 index a01b35ed95..0000000000 --- a/cmake/InstallLaunchFiles.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -function(install_launch_files) - file (GLOB LAUNCH_FILES launch/*.launch launch/*.yaml launch/*.xml) - get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) - install(DIRECTORY launch/ DESTINATION share/${PROJECT_NAME}/launch) -endfunction() diff --git a/cmake/catkin/all.cmake b/cmake/catkin/all.cmake deleted file mode 100644 index ac31ea1d2e..0000000000 --- a/cmake/catkin/all.cmake +++ /dev/null @@ -1,206 +0,0 @@ -# prevent multiple inclusion -if(DEFINED _CATKIN_ALL_INCLUDED_) - message(FATAL_ERROR "catkin/cmake/all.cmake included multiple times") -endif() -set(_CATKIN_ALL_INCLUDED_ TRUE) - -if(NOT DEFINED catkin_EXTRAS_DIR) - message(FATAL_ERROR "catkin_EXTRAS_DIR is not set") -endif() - -# define devel space -if(CATKIN_DEVEL_PREFIX) - set(CATKIN_DEVEL_PREFIX ${CATKIN_DEVEL_PREFIX} CACHE PATH "catkin devel space") -else() - set(CATKIN_DEVEL_PREFIX "${CMAKE_BINARY_DIR}/devel") -endif() -#message(STATUS "Using CATKIN_DEVEL_PREFIX: ${CATKIN_DEVEL_PREFIX}") - -# update develspace marker file with a reference to this sourcespace -set(_catkin_marker_file "${CATKIN_DEVEL_PREFIX}/.catkin") - -# check if the develspace marker file exists yet -if(EXISTS ${_catkin_marker_file}) - file(READ ${_catkin_marker_file} _existing_sourcespaces) - if(_existing_sourcespaces STREQUAL "") - # write this sourcespace to the marker file - file(WRITE ${_catkin_marker_file} "${CMAKE_SOURCE_DIR}") - else() - # append to existing list of sourcespaces if it's not in the list - list(FIND _existing_sourcespaces "${CMAKE_SOURCE_DIR}" _existing_sourcespace_index) - if(_existing_sourcespace_index EQUAL -1) - file(APPEND ${_catkin_marker_file} ";${CMAKE_SOURCE_DIR}") - endif() - endif() -else() - # create a new develspace marker file - # NOTE: extra care must be taken when running multiple catkin jobs in parallel - # so that this does not overwrite the result of a similar call in another package - file(WRITE ${_catkin_marker_file} "${CMAKE_SOURCE_DIR}") -endif() - -# use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument -# or CMAKE_PREFIX_PATH from the environment -if(NOT DEFINED CMAKE_PREFIX_PATH) - if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "") - string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) - endif() -endif() -#message(STATUS "Using CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}") -# store original CMAKE_PREFIX_PATH -set(CMAKE_PREFIX_PATH_AS_IS ${CMAKE_PREFIX_PATH}) - -# list of unique catkin workspaces based on CMAKE_PREFIX_PATH -set(CATKIN_WORKSPACES "") -foreach(path ${CMAKE_PREFIX_PATH}) - if(EXISTS "${path}/.catkin") - list(FIND CATKIN_WORKSPACES ${path} _index) - if(_index EQUAL -1) - list(APPEND CATKIN_WORKSPACES ${path}) - endif() - endif() -endforeach() -if(CATKIN_WORKSPACES) - #message(STATUS "This workspace overlays: ${CATKIN_WORKSPACES}") -endif() - -# prepend devel space to CMAKE_PREFIX_PATH -list(FIND CMAKE_PREFIX_PATH ${CATKIN_DEVEL_PREFIX} _index) -if(_index EQUAL -1) - list(INSERT CMAKE_PREFIX_PATH 0 ${CATKIN_DEVEL_PREFIX}) -endif() - - -# enable all new policies (if available) -macro(_set_cmake_policy_to_new_if_available policy) - if(POLICY ${policy}) - cmake_policy(SET ${policy} NEW) - endif() -endmacro() -_set_cmake_policy_to_new_if_available(CMP0000) -_set_cmake_policy_to_new_if_available(CMP0001) -_set_cmake_policy_to_new_if_available(CMP0002) -_set_cmake_policy_to_new_if_available(CMP0003) -_set_cmake_policy_to_new_if_available(CMP0004) -_set_cmake_policy_to_new_if_available(CMP0005) -_set_cmake_policy_to_new_if_available(CMP0006) -_set_cmake_policy_to_new_if_available(CMP0007) -_set_cmake_policy_to_new_if_available(CMP0008) -_set_cmake_policy_to_new_if_available(CMP0009) -_set_cmake_policy_to_new_if_available(CMP0010) -_set_cmake_policy_to_new_if_available(CMP0011) -_set_cmake_policy_to_new_if_available(CMP0012) -_set_cmake_policy_to_new_if_available(CMP0013) -_set_cmake_policy_to_new_if_available(CMP0014) -_set_cmake_policy_to_new_if_available(CMP0015) -_set_cmake_policy_to_new_if_available(CMP0016) -_set_cmake_policy_to_new_if_available(CMP0017) - -# the following operations must be performed inside a project context -if(NOT PROJECT_NAME) - project(catkin_internal) -endif() - -# include CMake functions -include(CMakeParseArguments) - -# functions/macros: list_append_unique, safe_execute_process -# python-integration: catkin_python_setup.cmake, interrogate_setup_dot_py.py, templates/__init__.py.in, templates/script.py.in, templates/python_distutils_install.bat.in, templates/python_distutils_install.sh.in, templates/safe_execute_install.cmake.in -foreach(filename - assert - atomic_configure_file - catkin_add_env_hooks - catkin_destinations - catkin_generate_environment - catkin_install_python - catkin_libraries - catkin_metapackage - catkin_package - catkin_package_xml - catkin_workspace - debug_message - em_expand - python # defines PYTHON_EXECUTABLE, required by empy - empy - find_program_required - legacy - list_append_deduplicate - list_append_unique - list_insert_in_workspace_order - safe_execute_process - stamp - string_starts_with - platform/lsb - platform/ubuntu - platform/windows - test/tests # defines CATKIN_ENABLE_TESTING, required by other test functions - test/catkin_download_test_data - test/gtest - test/nosetests - tools/doxygen - tools/libraries - tools/rt - -# tools/threads - ) - include(${catkin_EXTRAS_DIR}/${filename}.cmake) -endforeach() - -# output catkin version for debugging -_catkin_package_xml(${CMAKE_BINARY_DIR}/catkin/catkin_generated/version DIRECTORY ${catkin_EXTRAS_DIR}/..) -#message(STATUS "catkin ${catkin_VERSION}") -# ensure that no current package name is set -unset(_CATKIN_CURRENT_PACKAGE) - -# set global install destinations -set(CATKIN_GLOBAL_BIN_DESTINATION bin) -set(CATKIN_GLOBAL_ETC_DESTINATION etc) -set(CATKIN_GLOBAL_INCLUDE_DESTINATION include) -set(CATKIN_GLOBAL_LIB_DESTINATION lib) -set(CATKIN_GLOBAL_LIBEXEC_DESTINATION lib) -set(CATKIN_GLOBAL_PYTHON_DESTINATION ${PYTHON_INSTALL_DIR}) -set(CATKIN_GLOBAL_SHARE_DESTINATION share) - -# undefine CATKIN_ENV since it might be set in the cache from a previous build -set(CATKIN_ENV "" CACHE INTERNAL "catkin environment" FORCE) - -# generate environment files like env.* and setup.* -# uses em_expand without CATKIN_ENV being set yet -catkin_generate_environment() - -# file extension of env script -if(CMAKE_HOST_UNIX) # true for linux, apple, mingw-cross and cygwin - set(script_ext sh) -else() - set(script_ext bat) -endif() -# take snapshot of the modifications the setup script causes -# to reproduce the same changes with a static script in a fraction of the time -set(SETUP_DIR ${CMAKE_BINARY_DIR}/catkin_generated) -set(SETUP_FILENAME "setup_cached") -configure_file(${catkin_EXTRAS_DIR}/templates/generate_cached_setup.py.in - ${CMAKE_BINARY_DIR}/catkin_generated/generate_cached_setup.py) -set(GENERATE_ENVIRONMENT_CACHE_COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/catkin_generated/generate_cached_setup.py) -# the script is generated once here and refreshed by every call to catkin_add_env_hooks() -safe_execute_process(COMMAND ${GENERATE_ENVIRONMENT_CACHE_COMMAND}) -# generate env_cached which just relays to the setup_cached -configure_file(${catkin_EXTRAS_DIR}/templates/env.${script_ext}.in - ${SETUP_DIR}/env_cached.${script_ext} - @ONLY) -# environment to call external processes -set(CATKIN_ENV ${SETUP_DIR}/env_cached.${script_ext} CACHE INTERNAL "catkin environment") - -# add additional environment hooks -if(CATKIN_BUILD_BINARY_PACKAGE) - set(catkin_skip_install_env_hooks "SKIP_INSTALL") -endif() -if(CMAKE_HOST_UNIX) - catkin_add_env_hooks(05.catkin_make SHELLS bash DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks}) - catkin_add_env_hooks(05.catkin_make_isolated SHELLS bash DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks}) - catkin_add_env_hooks(05.catkin-test-results SHELLS sh DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks}) -else() - catkin_add_env_hooks(05.catkin-test-results SHELLS bat DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks}) -endif() - -# requires stamp and environment files -include(${catkin_EXTRAS_DIR}/catkin_python_setup.cmake) diff --git a/cmake/catkin/assert.cmake b/cmake/catkin/assert.cmake deleted file mode 100644 index 1a3f2c194b..0000000000 --- a/cmake/catkin/assert.cmake +++ /dev/null @@ -1,22 +0,0 @@ -function(assert VAR) - if(NOT ${VAR}) - message(FATAL_ERROR "\nAssertion failed: ${VAR} (value is '${${VAR}}')\n") - endif() - debug_message(3 "assert(${VAR}) passed (${VAR} = ${${VAR}})") -endfunction() - -function(assert_unset VAR) - if(${VAR}) - message(FATAL_ERROR "\nAssertion failed: '${VAR}' is set but should not be (value is '${${VAR}}')\n") - endif() - debug_message(3 "assert_unset(${VAR}) passed") -endfunction() - -function(assert_file_exists FILENAME MESSAGE) - if(NOT FILENAME) - message(FATAL_ERROR "\nAssertion failed: check for file existence, but filename (${FILENAME}) unset. Message: ${MESSAGE}\n") - endif() - if(NOT EXISTS ${FILENAME}) - message(FATAL_ERROR "\nAssertion failed: file '${FILENAME}' does not exist. Message: ${MESSAGE}\n") - endif() -endfunction() diff --git a/cmake/catkin/atomic_configure_file.cmake b/cmake/catkin/atomic_configure_file.cmake deleted file mode 100644 index b5a20a37bb..0000000000 --- a/cmake/catkin/atomic_configure_file.cmake +++ /dev/null @@ -1,9 +0,0 @@ -function(atomic_configure_file input output) - set(atomic_file "${CMAKE_BINARY_DIR}/atomic_configure_file") - configure_file("${input}" "${atomic_file}" ${ARGN}) - get_filename_component(output_path ${output} PATH) - if(NOT EXISTS ${output_path}) - file(MAKE_DIRECTORY ${output_path}) - endif() - file(RENAME "${atomic_file}" "${output}") -endfunction() diff --git a/cmake/catkin/catkinConfig.cmake.in b/cmake/catkin/catkinConfig.cmake.in deleted file mode 100644 index 2183ce8c6a..0000000000 --- a/cmake/catkin/catkinConfig.cmake.in +++ /dev/null @@ -1,117 +0,0 @@ -# generated from catkin/cmake/catkinConfig.cmake.in -# which overlays the default template catkin/cmake/template/pkgConfig.cmake.in -# -# :outvar catkin_INCLUDE_DIRS: contains the include dirs of all searched components. -# For use with CMake ``include_directories(${catkin_INCLUDE_DIRS})``. -# :outvar catkin_LIBRARY_DIRS: contains the library dirs of all searched components. -# For use with CMake ``link_directories(${catkin_INCLUDE_DIRS})``. -# :outvar catkin_LIBRARIES: contains the include dirs of all searched components. -# For use with CMake ``include_directories(${catkin_INCLUDE_DIRS})``. -# :outvar _INCLUDE_DIRS/_LIBRARY_DIRS/_LIBRARY: -# contains the include dirs / library dirs / libraries of the searched component . - -if(CATKIN_TOPLEVEL_FIND_PACKAGE OR NOT CATKIN_TOPLEVEL) - set(catkin_EXTRAS_DIR "@PKG_CMAKE_DIR@") - - # prevent multiple inclusion from repeated find_package() calls in non-workspace context - # as long as this variable is in the scope the variables from all.cmake are also, so no need to be evaluated again - if(NOT DEFINED _CATKIN_CONFIG_ALL_INCLUDED_) - set(_CATKIN_CONFIG_ALL_INCLUDED_ TRUE) - include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE) - endif() -endif() - -# skip setting find_package() variables when discovered from toplevel.cmake -if(CATKIN_TOPLEVEL_FIND_PACKAGE) - return() -endif() - - -# prevent usage with wrong case -if(CATKIN_FIND_COMPONENTS OR CATKIN_FIND_REQUIRED OR CATKIN_FIND_QUIETLY) - message(FATAL_ERROR "find_package() only supports lower-case package name 'catkin'") -endif() - -# mark as found -if(NOT catkin_FOUND) - set(catkin_FOUND) - set(CATKIN_PACKAGE_PREFIX "" CACHE STRING "Prefix to apply to package generated via gendebian") -endif() - -# flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project -set(catkin_FOUND_CATKIN_PROJECT TRUE) - -# XXXX don't overwrite catkin_* variables when being called recursively -if(NOT _CATKIN_FIND_ OR _CATKIN_FIND_ EQUAL 0) - set(_CATKIN_FIND_ 0) - if(catkin_FIND_COMPONENTS) - set(catkin_INCLUDE_DIRS "") - set(catkin_LIBRARIES "") - set(catkin_LIBRARY_DIRS "") - set(catkin_EXPORTED_TARGETS "") - endif() -endif() - -# increment recursion counter -math(EXPR _CATKIN_FIND_ "${_CATKIN_FIND_} + 1") - -# find all components -if(catkin_FIND_COMPONENTS) - foreach(component ${catkin_FIND_COMPONENTS}) - string(TOLOWER "${component}" component_lower) - # skip catkin since it does not make sense as a component - if(NOT ${component_lower} STREQUAL "catkin") - - # get search paths from CMAKE_PREFIX_PATH (which includes devel space) - set(paths "") - foreach(path ${CMAKE_PREFIX_PATH}) - if(IS_DIRECTORY ${path}/share/${component}/cmake) - list(APPEND paths ${path}/share/${component}/cmake) - endif() - endforeach() - - # find package component - if(catkin_FIND_REQUIRED) - find_package(${component} REQUIRED NO_MODULE PATHS ${paths} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - elseif(catkin_FIND_QUIETLY) - find_package(${component} QUIET NO_MODULE PATHS ${paths} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - else() - find_package(${component} NO_MODULE PATHS ${paths} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - endif() - - # append component-specific variables to catkin_* variables - list_append_unique(catkin_INCLUDE_DIRS ${${component}_INCLUDE_DIRS}) - - # merge build configuration keywords with library names to correctly deduplicate - catkin_pack_libraries_with_build_configuration(catkin_LIBRARIES ${catkin_LIBRARIES}) - catkin_pack_libraries_with_build_configuration(_libraries ${${component}_LIBRARIES}) - list_append_deduplicate(catkin_LIBRARIES ${_libraries}) - # undo build configuration keyword merging after deduplication - catkin_unpack_libraries_with_build_configuration(catkin_LIBRARIES ${catkin_LIBRARIES}) - - list_append_unique(catkin_LIBRARY_DIRS ${${component}_LIBRARY_DIRS}) - list(APPEND catkin_EXPORTED_TARGETS ${${component}_EXPORTED_TARGETS}) - endif() - endforeach() - list_insert_in_workspace_order(catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS}) - list_insert_in_workspace_order(catkin_LIBRARY_DIRS ${catkin_LIBRARY_DIRS}) -endif() - -# add dummy target to catkin_EXPORTED_TARGETS if empty -if(NOT catkin_EXPORTED_TARGETS) - if(NOT TARGET _catkin_empty_exported_target) - add_custom_target(_catkin_empty_exported_target) - endif() - list(APPEND catkin_EXPORTED_TARGETS _catkin_empty_exported_target) -endif() - -# decrement recursion counter -math(EXPR _CATKIN_FIND_ "${_CATKIN_FIND_} - 1") - -if(_CATKIN_FIND_ EQUAL 0) - # store found components (from the fist level only) for validation in catkin_package() that they are build dependencies - list(APPEND catkin_ALL_FOUND_COMPONENTS ${catkin_FIND_COMPONENTS}) -endif() diff --git a/cmake/catkin/catkin_add_env_hooks.cmake b/cmake/catkin/catkin_add_env_hooks.cmake deleted file mode 100644 index dc063bd803..0000000000 --- a/cmake/catkin/catkin_add_env_hooks.cmake +++ /dev/null @@ -1,139 +0,0 @@ -# -# Register environment hooks which are executed by the setup script. -# -# For each shell in ``SHELLS``, the macro searches for one of the -# following files in the directory ``DIRECTORY``: -# ``.``, -# ``...em``, -# ``..em``, -# ``...in`` or -# ``..in``. -# -# Plain shells, will be copied to, templates are expanded to -# ``etc/catkin/profile.d/``, where it will be read by global generated -# ``setup.``. -# -# The templates can also distinguish between devel- and installspace -# using the boolean variables ``DEVELSPACE`` and ``INSTALLSPACE`` -# which are either ``true`` or ``false``. -# E.g. @[if DEVELSPACE]@ ... @[end if]@ for .em -# -# .. note:: Note that the extra extensions must appear in the filename -# but must not appear in the argument. -# -# .. note:: These files will share a single directory with other -# packages that choose to install env hooks. Be careful to give -# the file a unique name. Typically ``NN.name.`` is used, -# where NN can define when something should be run (the files are -# read in alphanumeric order) and the name serves to disambiguate -# in the event of collisions. -# -# Example:: -# -# catkin_add_env_hooks(my_prefix SHELLS bash tcsh zsh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks) -# -# looks for files env-hooks/my_prefix.[bash|tcsh|zsh]((.(devel|install)space)?.[em|in])? -# -# :param file_prefix: the filename prefix -# :type file_prefix: string -# :param SHELLS: the shell extensions (e.g.: sh bat bash zsh tcsh) -# :type SHELLS: list of strings -# :param DIRECTORY: the directory (default: ${CMAKE_CURRENT_SOURCE_DIR}) -# :type DIRECTORY: string -# :param SKIP_INSTALL: if specified the env hooks are only generated -# in the devel space but not installed -# :type SKIP_INSTALL: option -# -# @public -# -function(catkin_add_env_hooks file_prefix) - cmake_parse_arguments(ARG "SKIP_INSTALL" "DIRECTORY" "SHELLS" ${ARGN}) - - # create directory if necessary - if(NOT IS_DIRECTORY ${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d) - file(MAKE_DIRECTORY ${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d) - endif() - - if(NOT ARG_DIRECTORY) - set(ARG_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() - - foreach(shell ${ARG_SHELLS}) - set(ENV_HOOK ${file_prefix}.${shell}) - set(base ${ARG_DIRECTORY}/${ENV_HOOK}) - - # generate environment hook for devel space - set(DEVELSPACE True) - set(INSTALLSPACE False) - if(EXISTS ${base}.em OR EXISTS ${base}.develspace.em) - # evaluate em template - if(EXISTS ${base}.develspace.em) - set(em_template ${base}.develspace.em) - else() - set(em_template ${base}.em) - endif() - em_expand(${catkin_EXTRAS_DIR}/templates/env-hook.context.py.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/${ENV_HOOK}.develspace.context.py - ${em_template} - ${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d/${ENV_HOOK}) - elseif(EXISTS ${base}.in OR EXISTS ${base}.develspace.in) - # evaluate in template - if(EXISTS ${base}.develspace.in) - set(in_template ${base}.develspace.in) - else() - set(in_template ${base}.in) - endif() - atomic_configure_file(${in_template} - ${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d/${ENV_HOOK} - @ONLY) - elseif (EXISTS ${base}) - # copy plain file - file(COPY ${base} DESTINATION ${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d) - else() - message(FATAL_ERROR "catkin_add_env_hooks() could not find environment hook. Either '${base}', '${base}.em', '${base}.develspace.em' or '${base}.in' must exist.") - endif() - - # generate and install environment hook for installspace - set(DEVELSPACE False) - set(INSTALLSPACE True) - if(EXISTS ${base}.em OR EXISTS ${base}.installspace.em) - # evaluate em template and install - if(EXISTS ${base}.installspace.em) - set(em_template ${base}.installspace.em) - else() - set(em_template ${base}.em) - endif() - em_expand(${catkin_EXTRAS_DIR}/templates/env-hook.context.py.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/${ENV_HOOK}.installspace.context.py - ${em_template} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK}) - if(NOT ${ARG_SKIP_INSTALL}) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} - DESTINATION etc/catkin/profile.d) - endif() - elseif(EXISTS ${base}.in OR EXISTS ${base}.installspace.in) - # evaluate in template and install - if(EXISTS ${base}.installspace.in) - set(in_template ${base}.installspace.in) - else() - set(in_template ${base}.in) - endif() - configure_file(${in_template} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} - @ONLY) - if(NOT ${ARG_SKIP_INSTALL}) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK} - DESTINATION etc/catkin/profile.d) - endif() - elseif (EXISTS ${base}) - # install plain file - if(NOT ${ARG_SKIP_INSTALL}) - install(FILES ${base} - DESTINATION etc/catkin/profile.d) - endif() - endif() - endforeach() - - # refresh environment cache - safe_execute_process(COMMAND ${GENERATE_ENVIRONMENT_CACHE_COMMAND}) -endfunction() diff --git a/cmake/catkin/catkin_destinations.cmake b/cmake/catkin/catkin_destinations.cmake deleted file mode 100644 index c4327e1223..0000000000 --- a/cmake/catkin/catkin_destinations.cmake +++ /dev/null @@ -1,59 +0,0 @@ -# -# Set several path suffixes for install destinations. -# -# :outvar CATKIN_PACKAGE_BIN_DESTINATION: -# See :cmake:data:`CATKIN_PACKAGE_BIN_DESTINATION`. -# :outvar CATKIN_PACKAGE_ETC_DESTINATION: -# See :cmake:data:`CATKIN_PACKAGE_ETC_DESTINATION`. -# :outvar CATKIN_PACKAGE_INCLUDE_DESTINATION: -# See :cmake:data:`CATKIN_PACKAGE_INCLUDE_DESTINATION`. -# :outvar CATKIN_PACKAGE_LIB_DESTINATION: -# See :cmake:data:`CATKIN_PACKAGE_LIB_DESTINATION`. -# :outvar CATKIN_PACKAGE_PYTHON_DESTINATION: -# See :cmake:data:`CATKIN_PACKAGE_PYTHON_DESTINATION`. -# :outvar CATKIN_PACKAGE_SHARE_DESTINATION: -# See :cmake:data:`CATKIN_PACKAGE_SHARE_DESTINATION`. -# -# :outvar CATKIN_GLOBAL_BIN_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_BIN_DESTINATION`. -# :outvar CATKIN_GLOBAL_ETC_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_ETC_DESTINATION`. -# :outvar CATKIN_GLOBAL_INCLUDE_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_INCLUDE_DESTINATION`. -# :outvar CATKIN_GLOBAL_LIB_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_LIB_DESTINATION`. -# :outvar CATKIN_GLOBAL_LIBEXEC_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_LIBEXEC_DESTINATION`. -# :outvar CATKIN_GLOBAL_PYTHON_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_PYTHON_DESTINATION`. -# :outvar CATKIN_GLOBAL_SHARE_DESTINATION: -# See :cmake:data:`CATKIN_GLOBAL_SHARE_DESTINATION`. -# -macro(catkin_destinations) - # verify that project() has been called before - if(NOT PROJECT_NAME) - message(FATAL_ERROR "catkin_destinations() PROJECT_NAME is not set. You must call project() before you can call catkin_destinations().") - endif() - - # execute catkin_destinations() only once, skip repeated invocations - if(NOT DEFINED _${PROJECT_NAME}_CATKIN_DESTINATIONS) - debug_message(10 "catkin_destinations()") - - # mark that catkin_destinations() was called - set(_${PROJECT_NAME}_CATKIN_DESTINATIONS TRUE) - - # set project specific install destinations - set(CATKIN_PACKAGE_BIN_DESTINATION ${CATKIN_GLOBAL_LIBEXEC_DESTINATION}/${PROJECT_NAME}) - set(CATKIN_PACKAGE_ETC_DESTINATION ${CATKIN_GLOBAL_ETC_DESTINATION}/${PROJECT_NAME}) - set(CATKIN_PACKAGE_INCLUDE_DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/${PROJECT_NAME}) - set(CATKIN_PACKAGE_LIB_DESTINATION ${CATKIN_GLOBAL_LIB_DESTINATION}) - set(CATKIN_PACKAGE_PYTHON_DESTINATION ${CATKIN_GLOBAL_PYTHON_DESTINATION}/${PROJECT_NAME}) - set(CATKIN_PACKAGE_SHARE_DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}) - - # set project specific output directory for libraries - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}) - # set project specific output directory for binaries - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}) - endif() -endmacro() diff --git a/cmake/catkin/catkin_generate_environment.cmake b/cmake/catkin/catkin_generate_environment.cmake deleted file mode 100644 index 912078b6e6..0000000000 --- a/cmake/catkin/catkin_generate_environment.cmake +++ /dev/null @@ -1,146 +0,0 @@ -function(catkin_generate_environment) - set(SETUP_FILENAME "setup") - - # devel space - set(SETUP_DIR ${CATKIN_DEVEL_PREFIX}) - - # generate empty file to prevent searching for packages in binary dir - # except if source space and build space are identical (which is the case for dry eclipse projects) - if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - file(WRITE "${CMAKE_BINARY_DIR}/CATKIN_IGNORE" "") - endif() - - # get multiarch name - set(CATKIN_LIB_ENVIRONMENT_PATHS "'${CATKIN_GLOBAL_LIB_DESTINATION}'") - set(CATKIN_PKGCONFIG_ENVIRONMENT_PATHS "os.path.join('${CATKIN_GLOBAL_LIB_DESTINATION}', 'pkgconfig')") - if (UNIX AND NOT APPLE) - # Two step looking for multiarch support: check for gcc -print-multiarch - # and, if failed, try to run dpkg-architecture - execute_process(COMMAND gcc -print-multiarch - OUTPUT_VARIABLE CATKIN_MULTIARCH - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - if ("${CATKIN_MULTIARCH}" STREQUAL "") - execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH - OUTPUT_VARIABLE CATKIN_MULTIARCH - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - endif() - if (NOT "${CATKIN_MULTIARCH}" STREQUAL "") - set(CATKIN_LIB_ENVIRONMENT_PATHS - "[${CATKIN_LIB_ENVIRONMENT_PATHS}, os.path.join('${CATKIN_GLOBAL_LIB_DESTINATION}', '${CATKIN_MULTIARCH}')]") - set(CATKIN_PKGCONFIG_ENVIRONMENT_PATHS - "[${CATKIN_PKGCONFIG_ENVIRONMENT_PATHS}, os.path.join('${CATKIN_GLOBAL_LIB_DESTINATION}', '${CATKIN_MULTIARCH}', 'pkgconfig')]") - endif() - endif() - - # generate Python setup util - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/_setup_util.py.in - ${CATKIN_DEVEL_PREFIX}/_setup_util.py - @ONLY) - - if(NOT WIN32) - # non-windows - # generate env - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in - ${CATKIN_DEVEL_PREFIX}/env.sh - @ONLY) - # generate setup for various shells - foreach(shell bash sh zsh) - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in - ${CATKIN_DEVEL_PREFIX}/setup.${shell} - @ONLY) - endforeach() - - else() - # windows - # generate env - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in - ${CATKIN_DEVEL_PREFIX}/env.bat - @ONLY) - # generate setup - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/setup.bat.in - ${CATKIN_DEVEL_PREFIX}/setup.bat - @ONLY) - endif() - - # generate rosinstall file referencing setup.sh - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/rosinstall.in - ${CATKIN_DEVEL_PREFIX}/.rosinstall - @ONLY) - - # installspace - set(SETUP_DIR ${CMAKE_INSTALL_PREFIX}) - - if(NOT CATKIN_BUILD_BINARY_PACKAGE) - # install empty workspace marker if it doesn't already exist - install(CODE " - if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\") - file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\") - endif() - if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/.catkin\") - file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/.catkin\" \"\") - endif()") - - # generate and install Python setup util - configure_file(${catkin_EXTRAS_DIR}/templates/_setup_util.py.in - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/_setup_util.py - @ONLY) - catkin_install_python(PROGRAMS - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/_setup_util.py - DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() - - if(NOT WIN32) - # non-windows - # generate and install env - configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/env.sh - @ONLY) - if(NOT CATKIN_BUILD_BINARY_PACKAGE) - install(PROGRAMS - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/env.sh - DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() - # generate and install setup for various shells - foreach(shell bash sh zsh) - configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/setup.${shell} - @ONLY) - if(NOT CATKIN_BUILD_BINARY_PACKAGE) - install(FILES - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/setup.${shell} - DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() - endforeach() - - else() - # windows - # generate and install env - configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/env.bat - @ONLY) - install(PROGRAMS - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/env.bat - DESTINATION ${CMAKE_INSTALL_PREFIX}) - # generate and install setup - configure_file(${catkin_EXTRAS_DIR}/templates/setup.bat.in - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/setup.bat - @ONLY) - install(FILES - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/setup.bat - DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() - - # generate rosinstall file referencing setup.sh - configure_file(${catkin_EXTRAS_DIR}/templates/rosinstall.in - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/.rosinstall - @ONLY) - if(NOT CATKIN_BUILD_BINARY_PACKAGE) - install(FILES - ${CMAKE_BINARY_DIR}/catkin_generated/installspace/.rosinstall - DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() -endfunction() diff --git a/cmake/catkin/catkin_install_python.cmake b/cmake/catkin/catkin_install_python.cmake deleted file mode 100644 index 45f7a3c745..0000000000 --- a/cmake/catkin/catkin_install_python.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# -# Install Python files and update their shebang lines -# to use a different Python executable. -# -# The signature: -# -# catkin_install_python(PROGRAMS files... DESTINATION -# [OPTIONAL] -# ) -# -# See the documentation for CMake install() function for more information. -# -# @public -# -function(catkin_install_python signature) - string(TOUPPER "${signature}" signature) - if(NOT "${signature}" STREQUAL "PROGRAMS") - message(FATAL_ERROR "catkin_install_python() only supports the PROGRAMS signature (not '${signature}').") - endif() - cmake_parse_arguments(ARG "OPTIONAL" "DESTINATION" "" ${ARGN}) - if(NOT ARG_DESTINATION) - message(FATAL_ERROR "catkin_install_python() called without required DESTINATION argument.") - endif() - foreach(file ${ARG_UNPARSED_ARGUMENTS}) - if(NOT IS_ABSOLUTE ${file}) - set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - endif() - if(EXISTS ${file}) - # read file and check shebang line - file(READ ${file} data) - set(regex "^#!/([^\r\n]+)/env python([\r\n])") - string(REGEX MATCH "${regex}" shebang_line "${data}") - string(LENGTH "${shebang_line}" length) - string(SUBSTRING "${data}" 0 ${length} prefix) - if("${shebang_line}" STREQUAL "${prefix}") - # write modified file with modified shebang line - get_filename_component(python_name ${PYTHON_EXECUTABLE} NAME) - string(REGEX REPLACE "${regex}" "#!/\\1/env ${python_name}\\2" data "${data}") - get_filename_component(filename ${file} NAME) - set(file "${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace") - file(MAKE_DIRECTORY ${file}) - set(file "${file}/${filename}") - file(WRITE ${file} "${data}") - endif() - # install (modified) file to destination - set(optional_flag "") - if(ARG_OPTIONAL) - set(optional_flag "OPTIONAL") - endif() - install(PROGRAMS "${file}" DESTINATION "${ARG_DESTINATION}" ${optional_flag}) - elseif(NOT ARG_OPTIONAL) - message(FATAL_ERROR "catkin_install_python() called with non-existing file '${file}'.") - endif() - endforeach() -endfunction() diff --git a/cmake/catkin/catkin_libraries.cmake b/cmake/catkin/catkin_libraries.cmake deleted file mode 100644 index 723d40abd1..0000000000 --- a/cmake/catkin/catkin_libraries.cmake +++ /dev/null @@ -1,159 +0,0 @@ -set(CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR ":") - -# -# Filter libraries based on optional build configuration keywords. -# -# :param VAR: the output variable name -# :type VAR: string -# :param ARGN: a list of libraries -# :type ARGN: list of strings -# :param BUILD_TYPE: a keyword for the build type (default: -# ``CMAKE_BUILD_TYPE``) -# :type BUILD_TYPE: list of strings -# -# @public -# -macro(catkin_filter_libraries_for_build_configuration VAR) - cmake_parse_arguments(ARG "" "BUILD_TYPE" "" ${ARGN}) - if(NOT ARG_BUILD_TYPE) - set(ARG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - endif() - if(NOT ARG_BUILD_TYPE) - set(ARG_BUILD_TYPE "Debug") - endif() - set(${VAR} "") - list(LENGTH ARG_UNPARSED_ARGUMENTS _count) - set(_index 0) - while(${_index} LESS ${_count}) - list(GET ARG_UNPARSED_ARGUMENTS ${_index} lib) - - if("${lib}" STREQUAL "debug") - if(NOT "${ARG_BUILD_TYPE}" STREQUAL "Debug") - # skip keyword and debug library for non-debug builds - math(EXPR _index "${_index} + 1") - if(${_index} EQUAL ${_count}) - message(FATAL_ERROR "catkin_filter_libraries_for_build_configuration() the list of libraries '${ARG_UNPARSED_ARGUMENTS}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") - endif() - endif() - elseif("${lib}" STREQUAL "optimized") - if("${ARG_BUILD_TYPE}" STREQUAL "Debug") - # skip keyword and non-debug library for debug builds - math(EXPR _index "${_index} + 1") - if(${_index} EQUAL ${_count}) - message(FATAL_ERROR "catkin_filter_libraries_for_build_configuration() the list of libraries '${ARG_UNPARSED_ARGUMENTS}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") - endif() - endif() - elseif("${lib}" STREQUAL "general") - # just consume the keyword - if(${_index} EQUAL ${_count}) - message(FATAL_ERROR "catkin_package() the list of libraries '${ARG_UNPARSED_ARGUMENTS}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") - endif() - else() - list(APPEND ${VAR} "${lib}") - endif() - math(EXPR _index "${_index} + 1") - endwhile() - debug_message(10 "catkin_filter_libraries_for_build_configuration(${VAR} ${ARG_UNPARSED_ARGUMENTS} BUILD_TYPE ${ARG_BUILD_TYPE}) ${${VAR}}") -endmacro() - -# -# Pack a list of libraries with optional build configuration keywords. -# Each keyword is joined with its library using a separator. -# A packed library list can be deduplicated correctly. -# -# :param VAR: the output variable name -# :type VAR: string -# :param ARGN: a list of libraries -# :type ARGN: list of strings -# -# @public -# -macro(catkin_pack_libraries_with_build_configuration VAR) - set(${VAR} "") - set(_argn ${ARGN}) - list(LENGTH _argn _count) - set(_index 0) - while(${_index} LESS ${_count}) - list(GET _argn ${_index} lib) - if("${lib}" MATCHES "^debug|optimized|general$") - math(EXPR _index "${_index} + 1") - if(${_index} EQUAL ${_count}) - message(FATAL_ERROR "catkin_pack_libraries_with_build_configuration() the list of libraries '${_argn}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") - endif() - list(GET _argn ${_index} library) - list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") - else() - list(APPEND ${VAR} "${lib}") - endif() - math(EXPR _index "${_index} + 1") - endwhile() - #debug_message(10 "catkin_pack_libraries_with_build_configuration(${VAR} ${_argn}) ${${VAR}}") -endmacro() - -# -# Unpack a list of libraries with optional build configuration keyword prefixes. -# Libraries prefixed with a keyword are split into the keyword and the library. -# -# :param VAR: the output variable name -# :type VAR: string -# :param ARGN: a list of libraries -# :type ARGN: list of strings -# -# @public -# -macro(catkin_unpack_libraries_with_build_configuration VAR) - set(${VAR} "") - foreach(lib ${ARGN}) - string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") - list(APPEND ${VAR} "${lib}") - endforeach() - #set(_argn ${ARGN}) - #debug_message(10 "catkin_unpack_libraries_with_build_configuration(${VAR} ${_argn}) ${${VAR}}") -endmacro() - -# -# Replace imported library target names with the library name. -# -# :param VAR: the output variable name -# :type VAR: string -# :param ARGN: a list of libraries -# :type ARGN: list of strings -# -# @public -# -macro(catkin_replace_imported_library_targets VAR) - set(${VAR} "") - foreach(lib ${ARGN}) - if((NOT "${lib}" MATCHES "^debug|optimized|general$") AND TARGET ${lib}) - # sometimes cmake dependencies define imported targets, in which - # case the imported library information is not the target name, but - # the information embedded in cmake properties inside the imported library - get_target_property(${lib}_imported ${lib} IMPORTED) - if(${${lib}_imported}) - set(imported_libraries) # empty list - get_target_property(${lib}_imported_location ${lib} IMPORTED_LOCATION) - if(${lib}_imported_location) - list(APPEND imported_libraries ${${lib}_imported_location}) - else() - get_target_property(${lib}_imported_configurations ${lib} IMPORTED_CONFIGURATIONS) - foreach(cfg ${${lib}_imported_configurations}) - get_target_property(${lib}_imported_location_${cfg} ${lib} IMPORTED_LOCATION_${cfg}) - if(${lib}_imported_location_${cfg}) - list(APPEND imported_libraries ${${lib}_imported_location_${cfg}}) - endif() - endforeach() - endif() - foreach(imp_lib ${imported_libraries}) - list(APPEND ${VAR} "${imp_lib}") - endforeach() - else() - # not an imported library target - list(APPEND ${VAR} "${lib}") - endif() - else() - list(APPEND ${VAR} "${lib}") - endif() - endforeach() - #set(_argn ${ARGN}) - #debug_message(10 "catkin_replace_imported_library_targets(${VAR} ${_argn}) ${${VAR}}") -endmacro() diff --git a/cmake/catkin/catkin_metapackage.cmake b/cmake/catkin/catkin_metapackage.cmake deleted file mode 100644 index e111338a90..0000000000 --- a/cmake/catkin/catkin_metapackage.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# -# It installs the package.xml file of a metapackage. -# -# .. note:: It must be called once for each metapackage. Best -# practice is to call this macro early in your root CMakeLists.txt, -# immediately after calling ``project()`` and -# ``find_package(catkin REQUIRED)``. -# -# :param DIRECTORY: the path to the package.xml file if not in the same -# location as the CMakeLists.txt file -# :type DIRECTORY: string -# -# @public -# -function(catkin_metapackage) - cmake_parse_arguments(ARG "" "DIRECTORY" "" ${ARGN}) - if(ARG_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "catkin_metapackage() called with unused arguments: ${ARG_UNPARSED_ARGUMENTS}") - endif() - - # verify that project() has been called before - if(NOT PROJECT_NAME) - message(FATAL_ERROR "catkin_metapackage() PROJECT_NAME is not set. You must call project() before calling catkin_metapackage().") - endif() - if(PROJECT_NAME STREQUAL "Project") - message(FATAL_ERROR "catkin_metapackage() PROJECT_NAME is set to 'Project', which is not a valid project name. You must call project() before calling catkin_metapackage().") - endif() - - debug_message(10 "catkin_metapackage() called in file ${CMAKE_CURRENT_LIST_FILE}") - - if(NOT ARG_DIRECTORY) - if(${CMAKE_CURRENT_LIST_FILE} STREQUAL ${CMAKE_BINARY_DIR}/catkin_generated/metapackages/${PROJECT_NAME}/CMakeLists.txt) - set(ARG_DIRECTORY ${CMAKE_SOURCE_DIR}/${path}) - else() - set(ARG_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() - endif() - - catkin_package_xml(DIRECTORY ${ARG_DIRECTORY}) - - # install package.xml - install(FILES ${ARG_DIRECTORY}/package.xml - DESTINATION share/${PROJECT_NAME} - ) -endfunction() diff --git a/cmake/catkin/catkin_package.cmake b/cmake/catkin/catkin_package.cmake deleted file mode 100644 index 5a6aee1952..0000000000 --- a/cmake/catkin/catkin_package.cmake +++ /dev/null @@ -1,528 +0,0 @@ -# -# It installs the package.xml file, and it generates code for -# ``find_package`` and ``pkg-config`` so that other packages can get -# information about this package. For this purpose the information -# about include directories, libraries, further dependencies and -# CMake variables are used. -# -# .. note:: It must be called once for each package. It is indirectly -# calling``catkin_destinations()`` which will provide additional -# output variables. Please make sure to call ``catkin_package()`` -# before using those variables. -# -# :param INCLUDE_DIRS: ``CMAKE_CURRENT_SOURCE_DIR``-relative paths to -# C/C++ includes -# :type INCLUDE_DIRS: list of strings -# :param LIBRARIES: names of library targets that will appear in the -# ``catkin_LIBRARIES`` and ``${PROJECT_NAME}_LIBRARIES`` of other -# projects that search for you via ``find_package``. Currently -# this will break if the logical target names are not the same as -# the installed names. -# :type LIBRARIES: list of strings -# :param CATKIN_DEPENDS: a list of catkin projects which this project -# depends on. It is used when client code finds this project via -# ``find_package()`` or ``pkg-config``. Each project listed will in -# turn be ``find_package``\ -ed or is states as ``Requires`` in the -# .pc file. Therefore their ``INCLUDE_DIRS`` and ``LIBRARIES`` will -# be appended to ours. Only catkin projects should be used where it -# be guarantee that they are *find_packagable* and have pkg-config -# files. -# :type CATKIN_DEPENDS: list of strings -# :param DEPENDS: a list of CMake projects which this project depends -# on. Since they might not be *find_packagable* or lack a pkg-config -# file their ``INCLUDE_DIRS`` and ``LIBRARIES`` are passed directly. -# This requires that it has been ``find_package``\ -ed before. -# :type DEPENDS: list of strings -# :param CFG_EXTRAS: a CMake file containing extra stuff that should -# be accessible to users of this package after -# ``find_package``\ -ing it. This file must live in the -# subdirectory ``cmake`` or be an absolute path. Various additional -# file extension are possible: -# for a plain cmake file just ``.cmake``, for files expanded using -# CMake's ``configure_file()`` use ``.cmake.in`` or for files expanded -# by empy use ``.cmake.em``. The templates can distinguish between -# devel- and installspace using the boolean variables ``DEVELSPACE`` -# and ``INSTALLSPACE``. For templated files it is also possible to -# use the extensions ``.cmake.develspace.(in|em)`` or -# ``.cmake.installspace.(em|in)`` to generate the files only for a -# specific case. -# If the global variable ${PROJECT_NAME}_CFG_EXTRAS is set it will be -# prepended to the explicitly passed argument. -# :type CFG_EXTRAS: string -# :param EXPORTED_TARGETS: a list of target names which usually generate -# code. Downstream packages can depend on these targets to ensure that -# code is generated before it is being used. The generated CMake config -# file will ensure that the targets exists. -# If the global variable ${PROJECT_NAME}_EXPORTED_TARGETS is -# set it will be prepended to the explicitly passed argument. -# :type EXPORTED_TARGETS: list of strings -# :param SKIP_CMAKE_CONFIG_GENERATION: the option to skip the generation -# of the CMake config files for the package -# :type SKIP_CMAKE_CONFIG_GENERATION: bool -# :param SKIP_PKG_CONFIG_GENERATION: the option to skip the generation of -# the pkg-config file for the package -# :type SKIP_PKG_CONFIG_GENERATION: bool -# -# Example: -# :: -# -# catkin_package( -# INCLUDE_DIRS include -# LIBRARIES projlib1 projlib2 -# CATKIN_DEPENDS roscpp -# DEPENDS Eigen -# CFG_EXTRAS proj-extras[.cmake|.cmake.in|.cmake(.develspace|.installspace)?.em] -# ) -# -# @public -# -macro(catkin_package) - debug_message(10 "catkin_package() called in file ${CMAKE_CURRENT_LIST_FILE}") - - # verify that project() has been called before - if(NOT PROJECT_NAME) - message(FATAL_ERROR "catkin_package() PROJECT_NAME is not set. You must call project() before calling catkin_package().") - endif() - if(PROJECT_NAME STREQUAL "Project") - message(FATAL_ERROR "catkin_package() PROJECT_NAME is set to 'Project', which is not a valid project name. You must call project() before calling catkin_package().") - endif() - - # mark that catkin_package() was called in order to detect wrong order of calling with generate_messages() - set(${PROJECT_NAME}_CATKIN_PACKAGE TRUE) - - # call catkin_package_xml() if it has not been called before - if(NOT _CATKIN_CURRENT_PACKAGE) - catkin_package_xml() - endif() - - _catkin_package(${ARGN}) -endmacro() - -function(_catkin_package) - cmake_parse_arguments(PROJECT "SKIP_CMAKE_CONFIG_GENERATION;SKIP_PKG_CONFIG_GENERATION" "" "INCLUDE_DIRS;LIBRARIES;CATKIN_DEPENDS;DEPENDS;CFG_EXTRAS;EXPORTED_TARGETS" ${ARGN}) - if(PROJECT_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "catkin_package() called with unused arguments: ${PROJECT_UNPARSED_ARGUMENTS}") - endif() - - if(NOT ${PROJECT_NAME} STREQUAL "catkin") - list(FIND ${PROJECT_NAME}_BUILDTOOL_DEPENDS "catkin" _index) - if(_index EQUAL -1) - list(FIND ${PROJECT_NAME}_BUILD_DEPENDS "catkin" _index) - if(_index EQUAL -1) - message(FATAL_ERROR "catkin_package() 'catkin' must be listed as a buildtool dependency in the package.xml") - endif() - message("WARNING: 'catkin' should be listed as a buildtool dependency in the package.xml (instead of build dependency)") - endif() - endif() - - # prepend INCLUDE_DIRS and LIBRARIES passed using a variable - if(${PROJECT_NAME}_INCLUDE_DIRS) - list(INSERT PROJECT_INCLUDE_DIRS 0 ${${PROJECT_NAME}_INCLUDE_DIRS}) - endif() - if(${PROJECT_NAME}_LIBRARIES) - list(INSERT PROJECT_LIBRARIES 0 ${${PROJECT_NAME}_LIBRARIES}) - endif() - - # unset previously found directory of this package, so that this package overlays the other cleanly - if(${PROJECT_NAME}_DIR) - set(${PROJECT_NAME}_DIR "" CACHE PATH "" FORCE) - endif() - - set(_PROJECT_CATKIN_DEPENDS ${PROJECT_CATKIN_DEPENDS}) - - set(PROJECT_DEPENDENCIES_INCLUDE_DIRS "") - set(PROJECT_DEPENDENCIES_LIBRARIES "") - foreach(depend ${PROJECT_DEPENDS}) - string(REPLACE " " ";" depend_list ${depend}) - # check if the second argument is the COMPONENTS keyword - list(LENGTH depend_list count) - set(second_item "") - if(${count} GREATER 1) - list(GET depend_list 1 second_item) - endif() - if("${second_item}" STREQUAL "COMPONENTS") - list(GET depend_list 0 depend_name) - if(NOT ${${depend_name}_FOUND}) - message(FATAL_ERROR "catkin_package() DEPENDS on '${depend}' which must be find_package()-ed before") - endif() - message(WARNING "catkin_package() DEPENDS on '${depend}' which is deprecated. find_package() it before and only DEPENDS on '${depend_name}' instead") - list(APPEND PROJECT_DEPENDENCIES_INCLUDE_DIRS ${${depend_name}_INCLUDE_DIRS}) - list(APPEND PROJECT_DEPENDENCIES_LIBRARIES ${${depend_name}_LIBRARIES}) - else() - # split multiple names (without COMPONENTS) into separate dependencies - foreach(depend_name ${depend_list}) - if(${depend_name}_FOUND_CATKIN_PROJECT) - #message(WARNING "catkin_package() DEPENDS on catkin package '${depend_name}' which is deprecated. Use CATKIN_DEPENDS for catkin packages instead.") - list(APPEND _PROJECT_CATKIN_DEPENDS ${depend_name}) - else() - if(NOT ${${depend_name}_FOUND}) - message(FATAL_ERROR "catkin_package() DEPENDS on '${depend_name}' which must be find_package()-ed before. If it is a catkin package it can be declared as CATKIN_DEPENDS instead without find_package()-ing it.") - endif() - list(APPEND PROJECT_DEPENDENCIES_INCLUDE_DIRS ${${depend_name}_INCLUDE_DIRS}) - list(APPEND PROJECT_DEPENDENCIES_LIBRARIES ${${depend_name}_LIBRARIES}) - endif() - endforeach() - endif() - endforeach() - - # for catkin packages it can be guaranteed that they are find_package()-able and have pkg-config files - set(PROJECT_DEPENDENCIES "") - foreach(depend_name ${_PROJECT_CATKIN_DEPENDS}) - # verify that all catkin packages which have been find_package()-ed are listed as build dependencies - if(${depend_name}_FOUND) - # verify that these packages are really catkin packages - if(NOT ${depend_name}_FOUND_CATKIN_PROJECT) - if(DEFINED ${depend_name}_CONFIG) - message(FATAL_ERROR "catkin_package() CATKIN_DEPENDS on '${depend_name}', which has been found in '${${depend_name}_CONFIG}', but it is not a catkin package") - else() - message(FATAL_ERROR "catkin_package() CATKIN_DEPENDS on '${depend_name}', but it is not a catkin package") - endif() - endif() - if(catkin_ALL_FOUND_COMPONENTS) - list(FIND catkin_ALL_FOUND_COMPONENTS ${depend_name} _index) - else() - set(_index -1) - endif() - if(NOT _index EQUAL -1) - list(FIND ${PROJECT_NAME}_BUILD_DEPENDS ${depend_name} _index) - if(_index EQUAL -1) - message(FATAL_ERROR "catkin_package() the catkin package '${depend_name}' has been find_package()-ed but is not listed as a build dependency in the package.xml") - endif() - # verify versioned dependency constraints - if(DEFINED ${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_LT AND - NOT "${${depend_name}_VERSION}" VERSION_LESS "${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_LT}") - message(WARNING "catkin_package() version mismatch: the package.xml of '${PROJECT_NAME}' build_depends on '${depend_name} < ${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_LT}', but '${depend_name} ${${depend_name}_VERSION}' found") - endif() - if(DEFINED ${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_LTE AND - "${${depend_name}_VERSION}" VERSION_GREATER "${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_LTE}") - message(WARNING "catkin_package() version mismatch: the package.xml of '${PROJECT_NAME}' build_depends on '${depend_name} <= ${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_LTE}', but '${depend_name} ${${depend_name}_VERSION}' found") - endif() - if(DEFINED ${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_EQ AND - NOT "${${depend_name}_VERSION}" VERSION_EQUAL "${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_EQ}") - message(WARNING "catkin_package() version mismatch: the package.xml of '${PROJECT_NAME}' build_depends on '${depend_name} = ${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_EQ}', but '${depend_name} ${${depend_name}_VERSION}' found") - endif() - if(DEFINED ${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_GTE AND - "${${depend_name}_VERSION}" VERSION_LESS "${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_GTE}") - message(WARNING "catkin_package() version mismatch: the package.xml of '${PROJECT_NAME}' build_depends on '${depend_name} >= ${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_GTE}', but '${depend_name} ${${depend_name}_VERSION}' found") - endif() - if(DEFINED ${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_GT AND - NOT "${${depend_name}_VERSION}" VERSION_GREATER "${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_GT}") - message(WARNING "catkin_package() version mismatch: the package.xml of '${PROJECT_NAME}' build_depends on '${depend_name} > ${${PROJECT_NAME}_BUILD_DEPENDS_${depend_name}_VERSION_GT}', but '${depend_name} ${${depend_name}_VERSION}' found") - endif() - endif() - endif() - # verify that all catkin packages are listed as run dependencies - list(FIND ${PROJECT_NAME}_RUN_DEPENDS ${depend_name} _index) - if(_index EQUAL -1) - message(FATAL_ERROR "catkin_package() DEPENDS on the catkin package '${depend_name}' which must therefore be listed as a run dependency in the package.xml") - endif() - list(APPEND PROJECT_DEPENDENCIES ${depend_name}) - endforeach() - - # package version provided by package.cmake/xml - set(PROJECT_VERSION ${${PROJECT_NAME}_VERSION}) - - # flag if package is deprecated provided by package.cmake/xml - set(PROJECT_DEPRECATED ${${PROJECT_NAME}_DEPRECATED}) - - # package maintainer provided by package.cmake/xml - set(PROJECT_MAINTAINER ${${PROJECT_NAME}_MAINTAINER}) - - # get library paths from all workspaces - set(lib_paths "") - foreach(workspace ${CATKIN_WORKSPACES}) - list_append_unique(lib_paths ${workspace}/lib) - endforeach() - - # merge explicitly listed libraries and libraries from non-catkin but find_package()-ed packages - set(_PKG_CONFIG_LIBRARIES "") - if(PROJECT_LIBRARIES) - list(APPEND _PKG_CONFIG_LIBRARIES ${PROJECT_LIBRARIES}) - endif() - if(PROJECT_DEPENDENCIES_LIBRARIES) - list(APPEND _PKG_CONFIG_LIBRARIES ${PROJECT_DEPENDENCIES_LIBRARIES}) - endif() - - # resolve imported library targets - catkin_replace_imported_library_targets(_PKG_CONFIG_LIBRARIES ${_PKG_CONFIG_LIBRARIES}) - - # deduplicate libraries while maintaining build configuration keywords - catkin_pack_libraries_with_build_configuration(_PKG_CONFIG_LIBRARIES ${_PKG_CONFIG_LIBRARIES}) - set(PKG_CONFIG_LIBRARIES "") - foreach(library ${_PKG_CONFIG_LIBRARIES}) - list_append_deduplicate(PKG_CONFIG_LIBRARIES ${library}) - endforeach() - catkin_unpack_libraries_with_build_configuration(PKG_CONFIG_LIBRARIES ${PKG_CONFIG_LIBRARIES}) - - # .pc files can not handle build configuration keywords therefore filter them out based on the current build type - set(PKG_CONFIG_LIBRARIES_WITH_PREFIX "") - catkin_filter_libraries_for_build_configuration(libraries ${PKG_CONFIG_LIBRARIES}) - foreach(library ${libraries}) - if(IS_ABSOLUTE ${library}) - get_filename_component(suffix ${library} EXT) - if(NOT "${suffix}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(library "-l:${library}") - endif() - else() - set(library "-l${library}") - endif() - list_append_deduplicate(PKG_CONFIG_LIBRARIES_WITH_PREFIX ${library}) - endforeach() - - # - # DEVEL SPACE - # - - # used in the cmake extra files - set(DEVELSPACE TRUE) - set(INSTALLSPACE FALSE) - - set(PROJECT_SPACE_DIR ${CATKIN_DEVEL_PREFIX}) - set(PKG_INCLUDE_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}) - - # absolute path to include dirs and validate that they are existing either absolute or relative to packages source - set(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "") - set(PROJECT_PKG_CONFIG_INCLUDE_DIRS "") - foreach(idir ${PROJECT_INCLUDE_DIRS}) - if(IS_ABSOLUTE ${idir}) - if(IS_DIRECTORY ${idir}) - set(include ${idir}) - else() - message(FATAL_ERROR "catkin_package() absolute include dir '${idir}' does not exist") - endif() - elseif(IS_DIRECTORY ${PKG_INCLUDE_PREFIX}/${idir}) - set(include ${PKG_INCLUDE_PREFIX}/${idir}) - else() - message(FATAL_ERROR "catkin_package() include dir '${idir}' does not exist relative to '${PKG_INCLUDE_PREFIX}'") - endif() - list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${include}) - list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS ${include}) - endforeach() - if(PROJECT_DEPENDENCIES_INCLUDE_DIRS) - list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS}) - list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS}) - endif() - - # prepend library path of this workspace - set(PKG_CONFIG_LIB_PATHS ${lib_paths}) - list(INSERT PKG_CONFIG_LIB_PATHS 0 ${PROJECT_SPACE_DIR}/lib) - set(PKG_CMAKE_DIR ${PROJECT_SPACE_DIR}/share/${PROJECT_NAME}/cmake) - if("${PROJECT_NAME}" STREQUAL "catkin") - set(PKG_CMAKE_DIR "${catkin_EXTRAS_DIR}") - endif() - - if(NOT PROJECT_SKIP_PKG_CONFIG_GENERATION) - # ensure that output folder exists - file(MAKE_DIRECTORY ${CATKIN_DEVEL_PREFIX}/lib/pkgconfig) - # generate devel space pc for project - em_expand(${catkin_EXTRAS_DIR}/templates/pkg.context.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/pkg.develspace.context.pc.py - ${catkin_EXTRAS_DIR}/em/pkg.pc.em - ${CATKIN_DEVEL_PREFIX}/lib/pkgconfig/${PROJECT_NAME}.pc) - endif() - - # generate devel space cfg-extras for project - set(PKG_CFG_EXTRAS "") - foreach(extra ${${PROJECT_NAME}_CFG_EXTRAS} ${PROJECT_CFG_EXTRAS}) - if(IS_ABSOLUTE ${extra}) - set(base ${extra}) - get_filename_component(extra ${extra} NAME) - else() - set(base ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${extra}) - endif() - if(EXISTS ${base}.em OR EXISTS ${base}.develspace.em) - if(EXISTS ${base}.develspace.em) - set(em_template ${base}.develspace.em) - else() - set(em_template ${base}.em) - endif() - em_expand(${catkin_EXTRAS_DIR}/templates/cfg-extras.context.py.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/${extra}.develspace.context.cmake.py - ${em_template} - ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${extra}) - list(APPEND PKG_CFG_EXTRAS ${extra}) - elseif(EXISTS ${base}.in OR EXISTS ${base}.develspace.in) - if(EXISTS ${base}.develspace.in) - set(in_template ${base}.develspace.in) - else() - set(in_template ${base}.in) - endif() - configure_file(${in_template} - ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${extra} - @ONLY - ) - list(APPEND PKG_CFG_EXTRAS ${extra}) - elseif(EXISTS ${base}) - list(APPEND PKG_CFG_EXTRAS ${base}) - elseif(NOT EXISTS ${base}.installspace.em AND NOT EXISTS ${base}.installspace.in) - message(FATAL_ERROR "catkin_package() could not find CFG_EXTRAS file. Either 'cmake/${extra}.develspace.em', 'cmake/${extra}.em', 'cmake/${extra}.develspace.in', 'cmake/${extra}.in', 'cmake/${extra}' or a variant specific to the installspace must exist.") - endif() - endforeach() - - if(NOT PROJECT_SKIP_CMAKE_CONFIG_GENERATION) - set(PKG_EXPORTED_TARGETS ${${PROJECT_NAME}_EXPORTED_TARGETS} ${PROJECT_EXPORTED_TARGETS}) - foreach(t ${PKG_EXPORTED_TARGETS}) - if(NOT TARGET ${t}) - message(FATAL_ERROR "catkin_package() could not find target '${t}' for code generation.") - endif() - endforeach() - - # generate devel space config for project - set(infile ${${PROJECT_NAME}_EXTRAS_DIR}/${PROJECT_NAME}Config.cmake.in) - if(NOT EXISTS ${infile}) - set(infile ${catkin_EXTRAS_DIR}/templates/pkgConfig.cmake.in) - endif() - configure_file(${infile} - ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}Config.cmake - @ONLY - ) - # generate devel space config-version for project - configure_file(${catkin_EXTRAS_DIR}/templates/pkgConfig-version.cmake.in - ${CATKIN_DEVEL_PREFIX}/share/${PROJECT_NAME}/cmake/${PROJECT_NAME}Config-version.cmake - @ONLY - ) - endif() - - # - # INSTALLSPACE - # - - # used in the cmake extra files - set(DEVELSPACE FALSE) - set(INSTALLSPACE TRUE) - - set(PROJECT_SPACE_DIR ${CMAKE_INSTALL_PREFIX}) - set(PKG_INCLUDE_PREFIX ${PROJECT_SPACE_DIR}) - - # absolute path to include dir under install prefix if any include dir is set - set(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "") - set(PROJECT_PKG_CONFIG_INCLUDE_DIRS "") - foreach(idir ${PROJECT_INCLUDE_DIRS}) - # include dirs in source / build / devel space are handled like relative ones - # since these files are supposed to be installed to the include folder in install space - string_starts_with("${idir}/" "${CMAKE_CURRENT_SOURCE_DIR}/" _is_source_prefix) - string_starts_with("${idir}/" "${CMAKE_CURRENT_BINARY_DIR}/" _is_build_prefix) - string_starts_with("${idir}/" "${CATKIN_DEVEL_PREFIX}/" _is_devel_prefix) - if(_is_source_prefix OR _is_build_prefix OR _is_devel_prefix) - # generated header files should be places in the devel space rather then in the build space - if(_is_build_prefix) - message(WARNING "catkin_package() include dir '${idir}' should be placed in the devel space instead of the build space") - endif() - # the value doesn't matter as long as it doesn't match IS_ABSOLUTE - set(idir "${CATKIN_GLOBAL_INCLUDE_DESTINATION}") - endif() - if(IS_ABSOLUTE ${idir}) - list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "${idir}") - list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS "${idir}") - else() - list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "${CATKIN_GLOBAL_INCLUDE_DESTINATION}") - list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS "${PKG_INCLUDE_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}") - endif() - endforeach() - if(PROJECT_DEPENDENCIES_INCLUDE_DIRS) - list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS}) - list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS}) - endif() - - # prepend library path of this workspace - set(PKG_CONFIG_LIB_PATHS ${lib_paths}) - list(INSERT PKG_CONFIG_LIB_PATHS 0 ${PROJECT_SPACE_DIR}/lib) - # package cmake dir is the folder where the generated pkgConfig.cmake is located - set(PKG_CMAKE_DIR "\${${PROJECT_NAME}_DIR}") - - if(NOT PROJECT_SKIP_PKG_CONFIG_GENERATION) - # ensure that output folder exists - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace) - # generate and install pc for project - em_expand(${catkin_EXTRAS_DIR}/templates/pkg.context.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/pkg.installspace.context.pc.py - ${catkin_EXTRAS_DIR}/em/pkg.pc.em - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${PROJECT_NAME}.pc) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${PROJECT_NAME}.pc - DESTINATION lib/pkgconfig - ) - endif() - - # generate and install cfg-extras for project - set(PKG_CFG_EXTRAS "") - set(installable_cfg_extras "") - foreach(extra ${${PROJECT_NAME}_CFG_EXTRAS} ${PROJECT_CFG_EXTRAS}) - if(IS_ABSOLUTE ${extra}) - set(base ${extra}) - get_filename_component(extra ${extra} NAME) - else() - set(base ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${extra}) - endif() - if(EXISTS ${base}.em OR EXISTS ${base}.installspace.em) - if(EXISTS ${base}.installspace.em) - set(em_template ${base}.installspace.em) - else() - set(em_template ${base}.em) - endif() - em_expand(${catkin_EXTRAS_DIR}/templates/cfg-extras.context.py.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/${extra}.installspace.context.cmake.py - ${em_template} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${extra}) - list(APPEND installable_cfg_extras ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${extra}) - list(APPEND PKG_CFG_EXTRAS ${extra}) - elseif(EXISTS ${base}.in OR EXISTS ${base}.installspace.in) - if(EXISTS ${base}.installspace.in) - set(in_template ${base}.installspace.in) - else() - set(in_template ${base}.in) - endif() - configure_file(${in_template} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${extra} - @ONLY - ) - list(APPEND installable_cfg_extras ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${extra}) - list(APPEND PKG_CFG_EXTRAS ${extra}) - elseif(EXISTS ${base}) - list(APPEND installable_cfg_extras ${base}) - list(APPEND PKG_CFG_EXTRAS ${extra}) - elseif(NOT EXISTS ${base}.develspace.em AND NOT EXISTS ${base}.develspace.in) - message(FATAL_ERROR "catkin_package() could not find CFG_EXTRAS file. Either 'cmake/${extra}.installspace.em', 'cmake/${extra}.em', 'cmake/${extra}.installspace.in', 'cmake/${extra}.in', 'cmake/${extra}'or a variant specific to the develspace must exist.") - endif() - endforeach() - install(FILES - ${installable_cfg_extras} - DESTINATION share/${PROJECT_NAME}/cmake - ) - - if(NOT PROJECT_SKIP_CMAKE_CONFIG_GENERATION) - # generate config for project - set(infile ${${PROJECT_NAME}_EXTRAS_DIR}/${PROJECT_NAME}Config.cmake.in) - if(NOT EXISTS ${infile}) - set(infile ${catkin_EXTRAS_DIR}/templates/pkgConfig.cmake.in) - endif() - configure_file(${infile} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${PROJECT_NAME}Config.cmake - @ONLY - ) - # generate config-version for project - set(infile ${${PROJECT_NAME}_EXTRAS_DIR}/${PROJECT_NAME}Config-version.cmake.in) - if(NOT EXISTS ${infile}) - set(infile ${catkin_EXTRAS_DIR}/templates/pkgConfig-version.cmake.in) - endif() - configure_file(${infile} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${PROJECT_NAME}Config-version.cmake - @ONLY - ) - # install config, config-version and cfg-extras for project - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${PROJECT_NAME}Config-version.cmake - DESTINATION share/${PROJECT_NAME}/cmake - ) - endif() - - # install package.xml - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.xml - DESTINATION share/${PROJECT_NAME} - ) - - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/nodelet_plugins.xml) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nodelet_plugins.xml - DESTINATION share/${PROJECT_NAME} ) - endif () -endfunction() diff --git a/cmake/catkin/catkin_package_xml.cmake b/cmake/catkin/catkin_package_xml.cmake deleted file mode 100644 index 99dc212add..0000000000 --- a/cmake/catkin/catkin_package_xml.cmake +++ /dev/null @@ -1,69 +0,0 @@ -# -# Parse package.xml from ``CMAKE_CURRENT_SOURCE_DIR`` and -# make several information available to CMake. -# -# .. note:: It is called automatically by ``catkin_package()`` if not -# called manually before. It must be called once in each package, -# after calling ``project()`` where the project name must match the -# package name. The macro should only be called manually if the -# variables are use to parameterize ``catkin_package()``. -# -# :param DIRECTORY: the directory of the package.xml (default -# ``${CMAKE_CURRENT_SOURCE_DIR}``). -# :type DIRECTORY: string -# -# :outvar _VERSION: the version number -# :outvar _MAINTAINER: the name and email of the -# maintainer(s) -# :outvar _CATKIN_CURRENT_PACKAGE: the name of the package from the -# manifest -# -# .. note:: It is calling ``catkin_destinations()`` which will provide -# additional output variables. -# -# @public -# -macro(catkin_package_xml) - debug_message(10 "catkin_package_xml()") - - # verify that project() has been called before - if(NOT PROJECT_NAME) - message(FATAL_ERROR "catkin_package_xml() PROJECT_NAME is not set. You must call project() before you can call catkin_package_xml().") - endif() - - # ensure that function is not called multiple times per package - if(DEFINED _CATKIN_CURRENT_PACKAGE) - message(FATAL_ERROR "catkin_package_xml(): in '${CMAKE_CURRENT_LIST_FILE}', _CATKIN_CURRENT_PACKAGE is already set (to: ${_CATKIN_CURRENT_PACKAGE}). Did you called catkin_package_xml() multiple times?") - endif() - - _catkin_package_xml(${CMAKE_CURRENT_BINARY_DIR}/catkin_generated ${ARGN}) - - # verify that the package name from package.xml equals the project() name - if(NOT _CATKIN_CURRENT_PACKAGE STREQUAL PROJECT_NAME) - message(FATAL_ERROR "catkin_package_xml() package name '${_CATKIN_CURRENT_PACKAGE}' in '${_PACKAGE_XML_DIRECTORY}/package.xml' does not match current PROJECT_NAME '${PROJECT_NAME}'. You must call project() with the same package name before.") - endif() - - catkin_destinations() -endmacro() - -macro(_catkin_package_xml dest_dir) - cmake_parse_arguments(_PACKAGE_XML "" "DIRECTORY" "" ${ARGN}) - if(_PACKAGE_XML_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "catkin_package_xml() called with unused arguments: ${_PACKAGE_XML_UNPARSED_ARGUMENTS}") - endif() - - # set default directory - if(NOT _PACKAGE_XML_DIRECTORY) - set(_PACKAGE_XML_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() - - # stamp and parse package.xml - stamp(${_PACKAGE_XML_DIRECTORY}/package.xml) - file(MAKE_DIRECTORY ${dest_dir}) - safe_execute_process(COMMAND ${PYTHON_EXECUTABLE} - ${catkin_EXTRAS_DIR}/parse_package_xml.py - ${_PACKAGE_XML_DIRECTORY}/package.xml - ${dest_dir}/package.cmake) - # load extracted variable into cmake - include(${dest_dir}/package.cmake) -endmacro() diff --git a/cmake/catkin/catkin_python_setup.cmake b/cmake/catkin/catkin_python_setup.cmake deleted file mode 100644 index 2a8a0f7558..0000000000 --- a/cmake/catkin/catkin_python_setup.cmake +++ /dev/null @@ -1,150 +0,0 @@ -# This macro will interrogate the Python setup.py file in -# ``${${PROJECT_NAME}_SOURCE_DIR}``, and then creates forwarding -# Python :term:`pkgutil` infrastructure in devel space -# accordingly for the scripts and packages declared in setup.py. -# -# Doing so enables mixing :term:`generated code` in -# devel space with :term:`static code` from sourcespace within a -# single Python package. -# -# In addition, it adds the install command of -# distutils/setuputils to the install target. -# -# .. note:: If the project also uses genmsg message generation via -# ``generate_messages()`` this function must be called before. -# -# @public -# -function(catkin_python_setup) - if(ARGN) - message(FATAL_ERROR "catkin_python_setup() called with unused arguments: ${ARGN}") - endif() - - if(${PROJECT_NAME}_GENERATE_MESSAGES) - message(FATAL_ERROR "generate_messages() must be called after catkin_python_setup() in project '${PROJECT_NAME}'") - endif() - if(${PROJECT_NAME}_GENERATE_DYNAMIC_RECONFIGURE) - message(FATAL_ERROR "generate_dynamic_reconfigure_options() must be called after catkin_python_setup() in project '${PROJECT_NAME}'") - endif() - - if(NOT EXISTS ${${PROJECT_NAME}_SOURCE_DIR}/setup.py) - message(FATAL_ERROR "catkin_python_setup() called without 'setup.py' in project folder ' ${${PROJECT_NAME}_SOURCE_DIR}'") - endif() - - assert(PYTHON_INSTALL_DIR) - set(INSTALL_CMD_WORKING_DIRECTORY ${${PROJECT_NAME}_SOURCE_DIR}) - if(NOT WIN32) - set(INSTALL_SCRIPT - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/python_distutils_install.sh) - configure_file(${catkin_EXTRAS_DIR}/templates/python_distutils_install.sh.in - ${INSTALL_SCRIPT} - @ONLY) - else() - # need to convert install prefix to native path for python setuptools --prefix (its fussy about \'s) - file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX} PYTHON_INSTALL_PREFIX) - set(INSTALL_SCRIPT - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/python_distutils_install.bat) - configure_file(${catkin_EXTRAS_DIR}/templates/python_distutils_install.bat.in - ${INSTALL_SCRIPT} - @ONLY) - endif() - - # generate python script which gets executed at install time - configure_file(${catkin_EXTRAS_DIR}/templates/safe_execute_install.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/safe_execute_install.cmake) - install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/safe_execute_install.cmake) - - # interrogate setup.py - stamp(${${PROJECT_NAME}_SOURCE_DIR}/setup.py) - assert(CATKIN_ENV) - assert(PYTHON_EXECUTABLE) - set(cmd - ${CATKIN_ENV} ${PYTHON_EXECUTABLE} - ${catkin_EXTRAS_DIR}/interrogate_setup_dot_py.py - ${PROJECT_NAME} - ${${PROJECT_NAME}_SOURCE_DIR}/setup.py - ${${PROJECT_NAME}_BINARY_DIR}/catkin_generated/setup_py_interrogation.cmake - ) - debug_message(10 "catkin_python_setup() in project '{PROJECT_NAME}' executes: ${cmd}") - safe_execute_process(COMMAND ${cmd}) - include(${${PROJECT_NAME}_BINARY_DIR}/catkin_generated/setup_py_interrogation.cmake) - - # call catkin_package_xml() if it has not been called before - if(NOT _CATKIN_CURRENT_PACKAGE) - catkin_package_xml() - endif() - assert(${PROJECT_NAME}_VERSION) - # verify that version from setup.py is equal to version from package.xml - if(NOT "${${PROJECT_NAME}_SETUP_PY_VERSION}" STREQUAL "${${PROJECT_NAME}_VERSION}") - message(FATAL_ERROR "catkin_python_setup() version in setup.py (${${PROJECT_NAME}_SETUP_PY_VERSION}) differs from version in package.xml (${${PROJECT_NAME}_VERSION})") - endif() - - # generate relaying __init__.py for each python package - if(${PROJECT_NAME}_SETUP_PY_PACKAGES) - list(LENGTH ${PROJECT_NAME}_SETUP_PY_PACKAGES pkgs_count) - math(EXPR pkgs_range "${pkgs_count} - 1") - foreach(index RANGE ${pkgs_range}) - list(GET ${PROJECT_NAME}_SETUP_PY_PACKAGES ${index} pkg) - if("${pkg}" STREQUAL "${PROJECT_NAME}") - # mark that catkin_python_setup() was called and the setup.py file contains a package with the same name as the current project - # in order to disable installation of generated __init__.py files in generate_messages() and generate_dynamic_reconfigure_options() - set(${PROJECT_NAME}_CATKIN_PYTHON_SETUP_HAS_PACKAGE_INIT TRUE PARENT_SCOPE) - endif() - list(GET ${PROJECT_NAME}_SETUP_PY_PACKAGE_DIRS ${index} pkg_dir) - get_filename_component(name ${pkg_dir} NAME) - if(NOT ("${pkg}" STREQUAL "${name}")) - message(FATAL_ERROR "The package name '${pkg}' differs from the basename of the path '${pkg_dir}' in project '${PROJECT_NAME}'") - endif() - get_filename_component(path ${pkg_dir} PATH) - set(PACKAGE_PYTHONPATH ${CMAKE_CURRENT_SOURCE_DIR}/${path}) - configure_file(${catkin_EXTRAS_DIR}/templates/__init__.py.in - ${CATKIN_DEVEL_PREFIX}/${PYTHON_INSTALL_DIR}/${pkg}/__init__.py - @ONLY) - endforeach() - endif() - - # generate relay-script for each python module (and __init__.py files) if available - if(${PROJECT_NAME}_SETUP_PY_MODULES) - list(LENGTH ${PROJECT_NAME}_SETUP_PY_MODULES modules_count) - math(EXPR modules_range "${modules_count} - 1") - foreach(index RANGE ${modules_range}) - list(GET ${PROJECT_NAME}_SETUP_PY_MODULES ${index} module) - list(GET ${PROJECT_NAME}_SETUP_PY_MODULE_DIRS ${index} module_dir) - set(PYTHON_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/${module_dir}/${module}) - if(EXISTS ${PYTHON_SCRIPT}) - get_filename_component(path ${module} PATH) - file(MAKE_DIRECTORY "${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${path}") - configure_file(${catkin_EXTRAS_DIR}/templates/relay.py.in - ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${module} - @ONLY) - # relay parent __init__.py files if they exist - while(NOT "${path}" STREQUAL "") - set(PYTHON_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/${module_dir}/${path}/__init__.py) - if(EXISTS ${PYTHON_SCRIPT}) - file(MAKE_DIRECTORY "${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${path}") - configure_file(${catkin_EXTRAS_DIR}/templates/relay.py.in - ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${path}/__init__.py - @ONLY) - else() - message(WARNING "The module '${module_dir}/${module}' lacks an '__init__.py' file in the parent folder '${module_dir}/${path}' in project '${PROJECT_NAME}'") - endif() - get_filename_component(path ${path} PATH) - endwhile() - endif() - endforeach() - endif() - - # generate relay-script for each python script - foreach(script ${${PROJECT_NAME}_SETUP_PY_SCRIPTS}) - get_filename_component(name ${script} NAME) - if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${script}) - message(FATAL_ERROR "The script '${name}' as listed in 'setup.py' of '${PROJECT_NAME}' doesn't exist") - endif() - set(PYTHON_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/${script}) - atomic_configure_file(${catkin_EXTRAS_DIR}/templates/script.py.in - ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_BIN_DESTINATION}/${name} - @ONLY) - endforeach() -endfunction() - -stamp(${catkin_EXTRAS_DIR}/interrogate_setup_dot_py.py) diff --git a/cmake/catkin/catkin_workspace.cmake b/cmake/catkin/catkin_workspace.cmake deleted file mode 100644 index d346ff0fde..0000000000 --- a/cmake/catkin/catkin_workspace.cmake +++ /dev/null @@ -1,122 +0,0 @@ -# -# Search all subfolders in the workspace for ``package.xml`` files. -# Based on the dependencies specified in the ``build_depends``, -# ``buildtool_depends`` and (as of package format version 2) -# ``test_depends`` tags it performs a topological sort and calls -# ``add_subdirectory()`` for each directory. -# -# The functions is only called in catkin's ``toplevel.cmake``, which -# is usually symlinked to the workspace root directory (which -# contains multiple packages). -# -function(catkin_workspace) - debug_message(10 "catkin_workspace() called in file '${CMAKE_CURRENT_LIST_FILE}'") - - # set global output directories for artifacts and create them if necessary - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/lib) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/lib) - if(NOT IS_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - file(MAKE_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - endif() - - # tools/libraries.cmake - configure_shared_library_build_settings() - - set(CATKIN_WHITELIST_PACKAGES "" CACHE STRING "List of ';' separated packages to build") - set(CATKIN_BLACKLIST_PACKAGES "" CACHE STRING "List of ';' separated packages to exclude") - if(NOT "${CATKIN_WHITELIST_PACKAGES}" STREQUAL "") - message(STATUS "Using CATKIN_WHITELIST_PACKAGES: ${CATKIN_WHITELIST_PACKAGES}") - endif() - if(NOT "${CATKIN_BLACKLIST_PACKAGES}" STREQUAL "") - message(STATUS "Using CATKIN_BLACKLIST_PACKAGES: ${CATKIN_BLACKLIST_PACKAGES}") - endif() - - assert(catkin_EXTRAS_DIR) - em_expand( - ${catkin_EXTRAS_DIR}/templates/order_packages.context.py.in - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/order_packages.py - ${catkin_EXTRAS_DIR}/em/order_packages.cmake.em - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/order_packages.cmake - ) - debug_message(10 "catkin_workspace() including order_packages.cmake") - include(${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/order_packages.cmake) - - if(CATKIN_ORDERED_PACKAGES) - set(CATKIN_NONCONFORMANT_METAPACKAGE FALSE) - set(CATKIN_NONHOMOGENEOUS_WORKSPACE FALSE) - list(LENGTH CATKIN_ORDERED_PACKAGES count) - message(STATUS "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") - message(STATUS "~~ traversing ${count} packages in topological order:") - math(EXPR range "${count} - 1") - foreach(index RANGE ${range}) - list(GET CATKIN_ORDERED_PACKAGES ${index} name) - list(GET CATKIN_ORDERED_PACKAGE_PATHS ${index} path) - list(GET CATKIN_ORDERED_PACKAGES_IS_META ${index} is_meta) - list(GET CATKIN_ORDERED_PACKAGES_BUILD_TYPE ${index} build_type) - if(${is_meta}) - message(STATUS "~~ - ${name} (metapackage)") - # verify that CMakeLists.txt of metapackage conforms to standard - set(metapackage_arguments "") - assert(CATKIN_METAPACKAGE_CMAKE_TEMPLATE) - configure_file(${CATKIN_METAPACKAGE_CMAKE_TEMPLATE} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt - @ONLY) - if(EXISTS ${CMAKE_SOURCE_DIR}/${path}/CMakeLists.txt) - # compare CMakeLists.txt with standard content - file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt generated_cmakelists) - file(STRINGS ${path}/CMakeLists.txt existing_cmakelists) - if(NOT "${generated_cmakelists}" STREQUAL "${existing_cmakelists}") - set(CATKIN_NONHOMOGENEOUS_WORKSPACE TRUE) - message("WARNING: The CMakeLists.txt of the metapackage '${name}' contains non standard content. Use the content of the following file instead: ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt") - endif() - else() - message("WARNING: The metapackage '${name}' has no CMakeLists.txt. Please add one to the package source. You can use the following file: ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name}/CMakeLists.txt") - endif() - else() - if(${build_type} MATCHES catkin) - message(STATUS "~~ - ${name}") - else() - set(CATKIN_NONHOMOGENEOUS_WORKSPACE TRUE) - if(${build_type} MATCHES cmake) - message(STATUS "~~ - ${name} (plain cmake)") - else() - message(STATUS "~~ - ${name} (unknown)") - message(WARNING "Unknown build type '${build_type}' for package '${name}'") - endif() - endif() - endif() - endforeach() - message(STATUS "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") - - if(${CATKIN_NONCONFORMANT_METAPACKAGE}) - message(FATAL_ERROR "This workspace contains metapackages with a non-standard CMakeLists.txt.") - endif() - if(${CATKIN_NONHOMOGENEOUS_WORKSPACE}) - message(FATAL_ERROR "This workspace contains non-catkin packages in it, and catkin cannot build a non-homogeneous workspace without isolation. Try the 'catkin_make_isolated' command instead.") - endif() - - foreach(index RANGE ${range}) - list(GET CATKIN_ORDERED_PACKAGES ${index} name) - list(GET CATKIN_ORDERED_PACKAGE_PATHS ${index} path) - list(GET CATKIN_ORDERED_PACKAGES_IS_META ${index} is_meta) - list(GET CATKIN_ORDERED_PACKAGES_BUILD_TYPE ${index} build_type) - if(${is_meta}) - message(STATUS "+++ processing catkin metapackage: '${name}'") - if(EXISTS ${CMAKE_SOURCE_DIR}/${path}/CMakeLists.txt) - message(STATUS "==> add_subdirectory(${path})") - add_subdirectory(${path}) - else() - message(STATUS "==> add_subdirectory(${path}) (using generated file from /catkin_generated/metapackages/${name})") - message("WARNING: Add a CMakeLists.txt file to the metapackage '${name}'") - add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/metapackages/${name} ${CMAKE_BINARY_DIR}/${path}) - endif() - elseif(${build_type} MATCHES catkin) - message(STATUS "+++ processing catkin package: '${name}'") - message(STATUS "==> add_subdirectory(${path})") - add_subdirectory(${path}) - else() - message(FATAL_ERROR "Non-catkin package found, non-homogeneous workspaces are not supported.") - endif() - endforeach() - endif() -endfunction() diff --git a/cmake/catkin/debug_message.cmake b/cmake/catkin/debug_message.cmake deleted file mode 100644 index bdb94e5a11..0000000000 --- a/cmake/catkin/debug_message.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# Log levels -# 0 Normal use -# 1 Catkin developer use (Stuff being developed) -# 2 Catkin developer use (Stuff working) -# 3 Also Print True Assert Statements - -macro(debug_message level) - set(loglevel ${CATKIN_LOG}) - if(NOT loglevel) - set(loglevel 0) - endif() - - if(NOT ${level} GREATER ${loglevel}) - message(STATUS " ${ARGN}") - endif() -endmacro() diff --git a/cmake/catkin/em/order_packages.cmake.em b/cmake/catkin/em/order_packages.cmake.em deleted file mode 100644 index 087d4d802e..0000000000 --- a/cmake/catkin/em/order_packages.cmake.em +++ /dev/null @@ -1,56 +0,0 @@ -# generated from catkin/cmake/em/order_packages.cmake.em -@{ -import os -try: - from catkin_pkg.cmake import get_metapackage_cmake_template_path -except ImportError as e: - raise RuntimeError('ImportError: "from catkin_pkg.cmake import get_metapackage_cmake_template_path" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e) -try: - from catkin_pkg.topological_order import topological_order -except ImportError as e: - raise RuntimeError('ImportError: "from catkin_pkg.topological_order import topological_order" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e) -try: - from catkin_pkg.package import InvalidPackage -except ImportError as e: - raise RuntimeError('ImportError: "from catkin_pkg.package import InvalidPackage" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e) -# vars defined in order_packages.context.py.in -try: - ordered_packages = topological_order(os.path.normpath(source_root_dir), whitelisted=whitelisted_packages, blacklisted=blacklisted_packages, underlay_workspaces=underlay_workspaces) -except InvalidPackage as e: - print('message(FATAL_ERROR "%s")' % ('%s' % e).replace('"', '\\"')) - ordered_packages = [] -fatal_error = False -}@ - -set(CATKIN_ORDERED_PACKAGES "") -set(CATKIN_ORDERED_PACKAGE_PATHS "") -set(CATKIN_ORDERED_PACKAGES_IS_META "") -set(CATKIN_ORDERED_PACKAGES_BUILD_TYPE "") -@[for path, package in ordered_packages]@ -@[if path is None]@ -message(FATAL_ERROR "Circular dependency in subset of packages:\n@package") -@{ -fatal_error = True -}@ -@[elif package.name != 'catkin']@ -list(APPEND CATKIN_ORDERED_PACKAGES "@(package.name)") -list(APPEND CATKIN_ORDERED_PACKAGE_PATHS "@(path.replace('\\','/'))") -list(APPEND CATKIN_ORDERED_PACKAGES_IS_META "@(str('metapackage' in [e.tagname for e in package.exports]))") -list(APPEND CATKIN_ORDERED_PACKAGES_BUILD_TYPE "@(str([e.content for e in package.exports if e.tagname == 'build_type'][0]) if 'build_type' in [e.tagname for e in package.exports] else 'catkin')") -@{ -deprecated = [e for e in package.exports if e.tagname == 'deprecated'] -}@ -@[if deprecated]@ -message("WARNING: Package '@(package.name)' is deprecated@(' (%s)' % deprecated[0].content if deprecated[0].content else '')") -@[end if]@ -@[end if]@ -@[end for]@ - -@[if not fatal_error]@ -@{ -message_generators = [package.name for (_, package) in ordered_packages if 'message_generator' in [e.tagname for e in package.exports]] -}@ -set(CATKIN_MESSAGE_GENERATORS @(' '.join(message_generators))) -@[end if]@ - -set(CATKIN_METAPACKAGE_CMAKE_TEMPLATE "@(get_metapackage_cmake_template_path().replace('\\','/'))") diff --git a/cmake/catkin/em/pkg.pc.em b/cmake/catkin/em/pkg.pc.em deleted file mode 100644 index a4f72576cf..0000000000 --- a/cmake/catkin/em/pkg.pc.em +++ /dev/null @@ -1,8 +0,0 @@ -prefix=@PROJECT_SPACE_DIR - -Name: @(CATKIN_PACKAGE_PREFIX + PROJECT_NAME) -Description: Description of @PROJECT_NAME -Version: @PROJECT_VERSION -Cflags: @(' '.join(['-I%s' % include for include in PROJECT_PKG_CONFIG_INCLUDE_DIRS])) -Libs: -L@PROJECT_SPACE_DIR/lib @(' '.join(PKG_CONFIG_LIBRARIES_WITH_PREFIX)) -Requires: @(PROJECT_CATKIN_DEPENDS) diff --git a/cmake/catkin/em_expand.cmake b/cmake/catkin/em_expand.cmake deleted file mode 100644 index 0cca5f4667..0000000000 --- a/cmake/catkin/em_expand.cmake +++ /dev/null @@ -1,31 +0,0 @@ -macro(em_expand context_in context_out em_file_in file_out) - assert_file_exists("${context_in}" "input file for context missing") - assert_file_exists("${em_file_in}" "template file missing") - debug_message(2 "configure_file(${context_in}, ${context_out})") - configure_file(${context_in} ${context_out} @ONLY) - assert_file_exists("${context_out}" "context file was not generated correctly") - - stamp(${em_file_in}) - - # create directory if necessary - get_filename_component(_folder_out ${file_out} PATH) - if(NOT IS_DIRECTORY ${_folder_out}) - file(MAKE_DIRECTORY ${_folder_out}) - endif() - - debug_message(2 "Evaluate template '${em_file_in}' to '${file_out}' (with context from '${context_out}')") - assert(EMPY_SCRIPT) - # since empy contains a specific python version in its shebang line - # override the used python version by invoking it explicitly - set(command "${PYTHON_EXECUTABLE};${EMPY_SCRIPT}") - # prepend environment if set - if(CATKIN_ENV) - set(command ${CATKIN_ENV} ${command}) - endif() - safe_execute_process(COMMAND - ${command} - --raw-errors - -F ${context_out} - -o ${file_out} - ${em_file_in}) -endmacro() diff --git a/cmake/catkin/empy.cmake b/cmake/catkin/empy.cmake deleted file mode 100644 index 3328ce513d..0000000000 --- a/cmake/catkin/empy.cmake +++ /dev/null @@ -1,39 +0,0 @@ -function(find_python_module module) - # cribbed from http://www.cmake.org/pipermail/cmake/2011-January/041666.html - string(TOUPPER ${module} module_upper) - if(NOT PY_${module_upper}) - if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") - set(${module}_FIND_REQUIRED TRUE) - endif() - # A module's location is usually a directory, but for - # binary modules - # it's a .so file. - execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))" - RESULT_VARIABLE _${module}_status - OUTPUT_VARIABLE _${module}_location - ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT _${module}_status) - set(PY_${module_upper} ${_${module}_location} CACHE STRING "Location of Python module ${module}") - endif(NOT _${module}_status) - endif(NOT PY_${module_upper}) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper}) -endfunction(find_python_module) - -if(NOT EMPY_SCRIPT) - find_program(EMPY_EXECUTABLE empy) - if(NOT EMPY_EXECUTABLE) - # On OSX, there's an em.py, but not an executable empy script - find_python_module(em) - if(NOT PY_EM) - message(FATAL_ERROR "Unable to find either executable 'empy' or Python module 'em'... try installing the package 'python-empy'") - endif() - # ensure to use cmake-style path separators on Windows - file(TO_CMAKE_PATH "${PY_EM}" EMPY_SCRIPT) - else() - # ensure to use cmake-style path separators on Windows - file(TO_CMAKE_PATH "${EMPY_EXECUTABLE}" EMPY_SCRIPT) - endif() - set(EMPY_SCRIPT "${EMPY_SCRIPT}" CACHE STRING "Empy script" FORCE) -endif() -#message(STATUS "Using empy: ${EMPY_SCRIPT}") diff --git a/cmake/catkin/env-hooks/05.catkin-test-results.bat.develspace.in b/cmake/catkin/env-hooks/05.catkin-test-results.bat.develspace.in deleted file mode 100644 index e2eb02379b..0000000000 --- a/cmake/catkin/env-hooks/05.catkin-test-results.bat.develspace.in +++ /dev/null @@ -1,4 +0,0 @@ -REM generated from catkin/cmake/env-hooks/05.catkin-test-results.bat.develspace.in - -set CATKIN_TEST_RESULTS_DIR="@CATKIN_TEST_RESULTS_DIR@" -set ROS_TEST_RESULTS_DIR=%CATKIN_TEST_RESULTS_DIR% diff --git a/cmake/catkin/env-hooks/05.catkin-test-results.sh.develspace.in b/cmake/catkin/env-hooks/05.catkin-test-results.sh.develspace.in deleted file mode 100644 index dcbf018650..0000000000 --- a/cmake/catkin/env-hooks/05.catkin-test-results.sh.develspace.in +++ /dev/null @@ -1,4 +0,0 @@ -# generated from catkin/cmake/env-hooks/05.catkin-test-results.sh.develspace.in - -export CATKIN_TEST_RESULTS_DIR="@CATKIN_TEST_RESULTS_DIR@" -export ROS_TEST_RESULTS_DIR="$CATKIN_TEST_RESULTS_DIR" diff --git a/cmake/catkin/env-hooks/05.catkin_make.bash b/cmake/catkin/env-hooks/05.catkin_make.bash deleted file mode 100644 index 621d668a46..0000000000 --- a/cmake/catkin/env-hooks/05.catkin_make.bash +++ /dev/null @@ -1,67 +0,0 @@ -function _catkin_make() -{ - local cur prev - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - - # autocomplete path arguments for -C, --directory, --source, --build - case $prev in - -C|--directory|--source|--build) - _filedir -d - return 0 - ;; - esac - - if [[ "$cur" == -DCMAKE_BUILD_TYPE=* ]]; then - # autocomplete CMake argument CMAKE_BUILD_TYPE with its options - COMPREPLY=( $( compgen -P "-DCMAKE_BUILD_TYPE=" -W "None Debug Release RelWithDebInfo MinSizeRel" -- "${cur:19}" ) ) - elif [[ "$cur" == -DCATKIN_ENABLE_TESTING=* ]]; then - # autocomplete catkin argument CATKIN_ENABLE_TESTING with its options - COMPREPLY=( $( compgen -P "-DCATKIN_ENABLE_TESTING=" -W "0 1" -- "${cur:24}" ) ) - elif [[ "$cur" == -DCATKIN_DEVEL_PREFIX=* || "$cur" == -DCMAKE_INSTALL_PREFIX=* ]]; then - COMPREPLY=() - elif [[ "$cur" == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - if [[ "$cur" == -* ]]; then - # suggest some common CMake arguments - opts="$opts -DCATKIN_DEVEL_PREFIX= -DCATKIN_ENABLE_TESTING= -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=" - fi - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - else - # check if custom workspace root has been specified on the command line - local workspace_dir="." - for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do - if [[ ${COMP_WORDS[i]} == -C || ${COMP_WORDS[i]} == --directory ]]; then - # eval to expand tilde - eval workspace_dir=${COMP_WORDS[i+1]} - fi - done - # check if custom build folder has been specified on the command line - local build_dir="build" - for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do - if [[ ${COMP_WORDS[i]} == --build ]]; then - # eval to expand tilde - eval build_dir=${COMP_WORDS[i+1]} - fi - done - - # determine location of Makefile - local makefile_dir - if [[ "$build_dir" = /* ]]; then - makefile_dir="$build_dir" - else - makefile_dir="$workspace_dir/$build_dir" - fi - COMPREPLY=() - if [ -f "$makefile_dir/Makefile" ]; then - cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $( compgen -W "`make -C $makefile_dir -qp 2>/dev/null | awk -F':' '/^[a-zA-Z0-9][a-zA-Z0-9_\.]*:/ { print $1 }'`" -- $cur )) - elif [ -f "$makefile_dir/build.ninja" ]; then - cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $( compgen -W "`ninja -C $makefile_dir -t targets 2>/dev/null | awk -F':' '/^[a-zA-Z0-9][a-zA-Z0-9_\.]*:/ { print $1 }'`" -- $cur )) - fi - fi -} && -complete -F _catkin_make catkin_make diff --git a/cmake/catkin/env-hooks/05.catkin_make_isolated.bash b/cmake/catkin/env-hooks/05.catkin_make_isolated.bash deleted file mode 100644 index 99e5d30164..0000000000 --- a/cmake/catkin/env-hooks/05.catkin_make_isolated.bash +++ /dev/null @@ -1,65 +0,0 @@ -function _catkin_make_isolated() -{ - local cur prev - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - - # autocomplete path arguments for -C, --directory, --source, --build, --devel, --install - case $prev in - -C|--directory|--source|--build|--devel|--install) - _filedir -d - return 0 - ;; - esac - - if [[ "$cur" == -DCMAKE_BUILD_TYPE=* ]]; then - # autocomplete CMake argument CMAKE_BUILD_TYPE with its options - COMPREPLY=( $( compgen -P "-DCMAKE_BUILD_TYPE=" -W "None Debug Release RelWithDebInfo MinSizeRel" -- "${cur:19}" ) ) - elif [[ "$cur" == -DCATKIN_ENABLE_TESTING=* ]]; then - # autocomplete catkin argument CATKIN_ENABLE_TESTING with its options - COMPREPLY=( $( compgen -P "-DCATKIN_ENABLE_TESTING=" -W "0 1" -- "${cur:24}" ) ) - elif [[ "$cur" == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - if [[ "$cur" == -* ]]; then - # suggest some common CMake arguments - opts="$opts -DCATKIN_ENABLE_TESTING= -DCMAKE_BUILD_TYPE=" - fi - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - else - # check if custom workspace root has been specified on the command line - local workspace_dir="." - for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do - if [[ ${COMP_WORDS[i]} == -C || ${COMP_WORDS[i]} == --directory ]]; then - # eval to expand tilde - eval workspace_dir=${COMP_WORDS[i+1]} - fi - done - # check if custom build folder has been specified on the command line - local build_dir="build_isolated" - for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do - if [[ ${COMP_WORDS[i]} == --build ]]; then - # eval to expand tilde - eval build_dir=${COMP_WORDS[i+1]} - fi - done - - # determine location of Makefile - local makefile_dir - if [[ "$build_dir" = /* ]]; then - makefile_dir="$build_dir" - else - makefile_dir="$workspace_dir/$build_dir" - fi - COMPREPLY=() - if [ -f "$makefile_dir/Makefile" ]; then - cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $( compgen -W "`make -C $makefile_dir -qp 2>/dev/null | awk -F':' '/^[a-zA-Z0-9][a-zA-Z0-9_\.]*:/ { print $1 }'`" -- $cur )) - elif [ -f "$makefile_dir/build.ninja" ]; then - cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $( compgen -W "`ninja -C $makefile_dir -t targets 2>/dev/null | awk -F':' '/^[a-zA-Z0-9][a-zA-Z0-9_\.]*:/ { print $1 }'`" -- $cur )) - fi - fi -} && -complete -F _catkin_make_isolated catkin_make_isolated diff --git a/cmake/catkin/find_program_required.cmake b/cmake/catkin/find_program_required.cmake deleted file mode 100644 index 4cd3ab0c79..0000000000 --- a/cmake/catkin/find_program_required.cmake +++ /dev/null @@ -1,9 +0,0 @@ -function(find_program_required ARG_VAR ARG_PROGRAM_NAME) - cmake_parse_arguments(ARG "NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH" "" "PATHS" ${ARGN}) - find_program(${ARG_VAR} ${ARG_PROGRAM_NAME} PATHS ${ARG_PATHS} ${ARG_NO_DEFAULT_PATH} ${ARG_NO_CMAKE_FIND_ROOT_PATH}) - if(NOT ${ARG_VAR}) - message(FATAL_ERROR "${ARG_PROGRAM_NAME} not found") - else() - debug_message(1 "${ARG_PROGRAM_NAME} was found at ${${ARG_VAR}}") - endif() -endfunction() diff --git a/cmake/catkin/interrogate_setup_dot_py.py b/cmake/catkin/interrogate_setup_dot_py.py deleted file mode 100644 index 26882f02aa..0000000000 --- a/cmake/catkin/interrogate_setup_dot_py.py +++ /dev/null @@ -1,250 +0,0 @@ -#!/usr/bin/env python - -# Software License Agreement (BSD License) -# -# Copyright (c) 2012, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from __future__ import print_function -import os -import sys - -import distutils.core -try: - import setuptools -except ImportError: - pass - -from argparse import ArgumentParser - - -def _get_locations(pkgs, package_dir): - """ - based on setuptools logic and the package_dir dict, builds a dict - of location roots for each pkg in pkgs. - See http://docs.python.org/distutils/setupscript.html - - :returns: a dict {pkgname: root} for each pkgname in pkgs (and each of their parents) - """ - # package_dir contains a dict {package_name: relativepath} - # Example {'': 'src', 'foo': 'lib', 'bar': 'lib2'} - # - # '' means where to look for any package unless a parent package - # is listed so package bar.pot is expected at lib2/bar/pot, - # whereas package sup.dee is expected at src/sup/dee - # - # if package_dir does not state anything about a package, - # setuptool expects the package folder to be in the root of the - # project - locations = {} - allprefix = package_dir.get('', '') - for pkg in pkgs: - parent_location = None - splits = pkg.split('.') - # we iterate over compound name from parent to child - # so once we found parent, children just append to their parent - for key_len in range(len(splits)): - key = '.'.join(splits[:key_len + 1]) - if key not in locations: - if key in package_dir: - locations[key] = package_dir[key] - elif parent_location is not None: - locations[key] = parent_location - else: - locations[key] = allprefix - parent_location = locations[key] - return locations - - -def generate_cmake_file(package_name, version, scripts, package_dir, pkgs, modules): - """ - Generates lines to add to a cmake file which will set variables - - :param version: str, format 'int.int.int' - :param scripts: [list of str]: relative paths to scripts - :param package_dir: {modulename: path} - :pkgs: [list of str] python_packages declared in catkin package - :modules: [list of str] python modules - """ - prefix = '%s_SETUP_PY' % package_name - result = [] - result.append(r'set(%s_VERSION "%s")' % (prefix, version)) - result.append(r'set(%s_SCRIPTS "%s")' % (prefix, ';'.join(scripts))) - - # Remove packages with '.' separators. - # - # setuptools allows specifying submodules in other folders than - # their parent - # - # The symlink approach of catkin does not work with such submodules. - # In the common case, this does not matter as the submodule is - # within the containing module. We verify this assumption, and if - # it passes, we remove submodule packages. - locations = _get_locations(pkgs, package_dir) - for pkgname, location in locations.items(): - if not '.' in pkgname: - continue - splits = pkgname.split('.') - # hack: ignore write-combining setup.py files for msg and srv files - if splits[1] in ['msg', 'srv']: - continue - # check every child has the same root folder as its parent - parent_name = '.'.join(splits[:1]) - if location != locations[parent_name]: - raise RuntimeError( - "catkin_export_python does not support setup.py files that combine across multiple directories: %s in %s, %s in %s" % (pkgname, location, parent_name, locations[parent_name])) - - # If checks pass, remove all submodules - pkgs = [p for p in pkgs if '.' not in p] - - resolved_pkgs = [] - for pkg in pkgs: - resolved_pkgs += [os.path.join(locations[pkg], pkg)] - - result.append(r'set(%s_PACKAGES "%s")' % (prefix, ';'.join(pkgs))) - result.append(r'set(%s_PACKAGE_DIRS "%s")' % (prefix, ';'.join(resolved_pkgs).replace("\\", "/"))) - - # skip modules which collide with package names - filtered_modules = [] - for modname in modules: - splits = modname.split('.') - # check all parents too - equals_package = [('.'.join(splits[:-i]) in locations) for i in range(len(splits))] - if any(equals_package): - continue - filtered_modules.append(modname) - module_locations = _get_locations(filtered_modules, package_dir) - - result.append(r'set(%s_MODULES "%s")' % (prefix, ';'.join(['%s.py' % m.replace('.', '/') for m in filtered_modules]))) - result.append(r'set(%s_MODULE_DIRS "%s")' % (prefix, ';'.join([module_locations[m] for m in filtered_modules]).replace("\\", "/"))) - - return result - - -def _create_mock_setup_function(package_name, outfile): - """ - Creates a function to call instead of distutils.core.setup or - setuptools.setup, which just captures some args and writes them - into a file that can be used from cmake - - :param package_name: name of the package - :param outfile: filename that cmake will use afterwards - :returns: a function to replace disutils.core.setup and setuptools.setup - """ - - def setup(*args, **kwargs): - ''' - Checks kwargs and writes a scriptfile - ''' - if 'version' not in kwargs: - sys.stderr.write("\n*** Unable to find 'version' in setup.py of %s\n" % package_name) - raise RuntimeError("version not found in setup.py") - version = kwargs['version'] - package_dir = kwargs.get('package_dir', {}) - - pkgs = kwargs.get('packages', []) - scripts = kwargs.get('scripts', []) - modules = kwargs.get('py_modules', []) - - unsupported_args = [ - 'entry_points', - 'exclude_package_data', - 'ext_modules ', - 'ext_package', - 'include_package_data', - 'namespace_packages', - 'setup_requires', - 'use_2to3', - 'zip_safe'] - used_unsupported_args = [arg for arg in unsupported_args if arg in kwargs] - if used_unsupported_args: - sys.stderr.write("*** Arguments %s to setup() not supported in catkin devel space in setup.py of %s\n" % (used_unsupported_args, package_name)) - - result = generate_cmake_file(package_name=package_name, - version=version, - scripts=scripts, - package_dir=package_dir, - pkgs=pkgs, - modules=modules) - with open(outfile, 'w') as out: - out.write('\n'.join(result)) - - return setup - - -def main(): - """ - Script main, parses arguments and invokes Dummy.setup indirectly. - """ - parser = ArgumentParser(description='Utility to read setup.py values from cmake macros. Creates a file with CMake set commands setting variables.') - parser.add_argument('package_name', help='Name of catkin package') - parser.add_argument('setupfile_path', help='Full path to setup.py') - parser.add_argument('outfile', help='Where to write result to') - - args = parser.parse_args() - - # print("%s" % sys.argv) - # PACKAGE_NAME = sys.argv[1] - # OUTFILE = sys.argv[3] - # print("Interrogating setup.py for package %s into %s " % (PACKAGE_NAME, OUTFILE), - # file=sys.stderr) - - # print("executing %s" % args.setupfile_path) - - # be sure you're in the directory containing - # setup.py so the sys.path manipulation works, - # so the import of __version__ works - os.chdir(os.path.dirname(os.path.abspath(args.setupfile_path))) - - # patch setup() function of distutils and setuptools for the - # context of evaluating setup.py - try: - fake_setup = _create_mock_setup_function(package_name=args.package_name, - outfile=args.outfile) - - distutils_backup = distutils.core.setup - distutils.core.setup = fake_setup - try: - setuptools_backup = setuptools.setup - setuptools.setup = fake_setup - except NameError: - pass - - with open(args.setupfile_path, 'r') as fh: - exec(fh.read()) - finally: - distutils.core.setup = distutils_backup - try: - setuptools.setup = setuptools_backup - except NameError: - pass - -if __name__ == '__main__': - main() diff --git a/cmake/catkin/legacy.cmake b/cmake/catkin/legacy.cmake deleted file mode 100644 index a4c65c2146..0000000000 --- a/cmake/catkin/legacy.cmake +++ /dev/null @@ -1,3 +0,0 @@ -function(catkin_stack) - message(FATAL_ERROR "catkin_stack() is not supported by catkin as of groovy. Please update the package to the latest catkin version.") -endfunction() diff --git a/cmake/catkin/list_append_deduplicate.cmake b/cmake/catkin/list_append_deduplicate.cmake deleted file mode 100644 index e59a61bb14..0000000000 --- a/cmake/catkin/list_append_deduplicate.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# -# Append elements to a list and remove existing duplicates from the list. -# -# .. note:: Using CMake's ``list(APPEND ..)`` and -# ``list(REMOVE_DUPLICATES ..)`` is not sufficient since its -# implementation uses a set internally which makes the operation -# unstable. -# -macro(list_append_deduplicate listname) - if(NOT "${ARGN}" STREQUAL "") - if(${listname}) - list(REMOVE_ITEM ${listname} ${ARGN}) - endif() - list(APPEND ${listname} ${ARGN}) - endif() -endmacro() diff --git a/cmake/catkin/list_append_unique.cmake b/cmake/catkin/list_append_unique.cmake deleted file mode 100644 index 4c9bb1df86..0000000000 --- a/cmake/catkin/list_append_unique.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# -# Append elements to a list if they are not already in the list. -# -# .. note:: Using CMake's ``list(APPEND ..)`` and -# ``list(REMOVE_DUPLICATES ..)`` is not sufficient since its -# implementation uses a set internally which makes the operation -# unstable. -# -macro(list_append_unique listname) - foreach(_item ${ARGN}) - list(FIND ${listname} ${_item} _index) - if(_index EQUAL -1) - list(APPEND ${listname} ${_item}) - endif() - endforeach() -endmacro() diff --git a/cmake/catkin/list_insert_in_workspace_order.cmake b/cmake/catkin/list_insert_in_workspace_order.cmake deleted file mode 100644 index 57ade4a493..0000000000 --- a/cmake/catkin/list_insert_in_workspace_order.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# -# Insert elements to a list in the same order as the chained catkin workspaces. -# -set(CATKIN_ORDERED_SPACES "") -foreach(_space ${CATKIN_DEVEL_PREFIX} ${CATKIN_WORKSPACES}) - list(APPEND CATKIN_ORDERED_SPACES ${_space}) - if(NOT EXISTS "${_space}/.catkin") - message(FATAL_ERROR "The path '${_space}' is in CATKIN_WORKSPACES but does not have a .catkin file") - endif() - # prepend to existing list of sourcespaces - file(READ "${_space}/.catkin" _sourcespaces) - list(APPEND CATKIN_ORDERED_SPACES ${_sourcespaces}) -endforeach() - -debug_message(10 "CATKIN_ORDERED_SPACES ${CATKIN_ORDERED_SPACES}") - -macro(list_insert_in_workspace_order listname) - if(NOT "${ARGN}" STREQUAL "") - assert(CATKIN_ENV) - assert(PYTHON_EXECUTABLE) - set(cmd - ${CATKIN_ENV} ${PYTHON_EXECUTABLE} - ${catkin_EXTRAS_DIR}/order_paths.py - ${${PROJECT_NAME}_BINARY_DIR}/catkin_generated/ordered_paths.cmake - --paths-to-order ${ARGN} - --prefixes ${CATKIN_ORDERED_SPACES} - ) - debug_message(10 "list_insert_in_workspace_order() in project '{PROJECT_NAME}' executes: ${cmd}") - safe_execute_process(COMMAND ${cmd}) - include(${${PROJECT_NAME}_BINARY_DIR}/catkin_generated/ordered_paths.cmake) - set(${listname} ${ORDERED_PATHS}) - else() - set(${listname} "") - endif() -endmacro() diff --git a/cmake/catkin/order_paths.py b/cmake/catkin/order_paths.py deleted file mode 100644 index d2a3eca105..0000000000 --- a/cmake/catkin/order_paths.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -from argparse import ArgumentParser -import os -import sys - -try: - from catkin_pkg.workspaces import order_paths -except ImportError as e: - sys.exit('ImportError: "from catkin_pkg.package import parse_package" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e) - - -def main(): - """ - Order a list of paths according to a list of prefixes which define the order. - """ - parser = ArgumentParser(description='Utility to order a list of paths according to a list of prefixes. Creates a file with CMake set command setting a variable.') - parser.add_argument('outfile', help='The filename of the generated CMake file') - parser.add_argument('--paths-to-order', nargs='*', help='The semicolon-separated paths to order') - parser.add_argument('--prefixes', nargs='*', help='The semicolon-separated prefixes defining the order') - args = parser.parse_args() - - ordered_paths = order_paths(args.paths_to_order, args.prefixes) - - # create directory if necessary - outdir = os.path.dirname(args.outfile) - if not os.path.exists(outdir): - os.makedirs(outdir) - - with open(args.outfile, 'w') as fh: - fh.write('set(ORDERED_PATHS "%s")' % ';'.join(ordered_paths)) - - -if __name__ == '__main__': - main() diff --git a/cmake/catkin/parse_package_xml.py b/cmake/catkin/parse_package_xml.py deleted file mode 100755 index 71e3e91877..0000000000 --- a/cmake/catkin/parse_package_xml.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python - -# Software License Agreement (BSD License) -# -# Copyright (c) 2012, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from __future__ import print_function -import sys -import argparse - -try: - from catkin_pkg.package import parse_package -except ImportError as e: - sys.exit('ImportError: "from catkin_pkg.package import parse_package" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e) - - -def _get_output(package): - """ - returns a list of strings with cmake commands to execute to set cmake variables - - :param package: Package object - :returns: list of str, lines to output - """ - values = {} - values['VERSION'] = '"%s"' % package.version - - values['MAINTAINER'] = '"%s"' % (', '.join([str(m) for m in package.maintainers])) - - values.update(_get_dependency_values('BUILD_DEPENDS', package.build_depends)) - values.update(_get_dependency_values('BUILDTOOL_DEPENDS', package.buildtool_depends)) - values.update(_get_dependency_values('RUN_DEPENDS', package.run_depends)) - - deprecated = [e.content for e in package.exports if e.tagname == 'deprecated'] - values['DEPRECATED'] = '"%s"' % ((deprecated[0] if deprecated[0] else 'TRUE') if deprecated else '') - - output = [] - output.append(r'set(_CATKIN_CURRENT_PACKAGE "%s")' % package.name) - for k, v in values.items(): - output.append('set(%s_%s %s)' % (package.name, k, v)) - return output - -def _get_dependency_values(key, depends): - values = {} - values[key] = ' '.join(['"%s"' % str(d) for d in depends]) - for d in depends: - comparisons = ['version_lt', 'version_lte', 'version_eq', 'version_gte', 'version_gt'] - for comp in comparisons: - value = getattr(d, comp, None) - if value is not None: - values['%s_%s_%s' % (key, str(d), comp.upper())] = '"%s"' % value - return values - - -def main(argv=sys.argv[1:]): - """ - Reads given package_xml and writes extracted variables to outfile. - """ - parser = argparse.ArgumentParser(description="Read package.xml and write extracted variables to stdout") - parser.add_argument('package_xml') - parser.add_argument('outfile') - args = parser.parse_args(argv) - package = parse_package(args.package_xml) - - lines = _get_output(package) - with open(args.outfile, 'w') as ofile: - ofile.write('\n'.join(lines)) - - -if __name__ == '__main__': - main() diff --git a/cmake/catkin/platform/lsb.cmake b/cmake/catkin/platform/lsb.cmake deleted file mode 100644 index 7aca48b5f5..0000000000 --- a/cmake/catkin/platform/lsb.cmake +++ /dev/null @@ -1,28 +0,0 @@ -find_program(LSB_RELEASE_EXECUTABLE lsb_release) - -if(LSB_RELEASE_EXECUTABLE) - set(LSB_FOUND TRUE CACHE BOOL "lsb_release executable was found") - execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -si - OUTPUT_VARIABLE LSB_DISTRIB_ID - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(TOUPPER ${LSB_DISTRIB_ID} v) - set(${v} TRUE CACHE BOOL "LSB Distrib tag") - - execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sd - OUTPUT_VARIABLE LSB_DESCRIPTION - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sr - OUTPUT_VARIABLE LSB_RELEASE - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -sc - OUTPUT_VARIABLE LSB_CODENAME - OUTPUT_STRIP_TRAILING_WHITESPACE) - - string(TOUPPER ${LSB_DISTRIB_ID} v) - set(${v} TRUE CACHE BOOL "LSB Distribution") - #message(STATUS "${v} is on") - - string(TOUPPER ${LSB_DISTRIB_ID}_${LSB_CODENAME} v) - set(${v} TRUE CACHE BOOL "LSB Distrib - codename tag") - #message(STATUS "${v} is on") -endif() diff --git a/cmake/catkin/platform/ubuntu.cmake b/cmake/catkin/platform/ubuntu.cmake deleted file mode 100644 index 3850736270..0000000000 --- a/cmake/catkin/platform/ubuntu.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# requires lsb to be included first -if(UBUNTU) - # ubuntu-specifics go here -endif() diff --git a/cmake/catkin/platform/windows.cmake b/cmake/catkin/platform/windows.cmake deleted file mode 100644 index 35e61be15c..0000000000 --- a/cmake/catkin/platform/windows.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# BUILD_SHARED_LIBS is a global cmake variable (usually defaults to on) -# that determines the build type of libraries: -# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:BUILD_SHARED_LIBS -# It defaults to shared. - -# Make sure this is already defined as a cached variable (@sa tools/libraries.cmake) -if(NOT DEFINED BUILD_SHARED_LIBS) - option(BUILD_SHARED_LIBS "Build dynamically-linked binaries" ON) -endif() - -# Windows/cmake make things difficult if building dll's. -# By default: -# .dll -> CMAKE_RUNTIME_OUTPUT_DIRECTORY -# .exe -> CMAKE_RUNTIME_OUTPUT_DIRECTORY -# .lib -> CMAKE_LIBRARY_OUTPUT_DIRECTORY -# -# Subsequently, .dll's and .exe's use the same variable and by -# default must be installed to the same place. Which is not -# what we want for catkin. We wish: -# -# .dll -> CATKIN_GLOBAL_BIN_DESTINATION -# .exe -> CATKIN_PACKAGE_BIN_DESTINATION -# .lib -> CATKIN_PACKAGE_LIB_DESTINATION -# -# Since we can't put CMAKE_RUNTIME_OUTPUT_DIRECTORY to -# two values at once, we have this ugly workaround here. -# -# Note - we want to move away from redefining -# add_library style calls, but necessary until a better solution -# is available for windows. Alternatives are to set_target_properties -# on every lib (painful) or to make exe's public (name conflicts -# bound to arise). -# -# Another feature that would be desirable, is to install .pdb's for -# debugging along with the library. Can't do that here as we do not -# know for sure if the library target is intended for installation -# or not. Might a good idea to have a script that searches for all -# pdb's under CATKIN_DEVEL_PREFIX and copies them over at the end -# of the cmake build. -if(BUILD_SHARED_LIBS) - if(WIN32) - function(add_library library) - # Check if its an external, imported library (e.g. boost libs via cmake module definition) - list(FIND ARGN "IMPORTED" FIND_POS) - _add_library(${ARGV0} ${ARGN}) - if(${FIND_POS} EQUAL -1) - set_target_properties(${ARGV0} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_BIN_DESTINATION} - LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION} - ARCHIVE_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION} - ) - endif() - endfunction() - endif() -endif() diff --git a/cmake/catkin/python.cmake b/cmake/catkin/python.cmake deleted file mode 100644 index c82f31b479..0000000000 --- a/cmake/catkin/python.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# the CMake variable PYTHON_INSTALL_DIR has the same value as the Python function catkin.builder.get_python_install_dir() - -set(PYTHON_VERSION "" CACHE STRING "Specify specific Python version to use ('major.minor' or 'major')") -if(PYTHON_VERSION) - set(PythonInterp_FIND_VERSION "${PYTHON_VERSION}") -endif() - -find_package(PythonInterp REQUIRED) -#message(STATUS "Using PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") - -set(_PYTHON_PATH_VERSION_SUFFIX "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") - -set(enable_setuptools_deb_layout OFF) -if(EXISTS "/etc/debian_version") - set(enable_setuptools_deb_layout ON) -endif() -option(SETUPTOOLS_DEB_LAYOUT "Enable debian style python package layout" ${enable_setuptools_deb_layout}) - -if(SETUPTOOLS_DEB_LAYOUT) - #message(STATUS "Using Debian Python package layout") - set(PYTHON_PACKAGES_DIR dist-packages) - set(SETUPTOOLS_ARG_EXTRA "--install-layout=deb") - # use major version only when installing 3.x with debian layout - if("${PYTHON_VERSION_MAJOR}" STREQUAL "3") - set(_PYTHON_PATH_VERSION_SUFFIX "${PYTHON_VERSION_MAJOR}") - endif() -else() - #message(STATUS "Using default Python package layout") - set(PYTHON_PACKAGES_DIR site-packages) - # setuptools is fussy about windows paths, make sure the install prefix is in native format - file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" SETUPTOOLS_INSTALL_PREFIX) -endif() - -if(NOT WIN32) - set(PYTHON_INSTALL_DIR lib/python${_PYTHON_PATH_VERSION_SUFFIX}/${PYTHON_PACKAGES_DIR} - CACHE INTERNAL "This needs to be in PYTHONPATH when 'setup.py install' is called. And it needs to match. But setuptools won't tell us where it will install things.") -else() - # Windows setuptools installs to lib/site-packages not lib/python2.7/site-packages - set(PYTHON_INSTALL_DIR lib/${PYTHON_PACKAGES_DIR} - CACHE INTERNAL "This needs to be in PYTHONPATH when 'setup.py install' is called. And it needs to match. But setuptools won't tell us where it will install things.") -endif() diff --git a/cmake/catkin/safe_execute_process.cmake b/cmake/catkin/safe_execute_process.cmake deleted file mode 100644 index 3f6ea9aad4..0000000000 --- a/cmake/catkin/safe_execute_process.cmake +++ /dev/null @@ -1,13 +0,0 @@ -macro(safe_execute_process cmd_keyword arg1) - set(_cmd ${arg1}) - foreach(_arg ${ARGN}) - set(_cmd "${_cmd} \"${_arg}\"") - endforeach() - - debug_message(2 "execute_process(${_cmd})") - execute_process(${ARGV} RESULT_VARIABLE _res) - - if(NOT _res EQUAL 0) - message(FATAL_ERROR "execute_process(${_cmd}) returned error code ${_res}") - endif() -endmacro() diff --git a/cmake/catkin/shell.cmake b/cmake/catkin/shell.cmake deleted file mode 100644 index 4b150d419e..0000000000 --- a/cmake/catkin/shell.cmake +++ /dev/null @@ -1,17 +0,0 @@ -function(shell arg1) - set(cmd ${arg1}) - foreach(arg ${ARGN}) - set(cmd "${cmd} ${arg}") - endforeach() - - execute_process(COMMAND ${arg1} ${ARGN} - RESULT_VARIABLE res - OUTPUT_VARIABLE out - ERROR_VARIABLE out) - - if(res EQUAL 0) - debug_message(2 "execute_process(${cmd}) succeeded returning: ${out}") - else() - message(FATAL_ERROR "execute_process(${cmd})\n***FAILED with ERROR:***\n${out}") - endif() -endfunction() diff --git a/cmake/catkin/stamp.cmake b/cmake/catkin/stamp.cmake deleted file mode 100644 index 91de185de5..0000000000 --- a/cmake/catkin/stamp.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# -# :param path: file name -# -# Uses ``configure_file`` to generate a file ``filepath.stamp`` hidden -# somewhere in the build tree. This will cause cmake to rebuild its -# cache when ``filepath`` is modified. -# -function(stamp path) - get_filename_component(filename "${path}" NAME) - configure_file(${path} - ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/stamps/${PROJECT_NAME}/${filename}.stamp - COPYONLY) -endfunction() diff --git a/cmake/catkin/string_starts_with.cmake b/cmake/catkin/string_starts_with.cmake deleted file mode 100644 index 85483ec9e7..0000000000 --- a/cmake/catkin/string_starts_with.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# -# Check if a string starts with a prefix. -# -# :param str: the string -# :type str: string -# :param prefix: the prefix -# :type prefix: string -# :param var: the output variable name -# :type var: bool -# -function(string_starts_with str prefix var) - string(LENGTH "${str}" str_length) - string(LENGTH "${prefix}" prefix_length) - set(value FALSE) - if(NOT ${str_length} LESS ${prefix_length}) - string(SUBSTRING "${str}" 0 ${prefix_length} str_prefix) - if("${str_prefix}" STREQUAL "${prefix}") - set(value TRUE) - endif() - endif() - set(${var} ${value} PARENT_SCOPE) -endfunction() diff --git a/cmake/catkin/templates/Doxyfile.in b/cmake/catkin/templates/Doxyfile.in deleted file mode 100644 index f64c9bdff0..0000000000 --- a/cmake/catkin/templates/Doxyfile.in +++ /dev/null @@ -1,1630 +0,0 @@ -# Doxyfile 1.7.1 -# generated from catkin/cmake/template/Doxyfile.in -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = @PROJECT_NAME@ - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @PACKAGE_VERSION@ - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = api - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST = YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = @doc_sources@ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.hpp - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -# INPUT_FILTER = *.hpp - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -# FILTER_PATTERNS = *.py=/usr/bin/doxypy - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = YES - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -# INCLUDE_PATH = ../include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -# INCLUDE_FILE_PATTERNS = *.hpp - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/cmake/catkin/templates/__init__.py.in b/cmake/catkin/templates/__init__.py.in deleted file mode 100644 index 68f2f652ce..0000000000 --- a/cmake/catkin/templates/__init__.py.in +++ /dev/null @@ -1,37 +0,0 @@ -# generated from catkin/cmake/template/__init__.py.in -# keep symbol table as clean as possible by deleting all unnecessary symbols - -from os import path as os_path -from sys import path as sys_path - -from pkgutil import extend_path - -__extended_path = "@PACKAGE_PYTHONPATH@".split(";") -for p in reversed(__extended_path): - sys_path.insert(0, p) - del p -del sys_path - -__path__ = extend_path(__path__, __name__) -del extend_path - -__execfiles = [] -for p in __extended_path: - src_init_file = os_path.join(p, __name__ + '.py') - if os_path.isfile(src_init_file): - __execfiles.append(src_init_file) - else: - src_init_file = os_path.join(p, __name__, '__init__.py') - if os_path.isfile(src_init_file): - __execfiles.append(src_init_file) - del src_init_file - del p -del os_path -del __extended_path - -for __execfile in __execfiles: - with open(__execfile, 'r') as __fh: - exec(__fh.read()) - del __fh - del __execfile -del __execfiles diff --git a/cmake/catkin/templates/_setup_util.py.in b/cmake/catkin/templates/_setup_util.py.in deleted file mode 100755 index 46c8628052..0000000000 --- a/cmake/catkin/templates/_setup_util.py.in +++ /dev/null @@ -1,287 +0,0 @@ -#!@PYTHON_EXECUTABLE@ - -# Software License Agreement (BSD License) -# -# Copyright (c) 2012, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -'''This file generates shell code for the setup.SHELL scripts to set environment variables''' - -from __future__ import print_function -import argparse -import copy -import errno -import os -import platform -import sys - -CATKIN_MARKER_FILE = '.catkin' - -system = platform.system() -IS_DARWIN = (system == 'Darwin') -IS_WINDOWS = (system == 'Windows') - -# subfolder of workspace prepended to CMAKE_PREFIX_PATH -ENV_VAR_SUBFOLDERS = { - 'CMAKE_PREFIX_PATH': '', - 'CPATH': 'include', - 'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': @CATKIN_LIB_ENVIRONMENT_PATHS@, - 'PATH': '@CATKIN_GLOBAL_BIN_DESTINATION@', - 'PKG_CONFIG_PATH': @CATKIN_PKGCONFIG_ENVIRONMENT_PATHS@, - 'PYTHONPATH': '@PYTHON_INSTALL_DIR@', -} - - -def rollback_env_variables(environ, env_var_subfolders): - ''' - Generate shell code to reset environment variables - by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH. - This does not cover modifications performed by environment hooks. - ''' - lines = [] - unmodified_environ = copy.copy(environ) - for key in sorted(env_var_subfolders.keys()): - subfolders = env_var_subfolders[key] - if not isinstance(subfolders, list): - subfolders = [subfolders] - for subfolder in subfolders: - value = _rollback_env_variable(unmodified_environ, key, subfolder) - if value is not None: - environ[key] = value - lines.append(assignment(key, value)) - if lines: - lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH')) - return lines - - -def _rollback_env_variable(environ, name, subfolder): - ''' - For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder. - - :param subfolder: str '' or subfoldername that may start with '/' - :returns: the updated value of the environment variable. - ''' - value = environ[name] if name in environ else '' - env_paths = [path for path in value.split(os.pathsep) if path] - value_modified = False - if subfolder: - if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)): - subfolder = subfolder[1:] - if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)): - subfolder = subfolder[:-1] - for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True): - path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path - path_to_remove = None - for env_path in env_paths: - env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path - if env_path_clean == path_to_find: - path_to_remove = env_path - break - if path_to_remove: - env_paths.remove(path_to_remove) - value_modified = True - new_value = os.pathsep.join(env_paths) - return new_value if value_modified else None - - -def _get_workspaces(environ, include_fuerte=False, include_non_existing=False): - ''' - Based on CMAKE_PREFIX_PATH return all catkin workspaces. - - :param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool`` - ''' - # get all cmake prefix paths - env_name = 'CMAKE_PREFIX_PATH' - value = environ[env_name] if env_name in environ else '' - paths = [path for path in value.split(os.pathsep) if path] - # remove non-workspace paths - workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte')) or (include_non_existing and not os.path.exists(path))] - return workspaces - - -def prepend_env_variables(environ, env_var_subfolders, workspaces): - ''' - Generate shell code to prepend environment variables - for the all workspaces. - ''' - lines = [] - lines.append(comment('prepend folders of workspaces to environment variables')) - - paths = [path for path in workspaces.split(os.pathsep) if path] - - prefix = _prefix_env_variable(environ, 'CMAKE_PREFIX_PATH', paths, '') - lines.append(prepend(environ, 'CMAKE_PREFIX_PATH', prefix)) - - for key in sorted([key for key in env_var_subfolders.keys() if key != 'CMAKE_PREFIX_PATH']): - subfolder = env_var_subfolders[key] - prefix = _prefix_env_variable(environ, key, paths, subfolder) - lines.append(prepend(environ, key, prefix)) - return lines - - -def _prefix_env_variable(environ, name, paths, subfolders): - ''' - Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items. - ''' - value = environ[name] if name in environ else '' - environ_paths = [path for path in value.split(os.pathsep) if path] - checked_paths = [] - for path in paths: - if not isinstance(subfolders, list): - subfolders = [subfolders] - for subfolder in subfolders: - path_tmp = path - if subfolder: - path_tmp = os.path.join(path_tmp, subfolder) - # exclude any path already in env and any path we already added - if path_tmp not in environ_paths and path_tmp not in checked_paths: - checked_paths.append(path_tmp) - prefix_str = os.pathsep.join(checked_paths) - if prefix_str != '' and environ_paths: - prefix_str += os.pathsep - return prefix_str - - -def assignment(key, value): - if not IS_WINDOWS: - return 'export %s="%s"' % (key, value) - else: - return 'set %s=%s' % (key, value) - - -def comment(msg): - if not IS_WINDOWS: - return '# %s' % msg - else: - return 'REM %s' % msg - - -def prepend(environ, key, prefix): - if key not in environ or not environ[key]: - return assignment(key, prefix) - if not IS_WINDOWS: - return 'export %s="%s$%s"' % (key, prefix, key) - else: - return 'set %s=%s%%%s%%' % (key, prefix, key) - - -def find_env_hooks(environ, cmake_prefix_path): - ''' - Generate shell code with found environment hooks - for the all workspaces. - ''' - lines = [] - lines.append(comment('found environment hooks in workspaces')) - - generic_env_hooks = [] - generic_env_hooks_workspace = [] - specific_env_hooks = [] - specific_env_hooks_workspace = [] - generic_env_hooks_by_filename = {} - specific_env_hooks_by_filename = {} - generic_env_hook_ext = 'bat' if IS_WINDOWS else 'sh' - specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None - # remove non-workspace paths - workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))] - for workspace in reversed(workspaces): - env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d') - if os.path.isdir(env_hook_dir): - for filename in sorted(os.listdir(env_hook_dir)): - if filename.endswith('.%s' % generic_env_hook_ext): - # remove previous env hook with same name if present - if filename in generic_env_hooks_by_filename: - i = generic_env_hooks.index(generic_env_hooks_by_filename[filename]) - generic_env_hooks.pop(i) - generic_env_hooks_workspace.pop(i) - # append env hook - generic_env_hooks.append(os.path.join(env_hook_dir, filename)) - generic_env_hooks_workspace.append(workspace) - generic_env_hooks_by_filename[filename] = generic_env_hooks[-1] - elif specific_env_hook_ext is not None and filename.endswith('.%s' % specific_env_hook_ext): - # remove previous env hook with same name if present - if filename in specific_env_hooks_by_filename: - i = specific_env_hooks.index(specific_env_hooks_by_filename[filename]) - specific_env_hooks.pop(i) - specific_env_hooks_workspace.pop(i) - # append env hook - specific_env_hooks.append(os.path.join(env_hook_dir, filename)) - specific_env_hooks_workspace.append(workspace) - specific_env_hooks_by_filename[filename] = specific_env_hooks[-1] - env_hooks = generic_env_hooks + specific_env_hooks - env_hooks_workspace = generic_env_hooks_workspace + specific_env_hooks_workspace - count = len(env_hooks) - lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_COUNT', count)) - for i in range(count): - lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d' % i, env_hooks[i])) - lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, env_hooks_workspace[i])) - return lines - - -def _parse_arguments(args=None): - parser = argparse.ArgumentParser(description='Generates code blocks for the setup.SHELL script.') - parser.add_argument('--extend', action='store_true', help='Skip unsetting previous environment variables to extend context') - return parser.parse_known_args(args=args)[0] - - -if __name__ == '__main__': - try: - try: - args = _parse_arguments() - except Exception as e: - print(e, file=sys.stderr) - sys.exit(1) - - # environment at generation time - CMAKE_PREFIX_PATH = '@CMAKE_PREFIX_PATH_AS_IS@'.split(';') - # prepend current workspace if not already part of CPP - base_path = os.path.dirname(__file__) - if base_path not in CMAKE_PREFIX_PATH: - CMAKE_PREFIX_PATH.insert(0, base_path) - CMAKE_PREFIX_PATH = os.pathsep.join(CMAKE_PREFIX_PATH) - - environ = dict(os.environ) - lines = [] - if not args.extend: - lines += rollback_env_variables(environ, ENV_VAR_SUBFOLDERS) - lines += prepend_env_variables(environ, ENV_VAR_SUBFOLDERS, CMAKE_PREFIX_PATH) - lines += find_env_hooks(environ, CMAKE_PREFIX_PATH) - print('\n'.join(lines)) - - # need to explicitly flush the output - sys.stdout.flush() - except IOError as e: - # and catch potantial "broken pipe" if stdout is not writable - # which can happen when piping the output to a file but the disk is full - if e.errno == errno.EPIPE: - print(e, file=sys.stderr) - sys.exit(2) - raise - - sys.exit(0) diff --git a/cmake/catkin/templates/cfg-extras.context.py.in b/cmake/catkin/templates/cfg-extras.context.py.in deleted file mode 100644 index 256bb69bd6..0000000000 --- a/cmake/catkin/templates/cfg-extras.context.py.in +++ /dev/null @@ -1,33 +0,0 @@ -# generated from catkin/cmake/template/cfg-extras.context.py.in -DEVELSPACE = '@DEVELSPACE@' == 'TRUE' -INSTALLSPACE = '@INSTALLSPACE@' == 'TRUE' - -CATKIN_DEVEL_PREFIX = '@CATKIN_DEVEL_PREFIX@' - -CATKIN_GLOBAL_BIN_DESTINATION = '@CATKIN_GLOBAL_BIN_DESTINATION@' -CATKIN_GLOBAL_ETC_DESTINATION = '@CATKIN_GLOBAL_ETC_DESTINATION@' -CATKIN_GLOBAL_INCLUDE_DESTINATION = '@CATKIN_GLOBAL_INCLUDE_DESTINATION@' -CATKIN_GLOBAL_LIB_DESTINATION = '@CATKIN_GLOBAL_LIB_DESTINATION@' -CATKIN_GLOBAL_LIBEXEC_DESTINATION = '@CATKIN_GLOBAL_LIBEXEC_DESTINATION@' -CATKIN_GLOBAL_PYTHON_DESTINATION = '@CATKIN_GLOBAL_PYTHON_DESTINATION@' -CATKIN_GLOBAL_SHARE_DESTINATION = '@CATKIN_GLOBAL_SHARE_DESTINATION@' - -CATKIN_PACKAGE_BIN_DESTINATION = '@CATKIN_PACKAGE_BIN_DESTINATION@' -CATKIN_PACKAGE_ETC_DESTINATION = '@CATKIN_PACKAGE_ETC_DESTINATION@' -CATKIN_PACKAGE_INCLUDE_DESTINATION = '@CATKIN_PACKAGE_INCLUDE_DESTINATION@' -CATKIN_PACKAGE_LIB_DESTINATION = '@CATKIN_PACKAGE_LIB_DESTINATION@' -CATKIN_PACKAGE_LIBEXEC_DESTINATION = '@CATKIN_PACKAGE_LIBEXEC_DESTINATION@' -CATKIN_PACKAGE_PYTHON_DESTINATION = '@CATKIN_PACKAGE_PYTHON_DESTINATION@' -CATKIN_PACKAGE_SHARE_DESTINATION = '@CATKIN_PACKAGE_SHARE_DESTINATION@' - -CMAKE_BINARY_DIR = '@CMAKE_BINARY_DIR@' -CMAKE_CURRENT_BINARY_DIR = '@CMAKE_CURRENT_BINARY_DIR@' -CMAKE_CURRENT_SOURCE_DIR = '@CMAKE_CURRENT_SOURCE_DIR@' -CMAKE_INSTALL_PREFIX = '@CMAKE_INSTALL_PREFIX@' -CMAKE_SOURCE_DIR = '@CMAKE_SOURCE_DIR@' - -PKG_CMAKE_DIR = '@PKG_CMAKE_DIR@' - -PROJECT_NAME = '@PROJECT_NAME@' -PROJECT_BINARY_DIR = '@PROJECT_BINARY_DIR@' -PROJECT_SOURCE_DIR = '@PROJECT_SOURCE_DIR@' diff --git a/cmake/catkin/templates/env-hook.context.py.in b/cmake/catkin/templates/env-hook.context.py.in deleted file mode 100644 index 57cb22de6f..0000000000 --- a/cmake/catkin/templates/env-hook.context.py.in +++ /dev/null @@ -1,33 +0,0 @@ -# generated from catkin/cmake/template/env-hook.context.py.in -DEVELSPACE = @DEVELSPACE@ -INSTALLSPACE = @INSTALLSPACE@ - -CATKIN_DEVEL_PREFIX = '@CATKIN_DEVEL_PREFIX@' - -CATKIN_GLOBAL_BIN_DESTINATION = '@CATKIN_GLOBAL_BIN_DESTINATION@' -CATKIN_GLOBAL_ETC_DESTINATION = '@CATKIN_GLOBAL_ETC_DESTINATION@' -CATKIN_GLOBAL_INCLUDE_DESTINATION = '@CATKIN_GLOBAL_INCLUDE_DESTINATION@' -CATKIN_GLOBAL_LIB_DESTINATION = '@CATKIN_GLOBAL_LIB_DESTINATION@' -CATKIN_GLOBAL_LIBEXEC_DESTINATION = '@CATKIN_GLOBAL_LIBEXEC_DESTINATION@' -CATKIN_GLOBAL_PYTHON_DESTINATION = '@CATKIN_GLOBAL_PYTHON_DESTINATION@' -CATKIN_GLOBAL_SHARE_DESTINATION = '@CATKIN_GLOBAL_SHARE_DESTINATION@' - -CATKIN_PACKAGE_BIN_DESTINATION = '@CATKIN_PACKAGE_BIN_DESTINATION@' -CATKIN_PACKAGE_ETC_DESTINATION = '@CATKIN_PACKAGE_ETC_DESTINATION@' -CATKIN_PACKAGE_INCLUDE_DESTINATION = '@CATKIN_PACKAGE_INCLUDE_DESTINATION@' -CATKIN_PACKAGE_LIB_DESTINATION = '@CATKIN_PACKAGE_LIB_DESTINATION@' -CATKIN_PACKAGE_LIBEXEC_DESTINATION = '@CATKIN_PACKAGE_LIBEXEC_DESTINATION@' -CATKIN_PACKAGE_PYTHON_DESTINATION = '@CATKIN_PACKAGE_PYTHON_DESTINATION@' -CATKIN_PACKAGE_SHARE_DESTINATION = '@CATKIN_PACKAGE_SHARE_DESTINATION@' - -CMAKE_BINARY_DIR = '@CMAKE_BINARY_DIR@' -CMAKE_CURRENT_BINARY_DIR = '@CMAKE_CURRENT_BINARY_DIR@' -CMAKE_CURRENT_SOURCE_DIR = '@CMAKE_CURRENT_SOURCE_DIR@' -CMAKE_INSTALL_PREFIX = '@CMAKE_INSTALL_PREFIX@' -CMAKE_SOURCE_DIR = '@CMAKE_SOURCE_DIR@' - -PROJECT_NAME = '@PROJECT_NAME@' -PROJECT_BINARY_DIR = '@PROJECT_BINARY_DIR@' -PROJECT_SOURCE_DIR = '@PROJECT_SOURCE_DIR@' - -PYTHON_EXECUTABLE = '@PYTHON_EXECUTABLE@' diff --git a/cmake/catkin/templates/env.bat.in b/cmake/catkin/templates/env.bat.in deleted file mode 100644 index 55d882ec14..0000000000 --- a/cmake/catkin/templates/env.bat.in +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -REM generated from catkin/cmake/templates/env.bat.in - -if "%1"=="" ( - echo "Usage: env.bat COMMANDS" - echo "Calling env.bat without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually." - exit 1 -) else ( - call "@SETUP_DIR@/@SETUP_FILENAME@.bat" - %* -) diff --git a/cmake/catkin/templates/env.sh.in b/cmake/catkin/templates/env.sh.in deleted file mode 100755 index 4ffb7dd4b3..0000000000 --- a/cmake/catkin/templates/env.sh.in +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env sh -# generated from catkin/cmake/templates/env.sh.in - -if [ $# -eq 0 ] ; then - /bin/echo "Usage: env.sh COMMANDS" - /bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually." - exit 1 -fi - -# ensure to not use different shell type which was set before -CATKIN_SHELL=sh - -# source @SETUP_FILENAME@.sh from same directory as this file -_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd) -. "$_CATKIN_SETUP_DIR/@SETUP_FILENAME@.sh" -exec "$@" diff --git a/cmake/catkin/templates/generate_cached_setup.py.in b/cmake/catkin/templates/generate_cached_setup.py.in deleted file mode 100644 index c2848e04c5..0000000000 --- a/cmake/catkin/templates/generate_cached_setup.py.in +++ /dev/null @@ -1,29 +0,0 @@ -from __future__ import print_function -import argparse -import os -import stat -import sys - -# find the import for catkin's python package - either from source space or from an installed underlay -if os.path.exists(os.path.join('@catkin_EXTRAS_DIR@', 'catkinConfig.cmake.in')): - sys.path.insert(0, os.path.join('@catkin_EXTRAS_DIR@', '..', 'python')) -try: - from catkin.environment_cache import generate_environment_script -except ImportError: - # search for catkin package in all workspaces and prepend to path - for workspace in "@CATKIN_WORKSPACES@".split(';'): - python_path = os.path.join(workspace, '@CATKIN_GLOBAL_PYTHON_DESTINATION@') - if os.path.isdir(os.path.join(python_path, 'catkin')): - sys.path.insert(0, python_path) - break - from catkin.environment_cache import generate_environment_script - -code = generate_environment_script('@CATKIN_DEVEL_PREFIX@/env.@script_ext@') - -output_filename = '@SETUP_DIR@/@SETUP_FILENAME@.@script_ext@' -with open(output_filename, 'w') as f: - #print('Generate script for cached setup "%s"' % output_filename) - f.write('\n'.join(code)) - -mode = os.stat(output_filename).st_mode -os.chmod(output_filename, mode | stat.S_IXUSR) diff --git a/cmake/catkin/templates/order_packages.context.py.in b/cmake/catkin/templates/order_packages.context.py.in deleted file mode 100644 index 3609c0b300..0000000000 --- a/cmake/catkin/templates/order_packages.context.py.in +++ /dev/null @@ -1,5 +0,0 @@ -# generated from catkin/cmake/template/order_packages.context.py.in -source_root_dir = "@CMAKE_CURRENT_SOURCE_DIR@" -whitelisted_packages = "@CATKIN_WHITELIST_PACKAGES@".split(';') if "@CATKIN_WHITELIST_PACKAGES@" != "" else [] -blacklisted_packages = "@CATKIN_BLACKLIST_PACKAGES@".split(';') if "@CATKIN_BLACKLIST_PACKAGES@" != "" else [] -underlay_workspaces = "@CATKIN_WORKSPACES@".split(';') if "@CATKIN_WORKSPACES@" != "" else [] diff --git a/cmake/catkin/templates/pkg.context.pc.in b/cmake/catkin/templates/pkg.context.pc.in deleted file mode 100644 index 8e9cd6bc12..0000000000 --- a/cmake/catkin/templates/pkg.context.pc.in +++ /dev/null @@ -1,8 +0,0 @@ -# generated from catkin/cmake/template/pkg.context.pc.in -CATKIN_PACKAGE_PREFIX = "@CATKIN_PACKAGE_PREFIX@" -PROJECT_PKG_CONFIG_INCLUDE_DIRS = "@PROJECT_PKG_CONFIG_INCLUDE_DIRS@".split(';') if "@PROJECT_PKG_CONFIG_INCLUDE_DIRS@" != "" else [] -PROJECT_CATKIN_DEPENDS = "@_PROJECT_CATKIN_DEPENDS@".replace(';', ' ') -PKG_CONFIG_LIBRARIES_WITH_PREFIX = "@PKG_CONFIG_LIBRARIES_WITH_PREFIX@".split(';') if "@PKG_CONFIG_LIBRARIES_WITH_PREFIX@" != "" else [] -PROJECT_NAME = "@PROJECT_NAME@" -PROJECT_SPACE_DIR = "@PROJECT_SPACE_DIR@" -PROJECT_VERSION = "@PROJECT_VERSION@" diff --git a/cmake/catkin/templates/pkgConfig-version.cmake.in b/cmake/catkin/templates/pkgConfig-version.cmake.in deleted file mode 100644 index f29cb36d47..0000000000 --- a/cmake/catkin/templates/pkgConfig-version.cmake.in +++ /dev/null @@ -1,14 +0,0 @@ -# generated from catkin/cmake/template/pkgConfig-version.cmake.in -set(PACKAGE_VERSION "@PROJECT_VERSION@") - -set(PACKAGE_VERSION_EXACT False) -set(PACKAGE_VERSION_COMPATIBLE False) - -if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_EXACT True) - set(PACKAGE_VERSION_COMPATIBLE True) -endif() - -if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_COMPATIBLE True) -endif() diff --git a/cmake/catkin/templates/pkgConfig.cmake.in b/cmake/catkin/templates/pkgConfig.cmake.in deleted file mode 100644 index 91f6d65354..0000000000 --- a/cmake/catkin/templates/pkgConfig.cmake.in +++ /dev/null @@ -1,191 +0,0 @@ -# generated from catkin/cmake/template/pkgConfig.cmake.in - -# append elements to a list and remove existing duplicates from the list -# copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig -# self contained -macro(_list_append_deduplicate listname) - if(NOT "${ARGN}" STREQUAL "") - if(${listname}) - list(REMOVE_ITEM ${listname} ${ARGN}) - endif() - list(APPEND ${listname} ${ARGN}) - endif() -endmacro() - -# append elements to a list if they are not already in the list -# copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig -# self contained -macro(_list_append_unique listname) - foreach(_item ${ARGN}) - list(FIND ${listname} ${_item} _index) - if(_index EQUAL -1) - list(APPEND ${listname} ${_item}) - endif() - endforeach() -endmacro() - -# pack a list of libraries with optional build configuration keywords -# copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig -# self contained -macro(_pack_libraries_with_build_configuration VAR) - set(${VAR} "") - set(_argn ${ARGN}) - list(LENGTH _argn _count) - set(_index 0) - while(${_index} LESS ${_count}) - list(GET _argn ${_index} lib) - if("${lib}" MATCHES "^debug|optimized|general$") - math(EXPR _index "${_index} + 1") - if(${_index} EQUAL ${_count}) - message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") - endif() - list(GET _argn ${_index} library) - list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") - else() - list(APPEND ${VAR} "${lib}") - endif() - math(EXPR _index "${_index} + 1") - endwhile() -endmacro() - -# unpack a list of libraries with optional build configuration keyword prefixes -# copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig -# self contained -macro(_unpack_libraries_with_build_configuration VAR) - set(${VAR} "") - foreach(lib ${ARGN}) - string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") - list(APPEND ${VAR} "${lib}") - endforeach() -endmacro() - - -if(@PROJECT_NAME@_CONFIG_INCLUDED) - return() -endif() -set(@PROJECT_NAME@_CONFIG_INCLUDED TRUE) - -# set variables for source/devel/install prefixes -if("@DEVELSPACE@" STREQUAL "TRUE") - set(@PROJECT_NAME@_SOURCE_PREFIX @CMAKE_CURRENT_SOURCE_DIR@) - set(@PROJECT_NAME@_DEVEL_PREFIX @CATKIN_DEVEL_PREFIX@) - set(@PROJECT_NAME@_INSTALL_PREFIX "") - set(@PROJECT_NAME@_PREFIX ${@PROJECT_NAME@_DEVEL_PREFIX}) -else() - set(@PROJECT_NAME@_SOURCE_PREFIX "") - set(@PROJECT_NAME@_DEVEL_PREFIX "") - set(@PROJECT_NAME@_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@) - set(@PROJECT_NAME@_PREFIX ${@PROJECT_NAME@_INSTALL_PREFIX}) -endif() - -# warn when using a deprecated package -if(NOT "@PROJECT_DEPRECATED@" STREQUAL "") - set(_msg "WARNING: package '@PROJECT_NAME@' is deprecated") - # append custom deprecation text if available - if(NOT "@PROJECT_DEPRECATED@" STREQUAL "TRUE") - set(_msg "${_msg} (@PROJECT_DEPRECATED@)") - endif() - message("${_msg}") -endif() - -# flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project -set(@PROJECT_NAME@_FOUND_CATKIN_PROJECT TRUE) - -if(NOT "@PROJECT_CMAKE_CONFIG_INCLUDE_DIRS@" STREQUAL "") - set(@PROJECT_NAME@_INCLUDE_DIRS "") - set(_include_dirs "@PROJECT_CMAKE_CONFIG_INCLUDE_DIRS@") - foreach(idir ${_include_dirs}) - if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) - set(include ${idir}) - elseif("${idir}" STREQUAL "@CATKIN_GLOBAL_INCLUDE_DESTINATION@") - get_filename_component(include "${@PROJECT_NAME@_DIR}/../../../@CATKIN_GLOBAL_INCLUDE_DESTINATION@" ABSOLUTE) - if(NOT IS_DIRECTORY ${include}) - message(FATAL_ERROR "Project '@PROJECT_NAME@' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer '@PROJECT_MAINTAINER@' to fix it.") - endif() - else() - message(FATAL_ERROR "Project '@PROJECT_NAME@' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '@PKG_INCLUDE_PREFIX@/${idir}'. Ask the maintainer '@PROJECT_MAINTAINER@' to fix it.") - endif() - _list_append_unique(@PROJECT_NAME@_INCLUDE_DIRS ${include}) - endforeach() -endif() - -set(libraries "@PKG_CONFIG_LIBRARIES@") -foreach(library ${libraries}) - # keep build configuration keywords, target names and absolute libraries as-is - if("${library}" MATCHES "^debug|optimized|general$") - list(APPEND @PROJECT_NAME@_LIBRARIES ${library}) - elseif(TARGET ${library}) - list(APPEND @PROJECT_NAME@_LIBRARIES ${library}) - elseif(IS_ABSOLUTE ${library}) - list(APPEND @PROJECT_NAME@_LIBRARIES ${library}) - else() - set(lib_path "") - set(lib "${library}-NOTFOUND") - # since the path where the library is found is returned we have to iterate over the paths manually - foreach(path @PKG_CONFIG_LIB_PATHS@) - find_library(lib ${library} - PATHS ${path} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - if(lib) - set(lib_path ${path}) - break() - endif() - endforeach() - if(lib) - _list_append_unique(@PROJECT_NAME@_LIBRARY_DIRS ${lib_path}) - list(APPEND @PROJECT_NAME@_LIBRARIES ${lib}) - else() - # as a fall back for non-catkin libraries try to search globally - find_library(lib ${library}) - if(NOT lib) - message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project '@PROJECT_NAME@'? Did you find_package() it before the subdirectory containing its code is included?") - endif() - list(APPEND @PROJECT_NAME@_LIBRARIES ${lib}) - endif() - endif() -endforeach() - -set(@PROJECT_NAME@_EXPORTED_TARGETS "@PKG_EXPORTED_TARGETS@") -# create dummy targets for exported code generation targets to make life of users easier -foreach(t ${@PROJECT_NAME@_EXPORTED_TARGETS}) - if(NOT TARGET ${t}) - add_custom_target(${t}) - endif() -endforeach() - -set(depends "@PROJECT_DEPENDENCIES@") -foreach(depend ${depends}) - string(REPLACE " " ";" depend_list ${depend}) - # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls - list(GET depend_list 0 @PROJECT_NAME@_dep) - list(LENGTH depend_list count) - if(${count} EQUAL 1) - # simple dependencies must only be find_package()-ed once - if(NOT ${@PROJECT_NAME@_dep}_FOUND) - find_package(${@PROJECT_NAME@_dep} REQUIRED) - endif() - else() - # dependencies with components must be find_package()-ed again - list(REMOVE_AT depend_list 0) - find_package(${@PROJECT_NAME@_dep} REQUIRED ${depend_list}) - endif() - _list_append_unique(@PROJECT_NAME@_INCLUDE_DIRS ${${@PROJECT_NAME@_dep}_INCLUDE_DIRS}) - - # merge build configuration keywords with library names to correctly deduplicate - _pack_libraries_with_build_configuration(@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_LIBRARIES}) - _pack_libraries_with_build_configuration(_libraries ${${@PROJECT_NAME@_dep}_LIBRARIES}) - _list_append_deduplicate(@PROJECT_NAME@_LIBRARIES ${_libraries}) - # undo build configuration keyword merging after deduplication - _unpack_libraries_with_build_configuration(@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_LIBRARIES}) - - _list_append_unique(@PROJECT_NAME@_LIBRARY_DIRS ${${@PROJECT_NAME@_dep}_LIBRARY_DIRS}) - list(APPEND @PROJECT_NAME@_EXPORTED_TARGETS ${${@PROJECT_NAME@_dep}_EXPORTED_TARGETS}) -endforeach() - -set(pkg_cfg_extras "@PKG_CFG_EXTRAS@") -foreach(extra ${pkg_cfg_extras}) - if(NOT IS_ABSOLUTE ${extra}) - set(extra ${@PROJECT_NAME@_DIR}/${extra}) - endif() - include(${extra}) -endforeach() diff --git a/cmake/catkin/templates/python_distutils_install.bat.in b/cmake/catkin/templates/python_distutils_install.bat.in deleted file mode 100644 index fd9906a687..0000000000 --- a/cmake/catkin/templates/python_distutils_install.bat.in +++ /dev/null @@ -1,17 +0,0 @@ -@echo off - -if DEFINED DESTDIR ( - echo "Destdir.............%DESTDIR%" - set DESTDIR_ARG="--root=%DESTDIR%" -) - -cd "@INSTALL_CMD_WORKING_DIRECTORY@" - -cmd /V:on /C set PYTHONPATH="@CMAKE_INSTALL_PREFIX@/@PYTHON_INSTALL_DIR@;@CMAKE_BINARY_DIR@/@PYTHON_INSTALL_DIR@" ^ - && set CATKIN_BINARY_DIR="@CMAKE_BINARY_DIR@" ^ - && "@PYTHON_EXECUTABLE@" ^ - "@CMAKE_CURRENT_SOURCE_DIR@/setup.py" ^ - build --build-base "@CMAKE_CURRENT_BINARY_DIR@" ^ - install %DESTDIR_ARG% @SETUPTOOLS_ARG_EXTRA@ ^ - --prefix="@SETUPTOOLS_INSTALL_PREFIX@" ^ - --install-scripts="@SETUPTOOLS_INSTALL_PREFIX@\@CATKIN_GLOBAL_BIN_DESTINATION@" diff --git a/cmake/catkin/templates/python_distutils_install.sh.in b/cmake/catkin/templates/python_distutils_install.sh.in deleted file mode 100755 index e7b56c72d0..0000000000 --- a/cmake/catkin/templates/python_distutils_install.sh.in +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -x - -if [ -n "$DESTDIR" ] ; then - case $DESTDIR in - /*) # ok - ;; - *) - /bin/echo "DESTDIR argument must be absolute... " - /bin/echo "otherwise python's distutils will bork things." - exit 1 - esac - DESTDIR_ARG="--root=$DESTDIR" -fi - -cd "@INSTALL_CMD_WORKING_DIRECTORY@" - -# Note that PYTHONPATH is pulled from the environment to support installing -# into one location when some dependencies were installed in another -# location, #123. -/usr/bin/env \ - PYTHONPATH="@CMAKE_INSTALL_PREFIX@/@PYTHON_INSTALL_DIR@:@CMAKE_BINARY_DIR@/@PYTHON_INSTALL_DIR@:$PYTHONPATH" \ - CATKIN_BINARY_DIR="@CMAKE_BINARY_DIR@" \ - "@PYTHON_EXECUTABLE@" \ - "@CMAKE_CURRENT_SOURCE_DIR@/setup.py" \ - build --build-base "@CMAKE_CURRENT_BINARY_DIR@" \ - install \ - $DESTDIR_ARG \ - @SETUPTOOLS_ARG_EXTRA@ --prefix="@CMAKE_INSTALL_PREFIX@" --install-scripts="@CMAKE_INSTALL_PREFIX@/@CATKIN_GLOBAL_BIN_DESTINATION@" diff --git a/cmake/catkin/templates/relay.py.in b/cmake/catkin/templates/relay.py.in deleted file mode 100644 index 5221f48dc7..0000000000 --- a/cmake/catkin/templates/relay.py.in +++ /dev/null @@ -1,4 +0,0 @@ -# creates a relay to a python script source file, acting as that file. -# The purpose is that of a symlink -with open("@PYTHON_SCRIPT@", 'r') as fh: - exec(fh.read()) diff --git a/cmake/catkin/templates/rosinstall.in b/cmake/catkin/templates/rosinstall.in deleted file mode 100644 index 17f78a2981..0000000000 --- a/cmake/catkin/templates/rosinstall.in +++ /dev/null @@ -1,2 +0,0 @@ -- setup-file: - local-name: @SETUP_DIR@/setup.sh diff --git a/cmake/catkin/templates/safe_execute_install.cmake.in b/cmake/catkin/templates/safe_execute_install.cmake.in deleted file mode 100644 index 643c6eb4c9..0000000000 --- a/cmake/catkin/templates/safe_execute_install.cmake.in +++ /dev/null @@ -1,5 +0,0 @@ -execute_process(COMMAND "@INSTALL_SCRIPT@" RESULT_VARIABLE res) - -if(NOT res EQUAL 0) - message(FATAL_ERROR "execute_process(@INSTALL_SCRIPT@) returned error code ${res}") -endif() diff --git a/cmake/catkin/templates/script.bash.in b/cmake/catkin/templates/script.bash.in deleted file mode 100755 index ab172b97b8..0000000000 --- a/cmake/catkin/templates/script.bash.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -# generated from catkin/cmake/templates/script.bash.in - -"@BASH_SCRIPT@" "$@" diff --git a/cmake/catkin/templates/script.in b/cmake/catkin/templates/script.in deleted file mode 100755 index 6c1be8d232..0000000000 --- a/cmake/catkin/templates/script.in +++ /dev/null @@ -1 +0,0 @@ -@SCRIPT@ diff --git a/cmake/catkin/templates/script.py.in b/cmake/catkin/templates/script.py.in deleted file mode 100755 index dc3a277371..0000000000 --- a/cmake/catkin/templates/script.py.in +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python -# creates a relay to a python script source file, acting as that file. -# The purpose is that of a symlink -with open("@PYTHON_SCRIPT@", 'r') as fh: - exec(fh.read()) diff --git a/cmake/catkin/templates/script.sh.in b/cmake/catkin/templates/script.sh.in deleted file mode 100755 index 54e4e7a0a6..0000000000 --- a/cmake/catkin/templates/script.sh.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -# generated from catkin/cmake/templates/script.sh.in - -"@EXECUTABLE@" "$@" diff --git a/cmake/catkin/templates/setup.bash.in b/cmake/catkin/templates/setup.bash.in deleted file mode 100644 index ff47af8f30..0000000000 --- a/cmake/catkin/templates/setup.bash.in +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# generated from catkin/cmake/templates/setup.bash.in - -CATKIN_SHELL=bash - -# source setup.sh from same directory as this file -_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd) -. "$_CATKIN_SETUP_DIR/setup.sh" diff --git a/cmake/catkin/templates/setup.bat.in b/cmake/catkin/templates/setup.bat.in deleted file mode 100644 index 1549181597..0000000000 --- a/cmake/catkin/templates/setup.bat.in +++ /dev/null @@ -1,59 +0,0 @@ -@echo off -REM generated from catkin/cmake/template/setup.bat.in - -REM Sets various environment variables and sources additional environment hooks. -REM It tries it's best to undo changes from a previously sourced setup file before. -REM Supported command line options: -REM --extend: skips the undoing of changes from a previously sourced setup file - -set _SETUP_UTIL="@SETUP_DIR@/_setup_util.py" - -if NOT EXIST "%_SETUP_UTIL%" ( - echo "Missing Python script: %_SETUP_UTIL%" - exit 22 -) - -REM set the Python executable -set _PYTHON="@PYTHON_EXECUTABLE@" - -REM generate pseudo random temporary filename -:GenerateTempFilename -REM replace leading space of time with zero -set _SETUP_TMP=%Time: =0% -REM remove time delimiters -set _SETUP_TMP=%_SETUP_TMP::=% -set _SETUP_TMP=%_SETUP_TMP:.=% -set _SETUP_TMP=%_SETUP_TMP:,=% -set _SETUP_TMP=%Temp%\setup.%_SETUP_TMP%.bat -if EXIST %_SETUP_TMP% do goto GenerateTempFilename -type NUL > "%_SETUP_TMP%" -if NOT EXIST %_SETUP_TMP% ( - echo "Could not create temporary file: %_SETUP_TMP%" - exit 1 -) - -REM invoke Python script to generate necessary exports of environment variables -%_PYTHON% %_SETUP_UTIL% %* > %_SETUP_TMP% -if NOT EXIST %_SETUP_TMP% ( - echo "Could not create temporary file: %_SETUP_TMP%" - return 1 -) -call %_SETUP_TMP% -del %_SETUP_TMP% - -REM source all environment hooks -for /F "tokens=* delims=;" %%a in ("%_CATKIN_ENVIRONMENT_HOOKS%") do ( - for %%b in (%%a) do ( - call "%%b" - ) -) - -REM 3rdparty packages often put dll's into lib (convention is bin) and -REM windows finds it's dll's via the PATH variable. Make that happen here! -set PATH=%LD_LIBRARY_PATH%;%PATH% - -REM unset temporary variables -set _SETUP_UTIL= -set _PYTHON= -set _SETUP_TMP= -set _CATKIN_ENVIRONMENT_HOOKS= diff --git a/cmake/catkin/templates/setup.sh.in b/cmake/catkin/templates/setup.sh.in deleted file mode 100644 index a47611bdd0..0000000000 --- a/cmake/catkin/templates/setup.sh.in +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env sh -# generated from catkin/cmake/template/setup.sh.in - -# Sets various environment variables and sources additional environment hooks. -# It tries it's best to undo changes from a previously sourced setup file before. -# Supported command line options: -# --extend: skips the undoing of changes from a previously sourced setup file - -# since this file is sourced either use the provided _CATKIN_SETUP_DIR -# or fall back to the destination set at configure time -: ${_CATKIN_SETUP_DIR:=@SETUP_DIR@} -_SETUP_UTIL="$_CATKIN_SETUP_DIR/_setup_util.py" -unset _CATKIN_SETUP_DIR - -if [ ! -f "$_SETUP_UTIL" ]; then - echo "Missing Python script: $_SETUP_UTIL" - return 22 -fi - -# detect if running on Darwin platform -_UNAME=`uname -s` -_IS_DARWIN=0 -if [ "$_UNAME" = "Darwin" ]; then - _IS_DARWIN=1 -fi -unset _UNAME - -# make sure to export all environment variables -export CMAKE_PREFIX_PATH -export CPATH -if [ $_IS_DARWIN -eq 0 ]; then - export LD_LIBRARY_PATH -else - export DYLD_LIBRARY_PATH -fi -unset _IS_DARWIN -export PATH -export PKG_CONFIG_PATH -export PYTHONPATH - -# remember type of shell if not already set -if [ -z "$CATKIN_SHELL" ]; then - CATKIN_SHELL=sh -fi - -# invoke Python script to generate necessary exports of environment variables -_SETUP_TMP=`mktemp /tmp/setup.sh.XXXXXXXXXX` -if [ $? -ne 0 -o ! -f "$_SETUP_TMP" ]; then - echo "Could not create temporary file: $_SETUP_TMP" - return 1 -fi -CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ > $_SETUP_TMP -_RC=$? -if [ $_RC -ne 0 ]; then - if [ $_RC -eq 2 ]; then - echo "Could not write the output of '$_SETUP_UTIL' to temporary file '$_SETUP_TMP': may be the disk if full?" - else - echo "Failed to run '\"$_SETUP_UTIL\" $@': return code $_RC" - fi - unset _RC - unset _SETUP_UTIL - rm -f $_SETUP_TMP - unset _SETUP_TMP - return 1 -fi -unset _RC -unset _SETUP_UTIL -. $_SETUP_TMP -rm -f $_SETUP_TMP -unset _SETUP_TMP - -# source all environment hooks -_i=0 -while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do - eval _envfile=\$_CATKIN_ENVIRONMENT_HOOKS_$_i - unset _CATKIN_ENVIRONMENT_HOOKS_$_i - eval _envfile_workspace=\$_CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE - unset _CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE - # set workspace for environment hook - CATKIN_ENV_HOOK_WORKSPACE=$_envfile_workspace - . "$_envfile" - unset CATKIN_ENV_HOOK_WORKSPACE - _i=$((_i + 1)) -done -unset _i - -unset _CATKIN_ENVIRONMENT_HOOKS_COUNT diff --git a/cmake/catkin/templates/setup.zsh.in b/cmake/catkin/templates/setup.zsh.in deleted file mode 100644 index 9f780b7410..0000000000 --- a/cmake/catkin/templates/setup.zsh.in +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env zsh -# generated from catkin/cmake/templates/setup.zsh.in - -CATKIN_SHELL=zsh - -# source setup.sh from same directory as this file -_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd) -emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh"' diff --git a/cmake/catkin/test/catkin_download_test_data.cmake b/cmake/catkin/test/catkin_download_test_data.cmake deleted file mode 100644 index 9d39052607..0000000000 --- a/cmake/catkin/test/catkin_download_test_data.cmake +++ /dev/null @@ -1,52 +0,0 @@ -_generate_function_if_testing_is_disabled("catkin_download_test_data") - -# -# Download a file containing test data from a URL. -# -# It is commonly used to download larger data files for unit tests -# which should not be stored in the repository. -# -# .. note:: The target will be registered as a dependency -# of the "tests" target. -# -# .. note:: If the tests should be run on the ROS buildfarm the URL -# must be publically and reliably accessible. -# -# :param target: the target name -# :type target: string -# :param url: the url to download -# :type url: string - -# :param DESTINATION: the directory where the file is downloaded to -# (default: ${PROJECT_BINARY_DIR}) -# :type DESTINATION: string -# :param FILENAME: the filename of the downloaded file -# (default: the basename of the url) -# :type FILENAME: string -# :param MD5: the expected md5 hash to compare against -# (default: empty, skipping the check) -# :type MD5: string -# -# @public -function(catkin_download_test_data target url) - _warn_if_skip_testing("catkin_download_test_data") - - cmake_parse_arguments(ARG "" "DESTINATION;FILENAME;MD5" "" ${ARGN}) - if(ARG_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "catkin_download_test_data() called with unused arguments: ${ARG_UNPARSED_ARGUMENTS}") - endif() - if(NOT ARG_DESTINATION) - set(ARG_DESTINATION ${PROJECT_BINARY_DIR}) - endif() - if(NOT ARG_FILENAME) - get_filename_component(ARG_FILENAME ${url} NAME) - endif() - set(output "${ARG_DESTINATION}/${ARG_FILENAME}") - add_custom_command(OUTPUT ${output} - COMMAND ${PYTHON_EXECUTABLE} ${catkin_EXTRAS_DIR}/test/download_checkmd5.py ${url} ${output} ${ARG_MD5} - VERBATIM) - add_custom_target(${target} DEPENDS ${output}) - if(TARGET tests) - add_dependencies(tests ${target}) - endif() -endfunction() diff --git a/cmake/catkin/test/download_checkmd5.py b/cmake/catkin/test/download_checkmd5.py deleted file mode 100755 index 7394315b80..0000000000 --- a/cmake/catkin/test/download_checkmd5.py +++ /dev/null @@ -1,175 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function -import errno -import os -import sys -try: - from urllib.request import addinfourl, BaseHandler, build_opener, Request, URLError -except ImportError: - from urllib2 import addinfourl, BaseHandler, build_opener, Request, URLError -import hashlib -from argparse import ArgumentParser - -NAME = "download_checkmd5.py" - - -class HTTPRangeHandler(BaseHandler): - - def http_error_206(self, req, fp, code, msg, hdrs): - r = addinfourl(fp, hdrs, req.get_full_url()) - r.code = code - r.msg = msg - return r - - def http_error_416(self, req, fp, code, msg, hdrs): - raise URLError('Requested Range Not Satisfiable') - - -def download_with_resume(uri, dest): - handler = HTTPRangeHandler() - opener = build_opener(handler) - - offset = 0 - content_length = None - accept_ranges = False - while True: - req = Request(uri) - if offset: - req.add_header('Range', 'bytes=%d-' % offset) - src_file = None - try: - src_file = opener.open(req) - headers = src_file.info() - if not offset: - # on first connection check server capabilities - if 'Content-Length' in headers: - content_length = int(headers['Content-Length']) - if 'Accept-Ranges' in headers: - accept_ranges = headers['Accept-Ranges'] != 'none' - else: - # on resume verify that server understood range header and responded accordingly - if 'Content-Range' not in headers: - raise IOError('Download aborted and server does not support resuming download') - if int(headers['Content-Range'][len('bytes '):].split('-')[0]) != offset: - raise IOError('Download aborted because server replied with different content range then requested') - sys.stdout.write(' resume from %d...' % offset) - sys.stdout.flush() - with open(dest, 'ab' if offset else 'wb') as dst_file: - progress = False - while True: - data = src_file.read(8192) - if not data: - break - progress = True - dst_file.write(data) - offset += len(data) - if not progress: - # if no bytes have been received abort download - raise IOError("No progress when trying to download '%s'" % uri) - except: - if src_file: - src_file.close() - raise - - # when content length is unknown it is assumed that the download is complete - if content_length is None: - break - # or when enough data has been downloaded (> is especially a valid case) - if offset >= content_length: - break - if not accept_ranges: - raise IOError('Server does not accept ranges to resume download') - - -def download_md5(uri, dest): - """ - downloads file from uri to file dest - """ - # Create intermediate directories as necessary, #2970 - dirname = os.path.dirname(dest) - if len(dirname): - try: - os.makedirs(dirname) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - sys.stdout.write('Downloading %s to %s...' % (uri, dest)) - sys.stdout.flush() - try: - download_with_resume(uri, dest) - sys.stdout.write(' done.\n') - except Exception as e: - # delete partially downloaded data - if os.path.exists(dest): - os.unlink(dest) - sys.stdout.write(' failed (%s)!\n' % e) - raise - - -def checkmd5(dest, md5sum=None): - """ - checks file at dest against md5. - :returns (boolean, hexdigest): True if dest contents matches md5sum - """ - if not os.path.exists(dest): - return False, 'null' - with open(dest, 'rb') as f: - md5value = hashlib.md5() - while True: - buf = f.read(4096) - if not buf: - break - md5value.update(buf) - hexdigest = md5value.hexdigest() - - print('Checking md5sum on %s' % (dest)) - return hexdigest == md5sum, hexdigest - - -def main(argv=sys.argv[1:]): - """ - Dowloads URI to file dest and checks md5 if given. - """ - parser = ArgumentParser(description='Dowloads URI to file dest. If md5sum is given, checks md5sum. If file existed and mismatch, downloads and checks again') - parser.add_argument('uri') - parser.add_argument('dest') - parser.add_argument('md5sum', nargs='?') - parser.add_argument('--ignore-error', action='store_true', help='Ignore download errors') - args = parser.parse_args(argv) - - uri = args.uri - if '://' not in uri: - uri = 'file://' + uri - - fresh = False - if not os.path.exists(args.dest): - try: - download_md5(uri, args.dest) - except Exception: - if args.ignore_error: - return 0 - raise - fresh = True - - if args.md5sum: - result, hexdigest = checkmd5(args.dest, args.md5sum) - if result is False and fresh is False: - print('WARNING: md5sum mismatch (%s != %s); re-downloading file %s' % (hexdigest, args.md5sum, args.dest)) - os.remove(args.dest) - try: - download_md5(uri, args.dest) - except Exception: - if args.ignore_error: - return 0 - raise - result, hexdigest = checkmd5(args.dest, args.md5sum) - if result is False: - return 'ERROR: md5sum mismatch (%s != %s) on %s; aborting' % (hexdigest, args.md5sum, args.dest) - - return 0 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/cmake/catkin/test/gtest.cmake b/cmake/catkin/test/gtest.cmake deleted file mode 100644 index 916f98f0c8..0000000000 --- a/cmake/catkin/test/gtest.cmake +++ /dev/null @@ -1,139 +0,0 @@ -_generate_function_if_testing_is_disabled("catkin_add_gtest") - -# -# Add a GTest based test target. -# -# An executable target is created with the source files, it is linked -# against GTest and added to the set of unit tests. -# -# .. note:: The test can be executed by calling the binary directly -# or using: ``make run_tests_${PROJECT_NAME}_gtest_${target}`` -# -# :param target: the target name -# :type target: string -# :param source_files: a list of source files used to build the test -# executable -# :type source_files: list of strings -# :param TIMEOUT: currently not supported -# :type TIMEOUT: integer -# :param WORKING_DIRECTORY: the working directory when executing the -# executable -# :type WORKING_DIRECTORY: string -# -# @public -# -function(catkin_add_gtest target) - _warn_if_skip_testing("catkin_add_gtest") - - if(NOT GTEST_FOUND AND NOT GTEST_FROM_SOURCE_FOUND) - message(WARNING "skipping gtest '${target}' in project '${PROJECT_NAME}'") - return() - endif() - - if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) - message(FATAL_ERROR "catkin_add_gtest() must be called after catkin_package() so that default output directories for the test binaries are defined") - endif() - - # XXX look for optional TIMEOUT argument, #2645 - cmake_parse_arguments(_gtest "" "TIMEOUT;WORKING_DIRECTORY" "" ${ARGN}) - if(_gtest_TIMEOUT) - message(WARNING "TIMEOUT argument to catkin_add_gtest() is ignored") - endif() - - # create the executable, with basic + gtest build flags - include_directories(${GTEST_INCLUDE_DIRS}) - link_directories(${GTEST_LIBRARY_DIRS}) - add_executable(${target} EXCLUDE_FROM_ALL ${_gtest_UNPARSED_ARGUMENTS}) - assert(GTEST_LIBRARIES) - target_link_libraries(${target} ${GTEST_LIBRARIES} ${THREADS_LIBRARY}) - - # make sure gtest is built before the test target - add_dependencies(${target} gtest gtest_main) - # make sure the target is built before running tests - add_dependencies(tests ${target}) - - # XXX we DONT use rosunit to call the executable to get process control, #1629, #3112 - get_target_property(_target_path ${target} RUNTIME_OUTPUT_DIRECTORY) - set(cmd "${_target_path}/${target} --gtest_output=xml:${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}/gtest-${target}.xml") - catkin_run_tests_target("gtest" ${target} "gtest-${target}.xml" COMMAND ${cmd} DEPENDENCIES ${target} WORKING_DIRECTORY ${_gtest_WORKING_DIRECTORY}) -endfunction() - -find_package(GTest QUIET) -if(NOT GTEST_FOUND) - # only add gtest directory once per workspace - if(NOT TARGET gtest) - # fall back to system installed path (i.e. on Ubuntu) - set(_paths "/usr/src/gtest/src") - if(CATKIN_TOPLEVEL) - # search in the current workspace before - list(INSERT _paths 0 "${CMAKE_SOURCE_DIR}/gtest/src") - endif() - find_file(_CATKIN_GTEST_SRC "gtest.cc" - PATHS ${_paths} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - - # fall back to system installed path (i.e. on Ubuntu) - set(_paths "/usr/include/gtest") - if(CATKIN_TOPLEVEL) - # search in the current workspace before - list(INSERT _paths 0 "${CMAKE_SOURCE_DIR}/gtest/include/gtest") - endif() - find_file(_CATKIN_GTEST_INCLUDE "gtest.h" - PATHS ${_paths} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - - if(_CATKIN_GTEST_SRC) - get_filename_component(_CATKIN_GTEST_SOURCE_DIR ${_CATKIN_GTEST_SRC} PATH) - get_filename_component(_CATKIN_GTEST_BASE_DIR ${_CATKIN_GTEST_SOURCE_DIR} PATH) - # add CMakeLists.txt from gtest dir - set(_CATKIN_GTEST_BINARY_DIR ${CMAKE_BINARY_DIR}/gtest) - add_subdirectory(${_CATKIN_GTEST_BASE_DIR} ${_CATKIN_GTEST_BINARY_DIR}) - # mark gtest targets with EXCLUDE_FROM_ALL to only build when tests are built which depend on them - set_target_properties(gtest gtest_main PROPERTIES EXCLUDE_FROM_ALL 1) - get_filename_component(_CATKIN_GTEST_INCLUDE_DIR ${_CATKIN_GTEST_INCLUDE} PATH) - get_filename_component(_CATKIN_GTEST_INCLUDE_DIR ${_CATKIN_GTEST_INCLUDE_DIR} PATH) - # set from-source variables - set(GTEST_FROM_SOURCE_FOUND TRUE CACHE INTERNAL "") - set(GTEST_FROM_SOURCE_INCLUDE_DIRS ${_CATKIN_GTEST_INCLUDE_DIR} CACHE INTERNAL "") - set(GTEST_FROM_SOURCE_LIBRARY_DIRS ${_CATKIN_GTEST_BINARY_DIR} CACHE INTERNAL "") - set(GTEST_FROM_SOURCE_LIBRARIES "gtest" CACHE INTERNAL "") - set(GTEST_FROM_SOURCE_MAIN_LIBRARIES "gtest_main" CACHE INTERNAL "") - #message(STATUS "Found gtest sources under '${_CATKIN_GTEST_BASE_DIR}': gtests will be built") - endif() - if(NOT GTEST_FROM_SOURCE_FOUND) - if(CATKIN_TOPLEVEL) - message(STATUS "gtest not found, C++ tests can not be built. Please install the gtest headers globally in your system or checkout gtest (by running 'svn checkout http://googletest.googlecode.com/svn/tags/release-1.6.0 gtest' in the source space '${CMAKE_SOURCE_DIR}' of your workspace) to enable gtests") - else() - message(STATUS "gtest not found, C++ tests can not be built. Please install the gtest headers globally in your system to enable gtests") - endif() - endif() - endif() - if(GTEST_FROM_SOURCE_FOUND) - # set the same variables as find_package() - # do NOT set GTEST_FOUND in the cache since when using gtest from source - # we must always add the subdirectory to have the gtest targets defined - set(GTEST_FOUND ${GTEST_FROM_SOURCE_FOUND}) - set(GTEST_INCLUDE_DIRS ${GTEST_FROM_SOURCE_INCLUDE_DIRS}) - set(GTEST_LIBRARY_DIRS ${GTEST_FROM_SOURCE_LIBRARY_DIRS}) - set(GTEST_LIBRARIES ${GTEST_FROM_SOURCE_LIBRARIES}) - set(GTEST_MAIN_LIBRARIES ${GTEST_FROM_SOURCE_MAIN_LIBRARIES}) - set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) - endif() -else() - #message(STATUS "Found gtest: gtests will be built") - add_library(gtest SHARED IMPORTED) - set_target_properties(gtest PROPERTIES IMPORTED_LOCATION "${GTEST_LIBRARIES}") - add_library(gtest_main SHARED IMPORTED) - set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION "${GTEST_MAIN_LIBRARIES}") - set(GTEST_FOUND ${GTEST_FOUND} CACHE INTERNAL "") - set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} CACHE INTERNAL "") - set(GTEST_LIBRARIES ${GTEST_LIBRARIES} CACHE INTERNAL "") - set(GTEST_MAIN_LIBRARIES ${GTEST_MAIN_LIBRARIES} CACHE INTERNAL "") - set(GTEST_BOTH_LIBRARIES ${GTEST_BOTH_LIBRARIES} CACHE INTERNAL "") -endif() -# For Visual C++, need to increase variadic template size to build gtest -if(GTEST_FOUND) - if(WIN32) - add_definitions(/D _VARIADIC_MAX=10) - endif() -endif() diff --git a/cmake/catkin/test/nosetests.cmake b/cmake/catkin/test/nosetests.cmake deleted file mode 100644 index 874e46115f..0000000000 --- a/cmake/catkin/test/nosetests.cmake +++ /dev/null @@ -1,117 +0,0 @@ -_generate_function_if_testing_is_disabled("catkin_add_nosetests") - -# -# Add Python nose tests. -# -# Nose collects tests from the directory ``dir`` automatically. -# -# .. note:: The test can be executed by calling ``nosetests`` -# directly or using: -# `` make run_tests_${PROJECT_NAME}_nosetests_${dir}`` -# (where slashes in the ``dir`` are replaced with underscores) -# -# :param path: a relative or absolute directory to search for -# nosetests in or a relative or absolute file containing tests -# :type path: string -# :param DEPENDENCIES: the targets which must be built before executing -# the test -# :type DEPENDENCIES: list of strings -# :param TIMEOUT: the timeout for individual tests in seconds -# (default: 60) -# :type TIMEOUT: integer -# :param WORKING_DIRECTORY: the working directory when executing the -# tests -# :type WORKING_DIRECTORY: string -# -# @public -# -function(catkin_add_nosetests path) - _warn_if_skip_testing("catkin_add_nosetests") - - if(NOT NOSETESTS) - message(STATUS "skipping nosetests(${path}) in project '${PROJECT_NAME}'") - return() - endif() - - cmake_parse_arguments(_nose "" "TIMEOUT;WORKING_DIRECTORY" "DEPENDENCIES" ${ARGN}) - if(NOT _nose_TIMEOUT) - set(_nose_TIMEOUT 60) - endif() - if(NOT _nose_TIMEOUT GREATER 0) - message(FATAL_ERROR "nosetests() TIMEOUT argument must be a valid number of seconds greater than zero") - endif() - - # check that the directory exists - set(_path_name _path_name-NOTFOUND) - if(IS_ABSOLUTE ${path}) - set(_path_name ${path}) - else() - find_file(_path_name ${path} - PATHS ${CMAKE_CURRENT_SOURCE_DIR} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - if(NOT _path_name) - message(FATAL_ERROR "Can't find nosetests path '${path}'") - endif() - endif() - - # check if coverage reports are being requested - if("$ENV{CATKIN_TEST_COVERAGE}" STREQUAL "1") - set(_covarg " --with-coverage") - endif() - - # strip PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR prefix from output_file_name - set(output_file_name ${path}) - _strip_path_prefix(output_file_name "${output_file_name}" "${PROJECT_SOURCE_DIR}") - _strip_path_prefix(output_file_name "${output_file_name}" "${PROJECT_BINARY_DIR}") - if("${output_file_name}" STREQUAL "") - set(output_file_name ".") - endif() - string(REPLACE "/" "." output_file_name ${output_file_name}) - string(REPLACE ":" "." output_file_name ${output_file_name}) - - set(output_path ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}) - # make --xunit-file argument an absolute path (https://github.com/nose-devs/nose/issues/779) - get_filename_component(output_path "${output_path}" ABSOLUTE) - set(cmd "${CMAKE_COMMAND} -E make_directory ${output_path}") - if(IS_DIRECTORY ${_path_name}) - set(tests "--where=${_path_name}") - else() - set(tests "${_path_name}") - endif() - set(cmd ${cmd} "${NOSETESTS} -P --process-timeout=${_nose_TIMEOUT} ${tests} --with-xunit --xunit-file=${output_path}/nosetests-${output_file_name}.xml${_covarg}") - catkin_run_tests_target("nosetests" ${output_file_name} "nosetests-${output_file_name}.xml" COMMAND ${cmd} DEPENDENCIES ${_nose_DEPENDENCIES} WORKING_DIRECTORY ${_nose_WORKING_DIRECTORY}) -endfunction() - -find_program(NOSETESTS NAMES - "nosetests${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" - "nosetests-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" - "nosetests${PYTHON_VERSION_MAJOR}" - "nosetests-${PYTHON_VERSION_MAJOR}" - "nosetests") -if(NOT NOSETESTS) - if("${PYTHON_VERSION_MAJOR}" STREQUAL "3") - message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python3-nose')") - else() - message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')") - endif() -endif() - -macro(_strip_path_prefix var value prefix) - if("${value}" STREQUAL "${prefix}" OR "${value}" STREQUAL "${prefix}/") - set(${var} "") - else() - set(${var} "${value}") - string(LENGTH "${prefix}/" prefix_length) - string(LENGTH "${value}" var_length) - if(${var_length} GREATER ${prefix_length}) - string(SUBSTRING "${value}" 0 ${prefix_length} var_prefix) - if("${var_prefix}" STREQUAL "${prefix}/") - # passing length -1 does not work for CMake < 2.8.5 - # http://public.kitware.com/Bug/view.php?id=10740 - string(LENGTH "${value}" _rest) - math(EXPR _rest "${_rest} - ${prefix_length}") - string(SUBSTRING "${value}" ${prefix_length} ${_rest} ${var}) - endif() - endif() - endif() -endmacro() diff --git a/cmake/catkin/test/run_tests.py b/cmake/catkin/test/run_tests.py deleted file mode 100755 index 9b93d55e2b..0000000000 --- a/cmake/catkin/test/run_tests.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import argparse -import os -import sys -import subprocess - -from catkin.test_results import ensure_junit_result_exist, remove_junit_result - - -def main(argv=sys.argv[1:]): - parser = argparse.ArgumentParser(description='Runs the test command passed as an argument and verifies that the expected result file has been generated.') - parser.add_argument('results', help='The path to the xunit result file') - parser.add_argument('command', nargs='+', help='The test command to execute') - parser.add_argument('--working-dir', nargs='?', help='The working directory for the executed command') - parser.add_argument('--return-code', action='store_true', default=False, help='Set the return code based on the success of the test command') - args = parser.parse_args(argv) - - remove_junit_result(args.results) - - work_dir_msg = ' with working directory "%s"' % args.working_dir if args.working_dir is not None else '' - cmds_msg = ''.join(['\n %s' % cmd for cmd in args.command]) - print('-- run_tests.py: execute commands%s%s' % (work_dir_msg, cmds_msg)) - - rc = 0 - for cmd in args.command: - rc = subprocess.call(cmd, cwd=args.working_dir, shell=True) - if rc: - break - - print('-- run_tests.py: verify result "%s"' % args.results) - no_errors = ensure_junit_result_exist(args.results) - if not no_errors: - rc = 1 - - if args.return_code: - return rc - return 0 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/cmake/catkin/test/tests.cmake b/cmake/catkin/test/tests.cmake deleted file mode 100644 index cccaec7641..0000000000 --- a/cmake/catkin/test/tests.cmake +++ /dev/null @@ -1,147 +0,0 @@ -option(CATKIN_ENABLE_TESTING "Catkin enable testing" ON) - -if(NOT DEFINED CATKIN_SKIP_TESTING) - option(CATKIN_SKIP_TESTING "Catkin skip testing" OFF) -endif() - -# check if testing is explicity skipped -if(CATKIN_SKIP_TESTING) - set(CATKIN_ENABLE_TESTING OFF) - #message(STATUS "Using CATKIN_SKIP_TESTING: ${CATKIN_SKIP_TESTING} (implying CATKIN_ENABLE_TESTING=${CATKIN_ENABLE_TESTING})") -else() - #message(STATUS "Using CATKIN_ENABLE_TESTING: ${CATKIN_ENABLE_TESTING}") -endif() - -# creates a dummy function in case testing has been explicitly disabled (and not only skipping) -# which outputs an error message when being invoked -macro(_generate_function_if_testing_is_disabled funcname) - if(DEFINED CATKIN_ENABLE_TESTING AND NOT CATKIN_ENABLE_TESTING AND NOT CATKIN_SKIP_TESTING) - function(${funcname}) - message(FATAL_ERROR - "${funcname}() is not available when tests are not enabled. The CMake code should only use it inside a conditional block which checks that testing is enabled:\n" - "if(CATKIN_ENABLE_TESTING)\n" - " ${funcname}(...)\n" - "endif()\n") - endfunction() - return() - endif() -endmacro() - -# checks if a function has been called while testing is skipped -# and outputs a warning message -macro(_warn_if_skip_testing funcname) - if(DEFINED CATKIN_ENABLE_TESTING AND NOT CATKIN_ENABLE_TESTING) - message(WARNING - "${funcname}() should only be used inside a conditional block which checks that testing is enabled:\n" - "if(CATKIN_ENABLE_TESTING)\n" - " ${funcname}(...)\n" - "endif()\n") - endif() -endmacro() - -if(DEFINED CATKIN_ENABLE_TESTING AND NOT CATKIN_ENABLE_TESTING AND NOT CATKIN_SKIP_TESTING) - return() -endif() - -# do not enable ctest's on the farm, since they are automatically executed by the current rules files -# and since the tests have not been build rostests would hang forever -if(NOT CATKIN_BUILD_BINARY_PACKAGE) - # do not enable ctest's for dry packages, since they have a custom test target which must not be overwritten - if(NOT ROSBUILD_init_called) - #message(STATUS "Call enable_testing()") - enable_testing() - else() - message(STATUS "Skip enable_testing() for dry packages") - endif() -else() - message(STATUS "Skip enable_testing() when building binary package") -endif() - -# allow overriding CATKIN_TEST_RESULTS_DIR when explicitly passed to CMake as a command line argument -if(DEFINED CATKIN_TEST_RESULTS_DIR) - set(CATKIN_TEST_RESULTS_DIR ${CATKIN_TEST_RESULTS_DIR} CACHE INTERNAL "") -else() - set(CATKIN_TEST_RESULTS_DIR ${CMAKE_BINARY_DIR}/test_results CACHE INTERNAL "") -endif() -#message(STATUS "Using CATKIN_TEST_RESULTS_DIR: ${CATKIN_TEST_RESULTS_DIR}") -file(MAKE_DIRECTORY ${CATKIN_TEST_RESULTS_DIR}) - -# create target to build tests -if(NOT TARGET tests) - add_custom_target(tests) -endif() - -# create target to run all tests -# it uses the dot-prefixed test targets to depend on building all tests and cleaning test results before the tests are executed -if(NOT TARGET run_tests) - add_custom_target(run_tests) -endif() - -# create target to clean test results -if(NOT TARGET clean_test_results) - add_custom_target(clean_test_results - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CATKIN_TEST_RESULTS_DIR}) -endif() - -# -# Create a test target, integrate it with the run_tests infrastructure -# and post-process the junit result. -# -# All test results go under ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}/.. -# -# This function is only used internally by the various -# catkin_add_*test() functions. -# -function(catkin_run_tests_target type name xunit_filename) - cmake_parse_arguments(_testing "" "WORKING_DIRECTORY" "COMMAND;DEPENDENCIES" ${ARGN}) - if(_testing_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "catkin_run_tests_target() called with unused arguments: ${_testing_UNPARSED_ARGUMENTS}") - endif() - - # create meta target to trigger all tests of a project - if(NOT TARGET run_tests_${PROJECT_NAME}) - add_custom_target(run_tests_${PROJECT_NAME}) - # create hidden meta target which depends on hidden test targets which depend on clean_test_results - add_custom_target(_run_tests_${PROJECT_NAME}) - # run_tests depends on this hidden target hierarchy to clear test results before running all tests - add_dependencies(run_tests _run_tests_${PROJECT_NAME}) - endif() - # create meta target to trigger all tests of a specific type of a project - if(NOT TARGET run_tests_${PROJECT_NAME}_${type}) - add_custom_target(run_tests_${PROJECT_NAME}_${type}) - add_dependencies(run_tests_${PROJECT_NAME} run_tests_${PROJECT_NAME}_${type}) - # hidden meta target which depends on hidden test targets which depend on clean_test_results - add_custom_target(_run_tests_${PROJECT_NAME}_${type}) - add_dependencies(_run_tests_${PROJECT_NAME} _run_tests_${PROJECT_NAME}_${type}) - endif() - if(NOT DEFINED CATKIN_ENABLE_TESTING OR CATKIN_ENABLE_TESTING) - # create target for test execution - set(results ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}/${xunit_filename}) - if (_testing_WORKING_DIRECTORY) - set(working_dir_arg "--working-dir" ${_testing_WORKING_DIRECTORY}) - endif() - assert(CATKIN_ENV) - set(cmd_wrapper ${CATKIN_ENV} ${PYTHON_EXECUTABLE} - ${catkin_EXTRAS_DIR}/test/run_tests.py ${results} ${working_dir_arg}) - # for ctest the command needs to return non-zero if any test failed - set(cmd ${cmd_wrapper} "--return-code" ${_testing_COMMAND}) - add_test(NAME _ctest_${PROJECT_NAME}_${type}_${name} COMMAND ${cmd}) - # for the run_tests target the command needs to return zero so that testing is not aborted - set(cmd ${cmd_wrapper} ${_testing_COMMAND}) - add_custom_target(run_tests_${PROJECT_NAME}_${type}_${name} - COMMAND ${cmd}) - else() - # create empty dummy target - set(cmd "${CMAKE_COMMAND}" "-E" "echo" "Skipping test target \\'run_tests_${PROJECT_NAME}_${type}_${name}\\'. Enable testing via -DCATKIN_ENABLE_TESTING.") - add_custom_target(run_tests_${PROJECT_NAME}_${type}_${name} ${cmd}) - endif() - add_dependencies(run_tests_${PROJECT_NAME}_${type} run_tests_${PROJECT_NAME}_${type}_${name}) - if(_testing_DEPENDENCIES) - add_dependencies(run_tests_${PROJECT_NAME}_${type}_${name} ${_testing_DEPENDENCIES}) - endif() - # hidden test target which depends on building all tests and cleaning test results - add_custom_target(_run_tests_${PROJECT_NAME}_${type}_${name} - COMMAND ${cmd}) - add_dependencies(_run_tests_${PROJECT_NAME}_${type} _run_tests_${PROJECT_NAME}_${type}_${name}) - add_dependencies(_run_tests_${PROJECT_NAME}_${type}_${name} clean_test_results tests ${_testing_DEPENDENCIES}) -endfunction() diff --git a/cmake/catkin/tools/bz2.cmake b/cmake/catkin/tools/bz2.cmake deleted file mode 100644 index d5f129d2a3..0000000000 --- a/cmake/catkin/tools/bz2.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) 2011, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - - -find_package(Bzip2) - diff --git a/cmake/catkin/tools/doxygen.cmake b/cmake/catkin/tools/doxygen.cmake deleted file mode 100644 index e8ed5d721f..0000000000 --- a/cmake/catkin/tools/doxygen.cmake +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright (c) 2011, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -## -# doxygen( ) -# TARGET_NAME -> The cmake target to create. -# SEARCH_DIRS -> a CMake List of directories to search for doxygenated files. -# -find_program(DOXYGEN_EXECUTABLE doxygen) - -if (DOXYGEN_EXECUTABLE) - set(DOXYGEN_FOUND TRUE CACHE BOOL "Doxygen found") -endif() - -if(NOT TARGET doxygen) - add_custom_target(doxygen) -endif() - -macro(catkin_doxygen TARGET_NAME SEARCH_DIRS) - foreach(dir ${SEARCH_DIRS}) - file(GLOB_RECURSE _doc_sources ${dir}/*) - list(APPEND doc_sources ${_doc_sources}) - endforeach() - - string(REPLACE ";" " " doc_sources "${doc_sources}") - - configure_file(${catkin_EXTRAS_DIR}/templates/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - - add_custom_target(${TARGET_NAME} - COMMENT "Generating API documentation with Doxygen" VERBATIM - ) - - add_custom_command(TARGET ${TARGET_NAME} - COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - add_dependencies(doxygen ${TARGET_NAME}) - -endmacro() diff --git a/cmake/catkin/tools/libraries.cmake b/cmake/catkin/tools/libraries.cmake deleted file mode 100644 index 77e38d680e..0000000000 --- a/cmake/catkin/tools/libraries.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# BUILD_SHARED_LIBS is a global cmake variable (usually defaults to on) -# that determines the build type of libraries: -# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:BUILD_SHARED_LIBS -# It defaults to shared. -# -# Our only current major use case for static libraries is -# via the mingw cross compiler, though embedded builds -# could be feasibly built this way also (largely untested). - -# Make sure this is already defined as a cached variable (@sa platform/windows.cmake) -if(NOT DEFINED BUILD_SHARED_LIBS) - option(BUILD_SHARED_LIBS "Build dynamically-linked binaries" ON) -endif() - -function(configure_shared_library_build_settings) - if(BUILD_SHARED_LIBS) - message(STATUS "BUILD_SHARED_LIBS is on") - add_definitions(-DROS_BUILD_SHARED_LIBS=1) - else() - message(STATUS "BUILD_SHARED_LIBS is off") - endif() -endfunction() diff --git a/cmake/catkin/tools/rt.cmake b/cmake/catkin/tools/rt.cmake deleted file mode 100644 index 3e5b708d8f..0000000000 --- a/cmake/catkin/tools/rt.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (c) 2011, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -# message("CMAKE_LIBRARY_PATH: ${CMAKE_LIBRARY_PATH}") -# message("CMAKE_LIBRARY_ARCHITECTURE: ${CMAKE_LIBRARY_ARCHITECTURE}") -# message("CMAKE_SYSTEM_LIBRARY_PATH: ${CMAKE_SYSTEM_LIBRARY_PATH}") -# message("CMAKE_VERSION=${CMAKE_VERSION}") - -if(NOT (APPLE OR WIN32 OR MINGW OR ANDROID)) - if (${CMAKE_VERSION} VERSION_LESS 2.8.4) - # cmake later than 2.8.0 appears to have a better find_library - # that knows about the ABI of the compiler. For lucid we just - # depend on the linker to find it for us. - set(RT_LIBRARY rt CACHE FILEPATH "Hacked find of rt for cmake < 2.8.4") - else() - find_library(RT_LIBRARY rt) - assert_file_exists(${RT_LIBRARY} "RT Library") - endif() - #message(STATUS "RT_LIBRARY: ${RT_LIBRARY}") -endif() diff --git a/cmake/catkin/tools/threads.cmake b/cmake/catkin/tools/threads.cmake deleted file mode 100644 index 8087ad6fa1..0000000000 --- a/cmake/catkin/tools/threads.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) 2011, Willow Garage, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the Willow Garage, Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - - -find_package(Threads) -set(THREADS_LIBRARY ${CMAKE_THREAD_LIBS_INIT} CACHE FILEPATH "Threads library") diff --git a/cmake/catkin/toplevel.cmake b/cmake/catkin/toplevel.cmake deleted file mode 100644 index 2978ef0654..0000000000 --- a/cmake/catkin/toplevel.cmake +++ /dev/null @@ -1,63 +0,0 @@ -# toplevel CMakeLists.txt for a catkin workspace -# catkin/cmake/toplevel.cmake - -cmake_minimum_required(VERSION 2.8.3) - -set(CATKIN_TOPLEVEL TRUE) - -# search for catkin within the workspace -set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}") -execute_process(COMMAND ${_cmd} - RESULT_VARIABLE _res - OUTPUT_VARIABLE _out - ERROR_VARIABLE _err - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE -) -if(NOT _res EQUAL 0 AND NOT _res EQUAL 2) - # searching fot catkin resulted in an error - string(REPLACE ";" " " _cmd_str "${_cmd}") - message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}") -endif() - -# include catkin from workspace or via find_package() -if(_res EQUAL 0) - set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake") - # include all.cmake without add_subdirectory to let it operate in same scope - include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE) - add_subdirectory("${_out}") - -else() - # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument - # or CMAKE_PREFIX_PATH from the environment - if(NOT DEFINED CMAKE_PREFIX_PATH) - if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "") - string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) - endif() - endif() - - # list of catkin workspaces - set(catkin_search_path "") - foreach(path ${CMAKE_PREFIX_PATH}) - if(EXISTS "${path}/.catkin") - list(FIND catkin_search_path ${path} _index) - if(_index EQUAL -1) - list(APPEND catkin_search_path ${path}) - endif() - endif() - endforeach() - - # search for catkin in all workspaces - set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE) - find_package(catkin QUIET - NO_POLICY_SCOPE - PATHS ${catkin_search_path} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - unset(CATKIN_TOPLEVEL_FIND_PACKAGE) - - if(NOT catkin_FOUND) - message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.") - endif() -endif() - -catkin_workspace() diff --git a/cmake/catkin2Config.cmake b/cmake/catkin2Config.cmake index f1212b16f3..90bd6f89ff 100644 --- a/cmake/catkin2Config.cmake +++ b/cmake/catkin2Config.cmake @@ -27,8 +27,9 @@ # :outvar _INCLUDE_DIRS/_LIBRARY_DIRS/_LIBRARY: # contains the include dirs / library dirs / libraries of the searched component . +find_package(catkin REQUIRED) # defines catkin_DIR if(CATKIN_TOPLEVEL_FIND_PACKAGE OR NOT CATKIN_TOPLEVEL) - set(catkin_EXTRAS_DIR ${CMAKE_CURRENT_LIST_DIR}/catkin) + set(catkin_EXTRAS_DIR "${catkin_DIR}") # prevent multiple inclusion from repeated find_package() calls in non-workspace context # as long as this variable is in the scope the variables from all.cmake are also, so no need to be evaluated again @@ -92,15 +93,24 @@ if(catkin2_FIND_COMPONENTS) endforeach() # find package component - if(catkin2_FIND_REQUIRED) - find_package(${component} REQUIRED NO_MODULE PATHS ${paths} - NO_DEFAULT_PATH) - elseif(catkin2_FIND_QUIETLY) + if(catkin_FIND_REQUIRED) + # try without REQUIRED first + find_package(${component} NO_MODULE PATHS ${paths} + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(NOT ${component}_FOUND) + # show better message to help users with the CMake error message coming up + message(STATUS "Could not find the required component '${component}'. " + "The following CMake error indicates that you either need to install the package " + "with the same name or change your environment so that it can be found.") + find_package(${component} REQUIRED NO_MODULE PATHS ${paths} + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif() + elseif(catkin_FIND_QUIETLY) find_package(${component} QUIET NO_MODULE PATHS ${paths} - NO_DEFAULT_PATH) + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) else() find_package(${component} NO_MODULE PATHS ${paths} - NO_DEFAULT_PATH) + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) endif() # ROS Packages give their library packages via hard coded diff --git a/cmake/package.xml b/cmake/package.xml deleted file mode 100644 index c0bf80b0d7..0000000000 --- a/cmake/package.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - catkin - 0.6.11 - Low-level build system macros and infrastructure for ROS. - Dirk Thomas - BSD - - http://www.ros.org/wiki/catkin - https://github.com/ros/catkin/issues - https://github.com/ros/catkin - - Troy Straszheim - Morten Kjaergaard - Brian Gerkey - Dirk Thomas - - cmake - cmake - - python-argparse - python-catkin-pkg - - python-empy - - gtest - python-empy - python-nose - - python-mock - python-nose - - - - - - diff --git a/communications/CMakeLists.txt b/communications/CMakeLists.txt deleted file mode 100644 index d8162a363c..0000000000 --- a/communications/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(ff_msgs) -add_subdirectory(ff_hw_msgs) - -if (USE_DDS) - add_subdirectory(dds_msgs) - add_subdirectory(dds_ros_bridge) -endif (USE_DDS) diff --git a/communications/dds_msgs/CMakeLists.txt b/communications/dds_msgs/CMakeLists.txt index 6d9c160e76..c593054aa4 100644 --- a/communications/dds_msgs/CMakeLists.txt +++ b/communications/dds_msgs/CMakeLists.txt @@ -15,4 +15,100 @@ # License for the specific language governing permissions and limitations # under the License. -add_subdirectory(idl) +cmake_minimum_required(VERSION 3.0) +project(dds_msgs) + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +if (USE_DDS) + ## Find catkin macros and libraries + find_package(catkin2 REQUIRED COMPONENTS + ) + + if (USE_CTC) + set(SORACORE_ROOT_DIR ${ARM_CHROOT_DIR}/usr) + else (USE_CTC) + set(SORACORE_ROOT_DIR /usr) + endif (USE_CTC) + + set(MIRO_ROOT_DIR ${SORACORE_ROOT_DIR}) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../cmake") + find_package(Qt4 4.6.0 REQUIRED QtXml) + + find_package(Miro REQUIRED) + find_package(RtiDds REQUIRED) + find_package(Soracore REQUIRED) + + catkin_package( + INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/.. + LIBRARIES + rapidExtAstrobee + ) + + ########### + ## Build ## + ########### + # Specify additional locations of header files + include_directories( + ${catkin_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${RTIDDS_INCLUDE_DIR} + ${SORACORE_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/rapidDds + ${SORACORE_IDL_DIR}/rapidDds + ) + + # Copying IDL files + file(GLOB ASTROBEE_IDL_FILES + "idl/*.idl") + file(COPY ${ASTROBEE_IDL_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + + set(LIB_NAME "rapidExtAstrobee") + + include(CreateDdsMsgTargets) + + set(EXTRA_RTIDDS_IDL_ARGS -I${SORACORE_IDL_DIR}/rapidDds) + create_dds_msg_targets( + NAME ${LIB_NAME} + DIR ${CMAKE_CURRENT_BINARY_DIR} + INCLUDES "-I${SORACORE_IDL_DIR}/rapidDds") + + add_library(${LIB_NAME} ${rapidExtAstrobee_GENERATED}) + target_link_libraries(${LIB_NAME} + rapidDds + ) + target_compile_definitions(${LIB_NAME} PUBLIC ${RTIDDS_DEFINE_FLAGS}) + target_compile_options(${LIB_NAME} PUBLIC -Wno-write-strings) + target_compile_options(${LIB_NAME} PRIVATE -Wno-strict-aliasing) + target_include_directories(${LIB_NAME} PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} + ${RTIDDS_INCLUDE_DIR} + ${SORACORE_INCLUDE_DIRS} + ${MIRO_INCLUDE_DIR}) + + ############# + ## Install ## + ############# + + # Mark libraries for installation + install(TARGETS ${LIB_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ) + + install(FILES ${rapidExtAstrobee_GENERATED_HEADERS} + DESTINATION include/${LIB_NAME}) + + # Mark cpp header files for installation + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/../ + FILES_MATCHING PATTERN "dds_msgs/*.h" + PATTERN ".svn" EXCLUDE + ) +else (USE_DDS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() +endif (USE_DDS) \ No newline at end of file diff --git a/communications/dds_msgs/idl/CMakeLists.txt b/communications/dds_msgs/idl/CMakeLists.txt deleted file mode 100644 index 0be60313b0..0000000000 --- a/communications/dds_msgs/idl/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -message(STATUS "Copying IDL files") -file(GLOB DDS_IDL_FILES - "${CMAKE_SOURCE_DIR}/communications/dds_msgs/idl/*.idl") - -file(COPY ${DDS_IDL_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - -set(LIB_NAME "rapidExtAstrobee") - -include(CreateDdsMsgTargets) - -set(EXTRA_RTIDDS_IDL_ARGS -I${SORACORE_IDL_DIR}/rapidDds) -create_dds_msg_targets( - NAME ${LIB_NAME} - DIR ${CMAKE_CURRENT_BINARY_DIR} - INCLUDES "-I${SORACORE_IDL_DIR}/rapidDds") - -add_library(${LIB_NAME} ${rapidExtAstrobee_GENERATED}) -target_link_libraries(${LIB_NAME} - rapidDds - ) -target_compile_definitions(${LIB_NAME} PUBLIC ${RTIDDS_DEFINE_FLAGS}) -target_compile_options(${LIB_NAME} PUBLIC -Wno-write-strings) -target_compile_options(${LIB_NAME} PRIVATE -Wno-strict-aliasing) -target_include_directories(${LIB_NAME} PUBLIC - ${CMAKE_CURRENT_BINARY_DIR} - ${RTIDDS_INCLUDE_DIR} - ${SORACORE_INCLUDE_DIRS}) - -install(TARGETS ${LIB_NAME} DESTINATION lib) -install(FILES ${rapidExtAstrobee_GENERATED_HEADERS} - DESTINATION include/${LIB_NAME}) diff --git a/communications/dds_msgs/package.xml b/communications/dds_msgs/package.xml new file mode 100644 index 0000000000..0f35132e90 --- /dev/null +++ b/communications/dds_msgs/package.xml @@ -0,0 +1,21 @@ + + + dds_msgs + 0.0.0 + + The dds_msgs package + + + Apache License, Version 2.0 + + + Astrobee Flight Software + + + Astrobee Flight Software + + message_generation + message_runtime + catkin + + diff --git a/communications/dds_ros_bridge/CMakeLists.txt b/communications/dds_ros_bridge/CMakeLists.txt index 4e19586103..c0ee7aa106 100644 --- a/communications/dds_ros_bridge/CMakeLists.txt +++ b/communications/dds_ros_bridge/CMakeLists.txt @@ -15,50 +15,93 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(dds_ros_bridge) -catkin_package( - LIBRARIES dds_ros_bridge astrobee_astrobee_bridge - CATKIN_DEPENDS roscpp message_runtime std_msgs nav_msgs -) -set(DEPS +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +if (USE_DDS) +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + nodelet + config_reader + ff_util ff_msgs + ff_hw_msgs + dds_msgs ) -set(LIBS - ${Boost_IOSTREAMS_LIBRARY} - config_reader - ff_nodelet - Qt4::QtXml - rapidIo - rapidExtAstrobee +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) +find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS filesystem system iostreams thread program_options timer) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../cmake") + +if (USE_CTC) + set(SORACORE_ROOT_DIR ${ARM_CHROOT_DIR}/usr) +else (USE_CTC) + set(SORACORE_ROOT_DIR /usr) +endif (USE_CTC) + +set(MIRO_ROOT_DIR ${SORACORE_ROOT_DIR}) + +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# just calls the normal one +find_package(Qt4 4.6.0 REQUIRED QtXml) +find_package(Miro REQUIRED) +find_package(RtiDds REQUIRED) +find_package(Soracore REQUIRED) + + +catkin_package( + LIBRARIES dds_ros_bridge astrobee_astrobee_bridge + CATKIN_DEPENDS nodelet config_reader ff_util ff_msgs ff_hw_msgs dds_msgs ) -set(INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR}/include +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} + ${RTIDDS_INCLUDE_DIR} ${SORACORE_INCLUDE_DIRS} + ${MIRO_INCLUDE_DIR} + ${QT_INCLUDE_DIR} + ${QT_INCLUDE_DIR}/Qt + ${Boost_INCLUDE_DIRS} ) -create_library(TARGET dds_ros_bridge - LIBS ${LIBS} - INC ${INCLUDES} - DEPS ${DEPS} +file(GLOB cc_files + "src/*.cc" ) -create_library(TARGET astrobee_astrobee_bridge - LIBS ${LIBS} - INC ${INCLUDES} - DEPS ${DEPS} +# Declare C++ libraries +add_library(dds_ros_bridge + ${cc_files} ) +target_compile_definitions(dds_ros_bridge PUBLIC ${RTIDDS_DEFINE_FLAGS}) +add_dependencies(dds_ros_bridge ${catkin_EXPORTED_TARGETS}) +target_link_libraries(dds_ros_bridge rapidIo ${Boost_LIBRARIES} ${catkin_LIBRARIES}) + -create_tool_targets(DIR tools - LIBS dds_ros_bridge - INC ${INCLUDES} - DEPS ${DEPS} dds_ros_bridge +add_library(astrobee_astrobee_bridge + src/astrobee_astrobee_bridge.cc ) +target_compile_definitions(astrobee_astrobee_bridge PUBLIC ${RTIDDS_DEFINE_FLAGS}) +add_dependencies(astrobee_astrobee_bridge ${catkin_EXPORTED_TARGETS}) +target_link_libraries(astrobee_astrobee_bridge Qt4::QtXml rapidIo ${Boost_LIBRARIES} ${catkin_LIBRARIES}) + +############# +## Install ## +############# # Determine our module name get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) @@ -70,4 +113,28 @@ install(CODE "execute_process( ERROR_QUIET )") -install_launch_files() +# Mark libraries for installation +install(TARGETS dds_ros_bridge + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS astrobee_astrobee_bridge + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) +else (USE_DDS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() +endif (USE_DDS) \ No newline at end of file diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_command_ros_command_plan.h b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_command_ros_command_plan.h index 821a2feca2..f3940d3d3e 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_command_ros_command_plan.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_command_ros_command_plan.h @@ -33,7 +33,7 @@ #include "ff_msgs/CommandArg.h" #include "ff_msgs/CommandStamped.h" -#include "AstrobeeCommandConstants.h" +#include "dds_msgs/AstrobeeCommandConstants.h" #include "knDds/DdsTypedSupplier.h" diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_compressed_file_ros_compressed_file.h b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_compressed_file_ros_compressed_file.h index 1938fe2cb2..5a22668a23 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_compressed_file_ros_compressed_file.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_compressed_file_ros_compressed_file.h @@ -31,9 +31,9 @@ #include "ff_msgs/CompressedFile.h" -#include "AstrobeeConstants.h" -#include "CompressedFile.h" -#include "CompressedFileSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/CompressedFile.h" +#include "dds_msgs/CompressedFileSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_ekf_ros_ekf.h b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_ekf_ros_ekf.h index 5a973a81bf..93a41ca65c 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_ekf_ros_ekf.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_ekf_ros_ekf.h @@ -32,11 +32,11 @@ #include "ff_msgs/EkfState.h" -#include "AstrobeeConstants.h" +#include "dds_msgs/AstrobeeConstants.h" #include "knDds/DdsTypedSupplier.h" -#include "EkfStateSupport.h" +#include "dds_msgs/EkfStateSupport.h" #include "rapidDds/RapidConstants.h" diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_gs_data_ros_gs_data.h b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_gs_data_ros_gs_data.h index 1b44ac9272..a11da1d691 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_gs_data_ros_gs_data.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/rapid_gs_data_ros_gs_data.h @@ -32,11 +32,11 @@ #include "ff_msgs/GuestScienceData.h" -#include "AstrobeeConstants.h" +#include "dds_msgs/AstrobeeConstants.h" #include "knDds/DdsTypedSupplier.h" -#include "GuestScienceDataSupport.h" +#include "dds_msgs/GuestScienceDataSupport.h" #include "rapidDds/RapidConstants.h" diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_agent_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_agent_state.h index 6c81a94006..d51fb94e8a 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_agent_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_agent_state.h @@ -35,9 +35,9 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeAgentStateSupport.h" -#include "AstrobeeConstants.h" -#include "MobilitySettingsStateSupport.h" +#include "dds_msgs/AstrobeeAgentStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/MobilitySettingsStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_arm_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_arm_state.h index edf88296b6..fadf46e604 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_arm_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_arm_state.h @@ -34,8 +34,8 @@ #include "rapidUtil/RapidHelper.h" -#include "ArmStateSupport.h" -#include "AstrobeeConstants.h" +#include "dds_msgs/ArmStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_battery_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_battery_state.h index d03251bc40..0083a3aaf3 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_battery_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_battery_state.h @@ -33,9 +33,9 @@ #include "sensor_msgs/BatteryState.h" #include "sensor_msgs/Temperature.h" -#include "AstrobeeConstants.h" -#include "EpsStateSupport.h" -#include "EpsConfigSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/EpsStateSupport.h" +#include "dds_msgs/EpsConfigSupport.h" #include "rapidUtil/RapidHelper.h" diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_command_config_rapid_command_config.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_command_config_rapid_command_config.h index 69d53f75e7..acc160f687 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_command_config_rapid_command_config.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_command_config_rapid_command_config.h @@ -36,7 +36,7 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeCommandConstants.h" +#include "dds_msgs/AstrobeeCommandConstants.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_ack.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_ack.h index 1dffa64233..1aa210e678 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_ack.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_ack.h @@ -33,8 +33,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "CompressedFileAckSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/CompressedFileAckSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_rapid_compressed_file.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_rapid_compressed_file.h index 34bc85c097..e3a957d9c1 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_rapid_compressed_file.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_compressed_file_rapid_compressed_file.h @@ -33,8 +33,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "CompressedFileSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/CompressedFileSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_cpu_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_cpu_state.h index acb06d0a1a..c820bc3f0e 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_cpu_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_cpu_state.h @@ -32,9 +32,9 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "CpuConfigSupport.h" -#include "CpuStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/CpuConfigSupport.h" +#include "dds_msgs/CpuStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_data_to_disk.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_data_to_disk.h index 9fd42415d6..a58e4f13d3 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_data_to_disk.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_data_to_disk.h @@ -33,9 +33,9 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "DataToDiskStateSupport.h" -#include "DataTopicsListSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/DataToDiskStateSupport.h" +#include "dds_msgs/DataTopicsListSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_disk_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_disk_state.h index bb890ca8b2..b9250bdae1 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_disk_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_disk_state.h @@ -34,9 +34,9 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "DiskStateSupport.h" -#include "DiskConfigSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/DiskStateSupport.h" +#include "dds_msgs/DiskConfigSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_ekf_rapid_ekf.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_ekf_rapid_ekf.h index 5a754d1296..ff1ba346d2 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_ekf_rapid_ekf.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_ekf_rapid_ekf.h @@ -36,8 +36,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "EkfStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/EkfStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_config.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_config.h index c3cdea3110..aba113753a 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_config.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_config.h @@ -32,9 +32,9 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "FaultConfigSupport.h" -#include "FaultStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/FaultConfigSupport.h" +#include "dds_msgs/FaultStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_state.h index 149f9489fc..629c750dc7 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_fault_state.h @@ -32,8 +32,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "FaultStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/FaultStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_control_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_control_state.h index 729683cdfb..653c52847f 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_control_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_control_state.h @@ -18,8 +18,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "GncControlStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/GncControlStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_fam_cmd_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_fam_cmd_state.h index 49e8e451a1..210c312410 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_fam_cmd_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_gnc_fam_cmd_state.h @@ -35,8 +35,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "GncFamCmdStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/GncFamCmdStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_guest_science.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_guest_science.h index 3a861090d8..e54b9e2a1e 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_guest_science.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_guest_science.h @@ -37,10 +37,10 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "GuestScienceConfigSupport.h" -#include "GuestScienceDataSupport.h" -#include "GuestScienceStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/GuestScienceConfigSupport.h" +#include "dds_msgs/GuestScienceDataSupport.h" +#include "dds_msgs/GuestScienceStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_inertia.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_inertia.h index 34d4281db4..fa112aec69 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_inertia.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_inertia.h @@ -30,8 +30,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "InertialPropertiesSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/InertialPropertiesSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_log_sample.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_log_sample.h index 7968382dd7..a9b467e0e2 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_log_sample.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_log_sample.h @@ -18,8 +18,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "LogSampleSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/LogSampleSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_odom_rapid_position.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_odom_rapid_position.h index d1201e560d..6284e38b5e 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_odom_rapid_position.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_odom_rapid_position.h @@ -36,8 +36,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "EkfStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/EkfStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_payload_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_payload_state.h index 7ba4eaccef..73e3fee1d5 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_payload_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_payload_state.h @@ -33,9 +33,9 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "PayloadConfigSupport.h" -#include "PayloadStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/PayloadConfigSupport.h" +#include "dds_msgs/PayloadStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_plan_status_rapid_plan_status.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_plan_status_rapid_plan_status.h index 9dc1241916..36bdbf780d 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_plan_status_rapid_plan_status.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_plan_status_rapid_plan_status.h @@ -35,8 +35,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "PlanStatusSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/PlanStatusSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_pmc_cmd_state.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_pmc_cmd_state.h index 97a971e9a9..de30077fec 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_pmc_cmd_state.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_pmc_cmd_state.h @@ -18,8 +18,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "PmcCmdStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/PmcCmdStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_telemetry_rapid_telemetry.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_telemetry_rapid_telemetry.h index 09f3cf9e81..584b5db19f 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_telemetry_rapid_telemetry.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_telemetry_rapid_telemetry.h @@ -34,9 +34,9 @@ #include "ros/ros.h" -#include "AstrobeeConstants.h" -#include "TelemetryConfigSupport.h" -#include "TelemetryStateSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/TelemetryConfigSupport.h" +#include "dds_msgs/TelemetryStateSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_zones_rapid_compressed_file.h b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_zones_rapid_compressed_file.h index 4cc7c52efa..69f409455d 100644 --- a/communications/dds_ros_bridge/include/dds_ros_bridge/ros_zones_rapid_compressed_file.h +++ b/communications/dds_ros_bridge/include/dds_ros_bridge/ros_zones_rapid_compressed_file.h @@ -44,8 +44,8 @@ #include "rapidUtil/RapidHelper.h" -#include "AstrobeeConstants.h" -#include "CompressedFileSupport.h" +#include "dds_msgs/AstrobeeConstants.h" +#include "dds_msgs/CompressedFileSupport.h" namespace ff { diff --git a/communications/dds_ros_bridge/package.xml b/communications/dds_ros_bridge/package.xml index 50931e9e46..010526ba3c 100644 --- a/communications/dds_ros_bridge/package.xml +++ b/communications/dds_ros_bridge/package.xml @@ -15,22 +15,18 @@ Astrobee Flight Software catkin - cmake_modules - message_generation - ff_msgs - nav_msgs - roscpp - rossmbus - std_msgs nodelet - cmake_modules - message_runtime - ff_msgs - nav_msgs - roscpp - rossmbus - std_msgs + config_reader + ff_util + ff_msgs + ff_hw_msgs + dds_msgs nodelet + config_reader + ff_util + ff_msgs + ff_hw_msgs + dds_msgs diff --git a/communications/ff_hw_msgs/CMakeLists.txt b/communications/ff_hw_msgs/CMakeLists.txt index b2ad112ac7..c88a4c5219 100644 --- a/communications/ff_hw_msgs/CMakeLists.txt +++ b/communications/ff_hw_msgs/CMakeLists.txt @@ -15,16 +15,35 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ff_hw_msgs) -find_package(catkin2 REQUIRED COMPONENTS +find_package(catkin REQUIRED COMPONENTS message_generation roscpp std_msgs sensor_msgs ) -create_msg_targets(DIR msg SDIR srv DEPS std_msgs sensor_msgs) +# Generate messages in the 'msg' folder +file(GLOB MSG_FILES msg/*.msg) +foreach(SRC ${MSG_FILES}) + get_filename_component(NAME ${SRC} NAME) + list(APPEND MSG_FILE_NAMES ${NAME}) +endforeach() +add_message_files(FILES ${MSG_FILE_NAMES}) + +# Generate services in the 'srv' folder +file(GLOB SRV_FILES srv/*.srv) +foreach(SRC ${SRV_FILES}) + get_filename_component(NAME ${SRC} NAME) + list(APPEND SRV_FILE_NAMES ${NAME}) +endforeach() +add_service_files(FILES ${SRV_FILE_NAMES}) + +generate_messages( + DEPENDENCIES std_msgs geometry_msgs sensor_msgs +) catkin_package( # INCLUDE_DIRS include @@ -35,4 +54,4 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} -) \ No newline at end of file +) diff --git a/communications/ff_msgs/CMakeLists.txt b/communications/ff_msgs/CMakeLists.txt index 5040c836e1..37d9842fc3 100644 --- a/communications/ff_msgs/CMakeLists.txt +++ b/communications/ff_msgs/CMakeLists.txt @@ -15,9 +15,10 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ff_msgs) -find_package(catkin2 REQUIRED COMPONENTS +find_package(catkin REQUIRED COMPONENTS message_generation std_msgs geometry_msgs @@ -26,8 +27,33 @@ find_package(catkin2 REQUIRED COMPONENTS sensor_msgs ) -create_msg_targets(DIR msg SDIR srv ADIR action - DEPS std_msgs geometry_msgs actionlib_msgs trajectory_msgs sensor_msgs) +# Generate messages in the 'msg' folder +file(GLOB MSG_FILES msg/*.msg) +foreach(SRC ${MSG_FILES}) + get_filename_component(NAME ${SRC} NAME) + list(APPEND MSG_FILE_NAMES ${NAME}) +endforeach() +add_message_files(FILES ${MSG_FILE_NAMES}) + +# Generate services in the 'srv' folder +file(GLOB SRV_FILES srv/*.srv) +foreach(SRC ${SRV_FILES}) + get_filename_component(NAME ${SRC} NAME) + list(APPEND SRV_FILE_NAMES ${NAME}) +endforeach() +add_service_files(FILES ${SRV_FILE_NAMES}) + +# Generate actions in the 'action' folder +file(GLOB ACTION_FILES action/*.action) +foreach(SRC ${ACTION_FILES}) + get_filename_component(NAME ${SRC} NAME) + list(APPEND ACTION_FILE_NAMES ${NAME}) +endforeach() +add_action_files(FILES ${ACTION_FILE_NAMES}) + +generate_messages( + DEPENDENCIES std_msgs geometry_msgs actionlib_msgs trajectory_msgs sensor_msgs std_msgs +) catkin_package( # INCLUDE_DIRS include diff --git a/debian/rules b/debian/rules index 9ac1033ac5..b36dc4a593 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ export EXTRA_CMAKE_OPTS export LIB_SEARCH_OPTIONS ifeq ($(DEB_HOST_ARCH),armhf) - export EXTRA_CMAKE_OPTS=-DCMAKE_TOOLCHAIN_FILE=../scripts/build/ubuntu_cross.cmake -DUSE_CTC=true +# export EXTRA_CMAKE_OPTS=-DCMAKE_TOOLCHAIN_FILE=../scripts/build/ubuntu_cross.cmake -DUSE_CTC=true # stripping doesn't work with the cross compile #export DEB_BUILD_OPTIONS += nostrip export LIB_SEARCH_OPTIONS = -l$(ARMHF_CHROOT_DIR)/opt/rti/ndds/lib/armv6vfphLinux3.xgcc4.7.2:$(ARMHF_CHROOT_DIR)/opt/ros/kinetic/lib:$(ARMHF_CHROOT_DIR)/opt/ros/kinetic/lib/arm-linux-gnueabihf:$(ARMHF_CHROOT_DIR)/lib:$(ARMHF_CHROOT_DIR)/usr/lib:$(ARMHF_CHROOT_DIR)/usr/lib/arm-linux-gnueabihf:$(ARMHF_CHROOT_DIR)/lib/arm-linux-gnueabihf -- --ignore-missing-info --admindir=$(ARMHF_CHROOT_DIR)/var/lib/dpkg @@ -36,8 +36,16 @@ build-indep: ; # we always need release, otherwise it is too slow override_dh_auto_configure: - mkdir -p build - cd build && cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=/opt/astrobee -DCMAKE_BUILD_TYPE=Release $(EXTRA_CMAKE_OPTS) && cd .. + # configure the build + cd .. && \ + ./src/scripts/configure.sh -a -w src/debian/tmp && \ + catkin clean -y --force +override_dh_auto_build: ; + +# the install command is already invoked in the build +override_dh_auto_install: + cd .. && \ + catkin build override_dh_install: dh_movefiles diff --git a/description/CMakeLists.txt b/description/CMakeLists.txt deleted file mode 100644 index 91d48bc92e..0000000000 --- a/description/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# Check to see if correct version of media has been downloaded into tree. We -# dont do this if we are cross-compiling, as there is no need for it. We must -# also make sure the media is copied in a native install to a simulator. - -# Add the things that need to be on both the robot and the simulation -add_subdirectory(description) - -# Optional: install only for simulated context -if (NOT USE_CTC) - add_subdirectory(media/astrobee_granite) - add_subdirectory(media/astrobee_dock) - add_subdirectory(media/astrobee_iss) - add_subdirectory(media/astrobee_handrail_8_5) - add_subdirectory(media/astrobee_handrail_21_5) - add_subdirectory(media/astrobee_handrail_30) - add_subdirectory(media/astrobee_handrail_41_5) - add_subdirectory(media/astrobee_freeflyer) -endif (NOT USE_CTC) diff --git a/description/description/CMakeLists.txt b/description/description/CMakeLists.txt index 6da9a5ccfc..8212f71f21 100644 --- a/description/description/CMakeLists.txt +++ b/description/description/CMakeLists.txt @@ -19,8 +19,12 @@ # dont do this if we are cross-compiling, as there is no need for it. We must # also make sure the media is copied in a native install to a simulator. +cmake_minimum_required(VERSION 3.0) project(description) +find_package(catkin REQUIRED COMPONENTS +) + catkin_package() install(DIRECTORY urdf DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) diff --git a/description/media b/description/media index bf2057d4ab..e3561545c6 160000 --- a/description/media +++ b/description/media @@ -1 +1 @@ -Subproject commit bf2057d4ab02516878fd374f2f2e6601ac49510f +Subproject commit e3561545c61b6be5406839b9d959becbfe7b4100 diff --git a/doc/general_documentation/INSTALL.md b/doc/general_documentation/INSTALL.md index 72094b1858..f376bac6bb 100644 --- a/doc/general_documentation/INSTALL.md +++ b/doc/general_documentation/INSTALL.md @@ -22,28 +22,21 @@ support running Astrobee Robot Software on 32-bit systems.* ### Checkout the project source code At this point you need to decide where you'd like to put the source code -(`SOURCE_PATH`) on your machine: +(`ASTROBEE_WS`) on your machine: - export SOURCE_PATH=$HOME/astrobee + export ASTROBEE_WS=$HOME/astrobee First, clone the flight software repository and media: - git clone https://github.com/nasa/astrobee.git $SOURCE_PATH - pushd $SOURCE_PATH + git clone https://github.com/nasa/astrobee.git $ASTROBEE_WS/src + pushd $ASTROBEE_WS/src git submodule update --init --depth 1 description/media popd If you are planning to work with guest science code, you will also need the -`astrobee_android` repository. You should checkout the repository in the same -directory you checked out the source code in: - - export ANDROID_PATH="${SOURCE_PATH}_android" - - -Clone the android repository: - - git clone https://github.com/nasa/astrobee_android.git $ANDROID_PATH +`astrobee_android` repository. You should checkout the repository as a submodule: + git submodule update --init --depth 1 submodules/android ### Dependencies @@ -54,8 +47,8 @@ Next, install all required dependencies: *Note: Before running this please ensure that your system is completely updated by running 'sudo apt-get update' and then 'sudo apt-get upgrade'* - pushd $SOURCE_PATH - cd scripts/setup + pushd $ASTROBEE_WS + cd src/scripts/setup ./add_ros_repository.sh sudo apt-get update cd debians @@ -82,16 +75,16 @@ by running 'sudo apt-get update' and then 'sudo apt-get upgrade'* ### Note for the build setup By default, the configure script uses the following paths: - - native build path: `$HOME/astrobee_build/native` - - native install path: `$HOME/astrobee_install/native` + - native build path: `$ASTROBEE_WS/build` + - native install path: `$ASTROBEE_WS/install` If you are satisfied with these paths, you can invoke the `configure.sh` without the `-p` and `-b` options. For the simplicity of the instructions below, we assume that `$BUILD_PATH` and `$INSTALL_PATH` contain the location of the build and install path. For example: - export BUILD_PATH=$HOME/astrobee_build/native - export INSTALL_PATH=$HOME/astrobee_install/native + export BUILD_PATH=$ASTROBEE_WS/build + export INSTALL_PATH=$ASTROBEE_WS/install ### Native build @@ -100,14 +93,15 @@ that `configure.sh` is simply a wrapper around CMake that provides an easy way of turning on and off options. To see which options are supported, simply run `configure.sh -h`. - pushd $SOURCE_PATH - ./scripts/configure.sh -l -F -D + pushd $ASTROBEE_WS + ./src/scripts/configure.sh -l -F -D + source ~/.bashrc popd If you want to explicitly specify the build and install directories, use instead: - ./scripts/configure.sh -l -F -D -p $INSTALL_PATH -b $BUILD_PATH + ./src/scripts/configure.sh -l -F -D -p $INSTALL_PATH -b $BUILD_PATH *Note: Make sure you use the -F and -D flags. If these flags are not used, the code will not compile. The -F flag is used to turn off building the Picoflex. @@ -123,8 +117,8 @@ machine, this might take in the order of tens of minutes to complete the first time round. Future builds will be faster, as only changes to the code are rebuilt, and not the entire code base. - pushd $BUILD_PATH - make -j2 + pushd $ASTROBEE_WS + catkin build popd If you configured your virtual machine with more than the baseline resources, diff --git a/doc/general_documentation/NASA_INSTALL.md b/doc/general_documentation/NASA_INSTALL.md index 5074c259cf..d7600c722d 100644 --- a/doc/general_documentation/NASA_INSTALL.md +++ b/doc/general_documentation/NASA_INSTALL.md @@ -70,13 +70,13 @@ exit this session on `m` with `+D`. ### Checkout the project source code At this point you need to decide where you'd like to put the source code -(`SOURCE_PATH`) on your machine: +(`ASTROBEE_WS`) on your machine: - export SOURCE_PATH=$HOME/astrobee + export ASTROBEE_WS=$HOME/astrobee First, clone the flight software repository: - git clone https://github.com/nasa/astrobee.git --branch develop $SOURCE_PATH + git clone https://github.com/nasa/astrobee.git --branch develop $ASTROBEE_WS/src git submodule update --init --depth 1 description/media git submodule update --init --depth 1 submodules/platform @@ -96,8 +96,8 @@ module is used when cross-compiling to test on the robot hardware. ### Dependencies Install dependencies: - pushd $SOURCE_PATH - cd scripts/setup + pushd $ASTROBEE_WS + cd src/scripts/setup ./add_local_repository.sh ./add_ros_repository.sh ./install_desktop_packages.sh @@ -131,8 +131,8 @@ Next, download the cross toolchain and install the chroot: mkdir -p $ARMHF_TOOLCHAIN cd $HOME/arm_cross - $SOURCE_PATH/submodules/platform/fetch_toolchain.sh - $SOURCE_PATH/submodules/platform/rootfs/make_xenial.sh dev $ARMHF_CHROOT_DIR + $ASTROBEE_WS/src/submodules/platform/fetch_toolchain.sh + $ASTROBEE_WS/src/submodules/platform/rootfs/make_xenial.sh dev $ARMHF_CHROOT_DIR ## Configuring the build @@ -144,10 +144,10 @@ the code on the robot itself). Please skip to the relevant subsection. By default, the configure script uses the following paths: - - native build path (BUILD_PATH): `$HOME/astrobee_build/native` - - native install path (INSTALL_PATH): `$HOME/astrobee_install/native` - - armhf build path (BUILD_PATH): `$HOME/astrobee_build/armhf` - - armhf install path (INSTALL_PATH): `$HOME/astrobee_install/armhf` + - native build path (BUILD_PATH): `$ASTROBEE_WS/build` + - native install path (INSTALL_PATH): `$ASTROBEE_WS/install` + - armhf build path (BUILD_PATH): `$ARMHF_CHROOT_DIR/home/astrobee/astrobee/build` + - armhf install path (INSTALL_PATH): `$ARMHF_CHROOT_DIR/home/astrobee/astrobee/install` You should set these values in your shell. @@ -163,8 +163,9 @@ that `configure.sh` is simply a wrapper around CMake that provides an easy way of turning on and off options. To see which options are supported, simply run `configure.sh -h`. - pushd $SOURCE_PATH - ./scripts/configure.sh -l + pushd $ASTROBEE_WS + ./src/scripts/configure.sh -l + source ~/.bashrc popd If you want to explicitly specify the build and install directories, use @@ -177,8 +178,8 @@ instead: Cross compiling for the robot follows the same process, except the configure script takes a `-a` flag instead of `-l`. - pushd $SOURCE_PATH - ./scripts/configure.sh -a + pushd $ASTROBEE_WS + ./src/scripts/configure.sh -a popd Or with explicit build and install paths: @@ -196,8 +197,8 @@ machine, this might take in the order of tens of minutes to complete the first time round. Future builds will be faster, as only changes to the code are rebuilt, and not the entire code base. - pushd $BUILD_PATH - make -j6 + pushd $ASTROBEE_WS + catkin build popd *Note: `$BUILD_PATH` above is either the path for native build or armhf build, @@ -209,7 +210,7 @@ In order to run a simulation you must have build natively. You will need to first setup your environment, so that ROS knows about the new packages provided by Astrobee flight software: - pushd $BUILD_PATH + pushd $ASTROBEE_WS source devel/setup.bash popd @@ -231,21 +232,17 @@ For more information on running the simulator and moving the robot, please see t ## Running the code on a real robot In order to do this, you will need to have followed the cross-compile build -instructions. Once the code has been built, you also need to install the code to +instructions. Once the code has been built, it also installs the code to a singular location. CMake remembers what `$INSTALL_PATH` you specified, and will copy all products into this directory. - pushd $BUILD_PATH - make install - popd - Once the installation has completed, copy the install directory to the robot. This script assumes that you are connected to the Astrobee network, as it uses rsync to copy the install directory to `~/armhf` on the two processors. It takes the robot name as an argument. Here we use `p4d'. - pushd $SOURCE_PATH - ./scripts/install_to_astrobee.sh $INSTALL_PATH p4d + pushd $ASTROBEE_WS + ./src/scripts/install_to_astrobee.sh $INSTALL_PATH p4d popd Here, p4d is the name of the robot, which may be different in your case. @@ -253,8 +250,8 @@ Here, p4d is the name of the robot, which may be different in your case. You are now ready to run the code. This code launches a visualization tool, which starts the flight software as a background process. - pushd $SOURCE_PATH - python ./tools/gnc_visualizer/scripts/visualizer --proto4 + pushd $ASTROBEE_WS + python ./src/tools/gnc_visualizer/scripts/visualizer --proto4 popd # Further information diff --git a/external/CATKIN_IGNORE b/external/CATKIN_IGNORE deleted file mode 100644 index 8d1c8b69c3..0000000000 --- a/external/CATKIN_IGNORE +++ /dev/null @@ -1 +0,0 @@ - diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt deleted file mode 100644 index 09e17b861b..0000000000 --- a/external/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# all the external packages have lots of warnings, ignore them -#STRING(REGEX REPLACE "-Wall" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -#STRING(REGEX REPLACE "-Wall" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -#STRING(REGEX REPLACE "-Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -#STRING(REGEX REPLACE "-Werror" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - -# gtest is needed because no binaries distributed with ubuntu!!! -add_subdirectory(gtest) -set(GTEST_LIBRARIES ${GTEST_LIBRARIES} PARENT_SCOPE) -set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE) - diff --git a/gnc/CMakeLists.txt b/gnc/CMakeLists.txt deleted file mode 100644 index a4cca4df8e..0000000000 --- a/gnc/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(ctl) -add_subdirectory(ekf) -add_subdirectory(fam) -add_subdirectory(gnc_autocode) -add_subdirectory(sim_wrapper) diff --git a/gnc/ctl/CMakeLists.txt b/gnc/ctl/CMakeLists.txt index cd8dca1eff..b0e43276e2 100644 --- a/gnc/ctl/CMakeLists.txt +++ b/gnc/ctl/CMakeLists.txt @@ -15,18 +15,54 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ctl) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_msgs + ff_util + config_reader + gnc_autocode +) +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + catkin_package( - LIBRARIES ctl - CATKIN_DEPENDS roscpp sensor_msgs nav_msgs - DEPENDS ff_msgs ff_hw_msgs ff_common + LIBRARIES + ctl + CATKIN_DEPENDS + roscpp + nodelet + ff_msgs + ff_util + config_reader + gnc_autocode ) -create_library(TARGET ctl - LIBS ${catkin_LIBRARIES} ${EIGEN_LIBRARIES} gnc_autocode msg_conversions ff_common config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_msgs ff_hw_msgs) +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} +) + +# Declare C++ libraries +add_library(ctl + src/ctl.cc + src/ctl_nodelet.cc +) +add_dependencies(ctl ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ctl ${catkin_LIBRARIES}) if(CATKIN_ENABLE_TESTING AND ENABLE_INTEGRATION_TESTING) find_package(rostest REQUIRED) @@ -38,4 +74,32 @@ if(CATKIN_ENABLE_TESTING AND ENABLE_INTEGRATION_TESTING) ) endif() -install_launch_files() + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + diff --git a/gnc/ctl/package.xml b/gnc/ctl/package.xml index 0d84445096..6a4eade279 100644 --- a/gnc/ctl/package.xml +++ b/gnc/ctl/package.xml @@ -16,18 +16,18 @@ catkin roscpp - sensor_msgs - vpp_msgs - nav_msgs - ff_msgs nodelet + ff_msgs + ff_util + config_reader + gnc_autocode roscpp - rt_analyze - sensor_msgs - vpp_msgs - nav_msgs - ff_msgs nodelet + ff_msgs + ff_util + ff_msgs + config_reader + gnc_autocode diff --git a/gnc/ekf/CMakeLists.txt b/gnc/ekf/CMakeLists.txt index 1a3769a6ea..5a74453bb7 100644 --- a/gnc/ekf/CMakeLists.txt +++ b/gnc/ekf/CMakeLists.txt @@ -15,17 +15,71 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ekf) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + ff_util + config_reader + gnc_autocode + camera +) + catkin_package( + INCLUDE_DIRS include LIBRARIES ekf - CATKIN_DEPENDS roscpp sensor_msgs nav_msgs - DEPENDS ff_msgs ff_hw_msgs ff_common + CATKIN_DEPENDS roscpp ff_msgs ff_util config_reader gnc_autocode camera +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(ekf + src/ekf.cc + src/ekf_nodelet.cc + src/ekf_wrapper.cc +) +add_dependencies(ekf ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ekf ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET ekf - LIBS ${catkin_LIBRARIES} ${EIGEN_LIBRARIES} gnc_autocode msg_conversions camera ff_common config_reader ff_nodelet ff_flight - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_msgs ff_hw_msgs) +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/gnc/ekf/package.xml b/gnc/ekf/package.xml index f65c8d463f..0062940cee 100644 --- a/gnc/ekf/package.xml +++ b/gnc/ekf/package.xml @@ -16,18 +16,18 @@ catkin roscpp - sensor_msgs - vpp_msgs - nav_msgs ff_msgs - nodelet + ff_util + config_reader + gnc_autocode + camera roscpp - rt_analyze - sensor_msgs - vpp_msgs - nav_msgs ff_msgs - nodelet + ff_util + ff_msgs + config_reader + gnc_autocode + camera diff --git a/gnc/fam/CMakeLists.txt b/gnc/fam/CMakeLists.txt index b51661889c..0c3ee5e304 100644 --- a/gnc/fam/CMakeLists.txt +++ b/gnc/fam/CMakeLists.txt @@ -15,17 +15,77 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(fam) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_msgs + ff_hw_msgs + ff_util + config_reader + gnc_autocode +) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + catkin_package( - LIBRARIES fam - CATKIN_DEPENDS roscpp sensor_msgs nav_msgs - DEPENDS ff_msgs ff_hw_msgs ff_common + LIBRARIES + fam + CATKIN_DEPENDS + roscpp + nodelet + ff_msgs + ff_hw_msgs + ff_util + config_reader + gnc_autocode ) -create_library(TARGET fam - LIBS ${catkin_LIBRARIES} ${EIGEN_LIBRARIES} gnc_autocode msg_conversions ff_common config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_msgs ff_hw_msgs) +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} +) + +# Declare C++ libraries +add_library(fam + src/fam.cc + src/fam_nodelet.cc +) +add_dependencies(fam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(fam ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + -install_launch_files() diff --git a/gnc/fam/package.xml b/gnc/fam/package.xml index c556cf684f..1a4392849d 100644 --- a/gnc/fam/package.xml +++ b/gnc/fam/package.xml @@ -16,18 +16,20 @@ catkin roscpp - sensor_msgs - vpp_msgs - nav_msgs - ff_msgs nodelet + ff_msgs + ff_hw_msgs + ff_util + config_reader + gnc_autocode roscpp - rt_analyze - sensor_msgs - vpp_msgs - nav_msgs - ff_msgs nodelet + ff_msgs + ff_util + ff_msgs + ff_hw_msgs + config_reader + gnc_autocode diff --git a/gnc/gnc_autocode/CMakeLists.txt b/gnc/gnc_autocode/CMakeLists.txt index a43881d83a..b06e34b52e 100644 --- a/gnc/gnc_autocode/CMakeLists.txt +++ b/gnc/gnc_autocode/CMakeLists.txt @@ -15,12 +15,25 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(gnc_autocode) + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_util + config_reader + msg_conversions +) + # find gnc directories find_path ( GNC_ROOT_DIR ctl_controller0_ert_rtw/ctl_controller0.h - PATHS ${CMAKE_SOURCE_DIR}/gnc/matlab/code_generation - HINTS ${CMAKE_SOURCE_DIR}/gnc/matlab/code_generation + PATHS ${CMAKE_SOURCE_DIR}/../matlab/code_generation + HINTS ${CMAKE_SOURCE_DIR}/../matlab/code_generation NO_CMAKE_FIND_ROOT_PATH ) @@ -34,7 +47,7 @@ if (GNC_ROOT_DIR) set (GNC_BL1_DIR ${GNC_ROOT_DIR}/bpm_blower_1_propulsion_module_ert_rtw) set (GNC_BL2_DIR ${GNC_ROOT_DIR}/bpm_blower_2_propulsion_module_ert_rtw) set (GNC_UTIL_DIR ${GNC_ROOT_DIR}/sharedutils) - set (GNC_SPD_DIR ${GNC_ROOT_DIR}/esc_electronic_speed_controller0_ert_rtw) + #set (GNC_SPD_DIR ${GNC_ROOT_DIR}/esc_electronic_speed_controller0_ert_rtw) set (GNC_CXX_DIR ${GNC_ROOT_DIR}/../cxx_functions) set (GNC_INCLUDE_DIRS ${GNC_ADDITIONAL_DIR} ${GNC_CTL_DIR} ${GNC_EST_DIR} ${GNC_FAM_DIR}) else (GNC_ROOT_DIR) @@ -91,9 +104,57 @@ STRING(REGEX REPLACE "-Werror[^ ]*" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w -DPORTABLE_WORDSIZES -ffast-math -funsafe-math-optimizations") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -DPORTABLE_WORDSIZES -ffast-math -funsafe-math-optimizations") -create_library(TARGET gnc_autocode - LIBS ${EIGEN_LIBRARIES} ff_nodelet config_reader msg_conversions - INC ${GNC_INCLUDES} ${EIGEN_INCLUDE_DIRS} - ADD_SRCS ${GNC_SOURCES} +catkin_package( + INCLUDE_DIRS include ${GNC_INCLUDES} + LIBRARIES gnc_autocode + CATKIN_DEPENDS + roscpp + ff_util + config_reader + msg_conversions +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${GNC_INCLUDES} ) +# Declare C++ libraries +add_library(gnc_autocode + src/autocode.cc + src/constants.cc + src/ekf.cc + src/fam.cc + src/sim_csv.cc + src/blowers.cc + src/ctl.cc + src/ekf_csv.cc + src/sim.cc + ${GNC_SOURCES} +) +add_dependencies(gnc_autocode ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gnc_autocode ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) diff --git a/gnc/gnc_autocode/package.xml b/gnc/gnc_autocode/package.xml new file mode 100644 index 0000000000..dfc9e816dd --- /dev/null +++ b/gnc/gnc_autocode/package.xml @@ -0,0 +1,29 @@ + + + gnc_autocode + 0.0.0 + Calls the GNC simulink auto-generated EKF code, and passes + inputs and outputs to and from ros messages. + + + Apache License, Version 2.0 + + + Astrobee Flight Software + + + Astrobee Flight Software + + catkin + roscpp + ff_util + config_reader + msg_conversions + roscpp + ff_util + config_reader + msg_conversions + + + + diff --git a/gnc/sim_wrapper/CMakeLists.txt b/gnc/sim_wrapper/CMakeLists.txt index d4fb7d17ca..7bdc66b067 100644 --- a/gnc/sim_wrapper/CMakeLists.txt +++ b/gnc/sim_wrapper/CMakeLists.txt @@ -15,21 +15,96 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(sim_wrapper) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + ff_hw_msgs + ff_util + config_reader + gnc_autocode + camera + sparse_mapping +) + catkin_package( - LIBRARIES sim_wrapper - CATKIN_DEPENDS roscpp geometry_msgs ff_util nodelet pluginlib + LIBRARIES + sim_wrapper + CATKIN_DEPENDS + roscpp + ff_msgs + ff_hw_msgs + ff_util + config_reader + gnc_autocode + camera + sparse_mapping +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET sim_wrapper - LIBS ${catkin_LIBRARIES} gnc_autocode sparse_mapping msg_conversions camera ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs +# Declare C++ libraries +add_library(sim_wrapper + src/sim.cc + src/sim_nodelet.cc ) +add_dependencies(sim_wrapper ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sim_wrapper ${catkin_LIBRARIES}) -create_tool_targets(DIR tools - LIBS sim_wrapper +## Declare a C++ executable: sim_node +add_executable(sim_node tools/sim_node.cc) +add_dependencies(sim_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sim_node + sim_wrapper gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: sim_node +add_executable(test_sim tools/test_sim.cc) +add_dependencies(test_sim ${catkin_EXPORTED_TARGETS}) +target_link_libraries(test_sim + sim_wrapper ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -install_launch_files() \ No newline at end of file +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS sim_node DESTINATION bin) +install(TARGETS test_sim DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/sim_node share/${PROJECT_NAME} + COMMAND ln -s ../../bin/test_sim share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/gnc/sim_wrapper/package.xml b/gnc/sim_wrapper/package.xml index f3c0e624ce..3eded9c9ed 100644 --- a/gnc/sim_wrapper/package.xml +++ b/gnc/sim_wrapper/package.xml @@ -15,20 +15,22 @@ Astrobee Flight Software catkin - nodelet - pluginlib + roscpp ff_msgs + ff_hw_msgs ff_util - roscpp - sensor_msgs - geometry_msgs + config_reader + gnc_autocode + camera + sparse_mapping roscpp - nodelet - pluginlib ff_msgs + ff_hw_msgs ff_util - sensor_msgs - geometry_msgs + config_reader + gnc_autocode + camera + sparse_mapping diff --git a/hardware/eps_driver/CMakeLists.txt b/hardware/eps_driver/CMakeLists.txt index 74baa86642..ad23c586b0 100644 --- a/hardware/eps_driver/CMakeLists.txt +++ b/hardware/eps_driver/CMakeLists.txt @@ -15,9 +15,24 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(eps_driver) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + ff_util + ff_hw_msgs + i2c +) + catkin_package( + INCLUDE_DIRS include LIBRARIES eps_driver CATKIN_DEPENDS @@ -26,41 +41,90 @@ catkin_package( pluginlib ff_util ff_hw_msgs + i2c ) -# ROS agnostic proxy library and tool +########### +## Build ## +########### -create_library( - DIR src/eps_driver - TARGET eps_driver - LIBS i2c +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR tools/eps_driver_tool - LIBS eps_driver ff_common +# Declare C++ libraries +add_library(eps_driver + src/eps_driver/eps_driver.cc ) +add_dependencies(eps_driver ${catkin_EXPORTED_TARGETS}) +target_link_libraries(eps_driver ${catkin_LIBRARIES}) -# ROS node -create_library( - DIR src/eps_driver_node - TARGET eps_driver_node - LIBS ${catkin_LIBRARIES} eps_driver config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs +add_library(eps_driver_node + src/eps_driver_node/eps_driver_node.cc ) +add_dependencies(eps_driver_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(eps_driver_node eps_driver ${catkin_LIBRARIES}) + +## Declare a C++ executable: eps_driver_tool +add_executable(eps_driver_tool tools/eps_driver_tool/eps_driver_tool.cc) +add_dependencies(eps_driver_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(eps_driver_tool + eps_driver gflags ${catkin_LIBRARIES}) -# Simulator +## Declare a C++ executable: eps_simulator +add_executable(eps_simulator tools/eps_simulator/eps_simulator.cc) +add_dependencies(eps_simulator ${catkin_EXPORTED_TARGETS}) +target_link_libraries(eps_simulator + eps_driver gflags ${catkin_LIBRARIES}) -create_tool_targets( - DIR tools/eps_simulator - LIBS ${catkin_LIBRARIES} eps_driver ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME}_node + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -install_launch_files() +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Install C++ executables +install(TARGETS eps_driver_tool DESTINATION bin) +install(TARGETS eps_simulator DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/eps_driver_tool share/${PROJECT_NAME} + COMMAND ln -s ../../bin/eps_simulator share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + install(FILES tools/eps_aux.py DESTINATION share/${PROJECT_NAME}) diff --git a/hardware/eps_driver/package.xml b/hardware/eps_driver/package.xml index f1c49b11d1..1a809c5486 100644 --- a/hardware/eps_driver/package.xml +++ b/hardware/eps_driver/package.xml @@ -18,11 +18,13 @@ pluginlib ff_util ff_hw_msgs + i2c roscpp nodelet pluginlib ff_util ff_hw_msgs + i2c diff --git a/hardware/epson_imu/CMakeLists.txt b/hardware/epson_imu/CMakeLists.txt index 65c492fb90..635c1137e4 100644 --- a/hardware/epson_imu/CMakeLists.txt +++ b/hardware/epson_imu/CMakeLists.txt @@ -15,19 +15,72 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(epson_imu) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + rospy + nodelet + sensor_msgs + ff_util +) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result") catkin_package( LIBRARIES epson_imu - CATKIN_DEPENDS roscpp rospy sensor_msgs + CATKIN_DEPENDS roscpp rospy nodelet sensor_msgs ff_util +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(epson_imu + src/epson_imu_nodelet.cc + src/G362P.cc + src/GPIO.cc +) +add_dependencies(epson_imu ${catkin_EXPORTED_TARGETS}) +target_link_libraries(epson_imu ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -create_library(TARGET epson_imu - LIBS ${catkin_LIBRARIES} ff_nodelet config_reader - INC ${catkin_INCLUDE_DIRS} +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/epson_imu/package.xml b/hardware/epson_imu/package.xml index 2c6eab0869..9e9928e77e 100644 --- a/hardware/epson_imu/package.xml +++ b/hardware/epson_imu/package.xml @@ -15,12 +15,14 @@ catkin roscpp rospy - sensor_msgs nodelet + sensor_msgs + ff_util roscpp rospy - sensor_msgs nodelet + sensor_msgs + ff_util diff --git a/hardware/fam_cmd_i2c/CMakeLists.txt b/hardware/fam_cmd_i2c/CMakeLists.txt index 60884dc8ad..0cbdf2941c 100644 --- a/hardware/fam_cmd_i2c/CMakeLists.txt +++ b/hardware/fam_cmd_i2c/CMakeLists.txt @@ -15,16 +15,64 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(fam_cmd_i2c) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + rospy + ff_msgs + std_msgs + i2c +) + catkin_package( - CATKIN_DEPENDS roscpp rospy ff_msgs std_msgs + CATKIN_DEPENDS roscpp rospy ff_msgs std_msgs i2c ) -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} i2c - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs std_msgs +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -install_launch_files() +## Declare a C++ executable: inspection_tool +add_executable(fam_cmd_gen tools/fam_cmd_gen.cc) +add_dependencies(fam_cmd_gen ${catkin_EXPORTED_TARGETS}) +target_link_libraries(fam_cmd_gen + ${catkin_LIBRARIES}) + +## Declare a C++ executable: inspection_tool +add_executable(fam_cmd_i2c_node tools/fam_cmd_i2c_node.cc) +add_dependencies(fam_cmd_i2c_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(fam_cmd_i2c_node + ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Install C++ executables +install(TARGETS fam_cmd_gen DESTINATION bin) +install(TARGETS fam_cmd_i2c_node DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/fam_cmd_gen share/${PROJECT_NAME} + COMMAND ln -s ../../bin/fam_cmd_i2c_node share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + diff --git a/hardware/fam_cmd_i2c/package.xml b/hardware/fam_cmd_i2c/package.xml index c9c89e41e3..ac3ebc363a 100644 --- a/hardware/fam_cmd_i2c/package.xml +++ b/hardware/fam_cmd_i2c/package.xml @@ -18,9 +18,11 @@ rospy ff_msgs std_msgs + i2c roscpp rospy ff_msgs std_msgs + i2c diff --git a/hardware/ff_serial/CMakeLists.txt b/hardware/ff_serial/CMakeLists.txt index 58d30a1be4..87355d7a07 100644 --- a/hardware/ff_serial/CMakeLists.txt +++ b/hardware/ff_serial/CMakeLists.txt @@ -15,10 +15,58 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ff_serial) -create_library( - TARGET ff_serial - DIR src - LIBS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +find_package(catkin REQUIRED COMPONENTS +) + +catkin_package( + LIBRARIES ff_serial + INCLUDE_DIRS include +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(ff_serial + src/serial.cc +) +add_dependencies(ff_serial ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ff_serial ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) diff --git a/hardware/flashlight/CMakeLists.txt b/hardware/flashlight/CMakeLists.txt index 2b70e3bedf..868a45dcd2 100644 --- a/hardware/flashlight/CMakeLists.txt +++ b/hardware/flashlight/CMakeLists.txt @@ -15,34 +15,104 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(flashlight) -# Core library -create_library(TARGET flashlight - INC ${GLOG_INCLUDE_DIRS} - LIBS ${GLOG_LIBRARIES} i2c +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + roslib + nodelet + ff_hw_msgs + i2c + ff_util + config_reader +) + +catkin_package( + LIBRARIES + flashlight + CATKIN_DEPENDS + roscpp + roslib + nodelet + ff_hw_msgs + i2c + ff_util + config_reader ) -# Standalone test programs -create_tool_targets(DIR tools - INC ${GFLAGS_INCLUDE_DIRS} - LIBS ${GFLAGS_LIBRARIES} flashlight ff_common +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -# Create ROS nodes if we are using ROS -if(USE_ROS) - catkin_package( - LIBRARIES flashlight - CATKIN_DEPENDS roscpp roslib nodelet - DEPENDS ff_hw_msgs + # Declare C++ librarie - Core library + add_library(flashlight + src/flashlight.cc ) + add_dependencies(flashlight ${catkin_EXPORTED_TARGETS}) + target_link_libraries(flashlight glog ${catkin_LIBRARIES}) - create_library(TARGET flashlight_nodelet - DIR src/ros - LIBS ${roscpp_LIBRARIES} ${nodelet_LIBRARIES} flashlight config_reader - ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs + # Declare C++ librarie + add_library(flashlight_nodelet + src/ros/flashlight_nodelet.cc ) - install_launch_files() -endif(USE_ROS) + add_dependencies(flashlight_nodelet ${catkin_EXPORTED_TARGETS}) + target_link_libraries(flashlight_nodelet flashlight ${catkin_LIBRARIES}) + +## Declare a C++ executable: flashlight_test +add_executable(flashlight_test tools/flashlight_test.cc) +add_dependencies(flashlight_test ${catkin_EXPORTED_TARGETS}) +target_link_libraries(flashlight_test + flashlight gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME}_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Install C++ executables +install(TARGETS flashlight_test DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/flashlight_test share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/flashlight/package.xml b/hardware/flashlight/package.xml index 035c062fcc..d2756af322 100644 --- a/hardware/flashlight/package.xml +++ b/hardware/flashlight/package.xml @@ -18,11 +18,16 @@ roslib nodelet ff_hw_msgs + i2c + ff_util + config_reader roscpp + roslib nodelet ff_hw_msgs - roslib - message_runtime + i2c + ff_util + config_reader diff --git a/hardware/flycapture/CMakeLists.txt b/hardware/flycapture/CMakeLists.txt index 71b7762520..c558af0e75 100644 --- a/hardware/flycapture/CMakeLists.txt +++ b/hardware/flycapture/CMakeLists.txt @@ -15,15 +15,22 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(flycapture) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + # Need to think of a better way to get flycapture find_path(FLYCAPTURE_INCLUDE_DIR flycapture/FlyCapture2Defs.h HINTS ${FLYCAPTURE_ROOT_DIR}/include /usr) find_library(FLYCAPTURE_LIBRARY NAMES flycapture libflycapture HINTS /usr/lib ${FLYCAPTURE_ROOT_DIR}/lib) -find_package_handle_standard_args(FLYCAPTURE DEFAULT_MSG - FLYCAPTURE_INCLUDE_DIR FLYCAPTURE_LIBRARY) +# find_package_handle_standard_args(FLYCAPTURE DEFAULT_MSG +# FLYCAPTURE_INCLUDE_DIR FLYCAPTURE_LIBRARY) + +find_package(catkin REQUIRED COMPONENTS +) catkin_package( LIBRARIES flycapture @@ -32,10 +39,11 @@ catkin_package( if (FLYCAPTURE_FOUND) - create_tool_targets(DIR tools - LIBS ${FLYCAPTURE_LIBRARY} ${catkin_LIBRARIES} ff_nodelet - INC ${FLYCAPTURE_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} - ) + ## Declare a C++ executable: fly_node + add_executable(fly_node tools/fly_node.cc) + add_dependencies(fly_node ${catkin_EXPORTED_TARGETS}) + target_link_libraries(fly_node + gflags ${catkin_LIBRARIES}) else() message(STATUS "Not building fly_node") endif() diff --git a/hardware/gpio/CMakeLists.txt b/hardware/gpio/CMakeLists.txt index 7fb5761e9c..78cc53f436 100644 --- a/hardware/gpio/CMakeLists.txt +++ b/hardware/gpio/CMakeLists.txt @@ -15,4 +15,44 @@ # License for the specific language governing permissions and limitations # under the License. -create_library(TARGET gpio) +cmake_minimum_required(VERSION 3.0) +project(gpio) + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +find_package(catkin REQUIRED COMPONENTS +) + +catkin_package( + LIBRARIES + gpio +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(gpio + src/gpio.cc +) +add_dependencies(gpio ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gpio ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) \ No newline at end of file diff --git a/hardware/i2c/CMakeLists.txt b/hardware/i2c/CMakeLists.txt index 3f73f4b024..1ba70cf931 100644 --- a/hardware/i2c/CMakeLists.txt +++ b/hardware/i2c/CMakeLists.txt @@ -15,8 +15,52 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(i2c) -create_library(TARGET i2c - LIBS ${GLOG_LIBRARIES} - INC ${GLOG_INCLUDE_DIRS}) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +find_package(catkin REQUIRED COMPONENTS +) + +catkin_package( + LIBRARIES i2c + INCLUDE_DIRS include +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(i2c + src/i2c.cc + src/i2c_new.cc +) +add_dependencies(i2c ${catkin_EXPORTED_TARGETS}) +target_link_libraries(i2c glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) diff --git a/hardware/i2c/package.xml b/hardware/i2c/package.xml index 0dcc2828d7..00136cafd4 100644 --- a/hardware/i2c/package.xml +++ b/hardware/i2c/package.xml @@ -15,7 +15,5 @@ Astrobee Flight Software catkin - roscpp - roscpp diff --git a/hardware/is_camera/CMakeLists.txt b/hardware/is_camera/CMakeLists.txt index 32b6d3c1c9..b3e399b4fe 100644 --- a/hardware/is_camera/CMakeLists.txt +++ b/hardware/is_camera/CMakeLists.txt @@ -15,8 +15,21 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(is_camera) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + image_transport + nodelet + ff_util + config_reader +) + # Need to find libv4l2 find_path(V4L2_INCLUDE_DIR libv4l2.h linux/videodev2.h HINTS /usr ${V4L2_ROOT_DIR}) @@ -25,22 +38,56 @@ find_library(V4L2_LIBRARY NAMES libv4l2 v4l2 find_package_handle_standard_args(V4L2 DEFAULT_MSG V4L2_INCLUDE_DIR V4L2_LIBRARY) + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) + catkin_package( LIBRARIES is_camera - CATKIN_DEPENDS roscpp image_transport nodelet + CATKIN_DEPENDS + roscpp + image_transport + nodelet + ff_util + config_reader ) -create_library(TARGET is_camera - LIBS ${catkin_LIBRARIES} ${V4L2_LIBRARY} config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${V4L2_INCLUDE_DIR} - DEPS ff_msgs) +########### +## Build ## +########### -create_tool_targets(DIR tools - LIBS is_camera - ) +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(is_camera + src/camera.cc +) +add_dependencies(is_camera ${catkin_EXPORTED_TARGETS}) +target_link_libraries(is_camera ${V4L2_LIBRARY} ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) -# I'm not sure who installed package.xml for us, but we should do the same for -# nodelet_plugins.xml -install(FILES nodelet_plugins.xml DESTINATION share/is_camera) +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/is_camera/package.xml b/hardware/is_camera/package.xml index ee9bbd1cf2..1b8858acbe 100644 --- a/hardware/is_camera/package.xml +++ b/hardware/is_camera/package.xml @@ -15,12 +15,16 @@ Astrobee Flight Software catkin + image_transport roscpp nodelet - image_transport + ff_util + config_reader roscpp - nodelet image_transport + nodelet + ff_util + config_reader diff --git a/hardware/laser/CMakeLists.txt b/hardware/laser/CMakeLists.txt index b064c43921..e8534aee9c 100644 --- a/hardware/laser/CMakeLists.txt +++ b/hardware/laser/CMakeLists.txt @@ -15,33 +15,102 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(laser) -# Core library -create_library(TARGET laser - INC ${GLOG_INCLUDE_DIRS} - LIBS ${GLOG_LIBRARIES} i2c - DEPS i2c) - -# Standalone test programs -create_tool_targets(DIR tools - INC ${GFLAGS_INCLUDE_DIRS} - LIBS ${GFLAGS_LIBRARIES} laser ff_common - DEPS laser) - -# Create ROS nodes if we are using ROS -if(USE_ROS) - catkin_package( - LIBRARIES laser - CATKIN_DEPENDS roscpp roslib nodelet - DEPENDS ff_hw_msgs - ) - - create_library(TARGET laser_nodelet - DIR src/ros - LIBS ${catkin_LIBRARIES} laser config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs - ) - install_launch_files() -endif(USE_ROS) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + roslib + nodelet + cv_bridge + ff_util + ff_common + ff_hw_msgs + i2c + config_reader +) + +catkin_package( + INCLUDE_DIRS include + LIBRARIES laser + CATKIN_DEPENDS + roscpp + roslib + nodelet + cv_bridge + ff_util + ff_common + ff_hw_msgs + i2c + config_reader +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} +) + +# Declare C++ libraries +add_library(laser + src/laser.cc +) +add_dependencies(laser ${catkin_EXPORTED_TARGETS}) +target_link_libraries(laser ${catkin_LIBRARIES} ${EIGEN_LIBRARIES}) + +# Declare C++ libraries +add_library(laser_nodelet + src/ros/laser_nodelet.cc +) +add_dependencies(laser_nodelet ${catkin_EXPORTED_TARGETS}) +target_link_libraries(laser_nodelet laser ${catkin_LIBRARIES} ${EIGEN_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(laser_test tools/laser_test.cc) +add_dependencies(laser_test ${catkin_EXPORTED_TARGETS}) +target_link_libraries(laser_test + laser gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME}_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS laser_test DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/laser_test share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/laser/package.xml b/hardware/laser/package.xml index 653cf7196c..63332e9b2b 100644 --- a/hardware/laser/package.xml +++ b/hardware/laser/package.xml @@ -15,12 +15,21 @@ roscpp roslib nodelet + cv_bridge + ff_util + ff_common ff_hw_msgs + i2c + config_reader roscpp + roslib nodelet + cv_bridge + ff_util + ff_common ff_hw_msgs - roslib - message_runtime + i2c + config_reader diff --git a/hardware/perching_arm/CMakeLists.txt b/hardware/perching_arm/CMakeLists.txt index 2784bdf506..6f1e67d3e5 100644 --- a/hardware/perching_arm/CMakeLists.txt +++ b/hardware/perching_arm/CMakeLists.txt @@ -15,8 +15,22 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(perching_arm) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + ff_util + ff_serial + ff_hw_msgs +) + catkin_package( LIBRARIES perching_arm @@ -25,21 +39,61 @@ catkin_package( nodelet pluginlib ff_util + ff_serial ff_hw_msgs - sensor_msgs ) -create_library( - TARGET perching_arm - LIBS ${catkin_LIBRARIES} ff_serial config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS perching_arm_gencpp +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ) -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} perching_arm ff_common - INC ${catkin_INCLUDE_DIRS} - DEPS ff_common +# Declare C++ libraries +add_library(perching_arm + src/perching_arm.cc + src/perching_arm_node.cc ) +add_dependencies(perching_arm ${catkin_EXPORTED_TARGETS}) +target_link_libraries(perching_arm ${catkin_LIBRARIES} ${EIGEN_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(perching_arm_tool tools/perching_arm_tool.cc) +add_dependencies(perching_arm_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(perching_arm_tool + perching_arm gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS perching_arm_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/perching_arm_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/perching_arm/package.xml b/hardware/perching_arm/package.xml index 60601af3e8..921d8ba8e2 100644 --- a/hardware/perching_arm/package.xml +++ b/hardware/perching_arm/package.xml @@ -17,14 +17,14 @@ roscpp nodelet pluginlib - sensor_msgs ff_util + ff_serial ff_hw_msgs roscpp nodelet pluginlib - sensor_msgs ff_util + ff_serial ff_hw_msgs diff --git a/hardware/pico_driver/CMakeLists.txt b/hardware/pico_driver/CMakeLists.txt index ba5f87099d..18bdfc62cd 100644 --- a/hardware/pico_driver/CMakeLists.txt +++ b/hardware/pico_driver/CMakeLists.txt @@ -15,22 +15,64 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(pico_driver) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +if (ENABLE_PICOFLEXX) +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_msgs + ff_util + cv_bridge +) + +# System dependencies are found with CMake's conventions +find_package(royale REQUIRED) + catkin_package( LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS roscpp nodelet ff_msgs - DEPENDS ${PROJECT_NAME} + CATKIN_DEPENDS roscpp nodelet ff_msgs ff_util cv_bridge ) -link_directories(${royale_LIB_DIR}) +########### +## Build ## +########### -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${royale_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${royale_INCLUDE_DIRS} +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + ${royale_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} ) +# Declare C++ libraries +add_library(pico_driver + src/pico_driver.cc +) +add_dependencies(pico_driver ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pico_driver ${royale_LIBRARIES} ${EIGEN_LIBRARIES} ${catkin_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(pico_proxy tools/pico_proxy.cc) +add_dependencies(pico_proxy ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pico_proxy + pico_driver gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(pico_tool tools/pico_tool.cc) +add_dependencies(pico_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pico_tool + pico_driver gflags glog ${royale_LIBRARIES} ${catkin_LIBRARIES}) + if(CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) # Pico flexx initialization fault tester add_rostest_gtest(test_init_pico_flexx test/test_init_pico_flexx.test @@ -38,14 +80,43 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_pico_flexx - ${catkin_LIBRARIES} config_reader ff_nodelet + glog ${catkin_LIBRARIES} ) endif() -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} ${royale_LIBRARIES} uvc - INC ${catkin_INCLUDE_DIRS} ${royale_INCLUDE_DIRS} - DEPS ff_msgs opencv +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Install C++ executables +install(TARGETS pico_proxy DESTINATION bin) +install(TARGETS pico_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/pico_proxy share/${PROJECT_NAME} + COMMAND ln -s ../../bin/pico_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + +else (ENABLE_PICOFLEXX) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() +endif (ENABLE_PICOFLEXX) diff --git a/hardware/pico_driver/package.xml b/hardware/pico_driver/package.xml index 00b2e7634a..d789d1c0cb 100644 --- a/hardware/pico_driver/package.xml +++ b/hardware/pico_driver/package.xml @@ -17,11 +17,15 @@ catkin roscpp nodelet - ff_msgs + ff_msgs + ff_util + cv_bridge roscpp nodelet tf2_ros ff_msgs + ff_util + cv_bridge diff --git a/hardware/pmc_actuator/CMakeLists.txt b/hardware/pmc_actuator/CMakeLists.txt index 823883697b..438e4e1ed4 100644 --- a/hardware/pmc_actuator/CMakeLists.txt +++ b/hardware/pmc_actuator/CMakeLists.txt @@ -15,8 +15,24 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(pmc_actuator) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + ff_util + std_msgs + ff_msgs + ff_hw_msgs + i2c +) + catkin_package( LIBRARIES pmc_actuator @@ -28,36 +44,103 @@ catkin_package( std_msgs ff_msgs ff_hw_msgs + i2c ) -# ROS agnostic driver and tool +########### +## Build ## +########### -create_library( - DIR src/pmc_actuator - TARGET pmc_actuator - LIBS i2c +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ) -create_tool_targets(DIR tools/pmc_actuator_tool - LIBS pmc_actuator +# ROS agnostic driver and tool + +# Declare C++ libraries +add_library(pmc_actuator + src/pmc_actuator/pmc_actuator.cc ) +add_dependencies(pmc_actuator ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pmc_actuator ${catkin_LIBRARIES} ${EIGEN_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(pmc_actuator_tool tools/pmc_actuator_tool/pmc_actuator_tool.cc) +add_dependencies(pmc_actuator_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pmc_actuator_tool + pmc_actuator gflags glog ${catkin_LIBRARIES}) # ROS nodelet and tools -create_library( - DIR src/pmc_actuator_nodelet - TARGET pmc_actuator_nodelet - LIBS ${catkin_LIBRARIES} pmc_actuator config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs +# Declare C++ libraries +add_library(pmc_actuator_nodelet + src/pmc_actuator_nodelet/pmc_actuator_nodelet.cc +) +add_dependencies(pmc_actuator_nodelet ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pmc_actuator_nodelet pmc_actuator ${catkin_LIBRARIES} ${EIGEN_LIBRARIES}) + +## Declare a C++ executable: pmc_actuator_cmd_test +add_executable(pmc_actuator_cmd_test tools/pmc_actuator_cmd_test.cc) +add_dependencies(pmc_actuator_cmd_test ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pmc_actuator_cmd_test + pmc_actuator gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: pmc_actuator_feeder +add_executable(pmc_actuator_feeder tools/pmc_actuator_feeder.cc) +add_dependencies(pmc_actuator_feeder ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pmc_actuator_feeder + pmc_actuator gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: pmc_autotrim_node +add_executable(pmc_autotrim_node tools/pmc_autotrim_node.cc) +add_dependencies(pmc_autotrim_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pmc_autotrim_node + pmc_actuator gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME}_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} pmc_actuator ff_nodelet - INC ${catkin_INCLUDE_DIRS} +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Install C++ executables +install(TARGETS pmc_actuator_tool DESTINATION bin) +install(TARGETS pmc_actuator_cmd_test DESTINATION bin) +install(TARGETS pmc_actuator_feeder DESTINATION bin) +install(TARGETS pmc_autotrim_node DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/pmc_actuator_tool share/${PROJECT_NAME} + COMMAND ln -s ../../bin/pmc_actuator_cmd_test share/${PROJECT_NAME} + COMMAND ln -s ../../bin/pmc_actuator_feeder share/${PROJECT_NAME} + COMMAND ln -s ../../bin/pmc_autotrim_node share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + install(FILES tools/pmc_currents.py tools/pmc_status.py diff --git a/hardware/pmc_actuator/tools/pmc_actuator_tool/pmc_actuator_tool.cc b/hardware/pmc_actuator/tools/pmc_actuator_tool/pmc_actuator_tool.cc index 96576ddf0d..eb86a9dc9c 100644 --- a/hardware/pmc_actuator/tools/pmc_actuator_tool/pmc_actuator_tool.cc +++ b/hardware/pmc_actuator/tools/pmc_actuator_tool/pmc_actuator_tool.cc @@ -24,7 +24,7 @@ #include #include -// C++11 STL includes +// C++ STL includes #include #include #include diff --git a/hardware/signal_lights/CMakeLists.txt b/hardware/signal_lights/CMakeLists.txt index 7a6ba0ae3a..ce53bd52e6 100644 --- a/hardware/signal_lights/CMakeLists.txt +++ b/hardware/signal_lights/CMakeLists.txt @@ -15,8 +15,23 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(signal_lights) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + ff_util + std_msgs + ff_msgs + ff_hw_msgs +) + catkin_package( LIBRARIES signal_lights @@ -30,32 +45,80 @@ catkin_package( ff_hw_msgs ) -# ROS agnostic driver and tool -create_library( - DIR src/custom_i2c - TARGET custom_i2c +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(custom_i2c + src/custom_i2c/i2c.cc ) +add_dependencies(custom_i2c ${catkin_EXPORTED_TARGETS}) +target_link_libraries(custom_i2c ${catkin_LIBRARIES}) -create_library( - DIR src/signal_lights - TARGET signal_lights - LIBS custom_i2c +# Declare C++ libraries +add_library(signal_lights + src/signal_lights/signal_lights.cc ) +add_dependencies(signal_lights ${catkin_EXPORTED_TARGETS}) +target_link_libraries(signal_lights custom_i2c ${catkin_LIBRARIES}) -create_tool_targets( - DIR tools - LIBS signal_lights ff_common custom_i2c +# Declare C++ libraries +add_library(signal_lights_nodelet + src/signal_lights_node/signal_lights_nodelet.cc ) +add_dependencies(signal_lights_nodelet ${catkin_EXPORTED_TARGETS}) +target_link_libraries(signal_lights_nodelet signal_lights ${catkin_LIBRARIES}) -# ROS nodelet and tools +## Declare a C++ executable: inspection_tool +add_executable(signal_lights_tool tools/signal_lights_tool.cc) +add_dependencies(signal_lights_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(signal_lights_tool + signal_lights gflags ${catkin_LIBRARIES}) -create_library( - DIR src/signal_lights_node - TARGET signal_lights_nodelet - LIBS ${catkin_LIBRARIES} signal_lights config_reader ff_nodelet custom_i2c - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS custom_i2c + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS signal_lights + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS signal_lights_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -install_launch_files() +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS signal_lights_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/signal_lights_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/smart_dock/CMakeLists.txt b/hardware/smart_dock/CMakeLists.txt index 8a71ce8c23..33ab1059e3 100644 --- a/hardware/smart_dock/CMakeLists.txt +++ b/hardware/smart_dock/CMakeLists.txt @@ -15,42 +15,117 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(smart_dock) -set(DEPS - rapidExtAstrobee -) - -set(LIBS - Qt4::QtXml - rapidIo - rapidExtAstrobee - ff_common) - -set(INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${SORACORE_INCLUDE_DIRS} -) - -create_library(TARGET smart_dock - LIBS ${LIBS} i2c eps_driver - INC ${INCLUDES} - DEPS ${DEPS} -) - -create_tool_targets(DIR tools - LIBS ${LIBS} smart_dock config_reader - INC ${INCLUDES} - DEPS ${DEPS} -) - -# Determine our module name -get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) - -install(CODE "execute_process( - COMMAND mkdir -p share/${MODULE_NAME} - COMMAND ln -s ../../bin/dds_ros_bridge share/${MODULE_NAME} - WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} - OUTPUT_QUIET - ERROR_QUIET - )") +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +if (USE_DDS) + ## Find catkin macros and libraries + find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + i2c + eps_driver + dds_msgs + ) + + # System dependencies are found with CMake's conventions + find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS filesystem system iostreams thread program_options timer) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../cmake") + + if (USE_CTC) + set(SORACORE_ROOT_DIR ${ARM_CHROOT_DIR}/usr) + else (USE_CTC) + set(SORACORE_ROOT_DIR /usr) + endif (USE_CTC) + + set(MIRO_ROOT_DIR ${SORACORE_ROOT_DIR}) + + SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + + # just calls the normal one + find_package(Qt4 4.6.0 REQUIRED QtXml) + find_package(Miro REQUIRED) + find_package(RtiDds REQUIRED) + find_package(Soracore REQUIRED) + catkin_package( + LIBRARIES + signal_lights + CATKIN_DEPENDS + roscpp + nodelet + i2c + eps_driver + dds_msgs + ) + + ########### + ## Build ## + ########### + + # Specify additional locations of header files + include_directories( + include + ${catkin_INCLUDE_DIRS} + ${RTIDDS_INCLUDE_DIR} + ${SORACORE_INCLUDE_DIRS} + ${MIRO_INCLUDE_DIR} + ${QT_INCLUDE_DIR} + ${QT_INCLUDE_DIR}/Qt + ) + + + # Declare C++ libraries + add_library(smart_dock + src/smart_dock.cc + src/smart_dock_node.cc + ) + target_compile_definitions(smart_dock PUBLIC ${RTIDDS_DEFINE_FLAGS}) + add_dependencies(smart_dock ${catkin_EXPORTED_TARGETS}) + target_link_libraries(smart_dock rapidIo ${catkin_LIBRARIES}) + + ## Declare a C++ executable: smart_dock_service + add_executable(smart_dock_service tools/smart_dock_service.cc) + add_dependencies(smart_dock_service ${catkin_EXPORTED_TARGETS}) + target_link_libraries(smart_dock_service + smart_dock gflags ${catkin_LIBRARIES}) + + ## Declare a C++ executable: smart_dock_tool + add_executable(smart_dock_tool tools/smart_dock_tool.cc) + add_dependencies(smart_dock_tool ${catkin_EXPORTED_TARGETS}) + target_link_libraries(smart_dock_tool + smart_dock gflags ${catkin_LIBRARIES}) + + # Determine our module name + get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) + + ############# + ## Install ## + ############# + + # Mark libraries for installation + install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ) + + # Install C++ executables + install(TARGETS smart_dock_service DESTINATION bin) + install(TARGETS smart_dock_tool DESTINATION bin) + install(CODE "execute_process( + COMMAND ln -s ../../bin/smart_dock_service share/${PROJECT_NAME} + COMMAND ln -s ../../bin/smart_dock_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +else (USE_DDS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() +endif (USE_DDS) \ No newline at end of file diff --git a/hardware/smart_dock/include/smart_dock/smart_dock_node.h b/hardware/smart_dock/include/smart_dock/smart_dock_node.h index 4bdc4362c2..a04e0c31cc 100644 --- a/hardware/smart_dock/include/smart_dock/smart_dock_node.h +++ b/hardware/smart_dock/include/smart_dock/smart_dock_node.h @@ -28,11 +28,11 @@ #include #include -#include "AstrobeeConstants.h" +#include "dds_msgs/AstrobeeConstants.h" #include "ff_common/init.h" -#include "DockStateSupport.h" +#include "dds_msgs/DockStateSupport.h" #include "knDds/DdsEntitiesFactory.h" #include "knDds/DdsEntitiesFactorySvc.h" diff --git a/hardware/smart_dock/package.xml b/hardware/smart_dock/package.xml new file mode 100644 index 0000000000..91f95b596c --- /dev/null +++ b/hardware/smart_dock/package.xml @@ -0,0 +1,33 @@ + + smart_dock + 0.0.1 + + Package to control the signal lights + + + Apache License, Version 2.0 + + + Astrobee Flight Software + + + Astrobee Flight Software + + catkin + roscpp + nodelet + i2c + eps_driver + ff_util + ff_msgs + ff_hw_msgs + dds_msgs + roscpp + nodelet + i2c + eps_driver + ff_util + ff_msgs + ff_hw_msgs + dds_msgs + diff --git a/hardware/speed_cam/CMakeLists.txt b/hardware/speed_cam/CMakeLists.txt index 840a9170c0..1a0a5aa3f2 100644 --- a/hardware/speed_cam/CMakeLists.txt +++ b/hardware/speed_cam/CMakeLists.txt @@ -15,29 +15,59 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(speed_cam) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_util + ff_hw_msgs + ff_serial + mavlink +) + catkin_package( LIBRARIES speed_cam CATKIN_DEPENDS roscpp nodelet - pluginlib - sensor_msgs - geometry_msgs ff_util ff_hw_msgs - mavlink + ff_serial ) -create_library( - TARGET speed_cam - LIBS ${catkin_LIBRARIES} ff_serial config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS mavlink speed_cam_gencpp +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) +# Declare C++ libraries +# Declare C++ libraries +add_library(speed_cam + src/speed_cam.cc + src/speed_cam_node.cc +) +add_dependencies(speed_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(speed_cam ${catkin_LIBRARIES}) + +## Declare a C++ executable: speed_cam_tool +add_executable(speed_cam_tool tools/speed_cam_tool.cc) +add_dependencies(speed_cam_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(speed_cam_tool + speed_cam gflags ${catkin_LIBRARIES}) + + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) # Speed cam initialization fault tester @@ -47,13 +77,37 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_speed_cam - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} speed_cam - INC ${catkin_INCLUDE_DIRS} +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Install C++ executables +install(TARGETS speed_cam_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/speed_cam_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + diff --git a/hardware/speed_cam/package.xml b/hardware/speed_cam/package.xml index 5a47339720..985cc8b6d5 100644 --- a/hardware/speed_cam/package.xml +++ b/hardware/speed_cam/package.xml @@ -16,19 +16,15 @@ catkin roscpp nodelet - pluginlib - sensor_msgs - geometry_msgs ff_util ff_hw_msgs + ff_serial mavlink roscpp nodelet - pluginlib - sensor_msgs - geometry_msgs ff_util ff_hw_msgs + ff_serial mavlink diff --git a/hardware/temp_monitor/CMakeLists.txt b/hardware/temp_monitor/CMakeLists.txt index ac4e787f8f..e74a1eff61 100644 --- a/hardware/temp_monitor/CMakeLists.txt +++ b/hardware/temp_monitor/CMakeLists.txt @@ -15,30 +15,86 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(temp_monitor) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + i2c + config_reader + ff_hw_msgs + ff_msgs + ff_util +) + catkin_package( LIBRARIES temp_monitor CATKIN_DEPENDS roscpp nodelet - pluginlib + i2c + config_reader ff_util ff_hw_msgs - sensor_msgs ) -create_library( - TARGET temp_monitor - LIBS ${catkin_LIBRARIES} i2c config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS config_reader i2c +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR tools - LIBS temp_monitor +# Declare C++ libraries +add_library(temp_monitor + src/ADT7410.cc + src/TCN75A.cc + src/temp_monitor.cc + src/temp_monitor_node.cc ) +add_dependencies(temp_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(temp_monitor ${catkin_LIBRARIES}) + +## Declare a C++ executable: temp_monitor_tool +add_executable(temp_monitor_tool tools/temp_monitor_tool.cc) +add_dependencies(temp_monitor_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(temp_monitor_tool + temp_monitor gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS temp_monitor_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/temp_monitor_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() \ No newline at end of file +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/temp_monitor/package.xml b/hardware/temp_monitor/package.xml index 5be91546e6..00b8076e65 100644 --- a/hardware/temp_monitor/package.xml +++ b/hardware/temp_monitor/package.xml @@ -17,16 +17,16 @@ catkin roscpp nodelet - pluginlib + i2c ff_util ff_hw_msgs - sensor_msgs + config_reader roscpp nodelet - pluginlib + i2c ff_util ff_hw_msgs - sensor_msgs + config_reader diff --git a/hardware/vive/CMakeLists.txt b/hardware/vive/CMakeLists.txt index 128153502a..9a21e664d4 100644 --- a/hardware/vive/CMakeLists.txt +++ b/hardware/vive/CMakeLists.txt @@ -15,11 +15,23 @@ # License for the specific language governing permissions and limitations # under the License. -# Declare the project +cmake_minimum_required(VERSION 3.0) project(vive) -# We need standard math -find_library(CMATH_LIBRARIES NAMES m) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_util + ff_hw_msgs + config_reader +) + +# System dependencies are found with CMake's conventions +find_package(cmake_modules REQUIRED) # declare the catkin package catkin_package( @@ -29,36 +41,86 @@ catkin_package( CATKIN_DEPENDS roscpp nodelet - pluginlib ff_util ff_hw_msgs + config_reader ) -# ROS agnostic proxy library and tool +########### +## Build ## +########### -create_library( - DIR src/vive_driver - TARGET vive_driver - INC ${USB_INCLUDE_DIRS} ${JSONC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} - LIBS ${USB_LIBRARIES} ${JSONC_LIBRARIES} ${ZLIB_LIBRARIES} ${CMATH_LIBRARIES} +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets( - DIR tools/vive_tool - INT ${ARGTABLE2_INCLUDE_DIRS} - LIBS vive_driver ${ARGTABLE2_LIBRARIES} +# Declare C++ libraries +add_library(vive_driver + src/vive_driver/vive.c + src/vive_driver/vive_data_button.c + src/vive_driver/vive_data_imu.c + src/vive_driver/vive_data_light.c + src/vive_driver/vive_data_ootx.c + src/vive_driver/vive_dev_tracker.c + src/vive_driver/vive_dev_watchman.c + src/vive_driver/vive_usb.c ) +add_dependencies(vive_driver ${catkin_EXPORTED_TARGETS}) +target_link_libraries(vive_driver json-c usb-1.0 z ${catkin_LIBRARIES}) + +# Declare C++ libraries +add_library(vive_nodelet + src/vive_nodelet/vive_nodelet.cc +) +add_dependencies(vive_nodelet ${catkin_EXPORTED_TARGETS}) +target_link_libraries(vive_nodelet vive_driver ${catkin_LIBRARIES}) + +## Declare a C++ executable: vive_tool +add_executable(vive_tool tools/vive_tool/vive_tool.c) +add_dependencies(vive_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(vive_tool + vive_driver argtable2 ${catkin_LIBRARIES}) -# ROS nodelet +############# +## Install ## +############# -create_library( - DIR src/vive_nodelet - TARGET vive_nodelet - LIBS ${catkin_LIBRARIES} vive_driver config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_hw_msgs +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME}_driver + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME}_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -# Launch files +# Install C++ executables +install(TARGETS vive_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/vive_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/hardware/vive/package.xml b/hardware/vive/package.xml index 03448f9c7a..6fcbe6babb 100644 --- a/hardware/vive/package.xml +++ b/hardware/vive/package.xml @@ -15,14 +15,14 @@ catkin roscpp nodelet - pluginlib ff_util ff_hw_msgs + config_reader roscpp nodelet - pluginlib ff_util ff_hw_msgs + config_reader diff --git a/localization/camera/CMakeLists.txt b/localization/camera/CMakeLists.txt index c8ee371895..3683d83894 100644 --- a/localization/camera/CMakeLists.txt +++ b/localization/camera/CMakeLists.txt @@ -15,43 +15,71 @@ # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0) project(camera) -set(LIBS - config_reader - ${GLOG_LIBRARIES} - ${GFLAGS_LIBRARIES} - ${OpenCV_LIBRARIES} - ${EIGEN_LIBRARIES} - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ) -set(INCLUDES +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + std_msgs + sensor_msgs + cv_bridge + image_transport + rosbag + ff_common + ff_msgs + nodelet config_reader - ${GFLAGS_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${OpenCV_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ) +# System dependencies are found with CMake's conventions +find_package(cmake_modules REQUIRED) +find_package(Boost REQUIRED COMPONENTS system) +find_package(Eigen3 REQUIRED) + catkin_package( INCLUDE_DIRS include LIBRARIES camera CATKIN_DEPENDS -# DEPENDS system_lib + roscpp + std_msgs + sensor_msgs + cv_bridge + image_transport + rosbag + ff_common + ff_msgs + nodelet + config_reader ) -create_library(TARGET camera - LIBS ${LIBS} - INC ${INCLUDES} +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ) -create_tool_targets(DIR tools - LIBS camera config_reader - INC ${INCLUDES} +# Declare C++ libraries +add_library(camera + src/camera_model.cc + src/camera_params.cc ) +add_dependencies(camera ${catkin_EXPORTED_TARGETS}) +target_link_libraries(camera ${catkin_LIBRARIES} ${EIGEN_LIBRARIES}) + +## Declare a C++ executable: undistort_image +add_executable(undistort_image tools/undistort_image.cc) +add_dependencies(undistort_image ${catkin_EXPORTED_TARGETS}) +target_link_libraries(undistort_image + camera gflags glog ${catkin_LIBRARIES}) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -74,4 +102,29 @@ if(CATKIN_ENABLE_TESTING) endif() -set(CAMERA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Install C++ executables +install(TARGETS undistort_image DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/undistort_image share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/localization/camera/package.xml b/localization/camera/package.xml index 412f360bd7..fa69774761 100644 --- a/localization/camera/package.xml +++ b/localization/camera/package.xml @@ -21,9 +21,11 @@ cv_bridge image_transport rosbag + ff_common ff_msgs nodelet tf2 + config_reader roscpp message_runtime std_msgs @@ -31,7 +33,9 @@ cv_bridge image_transport rosbag + ff_common ff_msgs nodelet tf2 + config_reader diff --git a/localization/camera/test/test_camera_model.cc b/localization/camera/test/test_camera_model.cc index 0b95949778..2ae5888e6e 100644 --- a/localization/camera/test/test_camera_model.cc +++ b/localization/camera/test/test_camera_model.cc @@ -176,3 +176,9 @@ TEST(camera_model, DistortionCoeffs) { EXPECT_NEAR(3.92, optical_center[0], 1e-3); EXPECT_NEAR(0.827, optical_center[1], 1e-3); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/camera/test/test_camera_params.cc b/localization/camera/test/test_camera_params.cc index 2021953974..6f417afd29 100644 --- a/localization/camera/test/test_camera_params.cc +++ b/localization/camera/test/test_camera_params.cc @@ -195,3 +195,9 @@ TEST(camera_params, conversion) { EXPECT_NEAR(input[0], output2[0], 1e-6); EXPECT_NEAR(input[1], output2[1], 1e-6); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/camera/tools/undistort_image.cc b/localization/camera/tools/undistort_image.cc index 5e27612b32..151c48ecda 100644 --- a/localization/camera/tools/undistort_image.cc +++ b/localization/camera/tools/undistort_image.cc @@ -256,7 +256,11 @@ int main(int argc, char ** argv) { cv::Mat bgr_image; if (FLAGS_save_bgr && undist_image.channels() == 1) { // Convert from grayscale to color if needed - cvtColor(undist_image, bgr_image, CV_GRAY2BGR); + #if (CV_VERSION_MAJOR >= 4) + cvtColor(undist_image, bgr_image, cv::COLOR_GRAY2BGR); + #else + cvtColor(undist_image, bgr_image, CV_GRAY2BGR); + #endif undist_image = bgr_image; } cv::imwrite(undist_file, undist_image); diff --git a/localization/graph_localizer/CMakeLists.txt b/localization/graph_localizer/CMakeLists.txt index 499d41542c..e44fb1955a 100644 --- a/localization/graph_localizer/CMakeLists.txt +++ b/localization/graph_localizer/CMakeLists.txt @@ -15,23 +15,74 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(graph_localizer) -if (USE_ROS) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +# Find GTSAM +find_package(GTSAM REQUIRED) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + nodelet + camera + config_reader + ff_util + ff_msgs + graph_optimizer + imu_integration + localization_common + localization_measurements + msg_conversions +) + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) # include ff_nodelet to get ff_util header files since these aren't exposed elsewhere catkin_package( - LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} camera config_reader ff_nodelet graph_optimizer imu_integration localization_common localization_measurements msg_conversions + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} INCLUDE_DIRS include ${GLOG_INCLUDE_DIRS} ${GTSAM_INCLUDE_DIR} - CATKIN_DEPENDS roscpp - DEPENDS gtsam ff_msgs + CATKIN_DEPENDS + nodelet + camera + config_reader + ff_util + ff_msgs + graph_optimizer + imu_integration + localization_common + localization_measurements + msg_conversions +) + +########### +## Build ## +########### +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} +) + +file(GLOB cc_files + "src/*.cc" ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} gtsam camera config_reader ff_nodelet graph_optimizer imu_integration localization_common localization_measurements msg_conversions - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs +# Declare C++ libraries +add_library(${PROJECT_NAME} + ${cc_files} ) +add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) +target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES} ${catkin_LIBRARIES}) + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -40,52 +91,77 @@ if(CATKIN_ENABLE_TESTING) test/test_rotation_factor_adder.cc ) target_link_libraries(test_rotation_factor_adder - graph_localizer gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) add_rostest_gtest(test_rotation_factor test/test_rotation_factor.test test/test_rotation_factor.cc ) target_link_libraries(test_rotation_factor - graph_localizer gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) add_rostest_gtest(test_point_to_line_factor test/test_point_to_line_factor.test test/test_point_to_line_factor.cc ) target_link_libraries(test_point_to_line_factor - graph_localizer gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) add_rostest_gtest(test_point_to_line_segment_factor test/test_point_to_line_segment_factor.test test/test_point_to_line_segment_factor.cc ) target_link_libraries(test_point_to_line_segment_factor - graph_localizer gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) add_rostest_gtest(test_point_to_plane_factor test/test_point_to_plane_factor.test test/test_point_to_plane_factor.cc ) target_link_libraries(test_point_to_plane_factor - graph_localizer localization_measurements gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) add_rostest_gtest(test_point_to_handrail_endpoint_factor test/test_point_to_handrail_endpoint_factor.test test/test_point_to_handrail_endpoint_factor.cc ) target_link_libraries(test_point_to_handrail_endpoint_factor - graph_localizer gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) add_rostest_gtest(test_silu test/test_silu.test test/test_silu.cc ) target_link_libraries(test_silu - graph_localizer gtsam + graph_localizer gtsam ${catkin_LIBRARIES} glog ) endif() -install_launch_files() +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) -endif (USE_ROS) diff --git a/localization/graph_localizer/package.xml b/localization/graph_localizer/package.xml index 784d51ba15..764dd85b33 100644 --- a/localization/graph_localizer/package.xml +++ b/localization/graph_localizer/package.xml @@ -14,12 +14,26 @@ Astrobee Flight Software catkin - ff_msgs nodelet - roscpp - ff_msgs + camera + config_reader + ff_util + ff_msgs + graph_optimizer + imu_integration + localization_common + localization_measurements + msg_conversions nodelet - roscpp + camera + config_reader + ff_util + ff_msgs + graph_optimizer + imu_integration + localization_common + localization_measurements + msg_conversions diff --git a/localization/graph_localizer/test/test_point_to_handrail_endpoint_factor.cc b/localization/graph_localizer/test/test_point_to_handrail_endpoint_factor.cc index 7f78f8f994..5f0144d488 100644 --- a/localization/graph_localizer/test/test_point_to_handrail_endpoint_factor.cc +++ b/localization/graph_localizer/test/test_point_to_handrail_endpoint_factor.cc @@ -79,3 +79,9 @@ TEST(PointToHandrailEndpointFactorTester, SelectingCorrectEndpoint) { EXPECT_TRUE(error.isApprox(gtsam::Vector3(-0.4, 0, 0), 1e-6)); } } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_localizer/test/test_point_to_line_factor.cc b/localization/graph_localizer/test/test_point_to_line_factor.cc index 0cc55984cb..1da80c4373 100644 --- a/localization/graph_localizer/test/test_point_to_line_factor.cc +++ b/localization/graph_localizer/test/test_point_to_line_factor.cc @@ -137,3 +137,9 @@ TEST(PointToLineFactorTester, ZeroErrorForZeroOffest) { error_norm = (factor.evaluateError(world_T_body)).norm(); EXPECT_DOUBLE_EQ(error_norm, 0); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_localizer/test/test_point_to_line_segment_factor.cc b/localization/graph_localizer/test/test_point_to_line_segment_factor.cc index cc8d5d1072..e55f1aca75 100644 --- a/localization/graph_localizer/test/test_point_to_line_segment_factor.cc +++ b/localization/graph_localizer/test/test_point_to_line_segment_factor.cc @@ -311,3 +311,9 @@ TEST(PointToLineSegmentFactorTester, IncreaseErrorWithIncreasedYDistanceWithSilu } EXPECT_LT(error_1_norm, error_2_norm); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_localizer/test/test_point_to_plane_factor.cc b/localization/graph_localizer/test/test_point_to_plane_factor.cc index 996de5475b..320b6681d9 100644 --- a/localization/graph_localizer/test/test_point_to_plane_factor.cc +++ b/localization/graph_localizer/test/test_point_to_plane_factor.cc @@ -47,3 +47,9 @@ TEST(PointToPlaneFactorTester, Jacobian) { ASSERT_TRUE(numerical_H.isApprox(H.matrix(), 1e-6)); } } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_localizer/test/test_rotation_factor.cc b/localization/graph_localizer/test/test_rotation_factor.cc index 98abb72b3e..8444005e01 100644 --- a/localization/graph_localizer/test/test_rotation_factor.cc +++ b/localization/graph_localizer/test/test_rotation_factor.cc @@ -51,3 +51,9 @@ TEST(RotationFactorTester, Jacobian) { world_T_body_1, world_T_perturbed_body_2, 1e-5); ASSERT_TRUE(numerical_H2.isApprox(factor_H2.matrix(), 1e-6)); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_localizer/test/test_rotation_factor_adder.cc b/localization/graph_localizer/test/test_rotation_factor_adder.cc index 740c9de49c..236615cd8b 100644 --- a/localization/graph_localizer/test/test_rotation_factor_adder.cc +++ b/localization/graph_localizer/test/test_rotation_factor_adder.cc @@ -151,3 +151,9 @@ TEST_F(RotationFactorAdderTester, CorrectOptimization) { ASSERT_TRUE(optimized_world_T_body_1.equals(world_T_body_1, 1e-6)); ASSERT_TRUE(optimized_world_T_body_2.equals(world_T_body_2, 1e-6)); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_localizer/test/test_silu.cc b/localization/graph_localizer/test/test_silu.cc index fc35450982..2708790d08 100644 --- a/localization/graph_localizer/test/test_silu.cc +++ b/localization/graph_localizer/test/test_silu.cc @@ -180,3 +180,9 @@ TEST(SiluWithOffsetTwoWayTester, NegativeXMuchGreaterThanOffset) { const double silu_x = gl::SiluWithOffsetTwoWay(x, offset); EXPECT_NEAR(0.0, silu_x, 1e-6); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/graph_optimizer/CMakeLists.txt b/localization/graph_optimizer/CMakeLists.txt index cbc0a62a79..604d1dc2ad 100644 --- a/localization/graph_optimizer/CMakeLists.txt +++ b/localization/graph_optimizer/CMakeLists.txt @@ -15,18 +15,67 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(graph_optimizer) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + config_reader + localization_common + localization_measurements + msg_conversions +) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + # include ff_nodelet to get ff_util header files since these aren't exposed elsewhere catkin_package( - LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} config_reader localization_common localization_measurements msg_conversions - INCLUDE_DIRS include ${GLOG_INCLUDE_DIRS} ${GTSAM_INCLUDE_DIR} - CATKIN_DEPENDS - DEPENDS gtsam + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} + INCLUDE_DIRS include ${GLOG_INCLUDE_DIRS} + CATKIN_DEPENDS config_reader localization_common localization_measurements msg_conversions ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} gtsam config_reader localization_common localization_measurements msg_conversions - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - DEPS +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} ) + +# Declare C++ libraries +add_library(${PROJECT_NAME} + src/graph_optimizer.cc + src/graph_values.cc + src/utilities.cc + src/graph_stats.cc + src/parameter_reader.cc +) +add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) +target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/localization/graph_optimizer/package.xml b/localization/graph_optimizer/package.xml index 81b9009955..10b279e9d5 100644 --- a/localization/graph_optimizer/package.xml +++ b/localization/graph_optimizer/package.xml @@ -14,4 +14,16 @@ Astrobee Flight Software catkin + roscpp + nodelet + config_reader + localization_common + localization_measurements + msg_conversions + roscpp + nodelet + config_reader + localization_common + localization_measurements + msg_conversions diff --git a/localization/ground_truth_localizer/CMakeLists.txt b/localization/ground_truth_localizer/CMakeLists.txt index 9d1d878271..d1bea27238 100644 --- a/localization/ground_truth_localizer/CMakeLists.txt +++ b/localization/ground_truth_localizer/CMakeLists.txt @@ -15,24 +15,74 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(ground_truth_localizer) if (USE_ROS) + + ## Compile as C++14, supported in ROS Kinetic and newer + add_compile_options(-std=c++14) -# include ff_nodelet to get ff_util header files since these aren't exposed elsewhere -catkin_package( - LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} config_reader ff_nodelet localization_common - INCLUDE_DIRS include ${GLOG_INCLUDE_DIRS} - CATKIN_DEPENDS roscpp - DEPENDS ff_msgs -) + ## Find catkin macros and libraries + find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_msgs + ff_util + localization_common + ) + + # System dependencies are found with CMake's conventions + find_package(Eigen3 REQUIRED) + + # include ff_nodelet to get ff_util header files since these aren't exposed elsewhere + catkin_package( + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} + INCLUDE_DIRS include ${GLOG_INCLUDE_DIRS} + CATKIN_DEPENDS roscpp ff_msgs ff_util localization_common + ) + + ########### + ## Build ## + ########### + # Specify additional locations of header files + include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ) + + # Declare C++ libraries + add_library(${PROJECT_NAME} + src/ground_truth_localizer_nodelet.cc + src/utilities.cc + ) + add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) + target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_LIBRARIES}) + + + ############# + ## Install ## + ############# + + # Mark libraries for installation + install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} config_reader ff_nodelet localization_common - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() + # Mark launch files for installation + install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) +else (USE_ROS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() endif (USE_ROS) diff --git a/localization/ground_truth_localizer/package.xml b/localization/ground_truth_localizer/package.xml index 842b4c5d22..7d9c801f35 100644 --- a/localization/ground_truth_localizer/package.xml +++ b/localization/ground_truth_localizer/package.xml @@ -14,12 +14,16 @@ Astrobee Flight Software catkin - ff_msgs - nodelet roscpp - ff_msgs - nodelet + nodelet + ff_msgs + ff_util + localization_common roscpp + nodelet + ff_msgs + ff_util + localization_common diff --git a/localization/handrail_detect/CMakeLists.txt b/localization/handrail_detect/CMakeLists.txt index 9887b0ecf1..c268d88d81 100644 --- a/localization/handrail_detect/CMakeLists.txt +++ b/localization/handrail_detect/CMakeLists.txt @@ -15,30 +15,66 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(handrail_detect) -if (USE_ROS) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + tf2 + nodelet + visualization_msgs + ff_msgs + ff_util +) + +# Find OpenCV3 +find_package(OpenCV 3 REQUIRED) catkin_package( LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS tf2 visualization_msgs roscpp ff_msgs nodelet - DEPENDS ${PROJECT_NAME} + CATKIN_DEPENDS roscpp tf2 nodelet visualization_msgs ff_msgs ff_util ) -set(CMAKE_CXX_FLAGS_HACKY "${CMAKE_CXX_FLAGS} -Wno-return-type") +########### +## Build ## +########### -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${OROCOS_KDL_LIBRARIES} ff_common config_reader msg_conversions ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_msgs +# Specify additional locations of header files +include_directories( + ${catkin_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} ) -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_HACKY}) +# Declare C++ libraries +add_library(handrail_detect + src/handrail_detect.cc +) +add_dependencies(handrail_detect ${catkin_EXPORTED_TARGETS}) +target_link_libraries(handrail_detect ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) -create_tool_targets(DIR tools - LIBS ${PROJECT_NAME} +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) -endif (USE_ROS) +install(DIRECTORY config/ DESTINATION config) diff --git a/localization/handrail_detect/package.xml b/localization/handrail_detect/package.xml index 7ca3c4bf22..a4bb30a8ae 100644 --- a/localization/handrail_detect/package.xml +++ b/localization/handrail_detect/package.xml @@ -17,7 +17,6 @@ catkin roscpp nodelet - pluginlib tf2 tf2_ros tf2_geometry_msgs @@ -29,7 +28,6 @@ ff_util roscpp nodelet - pluginlib tf2 tf2_ros tf2_geometry_msgs diff --git a/localization/handrail_detect/src/handrail_detect.cc b/localization/handrail_detect/src/handrail_detect.cc index 1fb3bef0d6..b2942d3731 100644 --- a/localization/handrail_detect/src/handrail_detect.cc +++ b/localization/handrail_detect/src/handrail_detect.cc @@ -52,7 +52,7 @@ #include #include -// Eigen incliudes +// Eigen includes #include #include #include diff --git a/localization/imu_augmentor/CMakeLists.txt b/localization/imu_augmentor/CMakeLists.txt index 2039fa6dee..639dd1f56e 100644 --- a/localization/imu_augmentor/CMakeLists.txt +++ b/localization/imu_augmentor/CMakeLists.txt @@ -15,23 +15,85 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(imu_augmentor) -if (USE_ROS) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +# Find GTSAM +find_package(GTSAM REQUIRED) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + nodelet + ff_util + imu_integration + localization_common + localization_measurements +) catkin_package( - LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} ff_nodelet imu_integration localization_common localization_measurements INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} ${GLOG_INCLUDE_DIRS} - CATKIN_DEPENDS - DEPENDS gtsam + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} + CATKIN_DEPENDS + nodelet + ff_util + imu_integration + localization_common + localization_measurements +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${GTSAM_INCLUDE_DIR} + ${EIGEN3_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(${PROJECT_NAME} + src/imu_augmentor.cc + src/imu_augmentor_nodelet.cc + src/imu_augmentor_wrapper.cc +) +add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) +target_link_libraries(${PROJECT_NAME} ${GTSAM_LIBRARIES} ${catkin_LIBRARIES}) + + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ff_nodelet imu_integration localization_common localization_measurements - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - DEPS gtsam ff_msgs +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) -endif (USE_ROS) diff --git a/localization/imu_augmentor/package.xml b/localization/imu_augmentor/package.xml index 0e0156dca1..503996e830 100644 --- a/localization/imu_augmentor/package.xml +++ b/localization/imu_augmentor/package.xml @@ -14,13 +14,16 @@ Astrobee Flight Software catkin - catkin - ff_msgs nodelet - roscpp - ff_msgs + ff_util + imu_integration + localization_common + localization_measurements nodelet - roscpp + ff_util + imu_integration + localization_common + localization_measurements diff --git a/localization/imu_integration/CMakeLists.txt b/localization/imu_integration/CMakeLists.txt index 7d07b77bed..1a7b581447 100644 --- a/localization/imu_integration/CMakeLists.txt +++ b/localization/imu_integration/CMakeLists.txt @@ -15,17 +15,67 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(imu_integration) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + config_reader + localization_common + localization_measurements +) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + catkin_package( - LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} config_reader localization_common localization_measurements + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} ${GLOG_INCLUDE_DIRS} - CATKIN_DEPENDS - DEPENDS gtsam + CATKIN_DEPENDS config_reader localization_common localization_measurements +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(${PROJECT_NAME} + src/dynamic_imu_filter.cc + src/identity_filter.cc + src/imu_filter.cc + src/imu_integrator.cc + src/latest_imu_integrator.cc + src/utilities.cc +) +add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) +target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) + + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} config_reader localization_common localization_measurements - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - DEPS gtsam +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) diff --git a/localization/imu_integration/package.xml b/localization/imu_integration/package.xml index dde9b9886c..f4bccb1e22 100644 --- a/localization/imu_integration/package.xml +++ b/localization/imu_integration/package.xml @@ -14,4 +14,11 @@ Astrobee Flight Software catkin + config_reader + localization_common + localization_measurements + config_reader + localization_common + localization_measurements + diff --git a/localization/interest_point/CMakeLists.txt b/localization/interest_point/CMakeLists.txt index 58ceb35cdb..2989c725ad 100644 --- a/localization/interest_point/CMakeLists.txt +++ b/localization/interest_point/CMakeLists.txt @@ -15,48 +15,55 @@ # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0) project(interest_point) -set(LIBS - ${GLOG_LIBRARIES} - ${GFLAGS_LIBRARIES} - ${OpenCV_LIBRARIES} - ${OPENMVG_LIBRARIES} - ${CERES_LIBRARY} - ) -set(INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/common/include - ${CERES_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${OpenCV_INCLUDE_DIRS} - ${OPENMVG_INCLUDE_DIRS} - ${GFLAGS_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp ) +# System dependencies are found with CMake's conventions +find_package(cmake_modules REQUIRED) +find_package(Eigen3 REQUIRED) +find_package(OpenMVG QUIET REQUIRED) + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) + catkin_package( INCLUDE_DIRS include - LIBRARIES interest_point + LIBRARIES interest_point ${OpenCV_LIBRARIES} CATKIN_DEPENDS # DEPENDS system_lib ) -create_library(TARGET interest_point - LIBS ${LIBS} - INC ${INCLUDES} -) +########### +## Build ## +########### -set(INTEREST_LIBS - interest_point - ff_common - ${LIBS}) +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + ${OpenCV_INCLUDE_DIRS} + ${OPENMVG_INCLUDE_DIRS} +) -create_tool_targets(DIR tools - LIBS ${INTEREST_LIBS} - INC ${INCLUDES} +# Declare C++ libraries +add_library(interest_point + src/agast_score.cc + src/brisk.cc + src/essential.cc + src/matching.cc ) +add_dependencies(interest_point ${catkin_EXPORTED_TARGETS}) +target_link_libraries(interest_point ${OPENMVG_LIBRARIES} ${catkin_LIBRARIES} ${OpenCV_LIBRARIES}) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -66,10 +73,25 @@ if(CATKIN_ENABLE_TESTING) test/test_matching.cc ) target_link_libraries(test_matching - interest_point + interest_point glog ) endif() -set(INTEREST_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/localization/interest_point/test/test_matching.cc b/localization/interest_point/test/test_matching.cc index 6f2ce0d3d1..d623f8c6ed 100644 --- a/localization/interest_point/test/test_matching.cc +++ b/localization/interest_point/test/test_matching.cc @@ -73,3 +73,9 @@ TEST_F(MatchingTest, ORGBRISK) { EXPECT_EQ(64, descriptor1.cols); EXPECT_LT(50u, matches.size()); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/lk_optical_flow/CMakeLists.txt b/localization/lk_optical_flow/CMakeLists.txt index 5ff2d04f17..79b87e341a 100644 --- a/localization/lk_optical_flow/CMakeLists.txt +++ b/localization/lk_optical_flow/CMakeLists.txt @@ -15,22 +15,70 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(lk_optical_flow) -if (USE_ROS) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + cv_bridge + image_transport + nodelet + camera + ff_util +) catkin_package( + INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS roscpp cv_bridge image_transport nodelet - DEPENDS lk_optical_flow + CATKIN_DEPENDS roscpp cv_bridge image_transport nodelet camera ff_util +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET lk_optical_flow - LIBS ff_nodelet camera config_reader ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs config_reader camera +# Declare C++ libraries +add_library(lk_optical_flow + src/lk_optical_flow.cc + src/lk_optical_flow_nodelet.cc ) +add_dependencies(lk_optical_flow ${catkin_EXPORTED_TARGETS}) +target_link_libraries(lk_optical_flow ${catkin_LIBRARIES}) + +############# +## Install ## +############# -install_launch_files() +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) -endif (USE_ROS) +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/localization/lk_optical_flow/package.xml b/localization/lk_optical_flow/package.xml index 4ae2b03065..33799fcf96 100644 --- a/localization/lk_optical_flow/package.xml +++ b/localization/lk_optical_flow/package.xml @@ -19,11 +19,15 @@ roscpp nodelet ff_msgs + camera + ff_util cv_bridge image_transport roscpp nodelet ff_msgs + camera + ff_util diff --git a/localization/localization_common/CMakeLists.txt b/localization/localization_common/CMakeLists.txt index 953e1db213..b87b5d880f 100644 --- a/localization/localization_common/CMakeLists.txt +++ b/localization/localization_common/CMakeLists.txt @@ -15,17 +15,77 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(localization_common) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + camera + config_reader + msg_conversions + ff_msgs +) + +# Find GTSAM +find_package(GTSAM REQUIRED) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + catkin_package( - LIBRARIES ${PROJECT_NAME} ${GTSAM_LIBRARIES} camera config_reader msg_conversions - INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} - CATKIN_DEPENDS - DEPENDS gtsam + INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} + LIBRARIES ${PROJECT_NAME} ${GTSAM_LIBRARIES} + CATKIN_DEPENDS + camera + config_reader + msg_conversions + ff_msgs + DEPENDS gtsam +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${GTSAM_INCLUDE_DIR} + ${EIGEN3_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(${PROJECT_NAME} + src/averager.cc + src/combined_nav_state.cc + src/combined_nav_state_covariances.cc + src/rate_timer.cc + src/ros_timer.cc + src/time.cc + src/timer.cc + src/utilities.cc ) +add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) +target_link_libraries(${PROJECT_NAME} gtsam ${catkin_LIBRARIES}) + +############# +## Install ## +############# -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} camera config_reader gtsam msg_conversions - INC ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - DEPS +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/localization/localization_common/package.xml b/localization/localization_common/package.xml index defe706423..2663824daa 100644 --- a/localization/localization_common/package.xml +++ b/localization/localization_common/package.xml @@ -14,4 +14,12 @@ Astrobee Flight Software catkin + camera + config_reader + msg_conversions + ff_msgs + camera + config_reader + msg_conversions + ff_msgs diff --git a/localization/localization_manager/CMakeLists.txt b/localization/localization_manager/CMakeLists.txt index 17964c6dfb..a8d82d33ca 100644 --- a/localization/localization_manager/CMakeLists.txt +++ b/localization/localization_manager/CMakeLists.txt @@ -15,8 +15,24 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(localization_manager) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + actionlib + nodelet + pluginlib + ff_msgs + std_msgs + std_srvs + ff_util +) + catkin_package( LIBRARIES localization_manager @@ -28,12 +44,44 @@ catkin_package( ff_msgs std_msgs std_srvs + ff_util +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(localization_manager + src/localization_manager_nodelet.cc +) +add_dependencies(localization_manager ${catkin_EXPORTED_TARGETS}) +target_link_libraries(localization_manager ${catkin_LIBRARIES}) + + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET localization_manager - LIBS ${catkin_LIBRARIES} ff_common ff_nodelet config_server - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/localization/localization_manager/include/localization_manager/localization_pipeline.h b/localization/localization_manager/include/localization_manager/localization_pipeline.h index 0f6911a90f..060652725d 100644 --- a/localization/localization_manager/include/localization_manager/localization_pipeline.h +++ b/localization/localization_manager/include/localization_manager/localization_pipeline.h @@ -29,7 +29,7 @@ #include #include -// C++11 +// C++ includes #include #include #include diff --git a/localization/localization_manager/package.xml b/localization/localization_manager/package.xml index bf0d3efd51..d52b6f709e 100644 --- a/localization/localization_manager/package.xml +++ b/localization/localization_manager/package.xml @@ -22,6 +22,7 @@ actionlib nodelet pluginlib + ff_util roscpp std_msgs std_srvs @@ -30,6 +31,7 @@ planner nodelet pluginlib + ff_util diff --git a/localization/localization_measurements/CMakeLists.txt b/localization/localization_measurements/CMakeLists.txt index c688bcfe03..648695cab9 100644 --- a/localization/localization_measurements/CMakeLists.txt +++ b/localization/localization_measurements/CMakeLists.txt @@ -15,21 +15,57 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(localization_measurements) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + ff_msgs + config_reader + localization_common + msg_conversions +) + + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + catkin_package( - LIBRARIES ${PROJECT_NAME} ${GTSAM_LIBRARIES} ff_common localization_common - INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} - CATKIN_DEPENDS - DEPENDS gtsam ff_msgs + LIBRARIES ${PROJECT_NAME} + INCLUDE_DIRS include + CATKIN_DEPENDS ff_msgs config_reader localization_common msg_conversions +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ff_common gtsam localization_common - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs +# create_library(TARGET ${PROJECT_NAME} +# LIBS ${catkin_LIBRARIES} ff_common gtsam localization_common +# INC ${catkin_INCLUDE_DIRS} +# DEPS ff_msgs +# ) + + +# Declare C++ libraries +add_library(${PROJECT_NAME} + src/measurement_conversions.cc ) +add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) +target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) + + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) add_rostest_gtest(test_plane @@ -49,3 +85,21 @@ if(CATKIN_ENABLE_TESTING) ) endif() + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/localization/localization_measurements/package.xml b/localization/localization_measurements/package.xml index d1ec591cc3..27acc9a3a3 100644 --- a/localization/localization_measurements/package.xml +++ b/localization/localization_measurements/package.xml @@ -15,5 +15,11 @@ catkin ff_msgs + config_reader + localization_common + msg_conversions ff_msgs + config_reader + localization_common + msg_conversions diff --git a/localization/localization_measurements/test/test_measurement_conversions.cc b/localization/localization_measurements/test/test_measurement_conversions.cc index 31657681f4..2d853c4846 100644 --- a/localization/localization_measurements/test/test_measurement_conversions.cc +++ b/localization/localization_measurements/test/test_measurement_conversions.cc @@ -89,3 +89,9 @@ TEST(MeasurementsConversionTester, MakeHandrailEndpoints) { EXPECT_NEAR(trans.z(), endpoints.second.z(), 1e-6); } } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/localization_measurements/test/test_plane.cc b/localization/localization_measurements/test/test_plane.cc index 9b8abd72a2..3e049390d0 100644 --- a/localization/localization_measurements/test/test_plane.cc +++ b/localization/localization_measurements/test/test_plane.cc @@ -158,3 +158,9 @@ TEST(PlaneTester, PointToPlaneDistanceZAxisPlane) { EXPECT_NEAR(0, distance, 1e-6); } } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/localization_node/CMakeLists.txt b/localization/localization_node/CMakeLists.txt index bac91ae60f..d5f6478a2a 100644 --- a/localization/localization_node/CMakeLists.txt +++ b/localization/localization_node/CMakeLists.txt @@ -15,23 +15,129 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(localization_node) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + cv_bridge + image_transport + nodelet + camera + ff_util + sparse_mapping + msg_conversions +) + +# System dependencies are found with CMake's conventions +find_package(OpenMVG QUIET REQUIRED) +find_package(Eigen3 REQUIRED) + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) + catkin_package( + INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS roscpp message_runtime std_msgs sensor_msgs cv_bridge image_transport rosbag ff_msgs tf2 sparse_mapping + CATKIN_DEPENDS + roscpp + message_runtime + std_msgs + sensor_msgs + cv_bridge + image_transport + rosbag + ff_msgs + tf2 + sparse_mapping + msg_conversions +) + + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} +) + +# Declare C++ libraries +add_library(localization_node + src/localization.cc + src/localization_nodelet.cc +) +add_dependencies(localization_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(localization_node + ${catkin_LIBRARIES} + ${OpenCV_LIBRARIES} + ${OPENMVG_LIBRARIES} +) + +## Declare a C++ executable: extract_image_bag +add_executable(extract_image_bag tools/extract_image_bag.cc) +add_dependencies(extract_image_bag ${catkin_EXPORTED_TARGETS}) +target_link_libraries(extract_image_bag + localization_node gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: interest_points_test_bag +add_executable(interest_points_test_bag tools/interest_points_test_bag.cc) +add_dependencies(interest_points_test_bag ${catkin_EXPORTED_TARGETS}) +target_link_libraries(interest_points_test_bag + localization_node gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: merge_bags +add_executable(merge_bags tools/merge_bags.cc) +add_dependencies(merge_bags ${catkin_EXPORTED_TARGETS}) +target_link_libraries(merge_bags + localization_node gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET localization_node - LIBS ${SPARSE_MAPPING_LIBRARIES} ff_nodelet msg_conversions ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} - DEPS sparse_mapping ff_msgs +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -create_tool_targets(DIR tools - LIBS ${SPARSE_MAPPING_LIBRARIES} localization_node ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} - DEPS localization_node +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) -install_launch_files() +# Install C++ executables +install(TARGETS extract_image_bag DESTINATION bin) +install(TARGETS interest_points_test_bag DESTINATION bin) +install(TARGETS merge_bags DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/extract_image_bag share/${PROJECT_NAME} + COMMAND ln -s ../../bin/interest_points_test_bag share/${PROJECT_NAME} + COMMAND ln -s ../../bin/merge_bags share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/localization/localization_node/package.xml b/localization/localization_node/package.xml index 197f369b21..8af7f9450e 100644 --- a/localization/localization_node/package.xml +++ b/localization/localization_node/package.xml @@ -25,6 +25,7 @@ nodelet tf2 sparse_mapping + msg_conversions roscpp message_runtime std_msgs @@ -36,6 +37,7 @@ nodelet tf2 sparse_mapping + msg_conversions diff --git a/localization/marker_tracking/CMakeLists.txt b/localization/marker_tracking/CMakeLists.txt index 2c2042b311..24e0b677ab 100644 --- a/localization/marker_tracking/CMakeLists.txt +++ b/localization/marker_tracking/CMakeLists.txt @@ -15,35 +15,180 @@ # License for the specific language governing permissions and limitations # under the License. -set(LIBS - ${ALVAR_LIBRARIES} - ${OpenCV_LIBRARIES} - camera - ff_common - config_reader - ${GLOG_LIBRARIES} - ${GFLAGS_LIBRARIES} - ) -set(INCLUDES +cmake_minimum_required(VERSION 3.0) +project(marker_tracking) + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_util + message_runtime + std_msgs + geometry_msgs + cv_bridge + image_transport + camera msg_conversions +) + +# System dependencies are found with CMake's conventions +find_package(cmake_modules REQUIRED) +find_package(Eigen3 REQUIRED) +find_package(Alvar REQUIRED) +find_package(Alvar REQUIRED) + + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) + +catkin_package( + LIBRARIES ${PROJECT_NAME} + CATKIN_DEPENDS roscpp ff_util message_runtime std_msgs geometry_msgs cv_bridge image_transport camera msg_conversions +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ${ALVAR_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFLAGS_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(marker_tracking + src/marker_tracking/arconfigio.cc + src/marker_tracking/arxmlio.cc + src/marker_tracking/labelling_method.cc + src/marker_tracking/marker_detector.cc +) +add_dependencies(marker_tracking ${catkin_EXPORTED_TARGETS}) +target_link_libraries(marker_tracking ${catkin_LIBRARIES} ${ALVAR_LIBRARIES}) + +## Declare a C++ executable: generate_ar_target +add_executable(generate_ar_target tools/marker_tracking/generate_ar_target.cc) +add_dependencies(generate_ar_target ${catkin_EXPORTED_TARGETS}) +target_link_libraries(generate_ar_target + marker_tracking gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: generate_multiscale_target +add_executable(generate_multiscale_target tools/marker_tracking/generate_multiscale_target.cc) +add_dependencies(generate_multiscale_target ${catkin_EXPORTED_TARGETS}) +target_link_libraries(generate_multiscale_target + marker_tracking gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: generate_svg_markers +add_executable(generate_svg_markers tools/marker_tracking/generate_svg_markers.cc) +add_dependencies(generate_svg_markers ${catkin_EXPORTED_TARGETS}) +target_link_libraries(generate_svg_markers + marker_tracking gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: identify_marker_in_image +add_executable(identify_marker_in_image tools/marker_tracking/identify_marker_in_image.cc) +add_dependencies(identify_marker_in_image ${catkin_EXPORTED_TARGETS}) +target_link_libraries(identify_marker_in_image + marker_tracking gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: marker_config2xml +add_executable(marker_config2xml tools/marker_tracking/marker_config2xml.cc) +add_dependencies(marker_config2xml ${catkin_EXPORTED_TARGETS}) +target_link_libraries(marker_config2xml + marker_tracking gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: markers_to_Kalibr +add_executable(markers_to_Kalibr tools/marker_tracking/markers_to_Kalibr.cc) +add_dependencies(markers_to_Kalibr ${catkin_EXPORTED_TARGETS}) +target_link_libraries(markers_to_Kalibr + marker_tracking gflags glog yaml-cpp ${catkin_LIBRARIES}) + +# Declare C++ libraries +add_library(marker_tracking_node + src/marker_tracking_node/marker_tracker.cc + src/marker_tracking_node/marker_tracking_nodelet.cc +) +add_dependencies(marker_tracking_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(marker_tracking_node marker_tracking ${catkin_LIBRARIES}) + +## Declare a C++ executable: overhead_tracking_node +add_executable(overhead_tracking_node tools/marker_tracking_node/overhead_tracking_node.cc) +add_dependencies(overhead_tracking_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(overhead_tracking_node + marker_tracking_node gflags glog ${catkin_LIBRARIES}) + +if(CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) + add_rostest_gtest(test_arxmlio test/test_arxmlio.test + test/test_arxmlio.cc + ) + target_link_libraries(test_arxmlio + marker_tracking + ) + + add_rostest_gtest(test_marker_config_loader test/test_marker_config_loader.test + test/test_marker_config_loader.cc + ) + target_link_libraries(test_marker_config_loader + marker_tracking ) -set(MARKER_TRACKING_LIBRARIES marker_tracking ${LIBS}) + add_rostest_gtest(test_marker_detector test/test_marker_detector.test + test/test_marker_detector.cc + ) + target_link_libraries(test_marker_detector + marker_tracking + ) +endif() + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS marker_tracking_node + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Install C++ executables +install(TARGETS overhead_tracking_node DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/overhead_tracking_node share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -create_library(TARGET marker_tracking - LIBS ${LIBS} - INC ${INCLUDES} - DEPS camera) +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) -if (YAMLCPP_FOUND) - create_tool_targets(DIR tools - LIBS marker_tracking ${YAMLCPP_LIBRARIES} - INC ${INCLUDES}) -endif (YAMLCPP_FOUND) +install(FILES + tools/marker_tracking_node/features_counter.py + DESTINATION share/${PROJECT_NAME}) -if (USE_ROS) - add_subdirectory(ros) -endif (USE_ROS) diff --git a/localization/marker_tracking/ros/include/marker_tracking_node/marker_tracker.h b/localization/marker_tracking/include/marker_tracking_node/marker_tracker.h similarity index 100% rename from localization/marker_tracking/ros/include/marker_tracking_node/marker_tracker.h rename to localization/marker_tracking/include/marker_tracking_node/marker_tracker.h diff --git a/localization/marker_tracking/ros/include/marker_tracking_node/marker_tracking_nodelet.h b/localization/marker_tracking/include/marker_tracking_node/marker_tracking_nodelet.h similarity index 100% rename from localization/marker_tracking/ros/include/marker_tracking_node/marker_tracking_nodelet.h rename to localization/marker_tracking/include/marker_tracking_node/marker_tracking_nodelet.h diff --git a/localization/marker_tracking/ros/launch/body_tags.xml b/localization/marker_tracking/launch/body_tags.xml similarity index 100% rename from localization/marker_tracking/ros/launch/body_tags.xml rename to localization/marker_tracking/launch/body_tags.xml diff --git a/localization/marker_tracking/ros/launch/dock_targets.m b/localization/marker_tracking/launch/dock_targets.m similarity index 100% rename from localization/marker_tracking/ros/launch/dock_targets.m rename to localization/marker_tracking/launch/dock_targets.m diff --git a/localization/marker_tracking/ros/launch/granite_lab_tags.xml b/localization/marker_tracking/launch/granite_lab_tags.xml similarity index 100% rename from localization/marker_tracking/ros/launch/granite_lab_tags.xml rename to localization/marker_tracking/launch/granite_lab_tags.xml diff --git a/localization/marker_tracking/ros/launch/granitetable_1280_960.xml b/localization/marker_tracking/launch/granitetable_1280_960.xml similarity index 100% rename from localization/marker_tracking/ros/launch/granitetable_1280_960.xml rename to localization/marker_tracking/launch/granitetable_1280_960.xml diff --git a/localization/marker_tracking/ros/launch/marker_tracking.launch b/localization/marker_tracking/launch/marker_tracking.launch similarity index 100% rename from localization/marker_tracking/ros/launch/marker_tracking.launch rename to localization/marker_tracking/launch/marker_tracking.launch diff --git a/localization/marker_tracking/ros/launch/marker_tracking_overhead.launch b/localization/marker_tracking/launch/marker_tracking_overhead.launch similarity index 100% rename from localization/marker_tracking/ros/launch/marker_tracking_overhead.launch rename to localization/marker_tracking/launch/marker_tracking_overhead.launch diff --git a/localization/marker_tracking/ros/launch/new_dock_targets.m b/localization/marker_tracking/launch/new_dock_targets.m similarity index 100% rename from localization/marker_tracking/ros/launch/new_dock_targets.m rename to localization/marker_tracking/launch/new_dock_targets.m diff --git a/localization/marker_tracking/ros/nodelet_plugins.xml b/localization/marker_tracking/nodelet_plugins.xml similarity index 84% rename from localization/marker_tracking/ros/nodelet_plugins.xml rename to localization/marker_tracking/nodelet_plugins.xml index 44e2ded10b..faf1b6d995 100644 --- a/localization/marker_tracking/ros/nodelet_plugins.xml +++ b/localization/marker_tracking/nodelet_plugins.xml @@ -1,4 +1,4 @@ - + diff --git a/localization/marker_tracking/ros/package.xml b/localization/marker_tracking/package.xml similarity index 80% rename from localization/marker_tracking/ros/package.xml rename to localization/marker_tracking/package.xml index 322f434e6e..993bfb7e8a 100644 --- a/localization/marker_tracking/ros/package.xml +++ b/localization/marker_tracking/package.xml @@ -15,7 +15,8 @@ catkin roscpp - message_generation + ff_util + message_runtime std_msgs geometry_msgs sensor_msgs @@ -23,7 +24,10 @@ image_transport ff_msgs nodelet + camera + msg_conversions roscpp + ff_util message_runtime std_msgs geometry_msgs @@ -32,6 +36,8 @@ image_transport ff_msgs nodelet + camera + msg_conversions diff --git a/localization/marker_tracking/ros/CMakeLists.txt b/localization/marker_tracking/ros/CMakeLists.txt deleted file mode 100644 index 13dca84b4f..0000000000 --- a/localization/marker_tracking/ros/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -project(marker_tracking) - -catkin_package( - LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS roscpp message_runtime std_msgs geometry_msgs cv_bridge image_transport - DEPENDS marker_tracking -) - -create_library(TARGET rosmarkertracking - LIBS ${MARKER_TRACKING_LIBRARIES} ff_nodelet msg_conversions config_reader ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} - DEPS marker_tracking ff_msgs -) - -create_tool_targets(DIR tools - LIBS ${MARKER_TRACKING_LIBRARIES} rosmarkertracking ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} - DEPS rosmarkertracking -) - -if(CATKIN_ENABLE_TESTING) - find_package(rostest REQUIRED) - add_rostest_gtest(test_arxmlio test/test_arxmlio.test - test/test_arxmlio.cc - ) - target_link_libraries(test_arxmlio - marker_tracking - ) - - add_rostest_gtest(test_marker_config_loader test/test_marker_config_loader.test - test/test_marker_config_loader.cc - ) - target_link_libraries(test_marker_config_loader - marker_tracking - ) - - add_rostest_gtest(test_marker_detector test/test_marker_detector.test - test/test_marker_detector.cc - ) - target_link_libraries(test_marker_detector - marker_tracking - ) -endif() - -install_launch_files() -install(FILES - tools/features_counter.py - DESTINATION share/${PROJECT_NAME}) - diff --git a/localization/marker_tracking/src/arconfigio.cc b/localization/marker_tracking/src/marker_tracking/arconfigio.cc similarity index 100% rename from localization/marker_tracking/src/arconfigio.cc rename to localization/marker_tracking/src/marker_tracking/arconfigio.cc diff --git a/localization/marker_tracking/src/arxmlio.cc b/localization/marker_tracking/src/marker_tracking/arxmlio.cc similarity index 100% rename from localization/marker_tracking/src/arxmlio.cc rename to localization/marker_tracking/src/marker_tracking/arxmlio.cc diff --git a/localization/marker_tracking/src/labelling_method.cc b/localization/marker_tracking/src/marker_tracking/labelling_method.cc similarity index 100% rename from localization/marker_tracking/src/labelling_method.cc rename to localization/marker_tracking/src/marker_tracking/labelling_method.cc diff --git a/localization/marker_tracking/src/marker_detector.cc b/localization/marker_tracking/src/marker_tracking/marker_detector.cc similarity index 100% rename from localization/marker_tracking/src/marker_detector.cc rename to localization/marker_tracking/src/marker_tracking/marker_detector.cc diff --git a/localization/marker_tracking/ros/src/marker_tracker.cc b/localization/marker_tracking/src/marker_tracking_node/marker_tracker.cc similarity index 100% rename from localization/marker_tracking/ros/src/marker_tracker.cc rename to localization/marker_tracking/src/marker_tracking_node/marker_tracker.cc diff --git a/localization/marker_tracking/ros/src/marker_tracking_nodelet.cc b/localization/marker_tracking/src/marker_tracking_node/marker_tracking_nodelet.cc similarity index 100% rename from localization/marker_tracking/ros/src/marker_tracking_nodelet.cc rename to localization/marker_tracking/src/marker_tracking_node/marker_tracking_nodelet.cc diff --git a/localization/marker_tracking/ros/test/data/IMG_20141217_160451.small.opt.jpg b/localization/marker_tracking/test/data/IMG_20141217_160451.small.opt.jpg similarity index 100% rename from localization/marker_tracking/ros/test/data/IMG_20141217_160451.small.opt.jpg rename to localization/marker_tracking/test/data/IMG_20141217_160451.small.opt.jpg diff --git a/localization/marker_tracking/ros/test/data/IMG_20141217_160458.small.opt.jpg b/localization/marker_tracking/test/data/IMG_20141217_160458.small.opt.jpg similarity index 100% rename from localization/marker_tracking/ros/test/data/IMG_20141217_160458.small.opt.jpg rename to localization/marker_tracking/test/data/IMG_20141217_160458.small.opt.jpg diff --git a/localization/marker_tracking/ros/test/data/IMG_20141217_160509.small.opt.jpg b/localization/marker_tracking/test/data/IMG_20141217_160509.small.opt.jpg similarity index 100% rename from localization/marker_tracking/ros/test/data/IMG_20141217_160509.small.opt.jpg rename to localization/marker_tracking/test/data/IMG_20141217_160509.small.opt.jpg diff --git a/localization/marker_tracking/ros/test/data/ar_lab_tags.xml b/localization/marker_tracking/test/data/ar_lab_tags.xml similarity index 100% rename from localization/marker_tracking/ros/test/data/ar_lab_tags.xml rename to localization/marker_tracking/test/data/ar_lab_tags.xml diff --git a/localization/marker_tracking/ros/test/data/dock_xml_markers.config b/localization/marker_tracking/test/data/dock_xml_markers.config similarity index 100% rename from localization/marker_tracking/ros/test/data/dock_xml_markers.config rename to localization/marker_tracking/test/data/dock_xml_markers.config diff --git a/localization/marker_tracking/ros/test/data/markers_sample.config b/localization/marker_tracking/test/data/markers_sample.config similarity index 100% rename from localization/marker_tracking/ros/test/data/markers_sample.config rename to localization/marker_tracking/test/data/markers_sample.config diff --git a/localization/marker_tracking/ros/test/test_arxmlio.cc b/localization/marker_tracking/test/test_arxmlio.cc similarity index 92% rename from localization/marker_tracking/ros/test/test_arxmlio.cc rename to localization/marker_tracking/test/test_arxmlio.cc index c0ed1d223b..6261655284 100644 --- a/localization/marker_tracking/ros/test/test_arxmlio.cc +++ b/localization/marker_tracking/test/test_arxmlio.cc @@ -49,3 +49,9 @@ TEST(AR_XML_IO, Reading) { EXPECT_NEAR(-0.993, ar_tags[29].row(BL)[0], 1e-3); EXPECT_NEAR(-0.824, ar_tags[29].row(BL)[2], 1e-3); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/marker_tracking/ros/test/test_arxmlio.test b/localization/marker_tracking/test/test_arxmlio.test similarity index 100% rename from localization/marker_tracking/ros/test/test_arxmlio.test rename to localization/marker_tracking/test/test_arxmlio.test diff --git a/localization/marker_tracking/ros/test/test_marker_config_loader.cc b/localization/marker_tracking/test/test_marker_config_loader.cc similarity index 93% rename from localization/marker_tracking/ros/test/test_marker_config_loader.cc rename to localization/marker_tracking/test/test_marker_config_loader.cc index 3a6a7101f2..33e2f81151 100644 --- a/localization/marker_tracking/ros/test/test_marker_config_loader.cc +++ b/localization/marker_tracking/test/test_marker_config_loader.cc @@ -58,3 +58,9 @@ TEST(MarkerDetector, ConfigLoader) { EXPECT_NEAR(diag1(1), diag2(1), 1E-2); EXPECT_NEAR(diag1(2), diag2(2), 1E-2); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/marker_tracking/ros/test/test_marker_config_loader.test b/localization/marker_tracking/test/test_marker_config_loader.test similarity index 100% rename from localization/marker_tracking/ros/test/test_marker_config_loader.test rename to localization/marker_tracking/test/test_marker_config_loader.test diff --git a/localization/marker_tracking/ros/test/test_marker_detector.cc b/localization/marker_tracking/test/test_marker_detector.cc similarity index 87% rename from localization/marker_tracking/ros/test/test_marker_detector.cc rename to localization/marker_tracking/test/test_marker_detector.cc index ee8367d913..682313702e 100644 --- a/localization/marker_tracking/ros/test/test_marker_detector.cc +++ b/localization/marker_tracking/test/test_marker_detector.cc @@ -55,7 +55,11 @@ TEST(MarkerDetector, TestDetection) { IplImage ipl_image; std::vector >::iterator expected_it = expected_corner_loc.begin(); for (std::string const& image_filename : image_filenames) { - image = cv::imread(data_dir + image_filename, CV_LOAD_IMAGE_GRAYSCALE); + #if (CV_VERSION_MAJOR >= 4) + image = cv::imread(data_dir + image_filename, cv::IMREAD_GRAYSCALE); + #else + image = cv::imread(data_dir + image_filename, CV_LOAD_IMAGE_GRAYSCALE); + #endif ipl_image = image; detector.Detect(&ipl_image, 0.08, 0.2); EXPECT_EQ(1u, detector.NumMarkers()); @@ -68,3 +72,9 @@ TEST(MarkerDetector, TestDetection) { expected_it++; } } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/marker_tracking/ros/test/test_marker_detector.test b/localization/marker_tracking/test/test_marker_detector.test similarity index 100% rename from localization/marker_tracking/ros/test/test_marker_detector.test rename to localization/marker_tracking/test/test_marker_detector.test diff --git a/localization/marker_tracking/tools/generate_ar_target.cc b/localization/marker_tracking/tools/marker_tracking/generate_ar_target.cc similarity index 99% rename from localization/marker_tracking/tools/generate_ar_target.cc rename to localization/marker_tracking/tools/marker_tracking/generate_ar_target.cc index f2a471b23e..bcb9132199 100644 --- a/localization/marker_tracking/tools/generate_ar_target.cc +++ b/localization/marker_tracking/tools/marker_tracking/generate_ar_target.cc @@ -16,7 +16,8 @@ * under the License. */ -#include +#include + #include #include diff --git a/localization/marker_tracking/tools/generate_multiscale_target.cc b/localization/marker_tracking/tools/marker_tracking/generate_multiscale_target.cc similarity index 99% rename from localization/marker_tracking/tools/generate_multiscale_target.cc rename to localization/marker_tracking/tools/marker_tracking/generate_multiscale_target.cc index 887edd9a09..70c463cbcd 100644 --- a/localization/marker_tracking/tools/generate_multiscale_target.cc +++ b/localization/marker_tracking/tools/marker_tracking/generate_multiscale_target.cc @@ -16,7 +16,8 @@ * under the License. */ -#include +#include + #include #include diff --git a/localization/marker_tracking/tools/generate_svg_markers.cc b/localization/marker_tracking/tools/marker_tracking/generate_svg_markers.cc similarity index 99% rename from localization/marker_tracking/tools/generate_svg_markers.cc rename to localization/marker_tracking/tools/marker_tracking/generate_svg_markers.cc index 5b3b075293..df063523bc 100644 --- a/localization/marker_tracking/tools/generate_svg_markers.cc +++ b/localization/marker_tracking/tools/marker_tracking/generate_svg_markers.cc @@ -19,7 +19,7 @@ #include -#include +#include #include #include diff --git a/localization/marker_tracking/tools/identify_marker_in_image.cc b/localization/marker_tracking/tools/marker_tracking/identify_marker_in_image.cc similarity index 92% rename from localization/marker_tracking/tools/identify_marker_in_image.cc rename to localization/marker_tracking/tools/marker_tracking/identify_marker_in_image.cc index 96b6577b2d..e9534d6e93 100644 --- a/localization/marker_tracking/tools/identify_marker_in_image.cc +++ b/localization/marker_tracking/tools/marker_tracking/identify_marker_in_image.cc @@ -47,7 +47,12 @@ int main(int argc, char** argv) { IplImage ipl_image; for (int i = 1; i < argc; i++) { std::string image_filename(argv[i]); - image = cv::imread(image_filename, CV_LOAD_IMAGE_GRAYSCALE); + + #if (CV_VERSION_MAJOR >= 4) + image = cv::imread(image_filename, cv::IMREAD_GRAYSCALE); + #else + image = cv::imread(image_filename, CV_LOAD_IMAGE_GRAYSCALE); + #endif ipl_image = image; detector.Detect(&ipl_image, 0.08, 0.2); LOG(INFO) << image_filename << " : Detected " << detector.NumMarkers() << " markers."; diff --git a/localization/marker_tracking/tools/marker_config2xml.cc b/localization/marker_tracking/tools/marker_tracking/marker_config2xml.cc similarity index 100% rename from localization/marker_tracking/tools/marker_config2xml.cc rename to localization/marker_tracking/tools/marker_tracking/marker_config2xml.cc diff --git a/localization/marker_tracking/tools/markers_to_Kalibr.cc b/localization/marker_tracking/tools/marker_tracking/markers_to_Kalibr.cc similarity index 99% rename from localization/marker_tracking/tools/markers_to_Kalibr.cc rename to localization/marker_tracking/tools/marker_tracking/markers_to_Kalibr.cc index fb7a406ac7..fce59fb266 100644 --- a/localization/marker_tracking/tools/markers_to_Kalibr.cc +++ b/localization/marker_tracking/tools/marker_tracking/markers_to_Kalibr.cc @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include diff --git a/localization/marker_tracking/ros/tools/features_counter.py b/localization/marker_tracking/tools/marker_tracking_node/features_counter.py similarity index 100% rename from localization/marker_tracking/ros/tools/features_counter.py rename to localization/marker_tracking/tools/marker_tracking_node/features_counter.py diff --git a/localization/marker_tracking/ros/tools/overhead_tracking_node.cc b/localization/marker_tracking/tools/marker_tracking_node/overhead_tracking_node.cc similarity index 100% rename from localization/marker_tracking/ros/tools/overhead_tracking_node.cc rename to localization/marker_tracking/tools/marker_tracking_node/overhead_tracking_node.cc diff --git a/localization/sparse_mapping/CMakeLists.txt b/localization/sparse_mapping/CMakeLists.txt index 1d21f64a30..4222f0904c 100644 --- a/localization/sparse_mapping/CMakeLists.txt +++ b/localization/sparse_mapping/CMakeLists.txt @@ -15,57 +15,163 @@ # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.12) # Need get_filename_component DIRECTORY +cmake_minimum_required(VERSION 3.0) project(sparse_mapping) -PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS protobuf/sparse_map.proto) -get_filename_component(PROTO_HDR_DIR ${PROTO_HDRS} DIRECTORY) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) -set(LIBS +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + ff_common camera - ${DBOW2_LIBRARIES} - ${OpenCV_LIBRARIES} - ${OPENMVG_LIBRARIES} - ${CERES_LIBRARIES} - ${PROTOBUF_LIBRARIES} interest_point config_reader - ff_common ) -set(INCLUDES - ${CERES_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${GFLAGS_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${NGRAPH_INCLUDE_DIRS} + +# System dependencies are found with CMake's conventions +find_package(cmake_modules REQUIRED) +find_package(Eigen3 REQUIRED) +find_package(OpenMVG QUIET REQUIRED) +find_package(Protobuf REQUIRED) +find_package(dbow2 REQUIRED) + + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) + + +catkin_package( + INCLUDE_DIRS include + LIBRARIES sparse_mapping + CATKIN_DEPENDS ff_msgs ff_common camera interest_point config_reader +) + +########### +## Build ## +########### + +# Build the protobuf message +PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS protobuf/sparse_map.proto) +get_filename_component(PROTO_HDR_DIR ${PROTO_HDRS} DIRECTORY) + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ${OpenCV_INCLUDE_DIRS} ${OPENMVG_INCLUDE_DIRS} ${PROTOBUF_INCLUDE_DIRS} ${PROTO_HDR_DIR} ${DBOW2_INCLUDE_DIRS} ) -set(SPARSE_MAPPING_LIBRARIES sparse_mapping ${LIBS}) -catkin_package( - INCLUDE_DIRS include - LIBRARIES sparse_mapping - CATKIN_DEPENDS camera interest_point config_reader ff_common +# Declare C++ libraries +add_library(sparse_mapping + src/ransac.cc + src/reprojection.cc + src/sparse_map.cc + src/sparse_mapping.cc + src/tensor.cc + src/vocab_tree.cc + ${PROTO_SRCS} +) +add_dependencies(sparse_mapping ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sparse_mapping + ${catkin_LIBRARIES} + ${DBOW2_LIBRARIES} + ${OpenCV_LIBRARIES} + ${OPENMVG_LIBRARIES} + ${CERES_LIBRARIES} + ${PROTOBUF_LIBRARIES} ) -create_library(TARGET sparse_mapping - LIBS ${LIBS} - INC include ${INCLUDES} - DEPS ${DEPS} - ADD_SRCS ${PROTO_SRCS} ) if (NOT USE_CTC) - create_tool_targets(DIR tools - LIBS ${LIBS} sparse_mapping - INC ${INCLUDES} - DEPS ${DEPS} - EXCLUDE ${EXCLUDE}) +## Declare a C++ executable: build_map +add_executable(build_map tools/build_map.cc) +add_dependencies(build_map ${catkin_EXPORTED_TARGETS}) +target_link_libraries(build_map + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: evaluate_camera +add_executable(evaluate_camera tools/evaluate_camera.cc) +add_dependencies(evaluate_camera ${catkin_EXPORTED_TARGETS}) +target_link_libraries(evaluate_camera + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: evaluate_localization +add_executable(evaluate_localization tools/evaluate_localization.cc) +add_dependencies(evaluate_localization ${catkin_EXPORTED_TARGETS}) +target_link_libraries(evaluate_localization + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: extract_camera_info +add_executable(extract_camera_info tools/extract_camera_info.cc) +add_dependencies(extract_camera_info ${catkin_EXPORTED_TARGETS}) +target_link_libraries(extract_camera_info + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: extract_submap +add_executable(extract_submap tools/extract_submap.cc) +add_dependencies(extract_submap ${catkin_EXPORTED_TARGETS}) +target_link_libraries(extract_submap + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: generate_localization_test +add_executable(generate_localization_test tools/generate_localization_test.cc) +add_dependencies(generate_localization_test ${catkin_EXPORTED_TARGETS}) +target_link_libraries(generate_localization_test + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: gen_trajectory +add_executable(gen_trajectory tools/gen_trajectory.cc) +add_dependencies(gen_trajectory ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gen_trajectory + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: import_map +add_executable(import_map tools/import_map.cc) +add_dependencies(import_map ${catkin_EXPORTED_TARGETS}) +target_link_libraries(import_map + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: localize_cams +add_executable(localize_cams tools/localize_cams.cc) +add_dependencies(localize_cams ${catkin_EXPORTED_TARGETS}) +target_link_libraries(localize_cams + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: localize +add_executable(localize tools/localize.cc) +add_dependencies(localize ${catkin_EXPORTED_TARGETS}) +target_link_libraries(localize + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: nvm_visualize +add_executable(nvm_visualize tools/nvm_visualize.cc) +add_dependencies(nvm_visualize ${catkin_EXPORTED_TARGETS}) +target_link_libraries(nvm_visualize + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: parse_cam +add_executable(parse_cam tools/parse_cam.cc) +add_dependencies(parse_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(parse_cam + sparse_mapping gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: select_images +add_executable(select_images tools/select_images.cc) +add_dependencies(select_images ${catkin_EXPORTED_TARGETS}) +target_link_libraries(select_images + sparse_mapping gflags glog ${catkin_LIBRARIES}) endif (NOT USE_CTC) + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -74,7 +180,7 @@ if(CATKIN_ENABLE_TESTING) test/test_build_db.cc ) target_link_libraries(test_build_db - sparse_mapping + sparse_mapping glog ) add_rostest_gtest(test_nvm_fileio @@ -106,17 +212,25 @@ if(CATKIN_ENABLE_TESTING) test/test_sparse_map.cc ) target_link_libraries(test_sparse_map - sparse_mapping + sparse_mapping glog ) endif() -set(SPARSE_MAPPING_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${INTEREST_INCLUDE_DIRS} - ${CAMERA_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${CERES_INCLUDE_DIRS}) +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) -set(SPARSE_MAPPING_LIBRARIES ${SPARSE_MAPPING_LIBRARIES} PARENT_SCOPE) -set(SPARSE_MAPPING_INCLUDE_DIRS ${SPARSE_MAPPING_INCLUDE_DIRS} PARENT_SCOPE) +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/localization/sparse_mapping/package.xml b/localization/sparse_mapping/package.xml index 8e8801bda8..79fab36473 100644 --- a/localization/sparse_mapping/package.xml +++ b/localization/sparse_mapping/package.xml @@ -14,15 +14,17 @@ Astrobee Flight Software catkin + ff_msgs + ff_common camera roscpp interest_point config_reader - ff_common roscpp + ff_msgs + ff_common camera interest_point config_reader - ff_common diff --git a/localization/sparse_mapping/src/sparse_map.cc b/localization/sparse_mapping/src/sparse_map.cc index 6bef6a6c73..7bb386b10f 100644 --- a/localization/sparse_mapping/src/sparse_map.cc +++ b/localization/sparse_mapping/src/sparse_map.cc @@ -662,7 +662,7 @@ bool Localize(cv::Mat const& test_descriptors, } // To turn on verbose localization for debugging - // FREEFLYER_GFLAGS_NAMESPACE::SetCommandLineOption("verbose_localization", "true"); + // google::SetCommandLineOption("verbose_localization", "true"); // Find matches to each image in map. Do this in two passes. First, // find matches to all map images, then keep only num_similar diff --git a/localization/sparse_mapping/src/tensor.cc b/localization/sparse_mapping/src/tensor.cc index 8efc3ef245..641c793fe3 100644 --- a/localization/sparse_mapping/src/tensor.cc +++ b/localization/sparse_mapping/src/tensor.cc @@ -918,7 +918,7 @@ void findMatchingTracks(sparse_mapping::SparseMap * A_in, // Match features. Must set num_subsequent_images to not try to // match images in same map, that was done when each map was built. - FREEFLYER_GFLAGS_NAMESPACE::SetCommandLineOption("num_subsequent_images", "0"); + google::SetCommandLineOption("num_subsequent_images", "0"); sparse_mapping::MatchFeatures(sparse_mapping::EssentialFile(output_map), sparse_mapping::MatchesFile(output_map), &C); diff --git a/localization/sparse_mapping/test/test_build_db.cc b/localization/sparse_mapping/test/test_build_db.cc index 08b8d69c75..1ea65875f4 100644 --- a/localization/sparse_mapping/test/test_build_db.cc +++ b/localization/sparse_mapping/test/test_build_db.cc @@ -132,3 +132,9 @@ void RunWithDB(std::string const& detector_name) { TEST(build_db_dbow2_orgbrisk, write_descriptors_build_db) { RunWithDB("ORGBRISK"); } + +// Run all the tests that were declared with TEST() +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/sparse_mapping/test/test_nvm_fileio.cc b/localization/sparse_mapping/test/test_nvm_fileio.cc index f5d8bae18b..3fbdb05919 100644 --- a/localization/sparse_mapping/test/test_nvm_fileio.cc +++ b/localization/sparse_mapping/test/test_nvm_fileio.cc @@ -154,3 +154,9 @@ TEST(nvm_fileio, read_write_loop_features) { EXPECT_EQ(descriptors1.at(1, i), descriptors2.at(1, i)); } } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/sparse_mapping/test/test_registration.cc b/localization/sparse_mapping/test/test_registration.cc index 4db194287e..386e9fb19d 100644 --- a/localization/sparse_mapping/test/test_registration.cc +++ b/localization/sparse_mapping/test/test_registration.cc @@ -146,3 +146,9 @@ TEST_F(SparseMapTest, Registration) { double scale = pow(surf_map->GetWorldTransform().linear().determinant(), 1.0/3.0); EXPECT_GT(scale, 0); // just a sanity check } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/sparse_mapping/test/test_registration.test b/localization/sparse_mapping/test/test_registration.test index d80baa30df..43e36df82b 100644 --- a/localization/sparse_mapping/test/test_registration.test +++ b/localization/sparse_mapping/test/test_registration.test @@ -17,5 +17,5 @@ - + diff --git a/localization/sparse_mapping/test/test_reprojection.cc b/localization/sparse_mapping/test/test_reprojection.cc index 3795ea12b3..eb9873b335 100644 --- a/localization/sparse_mapping/test/test_reprojection.cc +++ b/localization/sparse_mapping/test/test_reprojection.cc @@ -122,3 +122,9 @@ TEST(reprojection, affine_estimation) { EXPECT_NEAR(A.translation()[1], S[1], 1e-3); EXPECT_NEAR(A.translation()[2], S[2], 1e-3); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/sparse_mapping/test/test_sparse_map.cc b/localization/sparse_mapping/test/test_sparse_map.cc index a91f1e4fb7..bfce320c78 100644 --- a/localization/sparse_mapping/test/test_sparse_map.cc +++ b/localization/sparse_mapping/test/test_sparse_map.cc @@ -301,3 +301,9 @@ const Parameters test_parameters[] = { INSTANTIATE_TEST_CASE_P(SparseMapTest, SparseMapTest, ::testing::ValuesIn(test_parameters)); + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/localization/sparse_mapping/test/test_sparse_map.test b/localization/sparse_mapping/test/test_sparse_map.test index dbf49539d8..c7a4757039 100644 --- a/localization/sparse_mapping/test/test_sparse_map.test +++ b/localization/sparse_mapping/test/test_sparse_map.test @@ -17,5 +17,5 @@ - + diff --git a/localization/vive_localization/CMakeLists.txt b/localization/vive_localization/CMakeLists.txt index b03d1cd328..e8d8bfdf1c 100644 --- a/localization/vive_localization/CMakeLists.txt +++ b/localization/vive_localization/CMakeLists.txt @@ -15,12 +15,29 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(vive_localization) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + rosbag + nodelet + geometry_msgs + ff_hw_msgs + ff_util + msg_conversions + config_reader +) + # Find Eigen3 find_package(Eigen3 REQUIRED) # Find OpenCV3 +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") find_package(OpenCV 3 REQUIRED) # Non-linear optimizer @@ -34,25 +51,68 @@ catkin_package( roscpp rosbag nodelet - pluginlib - sensor_msgs - geometry_msgs - nav_msgs ff_hw_msgs - tf2_ros) + ff_util + msg_conversions + config_reader +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + ${OpenCV_INCLUDE_DIRS} + ${CERES_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(vive_localization + src/vive.cc + src/vive_solver.cc + src/tool/vive_offline.cc +) +add_dependencies(vive_localization ${catkin_EXPORTED_TARGETS}) +target_link_libraries(vive_localization json-c usb-1.0 z ${catkin_LIBRARIES}) + +## Declare a C++ executable: vive_offline +add_executable(vive_offline src/tool/vive_offline.cc) +add_dependencies(vive_offline ${catkin_EXPORTED_TARGETS}) +target_link_libraries(vive_offline + vive_localization gflags ${OpenCV_LIBRARIES} ${CERES_LIBRARIES} ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) -create_library(TARGET vive_localization - DIR src - LIBS ${catkin_LIBRARIES} ${OpenCV_LIBS} ${CERES_LIBRARIES} ff_common config_reader msg_conversions ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${CERES_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_common geometry_msgs sensor_msgs ff_hw_msgs) +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) -create_tool_targets( - DIR src/tool - LIBS ${catkin_LIBRARIES} ${EIGEN3_LIBRARIES} vive_localization ff_common config_reader - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} -DEPS ff_common geometry_msgs sensor_msgs ff_hw_msgs) +# Install C++ executables +install(TARGETS vive_offline DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/vive_offline share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) install(DIRECTORY config/ DESTINATION config) diff --git a/localization/vive_localization/package.xml b/localization/vive_localization/package.xml index da1a6553e4..76edd7d32c 100644 --- a/localization/vive_localization/package.xml +++ b/localization/vive_localization/package.xml @@ -18,21 +18,23 @@ roscpp rosbag nodelet - pluginlib sensor_msgs geometry_msgs nav_msgs ff_hw_msgs - tf2_ros + ff_util + msg_conversions + config_reader roscpp rosbag nodelet - pluginlib sensor_msgs geometry_msgs nav_msgs ff_hw_msgs - tf2_ros + ff_util + msg_conversions + config_reader diff --git a/management/CMakeLists.txt b/management/CMakeLists.txt deleted file mode 100644 index 3ee546050c..0000000000 --- a/management/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(access_control) -add_subdirectory(cpu_mem_monitor) -add_subdirectory(disk_monitor) -add_subdirectory(image_sampler) -add_subdirectory(sys_monitor) -add_subdirectory(executive) -add_subdirectory(data_bagger) -add_subdirectory(log_monitor) diff --git a/management/access_control/CMakeLists.txt b/management/access_control/CMakeLists.txt index f1a9214641..d33004fc50 100644 --- a/management/access_control/CMakeLists.txt +++ b/management/access_control/CMakeLists.txt @@ -15,18 +15,42 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(access_control) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + nodelet + config_reader + ff_util +) + catkin_package( LIBRARIES access_control - DEPENDS roscpp ff_msgs nodelet + DEPENDS roscpp ff_msgs nodelet config_reader ff_util +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET access_control - LIBS ${catkin_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs config_reader +# Declare C++ libraries +add_library(access_control + src/access_control.cc ) +add_dependencies(access_control ${catkin_EXPORTED_TARGETS}) +target_link_libraries(access_control ${catkin_LIBRARIES}) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -36,8 +60,27 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_access_control - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() -install_launch_files() +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/management/access_control/package.xml b/management/access_control/package.xml index 197f319223..f734b403a2 100644 --- a/management/access_control/package.xml +++ b/management/access_control/package.xml @@ -18,9 +18,13 @@ ff_msgs roscpp nodelet + config_reader + ff_util ff_msgs roscpp nodelet + config_reader + ff_util diff --git a/management/cpu_mem_monitor/CMakeLists.txt b/management/cpu_mem_monitor/CMakeLists.txt index b27893282c..3e4933c415 100644 --- a/management/cpu_mem_monitor/CMakeLists.txt +++ b/management/cpu_mem_monitor/CMakeLists.txt @@ -15,18 +15,44 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(cpu_mem_monitor) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_hw_msgs + ff_msgs + config_reader + ff_util +) + catkin_package( LIBRARIES cpu_mem_monitor - CATKIN_DEPENDS roscpp roslib nodelet ff_hw_msgs ff_msgs std_msgs + CATKIN_DEPENDS roscpp nodelet ff_hw_msgs ff_msgs config_reader ff_util +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET cpu_mem_monitor - LIBS ${catkin_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDES} - DEPS ff_msgs ff_hw_msgs +# Declare C++ libraries +add_library(cpu_mem_monitor + src/cpu.cc + src/cpu_mem_monitor.cc ) +add_dependencies(cpu_mem_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(cpu_mem_monitor ${catkin_LIBRARIES}) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -37,7 +63,7 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_llp_cpu_mem_monitor - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) # mlp CPU monitor initialization fault tester add_rostest_gtest(test_init_mlp_cpu_mem_monitor @@ -46,9 +72,29 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_mlp_cpu_mem_monitor - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() -install_launch_files() +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + diff --git a/management/cpu_mem_monitor/package.xml b/management/cpu_mem_monitor/package.xml index ed677a5f8d..8549acff8c 100644 --- a/management/cpu_mem_monitor/package.xml +++ b/management/cpu_mem_monitor/package.xml @@ -16,18 +16,17 @@ catkin roscpp - roslib nodelet ff_msgs ff_hw_msgs - std_msgs + config_reader + ff_util roscpp - roslib nodelet ff_msgs ff_hw_msgs - std_msgs - message_runtime + config_reader + ff_util diff --git a/management/data_bagger/CMakeLists.txt b/management/data_bagger/CMakeLists.txt index 1aa20100ca..c51d9bf161 100644 --- a/management/data_bagger/CMakeLists.txt +++ b/management/data_bagger/CMakeLists.txt @@ -15,17 +15,80 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(data_bagger) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + nodelet + ff_util + config_reader + rosbag +) + catkin_package( - LIBRARIES data_bagger astrobee_recorder - DEPENDS roscpp ff_msgs nodelet + LIBRARIES data_bagger astrobee_recorder + CATKIN_DEPENDS + roscpp + ff_msgs + nodelet + ff_util + config_reader + rosbag +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(astrobee_recorder + src/astrobee_recorder.cc ) +add_dependencies(astrobee_recorder ${catkin_EXPORTED_TARGETS}) +target_link_libraries(astrobee_recorder ${catkin_LIBRARIES}) -create_library(TARGET data_bagger - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDES} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs config_reader +# Declare C++ libraries +add_library(data_bagger + src/data_bagger.cc ) +add_dependencies(data_bagger ${catkin_EXPORTED_TARGETS}) +target_link_libraries(data_bagger astrobee_recorder ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS astrobee_recorder + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) -install_launch_files() diff --git a/management/data_bagger/package.xml b/management/data_bagger/package.xml index 027837d05d..aa10969571 100644 --- a/management/data_bagger/package.xml +++ b/management/data_bagger/package.xml @@ -19,9 +19,15 @@ roscpp ff_msgs nodelet + ff_util + config_reader + rosbag roscpp ff_msgs nodelet + ff_util + config_reader + rosbag diff --git a/management/disk_monitor/CMakeLists.txt b/management/disk_monitor/CMakeLists.txt index 077795d647..9f82463ff1 100644 --- a/management/disk_monitor/CMakeLists.txt +++ b/management/disk_monitor/CMakeLists.txt @@ -15,18 +15,47 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(disk_monitor) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + nodelet + config_reader + ff_util +) + catkin_package( LIBRARIES disk_monitor - DEPENDS roscpp ff_msgs nodelet + DEPENDS roscpp ff_msgs nodelet config_reader ff_util +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET disk_monitor - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDES} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs config_reader +# Declare C++ libraries +add_library(disk_monitor + src/disk_monitor_node.cc ) +add_dependencies(disk_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(disk_monitor ${catkin_LIBRARIES}) +# create_library(TARGET disk_monitor +# LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} config_reader ff_nodelet +# INC ${catkin_INCLUDES} ${GLOG_INCLUDE_DIRS} +# DEPS ff_msgs config_reader +# ) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -37,7 +66,7 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_llp_disk_monitor - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) # MLP disk monitor initialization fault tester add_rostest_gtest(test_init_mlp_disk_monitor @@ -46,12 +75,28 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_mlp_disk_monitor - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() -create_test_targets(DIR test - LIBS disk_monitor) +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/management/disk_monitor/package.xml b/management/disk_monitor/package.xml index bf3b29c0cb..b067e4689d 100644 --- a/management/disk_monitor/package.xml +++ b/management/disk_monitor/package.xml @@ -18,9 +18,13 @@ roscpp ff_msgs nodelet + config_reader + ff_util ff_msgs roscpp nodelet + config_reader + ff_util diff --git a/management/executive/CMakeLists.txt b/management/executive/CMakeLists.txt index 4bf49ccd1e..0901a5d81b 100644 --- a/management/executive/CMakeLists.txt +++ b/management/executive/CMakeLists.txt @@ -15,32 +15,114 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(executive) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + ff_hw_msgs + nodelet + config_reader + ff_util + jsonloader +) + +# System dependencies are found with CMake's conventions +find_package(cmake_modules REQUIRED) +find_package(Boost REQUIRED COMPONENTS system iostreams) + +# Find jsoncpp +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(JsonCpp REQUIRED) + catkin_package( LIBRARIES executive sequencer CATKIN_DEPENDS roscpp - ff_flight ff_msgs - ff_util + ff_hw_msgs nodelet + ff_util + jsonloader ) -create_library(TARGET sequencer - DIR src/utils/sequencer/ - LIBS ${catkin_LIBRARIES} ${Boost_IOSTREAMS_LIBRARY} jsonloader msg_conversions - INC ${catkin_INCLUDE_DIRS} msg_conversions - DEPS ff_msgs jsonloader msg_conversions +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${JSONCPP_INCLUDE_DIR} ) -create_library(TARGET executive - LIBS ${catkin_LIBRARIES} ff_flight ff_nodelet config_reader sequencer config_client - INC ${catkin_INCLUDE_DIRS} - DEPS ff_flight ff_msgs ff_util config_reader sequencer +# Declare C++ libraries +add_library(sequencer + src/utils/sequencer/command_conversion.cc + src/utils/sequencer/plan_io.cc + src/utils/sequencer/sequencer.cc ) +add_dependencies(sequencer ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sequencer ${Boost_IOSTREAMS_LIBRARY} ${catkin_LIBRARIES}) + +# Declare C++ libraries +add_library(executive + src/executive.cc + src/op_state.cc + src/op_state_auto_return.cc + src/op_state_fault.cc + src/op_state_plan_exec.cc + src/op_state_ready.cc + src/op_state_repo.cc + src/op_state_teleop.cc +) +add_dependencies(executive ${catkin_EXPORTED_TARGETS}) +target_link_libraries(executive sequencer ${Boost_SYSTEM_LIBRARY} ${catkin_LIBRARIES}) + + +## Declare a C++ executable: data_to_disk_pub +add_executable(data_to_disk_pub tools/data_to_disk_pub.cc) +add_dependencies(data_to_disk_pub ${catkin_EXPORTED_TARGETS}) +target_link_libraries(data_to_disk_pub + executive gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: ekf_switch_mux +add_executable(ekf_switch_mux tools/ekf_switch_mux.cc) +add_dependencies(ekf_switch_mux ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ekf_switch_mux + executive gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: plan_pub +add_executable(plan_pub tools/plan_pub.cc) +add_dependencies(plan_pub ${catkin_EXPORTED_TARGETS}) +target_link_libraries(plan_pub + executive gflags ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + +## Declare a C++ executable: simple_move +add_executable(simple_move tools/simple_move.cc) +add_dependencies(simple_move ${catkin_EXPORTED_TARGETS}) +target_link_libraries(simple_move + executive gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: teleop_tool +add_executable(teleop_tool tools/teleop_tool.cc) +add_dependencies(teleop_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(teleop_tool + executive gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: zones_pub +add_executable(zones_pub tools/zones_pub.cc) +add_dependencies(zones_pub ${catkin_EXPORTED_TARGETS}) +target_link_libraries(zones_pub + executive gflags ${catkin_LIBRARIES} ${Boost_LIBRARIES}) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -51,15 +133,51 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_executive - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() +############# +## Install ## +############# -create_tool_targets(DIR tools - LIBS executive ${catkin_LIBRARIES} ${Boost_IOSTREAMS_LIBRARY} - INC ${catkin_INCLUDE_DIRS} - DEPS executive +# Mark libraries for installation +install(TARGETS sequencer + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -install_launch_files() +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS data_to_disk_pub DESTINATION bin) +install(TARGETS ekf_switch_mux DESTINATION bin) +install(TARGETS plan_pub DESTINATION bin) +install(TARGETS simple_move DESTINATION bin) +install(TARGETS teleop_tool DESTINATION bin) +install(TARGETS zones_pub DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/data_to_disk_pub share/${PROJECT_NAME} + COMMAND ln -s ../../bin/ekf_switch_mux share/${PROJECT_NAME} + COMMAND ln -s ../../bin/plan_pub share/${PROJECT_NAME} + COMMAND ln -s ../../bin/simple_move share/${PROJECT_NAME} + COMMAND ln -s ../../bin/teleop_tool share/${PROJECT_NAME} + COMMAND ln -s ../../bin/zones_pub share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/management/executive/package.xml b/management/executive/package.xml index d31fc96960..4428a2275c 100644 --- a/management/executive/package.xml +++ b/management/executive/package.xml @@ -15,16 +15,20 @@ Astrobee Flight Software catkin - ff_flight - ff_msgs - ff_util roscpp + ff_msgs + ff_hw_msgs nodelet - ff_flight - ff_msgs - ff_util + config_reader + ff_util + jsonloader roscpp + ff_msgs + ff_hw_msgs nodelet + config_reader + ff_util + jsonloader diff --git a/management/executive/tools/data_to_disk_pub.cc b/management/executive/tools/data_to_disk_pub.cc index 74dbfaecde..d1c61e1a3f 100644 --- a/management/executive/tools/data_to_disk_pub.cc +++ b/management/executive/tools/data_to_disk_pub.cc @@ -44,8 +44,6 @@ namespace fs = boost::filesystem; namespace io = boost::iostreams; -namespace flags = FREEFLYER_GFLAGS_NAMESPACE; - DEFINE_string(compression, "none", "Type of compression [none, deflate, gzip]"); @@ -86,11 +84,11 @@ int main(int argc, char** argv) { ff_common::InitFreeFlyerApplication(&argc, &argv); ros::init(argc, argv, "data_to_disk_publisher"); - if (!flags::RegisterFlagValidator(&FLAGS_compression, &ValidateCompression)) { + if (!google::RegisterFlagValidator(&FLAGS_compression, &ValidateCompression)) { std::cerr << "Failed to register compression flag validator." << std::endl; return -1; } - flags::ParseCommandLineFlags(&argc, &argv, true); + google::ParseCommandLineFlags(&argc, &argv, true); if (argc <= 1) { std::cerr << "error: must provide at least one file to send as zones" diff --git a/management/executive/tools/plan_pub.cc b/management/executive/tools/plan_pub.cc index 3836a223c8..23acd5c236 100644 --- a/management/executive/tools/plan_pub.cc +++ b/management/executive/tools/plan_pub.cc @@ -45,7 +45,6 @@ namespace fs = boost::filesystem; namespace io = boost::iostreams; -namespace flags = FREEFLYER_GFLAGS_NAMESPACE; bool ValidateCompression(const char* name, std::string const &value) { if (value == "none" || value == "gzip" || value == "deflate") @@ -109,11 +108,11 @@ int main(int argc, char** argv) { ros::Time::waitForValid(); - if (!flags::RegisterFlagValidator(&FLAGS_compression, &ValidateCompression)) { + if (!google::RegisterFlagValidator(&FLAGS_compression, &ValidateCompression)) { std::cerr << "Failed to register compression flag validator." << std::endl; return -1; } - flags::ParseCommandLineFlags(&argc, &argv, true); + google::ParseCommandLineFlags(&argc, &argv, true); if (argc <= 1) { std::cerr << "error: must provide at least one file to send as a plan" diff --git a/management/executive/tools/zones_pub.cc b/management/executive/tools/zones_pub.cc index 3c72cddc99..3c990e1348 100644 --- a/management/executive/tools/zones_pub.cc +++ b/management/executive/tools/zones_pub.cc @@ -44,8 +44,6 @@ namespace fs = boost::filesystem; namespace io = boost::iostreams; -namespace flags = FREEFLYER_GFLAGS_NAMESPACE; - DEFINE_string(compression, "none", "Type of compression [none, deflate, gzip]"); @@ -86,11 +84,11 @@ int main(int argc, char** argv) { ff_common::InitFreeFlyerApplication(&argc, &argv); ros::init(argc, argv, "zone_publisher"); - if (!flags::RegisterFlagValidator(&FLAGS_compression, &ValidateCompression)) { + if (!google::RegisterFlagValidator(&FLAGS_compression, &ValidateCompression)) { std::cerr << "Failed to register compression flag validator." << std::endl; return -1; } - flags::ParseCommandLineFlags(&argc, &argv, true); + google::ParseCommandLineFlags(&argc, &argv, true); if (argc <= 1) { std::cerr << "error: must provide at least one file to send as zones" diff --git a/management/image_sampler/CMakeLists.txt b/management/image_sampler/CMakeLists.txt index 347a329123..546317542b 100644 --- a/management/image_sampler/CMakeLists.txt +++ b/management/image_sampler/CMakeLists.txt @@ -15,17 +15,72 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(image_sampler) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_msgs + nodelet + config_reader + ff_util + image_transport +) + +# Find OpenCV3 +find_package(OpenCV 3 REQUIRED) + catkin_package( LIBRARIES image_sampler - DEPENDS roscpp ff_msgs nodelet + DEPENDS roscpp ff_msgs nodelet config_reader ff_util image_transport +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} ) -create_library(TARGET image_sampler - LIBS ${catkin_LIBRARIES} config_reader ff_nodelet ${OpenCV_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} - DEPS ff_msgs config_reader opencv +# create_library(TARGET image_sampler +# LIBS ${catkin_LIBRARIES} config_reader ff_nodelet ${OpenCV_LIBRARIES} +# INC ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} +# DEPS ff_msgs config_reader opencv +# ) + +# Declare C++ libraries +add_library(image_sampler + src/image_sampler.cc +) +add_dependencies(image_sampler ${catkin_EXPORTED_TARGETS}) +target_link_libraries(image_sampler ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -install_launch_files() +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + diff --git a/management/image_sampler/package.xml b/management/image_sampler/package.xml index f9f3ba5536..a13b338397 100644 --- a/management/image_sampler/package.xml +++ b/management/image_sampler/package.xml @@ -18,9 +18,15 @@ ff_msgs roscpp nodelet + config_reader + ff_util + image_transport ff_msgs roscpp nodelet + config_reader + ff_util + image_transport diff --git a/management/log_monitor/CMakeLists.txt b/management/log_monitor/CMakeLists.txt index bccaa47114..fdfd2ed393 100644 --- a/management/log_monitor/CMakeLists.txt +++ b/management/log_monitor/CMakeLists.txt @@ -15,29 +15,48 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(log_monitor) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp +) + catkin_package( LIBRARIES log_monitor CATKIN_DEPENDS roscpp - roslib - nodelet - ff_hw_msgs - ff_msgs - std_msgs ) -create_tool_targets( - DIR - tools - LIBS - ${catkin_LIBRARIES} - ff_common - ff_nodelet - INC - ${catkin_INCLUDE_DIRS} - DEPS - ff_msgs -) \ No newline at end of file +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + ${catkin_INCLUDE_DIRS} +) + +## Declare a C++ executable: undistort_image +add_executable(log_tool tools/log_tool.cc) +add_dependencies(log_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(log_tool + gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Install C++ executables +install(TARGETS log_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/log_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") \ No newline at end of file diff --git a/management/log_monitor/package.xml b/management/log_monitor/package.xml index be1c8747af..9cce74e472 100644 --- a/management/log_monitor/package.xml +++ b/management/log_monitor/package.xml @@ -15,17 +15,6 @@ catkin roscpp - roslib - nodelet - ff_msgs - ff_hw_msgs - std_msgs roscpp - roslib - nodelet - ff_msgs - ff_hw_msgs - std_msgs - message_runtime diff --git a/management/sys_monitor/CMakeLists.txt b/management/sys_monitor/CMakeLists.txt index 92183c49d8..bc7ec205ef 100644 --- a/management/sys_monitor/CMakeLists.txt +++ b/management/sys_monitor/CMakeLists.txt @@ -15,18 +15,48 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(sys_monitor) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_util + ff_msgs + nodelet + config_reader +) + catkin_package( LIBRARIES sys_monitor - DEPENDS roscpp ff_msgs nodelet + DEPENDS roscpp ff_util ff_msgs nodelet config_reader +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET sys_monitor - LIBS ${catkin_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs config_reader +# Declare C++ libraries +add_library(sys_monitor + src/sys_monitor.cc ) +add_dependencies(sys_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sys_monitor ${catkin_LIBRARIES}) + +## Declare a C++ executable: fault_tester +add_executable(fault_tester tools/fault_tester.cc) +add_dependencies(fault_tester ${catkin_EXPORTED_TARGETS}) +target_link_libraries(fault_tester + sys_monitor gflags glog ${catkin_LIBRARIES}) if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -37,7 +67,7 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_sys_monitor - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) # System monitor tester add_rostest_gtest(test_sys_monitor @@ -46,13 +76,36 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_sys_monitor - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() -create_tool_targets(DIR tools - LIBS sys_monitor - DEPS sys_monitor +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -install_launch_files() +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS fault_tester DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/fault_tester share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/management/sys_monitor/package.xml b/management/sys_monitor/package.xml index 32d48e5013..0a98ba1a9c 100644 --- a/management/sys_monitor/package.xml +++ b/management/sys_monitor/package.xml @@ -15,12 +15,16 @@ Astrobee Flight Software catkin + ff_util ff_msgs roscpp nodelet + config_reader + ff_util ff_msgs roscpp nodelet + config_reader diff --git a/mobility/CMakeLists.txt b/mobility/CMakeLists.txt deleted file mode 100644 index c237dfe2aa..0000000000 --- a/mobility/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Basic system -add_subdirectory(framestore) -add_subdirectory(choreographer) -add_subdirectory(mapper) - -# Planners -add_subdirectory(planner_trapezoidal) -if (ENABLE_QP) - add_subdirectory(planner_qp) -endif() - -# High-level tools -add_subdirectory(mobility) diff --git a/mobility/choreographer/CMakeLists.txt b/mobility/choreographer/CMakeLists.txt index 412ddbcab2..1d3229056e 100644 --- a/mobility/choreographer/CMakeLists.txt +++ b/mobility/choreographer/CMakeLists.txt @@ -15,8 +15,24 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(choreographer) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_util + mapper + ff_msgs + ff_hw_msgs + tf2_ros + jsonloader +) + catkin_package( INCLUDE_DIRS include @@ -30,17 +46,27 @@ catkin_package( ff_util tf2 tf2_ros - nav_msgs - geometry_msgs - visualization_msgs + jsonloader ) -create_library(TARGET choreographer - LIBS ${catkin_LIBRARIES} ff_common ff_nodelet ff_flight config_server mapper - INC ${catkin_INCLUDE_DIRS} - DEPS ff_common nav_msgs geometry_msgs ff_msgs ff_util mapper +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) +# Declare C++ libraries +add_library(choreographer + src/choreographer_nodelet.cc + src/validator.cc +) +add_dependencies(choreographer ${catkin_EXPORTED_TARGETS}) +target_link_libraries(choreographer ${catkin_LIBRARIES}) + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) # Choreographer initialization fault tester @@ -49,7 +75,7 @@ if(CATKIN_ENABLE_TESTING) test/test_init_choreographer.cc ) target_link_libraries(test_init_choreographer - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) if(ENABLE_INTEGRATION_TESTING) # Choreographer test obstacles @@ -59,7 +85,7 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_obstacle - ${catkin_LIBRARIES} config_client ff_nodelet + ${catkin_LIBRARIES} ) # Choreographer test zones keepin @@ -69,7 +95,7 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_zones_keepin - ${catkin_LIBRARIES} config_client ff_nodelet + ${catkin_LIBRARIES} ) # Choreographer test zones keepout @@ -79,7 +105,7 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_zones_keepout - ${catkin_LIBRARIES} config_client ff_nodelet + ${catkin_LIBRARIES} ) # Choreographer test zones nominal @@ -89,9 +115,35 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_zones_nominal - ${catkin_LIBRARIES} config_client ff_nodelet + ${catkin_LIBRARIES} ) endif() endif() -install_launch_files() +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/mobility/choreographer/package.xml b/mobility/choreographer/package.xml index 9710a2f49a..fca0042978 100644 --- a/mobility/choreographer/package.xml +++ b/mobility/choreographer/package.xml @@ -17,24 +17,28 @@ catkin roscpp nodelet + mapper tf2 tf2_ros ff_msgs ff_util - geometry_msgs - nav_msgs - visualization_msgs + ff_msgs + ff_hw_msgs + tf2_ros + jsonloader roscpp nodelet mapper tf2 tf2_ros ff_msgs + jsonloader + ff_util - geometry_msgs - nav_msgs - visualization_msgs + ff_msgs + ff_hw_msgs + tf2_ros diff --git a/mobility/framestore/CMakeLists.txt b/mobility/framestore/CMakeLists.txt index 7795c721ce..a4488d367f 100644 --- a/mobility/framestore/CMakeLists.txt +++ b/mobility/framestore/CMakeLists.txt @@ -15,27 +15,79 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(framestore) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + ff_util + tf2_ros + geometry_msgs + config_reader +) + # Call catkin catkin_package( CATKIN_DEPENDS - roscpp roscpp tf2 tf2_ros geometry_msgs + roscpp nodelet pluginlib ff_util tf2_ros geometry_msgs config_reader +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -# Create global_transforms -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} ff_common msg_conversions config_reader - INC ${catkin_INCLUDE_DIRS} - DEPS ff_common msg_conversions config_reader tf2 tf2_ros geometry_msgs +# Declare C++ libraries +add_library(framestore + src/framestore.cc ) +add_dependencies(framestore ${catkin_EXPORTED_TARGETS}) +target_link_libraries(framestore ${catkin_LIBRARIES}) -# Create framestore -create_library(TARGET framestore - LIBS ${catkin_LIBRARIES} ff_common ff_nodelet msg_conversions - INC ${catkin_INCLUDE_DIRS} - DEPS ff_common msg_conversions roscpp nodelet pluginlib tf2 tf2_ros geometry_msgs + +## Declare a C++ executable: global_transforms +add_executable(global_transforms tools/global_transforms.cc) +add_dependencies(global_transforms ${catkin_EXPORTED_TARGETS}) +target_link_libraries(global_transforms + framestore gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -# Install our launch file -install_launch_files() +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS global_transforms DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/global_transforms share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/mobility/framestore/package.xml b/mobility/framestore/package.xml index 8d2951a34e..fecc5f5f12 100644 --- a/mobility/framestore/package.xml +++ b/mobility/framestore/package.xml @@ -18,15 +18,17 @@ roscpp nodelet pluginlib - tf2 + ff_util tf2_ros geometry_msgs + config_reader roscpp nodelet pluginlib - tf2 + ff_util tf2_ros geometry_msgs + config_reader diff --git a/mobility/mapper/CMakeLists.txt b/mobility/mapper/CMakeLists.txt index 4b48ef3fa8..5db03a90e8 100644 --- a/mobility/mapper/CMakeLists.txt +++ b/mobility/mapper/CMakeLists.txt @@ -15,36 +15,75 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(mapper) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## This fixes the Eigen aligment issue +## http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D EIGEN_MAX_STATIC_ALIGN_BYTES=0") + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + ff_util + ff_msgs + message_runtime + octomap +) + +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(Octomap REQUIRED) + +# Find Eigen3 +find_package(Eigen3 REQUIRED) +# Find PCL +find_package(PCL REQUIRED COMPONENTS common) + catkin_package( - DEPENDS - Eigen - INCLUDE_DIRS - include - ${EIGEN3_INCLUDE_DIRS} - ${PCL_INCLUDE_DIRS} + INCLUDE_DIRS include LIBRARIES mapper CATKIN_DEPENDS roscpp nodelet pluginlib + ff_util ff_msgs message_runtime - cmake_modules ) -set(INCLUDES - ${EIGEN3_INCLUDE_DIRS} +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ${PCL_INCLUDE_DIRS} - src + ${OCTOMAP_INCLUDE_DIRS} ) -create_library(TARGET mapper - LIBS ${catkin_LIBRARIES} ff_nodelet ff_flight config_server ${PCL_LIBRARIES} ${OCTOMAP_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} ${INCLUDES} ${OCTOMAP_INCLUDE_DIRS} +# Declare C++ libraries +add_library(mapper + src/callbacks.cc + src/mapper_nodelet.cc + src/octoclass.cc + src/polynomials.cc + src/sampled_trajectory.cc + src/services.cc + src/threads.cc + src/visualization_functions.cc ) +add_dependencies(mapper ${catkin_EXPORTED_TARGETS}) +target_link_libraries(mapper ${OCTOMAP_LIBRARIES} ${catkin_LIBRARIES}) + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -55,8 +94,35 @@ if(CATKIN_ENABLE_TESTING) ) target_link_libraries(test_init_mapper - ${catkin_LIBRARIES} config_reader ff_nodelet + ${catkin_LIBRARIES} glog ) endif() -install_launch_files() +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + diff --git a/mobility/mapper/package.xml b/mobility/mapper/package.xml index 63e22acfff..550fa3b848 100644 --- a/mobility/mapper/package.xml +++ b/mobility/mapper/package.xml @@ -17,20 +17,20 @@ catkin roscpp nodelet + ff_util pluginlib - actionlib ff_msgs + message_runtime cmake_modules - visualization_msgs - + octomap roscpp nodelet pluginlib - actionlib + ff_util ff_msgs - visualization_msgs - cmake_modules message_runtime + cmake_modules + octomap diff --git a/mobility/mobility/CMakeLists.txt b/mobility/mobility/CMakeLists.txt index 072ee98b3b..5a54389cac 100644 --- a/mobility/mobility/CMakeLists.txt +++ b/mobility/mobility/CMakeLists.txt @@ -15,25 +15,66 @@ # License for the specific language governing permissions and limitations # under the License. -# Subsystem matapackage +cmake_minimum_required(VERSION 3.0) project(mobility) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + choreographer + mapper + planner_trapezoidal + planner_qp + ff_msgs + ff_util + jsonloader +) catkin_package( CATKIN_DEPENDS choreographer mapper - sentinel planner_trapezoidal planner_qp - docker ff_msgs ff_util + jsonloader ) -create_tool_targets( - DIR tools - LIBS ${catkin_LIBRARIES} ${EIGEN3_LIBRARIES} config_client ff_common ff_flight planner_trapezoidal - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_msgs ff_common +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) +## Declare a C++ executable: plangen +add_executable(plangen tools/plangen.cc) +add_dependencies(plangen ${catkin_EXPORTED_TARGETS}) +target_link_libraries(plangen + gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: teleop +add_executable(teleop tools/teleop.cc) +add_dependencies(teleop ${catkin_EXPORTED_TARGETS}) +target_link_libraries(teleop + gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Install C++ executables +install(TARGETS plangen DESTINATION bin) +install(TARGETS teleop DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/plangen share/${PROJECT_NAME} + COMMAND ln -s ../../bin/teleop share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") diff --git a/mobility/mobility/package.xml b/mobility/mobility/package.xml index 71233c68db..a9f0f1b3c4 100644 --- a/mobility/mobility/package.xml +++ b/mobility/mobility/package.xml @@ -17,12 +17,16 @@ catkin ff_msgs ff_util + choreographer + mapper + planner_trapezoidal + planner_qp + jsonloader ff_msgs ff_util choreographer mapper - sentinel planner_trapezoidal planner_qp - docker - \ No newline at end of file + jsonloader + diff --git a/mobility/planner_qp/planner_qp/CMakeLists.txt b/mobility/planner_qp/planner_qp/CMakeLists.txt index ae6a315885..065d2a6acf 100644 --- a/mobility/planner_qp/planner_qp/CMakeLists.txt +++ b/mobility/planner_qp/planner_qp/CMakeLists.txt @@ -15,27 +15,34 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(planner_qp) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wno-deprecated-declarations -Werror=return-type") + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../cmake") + + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../../cmake") +find_package(OpenCV331 REQUIRED) + find_package(JPS3D REQUIRED) find_package(DecompUtil REQUIRED) -find_package(catkin2 REQUIRED COMPONENTS roscpp nodelet pluginlib actionlib tf) - -set(LIBS - ${TRAJ_OPT_PRO_LIBRARIES} - ${TRAJ_OPT_ROS_LIBRARIES} - ${JPS3D_LIBRARIES} - ${DECOMP_UTIL_LIBRARIES} - ${SPARSE_MAPPING_LIBRARIES} -) -# message(DECOMP_UTIL_LIBRARIES ${DECOMP_UTIL_LIBRARIES}) -# message(LIBS ${LIBS}) -set(INCLUDES - ${TRAJ_OPT_PRO_INCLUDE_DIRS} - ${TRAJ_OPT_ROS_INCLUDE_DIRS} - ${JPS3D_INCLUDE_DIRS} - ${DECOMP_UTIL_INCLUDE_DIRS} - ${SPARSE_MAPPING_INCLUDE_DIRS} +find_package(PCL REQUIRED COMPONENTS common) + + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + actionlib + tf + ff_util + choreographer + traj_opt_basic + traj_opt_pro + traj_opt_ros ) catkin_package( @@ -48,15 +55,65 @@ catkin_package( pluginlib actionlib tf + ff_util + choreographer + traj_opt_basic + traj_opt_pro + traj_opt_ros ) -create_library(TARGET planner_qp - LIBS ${LIBS} ${catkin_LIBRARIES} ff_nodelet msg_conversions config_server config_client jsonloader ff_flight mapper - INC ${catkin_INCLUDE_DIRS} ${INCLUDES} - DEPS choreographer + +########### +## Build ## +########### +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} + ${JPS3D_INCLUDE_DIR} + ${DECOMP_UTIL_INCLUDE_DIR} + ${PCL_INCLUDE_DIRS} ) -create_tool_targets(DIR test - LIBS ${LIBS} - INC ${INCLUDES} + +add_library(planner_qp + src/planner_qp.cc ) +add_dependencies(planner_qp ${catkin_EXPORTED_TARGETS}) +target_link_libraries(planner_qp ${JPS3D_LIBRARIES} ${DECOMP_UTIL_LIBRARIES} ${PCL_LIBRARIES} ${catkin_LIBRARIES}) + +## Declare a C++ executable: sfc_server +add_executable(sfc_server test/sfc_server.cc) +add_dependencies(sfc_server ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sfc_server + planner_qp gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS sfc_server DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/sfc_server share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) -install_launch_files() diff --git a/mobility/planner_qp/planner_qp/package.xml b/mobility/planner_qp/planner_qp/package.xml index 7afb2db4da..7256ee995a 100644 --- a/mobility/planner_qp/planner_qp/package.xml +++ b/mobility/planner_qp/planner_qp/package.xml @@ -20,6 +20,11 @@ pluginlib actionlib tf + ff_util + choreographer + traj_opt_basic + traj_opt_pro + traj_opt_ros diff --git a/mobility/planner_qp/traj_opt_basic/CMakeLists.catkin b/mobility/planner_qp/traj_opt_basic/CMakeLists.catkin deleted file mode 100644 index 0329d86e77..0000000000 --- a/mobility/planner_qp/traj_opt_basic/CMakeLists.catkin +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -cmake_minimum_required(VERSION 2.8.3) -project(traj_opt_basic) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations -Werror=return-type") - -find_package(catkin_simple REQUIRED) - -find_package(Eigen3 REQUIRED) -find_package(Boost REQUIRED) -include_directories(${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) - - -catkin_simple() - -cs_add_library(traj_opt_basic src/msg_traj.cpp src/polynomial_basis.cpp src/trajectory.cpp) - -cs_install() - -cs_export(DEPENDS Eigen3 Boost) \ No newline at end of file diff --git a/mobility/planner_qp/traj_opt_basic/CMakeLists.nasa b/mobility/planner_qp/traj_opt_basic/CMakeLists.nasa deleted file mode 100644 index 5763c8026a..0000000000 --- a/mobility/planner_qp/traj_opt_basic/CMakeLists.nasa +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -project(traj_opt_basic) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations -Werror=return-type") - -create_library(TARGET traj_opt_basic - INC ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} - ADD_SRCS src/msg_traj.cpp src/polynomial_basis.cpp src/trajectory.cpp -) - -set(TRAJ_OPT_BASIC_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${EIGEN3_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - PARENT_SCOPE) -set(TRAJ_OPT_BASIC_LIBRARIES traj_opt_basic PARENT_SCOPE) - - diff --git a/mobility/planner_qp/traj_opt_basic/CMakeLists.txt b/mobility/planner_qp/traj_opt_basic/CMakeLists.txt index db5401dc12..c0092c14c9 100644 --- a/mobility/planner_qp/traj_opt_basic/CMakeLists.txt +++ b/mobility/planner_qp/traj_opt_basic/CMakeLists.txt @@ -1,24 +1,68 @@ # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. -# +# # All rights reserved. -# +# # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.3) -option(NASA "Use NASA's build system" OFF) -if(NASA) - include(CMakeLists.nasa) -else() - include(CMakeLists.catkin) -endif() +cmake_minimum_required(VERSION 3.0) +project(traj_opt_basic) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wno-deprecated-declarations -Werror=return-type") + +find_package(catkin REQUIRED COMPONENTS +) + +find_package(Eigen3 REQUIRED) +find_package(Boost REQUIRED) + +catkin_package( + INCLUDE_DIRS include + LIBRARIES + traj_opt_basic +) + +########### +## Build ## +########### +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} +) + +add_library(traj_opt_basic + src/msg_traj.cpp + src/polynomial_basis.cpp + src/trajectory.cpp) +add_dependencies(traj_opt_basic ${catkin_EXPORTED_TARGETS}) +target_link_libraries(traj_opt_basic ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/mobility/planner_qp/traj_opt_msgs/CMakeLists.catkin b/mobility/planner_qp/traj_opt_msgs/CMakeLists.catkin deleted file mode 100644 index 0d4a79af6f..0000000000 --- a/mobility/planner_qp/traj_opt_msgs/CMakeLists.catkin +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -cmake_minimum_required(VERSION 2.8.3) - -project(traj_opt_msgs) - -find_package(catkin_simple REQUIRED) - -catkin_simple() - -cs_install() - -cs_export() diff --git a/mobility/planner_qp/traj_opt_msgs/CMakeLists.nasa b/mobility/planner_qp/traj_opt_msgs/CMakeLists.nasa deleted file mode 100644 index d86e4043ba..0000000000 --- a/mobility/planner_qp/traj_opt_msgs/CMakeLists.nasa +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -project(traj_opt_msgs) - -find_package(catkin2 REQUIRED COMPONENTS - message_generation - std_msgs -) - -create_msg_targets(DIR msg - DEPS std_msgs) diff --git a/mobility/planner_qp/traj_opt_msgs/CMakeLists.txt b/mobility/planner_qp/traj_opt_msgs/CMakeLists.txt index 9d0a5a98fb..f192b5bd51 100644 --- a/mobility/planner_qp/traj_opt_msgs/CMakeLists.txt +++ b/mobility/planner_qp/traj_opt_msgs/CMakeLists.txt @@ -1,25 +1,43 @@ # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. -# +# # All rights reserved. -# +# # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0) -option(NASA "Use NASA's build system" OFF) -if(NASA) - include(CMakeLists.nasa) -else() - include(CMakeLists.catkin) -endif() +project(traj_opt_msgs) + +find_package(catkin REQUIRED COMPONENTS + message_generation + std_msgs +) + + +# Generate messages in the 'msg' folder +add_message_files( + FILES + Polynomial.msg + SolverInfo.msg + Spline.msg + Trajectory.msg +) + +generate_messages( + DEPENDENCIES std_msgs +) + +catkin_package( + LIBRARIES +) diff --git a/mobility/planner_qp/traj_opt_pro/CMakeLists.catkin b/mobility/planner_qp/traj_opt_pro/CMakeLists.catkin deleted file mode 100644 index fe18bbe44b..0000000000 --- a/mobility/planner_qp/traj_opt_pro/CMakeLists.catkin +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -cmake_minimum_required(VERSION 2.8.3) - -project(traj_opt_pro) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations -Werror=return-type") -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") - - -############################ Optional Build Params ############################# -set(BUILD_GUROBI TRUE) # Commercial backend -set(INTEL_MKL FALSE) # Use Intel's Math Kernel Library (Not faster on an i7) -############################ End Optional Params ############################### - -# Find optional packages -if(BUILD_GUROBI) - find_package(GUROBI REQUIRED) - include_directories(${GUROBI_INCLUDE_DIRS}) -endif() -if(INTEL_MKL) - add_definitions(-DEIGEN_USE_MKL_ALL) - find_package(IntelMKL REQUIRED) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed -lpthread -lm -ldl" ) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed -lpthread -lm -ldl" ) - include_directories(${INTEL_MKL_INCLUDES}) -endif() - -# Find required packages -find_package(catkin_simple REQUIRED) - -find_package(Eigen3 REQUIRED) -include_directories(${EIGEN3_INCLUDE_DIR}) -find_package(OpenCV REQUIRED) -include_directories(${OpenCV_INCLUDE_DIR}) - - -catkin_simple() - -# Add libraries -cs_add_library(ff_common src/polynomial_basis.cpp src/trajectory_solver.cpp) - -if(BUILD_GUROBI) - cs_add_library(gurobi_backend src/gurobi_solver.cpp src/gurobi_trajectory.cpp ) - target_link_libraries(gurobi_backend ff_common ${GUROBI_LIBRARIES}) -endif() - -cs_add_library(fancy_custom_backend src/nonlinear_polynomial.cpp src/nonlinear_solver.cpp src/nonlinear_trajectory.cpp) -target_link_libraries(fancy_custom_backend ff_common ${OpenCV_LIBRARIES}) - -# Catkin simple stuff -cs_install() - -cs_export(DEPENDS OpenCV) diff --git a/mobility/planner_qp/traj_opt_pro/CMakeLists.nasa b/mobility/planner_qp/traj_opt_pro/CMakeLists.nasa deleted file mode 100644 index de2685d876..0000000000 --- a/mobility/planner_qp/traj_opt_pro/CMakeLists.nasa +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -project(traj_opt_pro) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations -Werror=return-type") - -set(LIBS - ${OpenCV_LIBRARIES} - ${TRAJ_OPT_BASIC_LIBRARIES} -) -set(INCLUDES - ${TRAJ_OPT_BASIC_INCLUDE_DIRS} - ${OpenCV_INCLUDE_DIRS} -) - -create_library(TARGET traj_opt_pro - INC ${INCLUDES} - LIBS ${LIBS} - DEPS traj_opt_basic - ADD_SRCS src/polynomial_basis.cpp src/trajectory_solver.cpp src/nonlinear_polynomial.cpp src/nonlinear_solver.cpp src/nonlinear_trajectory.cpp -) - -set(TRAJ_OPT_PRO_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${INCLUDES} - PARENT_SCOPE) -set(TRAJ_OPT_PRO_LIBRARIES traj_opt_pro ${LIBS} PARENT_SCOPE) - - diff --git a/mobility/planner_qp/traj_opt_pro/CMakeLists.txt b/mobility/planner_qp/traj_opt_pro/CMakeLists.txt index db5401dc12..44b0306832 100644 --- a/mobility/planner_qp/traj_opt_pro/CMakeLists.txt +++ b/mobility/planner_qp/traj_opt_pro/CMakeLists.txt @@ -1,24 +1,104 @@ # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. -# +# # All rights reserved. -# +# # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.3) -option(NASA "Use NASA's build system" OFF) -if(NASA) - include(CMakeLists.nasa) -else() - include(CMakeLists.catkin) +cmake_minimum_required(VERSION 3.0) + +project(traj_opt_pro) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wno-deprecated-declarations -Werror=return-type") + +############################ Optional Build Params ############################# +set(BUILD_GUROBI FALSE) # Commercial backend +set(INTEL_MKL FALSE) # Use Intel's Math Kernel Library (Not faster on an i7) +############################ End Optional Params ############################### + +# Find optional packages +if(BUILD_GUROBI) + find_package(GUROBI REQUIRED) + include_directories(${GUROBI_INCLUDE_DIRS}) endif() +if(INTEL_MKL) + add_definitions(-DEIGEN_USE_MKL_ALL) + find_package(IntelMKL REQUIRED) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed -lpthread -lm -ldl" ) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed -lpthread -lm -ldl" ) + include_directories(${INTEL_MKL_INCLUDES}) +endif() + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + traj_opt_basic +) + +find_package(Eigen3 REQUIRED) + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../../cmake") +find_package(OpenCV331 REQUIRED) + +catkin_package( + INCLUDE_DIRS include + LIBRARIES + traj_opt_pro fancy_custom_backend ${OpenCV_LIBRARIES} +) + + +########### +## Build ## +########### +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + ${OpenCV_INCLUDE_DIR} +) + +# Add libraries +add_library(traj_opt_pro + src/polynomial_basis.cpp + src/trajectory_solver.cpp) + +if(BUILD_GUROBI) + add_library(gurobi_backend + src/gurobi_solver.cpp + src/gurobi_trajectory.cpp ) + target_link_libraries(gurobi_backend traj_opt_pro ${GUROBI_LIBRARIES}) +endif() + +add_library(fancy_custom_backend + src/nonlinear_polynomial.cpp + src/nonlinear_solver.cpp + src/nonlinear_trajectory.cpp) +target_link_libraries(fancy_custom_backend traj_opt_pro ${OpenCV_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} fancy_custom_backend + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) \ No newline at end of file diff --git a/mobility/planner_qp/traj_opt_ros/CMakeLists.catkin b/mobility/planner_qp/traj_opt_ros/CMakeLists.catkin deleted file mode 100644 index 84e2a4cc93..0000000000 --- a/mobility/planner_qp/traj_opt_ros/CMakeLists.catkin +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -cmake_minimum_required(VERSION 2.8.3) -project(traj_opt_ros) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations -Werror=return-type -DQT_NO_KEYWORDS") - -# Qt Stuff, assume Qt5 -set(CMAKE_AUTOMOC ON) - -message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") -find_package(Qt5 REQUIRED Core Widgets) -set(QT_LIBRARIES Qt5::Widgets) - -include_directories(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}) - -find_package(catkin_simple REQUIRED) - -catkin_simple() - -cs_add_library(traj_ros_bridge src/ros_bridge.cpp) -cs_add_library(${PROJECT_NAME} src/trajectory_visual.cpp src/trajectory_display.cpp ${MOC_FILES}) -target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES} ${rviz_DEFAULT_PLUGIN_LIBRARIES} traj_ros_bridge) - - -cs_install() - -cs_export() diff --git a/mobility/planner_qp/traj_opt_ros/CMakeLists.nasa b/mobility/planner_qp/traj_opt_ros/CMakeLists.nasa deleted file mode 100644 index b139a05cf7..0000000000 --- a/mobility/planner_qp/traj_opt_ros/CMakeLists.nasa +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -project(traj_opt_ros) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations -Werror=return-type") - - -set(LIBS - ${TRAJ_OPT_BASIC_LIBRARIES} -) -set(INCLUDES - ${TRAJ_OPT_BASIC_INCLUDE_DIRS} -) -set(LIBRARIES traj_ros_bridge) -set(CAT_DEP roscpp) - -set(TRAJ_OPT_ROS_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${INCLUDES} - PARENT_SCOPE) -set(TRAJ_OPT_ROS_LIBRARIES ${LIBRARIES} ${LIBS} ${catkin_LIBRARIES} PARENT_SCOPE) - -# build rviz plugin if not cross compiling -if(NOT USE_CTC) - set(CMAKE_AUTOMOC ON) - find_package(catkin COMPONENTS rviz QUIET) - if(rviz_QT_VERSION) - message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") - find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets) - set(QT_LIBRARIES Qt5::Widgets) - - set(LIBRARIES ${LIBRARIES} traj_opt_ros) - set(CAT_DEP ${CAT_DEP} rviz) - set(LIBS ${LIBS} ${QT_LIBRARIES} ${rviz_DEFAULT_PLUGIN_LIBRARIES}) - set(INCLUDES ${INCLUDES} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}) - endif() -endif() -find_package(catkin REQUIRED COMPONENTS ${CAT_DEP}) - - -catkin_package( - LIBRARIES ${LIBRARIES} - DEPENDS traj_opt_basic traj_opt_msgs - CATKIN_DEPENDS ${CAT_DEP} -) - - -create_library(TARGET traj_ros_bridge - INC ${INCLUDES} ${catkin_INCLUDE_DIRS} - LIBS ${LIBS} ${catkin_LIBRARIES} - DEPS traj_opt_basic traj_opt_msgs - ADD_SRCS src/ros_bridge.cpp -) - -if(NOT USE_CTC) - if(rviz_QT_VERSION) - create_library(TARGET traj_opt_ros - INC ${INCLUDES} ${catkin_INCLUDE_DIRS} - LIBS ${LIBS} ${catkin_LIBRARIES} traj_ros_bridge - DEPS traj_opt_basic traj_ros_bridge - ADD_SRCS src/trajectory_visual.cpp src/trajectory_display.cpp ${MOC_FILES} - ) -endif() -endif() - - - - diff --git a/mobility/planner_qp/traj_opt_ros/CMakeLists.txt b/mobility/planner_qp/traj_opt_ros/CMakeLists.txt index db5401dc12..8b8bd427c9 100644 --- a/mobility/planner_qp/traj_opt_ros/CMakeLists.txt +++ b/mobility/planner_qp/traj_opt_ros/CMakeLists.txt @@ -1,24 +1,105 @@ # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. -# +# # All rights reserved. -# +# # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -cmake_minimum_required(VERSION 2.8.3) -option(NASA "Use NASA's build system" OFF) -if(NASA) - include(CMakeLists.nasa) -else() - include(CMakeLists.catkin) +cmake_minimum_required(VERSION 3.0) +project(traj_opt_ros) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wno-deprecated-declarations -Werror=return-type -DQT_NO_KEYWORDS") + +# Qt Stuff, assume Qt5 +set(CMAKE_AUTOMOC ON) + +## Find catkin macros and libraries +set(LIBRARIES traj_ros_bridge) + +# build rviz plugin if not cross compiling +if(NOT USE_CTC) + set(CMAKE_AUTOMOC ON) + find_package(catkin2 COMPONENTS rviz QUIET) + if(rviz_QT_VERSION) + message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") + find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets) + set(QT_LIBRARIES Qt5::Widgets) + set(LIBRARIES ${LIBRARIES} traj_opt_ros) + set(INCLUDES ${INCLUDES} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) + endif() endif() + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + traj_opt_basic + traj_opt_msgs +) + + +catkin_package( + INCLUDE_DIRS include + LIBRARIES + ${LIBRARIES} + CATKIN_DEPENDS + roscpp + traj_opt_basic + traj_opt_msgs +) + +########### +## Build ## +########### +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${INCLUDES} +) + +add_library(traj_ros_bridge + src/ros_bridge.cpp) +target_link_libraries(traj_ros_bridge ${catkin_LIBRARIES}) + +if (NOT USE_CTC) + if(rviz_QT_VERSION) + add_library(${PROJECT_NAME} + src/trajectory_visual.cpp + src/trajectory_display.cpp + ${MOC_FILES}) + target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES} ${rviz_DEFAULT_PLUGIN_LIBRARIES} traj_ros_bridge) + endif() +endif (NOT USE_CTC) + + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS traj_ros_bridge + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) diff --git a/mobility/planner_trapezoidal/CMakeLists.txt b/mobility/planner_trapezoidal/CMakeLists.txt index cca87ff9ec..5e3b7ad10e 100644 --- a/mobility/planner_trapezoidal/CMakeLists.txt +++ b/mobility/planner_trapezoidal/CMakeLists.txt @@ -15,11 +15,30 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(planner_trapezoidal) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + actionlib + choreographer + tf2_geometry_msgs + ff_util + ff_msgs + mapper +) + +## System dependencies are found with CMake's conventions +find_package(PCL REQUIRED COMPONENTS common) + catkin_package( - INCLUDE_DIRS - include + INCLUDE_DIRS include LIBRARIES planner_trapezoidal CATKIN_DEPENDS @@ -29,13 +48,54 @@ catkin_package( actionlib choreographer tf2_geometry_msgs + ff_util ff_msgs + mapper +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${PCL_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(planner_trapezoidal + src/planner_trapezoidal.cc + src/planner_trapezoidal_nodelet.cc +) +add_dependencies(planner_trapezoidal ${catkin_EXPORTED_TARGETS}) +target_link_libraries(planner_trapezoidal ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -create_library(TARGET planner_trapezoidal - LIBS ${catkin_LIBRARIES} ff_nodelet msg_conversions ff_flight config_server config_client jsonloader choreographer - INC ${catkin_INCLUDE_DIRS} - DEPS choreographer +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/mobility/planner_trapezoidal/package.xml b/mobility/planner_trapezoidal/package.xml index b17457336a..0f9ad6faa5 100644 --- a/mobility/planner_trapezoidal/package.xml +++ b/mobility/planner_trapezoidal/package.xml @@ -21,14 +21,18 @@ actionlib choreographer tf2_geometry_msgs + ff_util ff_msgs + mapper roscpp nodelet pluginlib actionlib choreographer tf2_geometry_msgs + ff_util ff_msgs + mapper diff --git a/scripts/build/build_debian.sh b/scripts/build/build_debian.sh index e4c3d5e9f4..bee79db433 100755 --- a/scripts/build/build_debian.sh +++ b/scripts/build/build_debian.sh @@ -14,5 +14,6 @@ if [[ $* == *--config* ]]; then fi pushd $DIR/../.. -DEB_BUILD_OPTIONS="parallel=20" debuild -e ARMHF_CHROOT_DIR -e ARMHF_TOOLCHAIN -us -uc $EXTRA_FLAGS +export CMAKE_TOOLCHAIN_FILE=${DIR}/ubuntu_cross.cmake +DEB_BUILD_OPTIONS="parallel=20" debuild -e ARMHF_CHROOT_DIR -e ARMHF_TOOLCHAIN -e CMAKE_TOOLCHAIN_FILE -e CMAKE_PREFIX_PATH -us -uc $EXTRA_FLAGS popd > /dev/null diff --git a/scripts/build/ubuntu_cross.cmake b/scripts/build/ubuntu_cross.cmake index 5fbd5e54c6..75ed774e28 100644 --- a/scripts/build/ubuntu_cross.cmake +++ b/scripts/build/ubuntu_cross.cmake @@ -51,8 +51,10 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # If this is not done, the resulting rpath will not look for them in the chroot # environment. # Also, RTI DDS is included once for the libraries and once for the headers. +execute_process(COMMAND catkin locate -i OUTPUT_VARIABLE CATKIN_INSTALL_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND catkin locate -d OUTPUT_VARIABLE CATKIN_DEVEL_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) SET(CMAKE_FIND_ROOT_PATH - ${ARM_CHROOT_DIR}) + ${ARM_CHROOT_DIR} ${CATKIN_INSTALL_PATH} ${CATKIN_DEVEL_PATH}) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) @@ -67,7 +69,8 @@ IF( DEFINED EXTRA_ROOT_PATH ) SET(CMAKE_FIND_ROOT_PATH ${EXTRA_ROOT_PATH} ${CMAKE_FIND_ROOT_PATH}) ENDIF( DEFINED EXTRA_ROOT_PATH ) -SET(catkin2_DIR ${CMAKE_SOURCE_DIR}/cmake) +execute_process(COMMAND catkin locate -s OUTPUT_VARIABLE CATKIN_SRC_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) +SET(catkin2_DIR ${CATKIN_SRC_PATH}/cmake) # needed for gflag to compile... SET( THREADS_PTHREAD_ARG diff --git a/scripts/configure.sh b/scripts/configure.sh index 9040e4c0bb..192c5bbc6d 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -40,20 +40,30 @@ gcc_major=`gcc -dumpversion | cut -f-2 -d .` archname="${cpu_type}_${os_kernel}_gcc${gcc_major}" # prefix for installation path -prefix="" - -# build name (if used, build under astrobee/build/$buildname) -buildname="" +install_path="" # configure nothing by default native_build=0 armhf_build=0 -# by default DDS is activated -dds_opt="-DUSE_DDS=on" - -# No extra options by default -extra_opts="" +# Define our options +use_ccache=" -DUSE_CCACHE=on" # Use ccache to speed up compiling, at the cost of optimization +use_ctc=" -DUSE_CTC=off" # Use cross compile toolchain for making ARM binaries +use_ros=" -DUSE_ROS=on" # Build the ROS-dependent functionality. +use_dds=" -DUSE_DDS=on" # Build the DDS-dependent functionality. +use_static_libs="" # Build using static libraries. Will use lots of drive space. +test_coverage="" # Build the code with code coverage options. Not compatible with USE_CTC. +use_drivers=" -DUSE_DRIVERS=on" # Build the tools in the drivers directory. +is_bamboo_build="" # The code is being built under the bamboo CI system" +enable_gprof="" # Enable compling with support for profiling wih gprof (the GNU Profiler)." +enable_google_prof="" # Enable support for profiling wih pprof (the Google Profiler). +enable_qp=" -DENABLE_QP=on" # Enable support for the QP planner. +enable_picoflexx=" -DENABLE_PICOFLEXX=on" # Enable support for building the PicoFlexx driver +enable_gazebo="" # Enable support for building the Gazebo simulator +enable_vive=" -DENABLE_VIVE=on" # Enable support for building the Vive drivers +enable_vive_solver=" -DENABLE_VIVE_SOLVER=on" # Enable support for building the Vive offline solver +enable_integration_testing=" -DENABLE_INTEGRATION_TESTING=on" # Build the integration tests if tests are active. +build_loc_rviz_plugins=" -DBUILD_LOC_RVIZ_PLUGINS=on" # Build the localization rviz plugins. # Force cache cleaning by default clean_cache=1 @@ -66,7 +76,7 @@ target="install" # short help usage_string="$scriptname [-h] [-l ] [-a ]\ - [-p install_path] [-b build_path] [-B build_type] [-c ]\ + [-p install_path] [-w workspace_path] [-B build_type] [-c ]\ [-C ] [-d ] [-D ]\ [-r ] [-R ]\ [-f ] [-F ]\ @@ -77,7 +87,7 @@ usage_string="$scriptname [-h] [-l ] [-a ]\ #[-t make_target] # options to parse -optstring="hlap:b:B:cCdDrRfFkKvVtTg" +optstring="hlap:w:B:cCdDrRfFkKvVtTg" # Print the script usage print_usage() @@ -94,8 +104,8 @@ print_help() echo -e "\t-a Generate a cross-compiled ARM build" echo -e "\t-p install_path specify the installation directory" echo -e "\t default=${HOME}/cmake_install_platform" - echo -e "\t-b build_path specify the build directory to use" - echo -e "\t default=${HOME}/cmake_build_platform" + echo -e "\t-w workspace_path specify the workspace directory" + echo -e "\t default=${ASTROBEE_WS}" echo -e "\t-B build_type specify build type (Debug|Release|RelWithDebInfo)" echo -e "\t-c delete the cmake cache before for every modules: default on" echo -e "\t (necessary when re-running buildall with diffent options)" @@ -132,57 +142,57 @@ parse_args() { while getopts $optstring opt $@ do - case $opt in - "h") print_help - exit 0 - ;; - "?") print_usage - exit 1 - ;; - "l") native_build=1 - ;; - "a") armhf_build=1 - ;; - "p") prefix=$OPTARG - ;; - "b") build_path=$OPTARG - ;; - "B") build_type=$OPTARG - ;; - "c") clean_cache=1 - ;; - "C") clean_cache=0 - ;; - "d") dds_opt="-DUSE_DDS=on" - ;; - "D") dds_opt="-DUSE_DDS=off" - ;; - "r") extra_opts+=" -DENABLE_QP=on" - ;; - "R") extra_opts+=" -DENABLE_QP=off" - ;; - "f") extra_opts+=" -DENABLE_PICOFLEXX=on" - ;; - "F") extra_opts+=" -DENABLE_PICOFLEXX=off" - ;; - "k") extra_opts+=" -DUSE_CCACHE=on" - ;; - "K") extra_opts+=" -DUSE_CCACHE=off" - ;; - "v") extra_opts+=" -DENABLE_VIVE=on" - ;; - "V") extra_opts+=" -DENABLE_VIVE=off" - ;; - "t") extra_opts+=" -DENABLE_INTEGRATION_TESTING=on" - ;; - "T") extra_opts+=" -DENABLE_INTEGRATION_TESTING=off" - ;; - "g") debug_mode=1 - ;; - *) print_usage - exit 1 - ;; - esac + case $opt in + "h") print_help + exit 0 + ;; + "?") print_usage + exit 1 + ;; + "l") native_build=1 + ;; + "a") armhf_build=1 + ;; + "p") install_path=$OPTARG + ;; + "w") workspace_path=$OPTARG/ + ;; + "B") build_type=$OPTARG + ;; + "c") clean_cache=1 + ;; + "C") clean_cache=0 + ;; + "d") use_dds=" -DUSE_DDS=on" + ;; + "D") use_dds=" -DUSE_DDS=off" + ;; + "r") enable_qp=" -DENABLE_QP=on" + ;; + "R") enable_qp=" -DENABLE_QP=off" + ;; + "f") enable_picoflexx=" -DENABLE_PICOFLEXX=on" + ;; + "F") enable_picoflexx=" -DENABLE_PICOFLEXX=off" + ;; + "k") use_ccache=" -DUSE_CCACHE=on" + ;; + "K") use_ccache=" -DUSE_CCACHE=off" + ;; + "v") enable_vive=" -DENABLE_VIVE=on" + ;; + "V") enable_vive=" -DENABLE_VIVE=off" + ;; + "t") enable_integration_testing=" -DENABLE_INTEGRATION_TESTING=on" + ;; + "T") enable_integration_testing=" -DENABLE_INTEGRATION_TESTING=off" + ;; + "g") debug_mode=1 + ;; + *) print_usage + exit 1 + ;; + esac done } @@ -197,104 +207,51 @@ canonicalize() freepath=$1 os_name=`uname -s` case $os_name in - Linux) - # just use readlink :-) - canonical_path=`readlink -f $freepath` - readl_ret=$? - echo $canonical_path - if [ $readl_ret == 1 ] ; then - return 1 - else - return 0 - fi - ;; - Darwin | SunOS) - # BSD systems do not support readlink :-( - if [ -d $freepath ] ; then - # the argument is a directory - canonical_path=`cd $freepath && pwd -P` - else - if [ -f $freepath ] ; then - # the argument is a file - freedir=`dirname $freepath` - freefile=`basename $freepath` - if [ -L $freepath ] ; then - canfile=`cd $freedir && stat -f "%Y" $freefile` - else - canfile=$freefile - fi - candir=`cd $freedir && pwd -P` - canonical_path="${candir}/${canfile}" - else - # given path does not exsit - # since readlink does not return any string for this - # scenario, just lets do the same and return an error - canonical_path="" - return 1 - fi - fi - echo $canonical_path - return 0 - ;; - *) - # echo platform not supported yet - echo "/${os_name}/is/not/yet/supported/by/canonicalize" - return 1 - ;; - esac -} - -# function to use the cmake configure with the right arguments -# arguments: -# 1: build_path -# 2: build_type -# 3: install_path -# 4: freeflyer_path -# 5: clean_cache -# 6-*: other options -configure() -{ - local build_path=$1 - shift - local build_type=$1 - shift - local install_path=$1 - shift - local ff_path=$1 - shift - local clean_cache=$1 - shift - local cmake_opts=$@ - - if [ $debug_mode == 1 ]; then - echo "build type: ${build_type}" - echo "build path: ${build_path}" - echo "install directory: ${install_path}" - echo - else - if [ "$install_path" != "none" ] ; then - if [ ! -d ${install_path} ] ; then - echo "Creating install directory: ${install_path}" - mkdir -p $install_path + Linux) + # just use readlink :-) + canonical_path=`readlink -f $freepath` + readl_ret=$? + echo $canonical_path + if [ $readl_ret == 1 ] ; then + return 1 + else + return 0 + fi + ;; + Darwin | SunOS) + # BSD systems do not support readlink :-( + if [ -d $freepath ] ; then + # the argument is a directory + canonical_path=`cd $freepath && pwd -P` + else + if [ -f $freepath ] ; then + # the argument is a file + freedir=`dirname $freepath` + freefile=`basename $freepath` + if [ -L $freepath ] ; then + canfile=`cd $freedir && stat -f "%Y" $freefile` + else + canfile=$freefile fi - full_install_path=`canonicalize $install_path` - install_opt="-DCMAKE_INSTALL_PREFIX=${full_install_path}" - fi - - if [ ! -d ${build_path} ] ; then - echo "Creating build directory: ${build_path}" - mkdir -p ${build_path} - fi - cd ${build_path} - - if [ ${clean_cache} -eq 1 ] ; then - echo "Remove the CMake Cache for ${build_path}" - rm -f CMakeCache.txt - fi - cmd="cmake -DCMAKE_BUILD_TYPE=${build_type} ${install_opt} ${cmake_opts} ${ff_path}" - echo $cmd # to se what we are geting - $cmd - fi + candir=`cd $freedir && pwd -P` + canonical_path="${candir}/${canfile}" + else + # given path does not exsit + # since readlink does not return any string for this + # scenario, just lets do the same and return an error + canonical_path="" + return 1 + fi + fi + echo $canonical_path + return 0 + ;; + *) + # echo platform not supported yet + echo "/${os_name}/is/not/yet/supported/by/canonicalize" + return 1 + ;; + esac } # Start the real work here... @@ -303,6 +260,15 @@ parse_args $@ # Define the paths to use ff_path=`canonicalize ${rootpath}` +DIST=`cat /etc/os-release | grep -oP "(?<=VERSION_CODENAME=).*"` +if [ "$DIST" = "xenial" ]; then + ros_version=kinetic +elif [ "$DIST" = "bionic" ]; then + ros_version=melodic +elif [ "$DIST" = "focal" ]; then + ros_version=noetic +fi + if [ $debug_mode == 1 ]; then echo "script is called from: $workdir" echo "script dir is: $confdir" @@ -316,6 +282,12 @@ if [ $debug_mode == 1 ]; then echo fi +extra_opts+=${use_ccache}${use_ros}${use_dds}${use_static_libs}${test_coverage}${use_drivers} +extra_opts+=${is_bamboo_build}${enable_gprof}${enable_google_prof}${enable_qp}${enable_picoflexx} +extra_opts+=${enable_vive}${enable_vive_solver}${enable_integration_testing} + + + if [[ $native_build == 0 && $armhf_build == 0 ]] ; then echo "Nothing to configure (use -l or -a)..." echo "Use $scriptname -h for the full list of options" @@ -325,29 +297,51 @@ fi if [[ $native_build == 1 && $armhf_build == 1 ]] ; then echo -n "Linux and ArmHF invoked simultanously:" echo " dropping any option -p and -b!" - prefix="" - build_path="" + workspace_path="" + install_path="" fi if [ $native_build == 1 ] ; then echo "configuring for native linux..." - # Performance of the shared disk system is horrendous on Vagrant. - # So by default we build in the home directory that is Vagrant native. - # In addition, we do not create an install directory by default. - # Update: we are currently forced to provide an install prefix! - native_build_path=${build_path:-${HOME}/astrobee_build/native} - native_install_path=${prefix:-${HOME}/astrobee_install/native} - configure ${native_build_path} ${build_type:-RelWithDebInfo} \ - ${native_install_path} ${ff_path} ${clean_cache} \ - ${dds_opt} ${extra_opts} + catkin init + enable_gazebo=" -DENABLE_GAZEBO=on" + + # Add our cmake to paths and bashrc + grep -qF 'source /opt/ros/'$ros_version'/setup.bash' ~/.bashrc || echo 'source /opt/ros/'$ros_version'/setup.bash' >> ~/.bashrc + cmake_astrobee_path=`catkin locate -s`/cmake + grep -qF ${cmake_astrobee_path} ~/.bashrc \ + || echo 'if [[ ":$CMAKE_PREFIX_PATH:" != *":'${cmake_astrobee_path}':"* ]]; then CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:+"$CMAKE_PREFIX_PATH:"}'${cmake_astrobee_path}'"; fi' >> ~/.bashrc + source ~/.bashrc + + catkin profile add native + catkin profile set native + catkin config --no-extend \ + --build-space ${workspace_path}build \ + --install-space ${install_path:-${workspace_path}install} \ + --devel-space ${workspace_path}devel \ + --log-space ${workspace_path}log \ + --no-install \ + --cmake-args ${enable_gazebo} ${build_loc_rviz_plugins} ${extra_opts} -DCMAKE_BUILD_TYPE=RelWithDebInfo + + fi if [ $armhf_build == 1 ] ; then echo "configuring for armhf..." - armhf_opts="-DCMAKE_TOOLCHAIN_FILE=${ff_path}/scripts/build/ubuntu_cross.cmake -DUSE_CTC=true" - armhf_build_path=${build_path:-${HOME}/astrobee_build/armhf} - armhf_install_path=${prefix:-${HOME}/astrobee_install/armhf} - configure ${armhf_build_path} ${build_type:-Release} \ - ${armhf_install_path} ${ff_path} ${clean_cache} \ - ${dds_opt} ${armhf_opts} ${extra_opts} + catkin init + armhf_opts="-DCMAKE_TOOLCHAIN_FILE=${ff_path}/scripts/build/ubuntu_cross.cmake" + use_ctc=" -DUSE_CTC=on" + enable_gazebo="" + build_loc_rviz_plugins="" + catkin profile add armhf + catkin profile set armhf + catkin config --extend $ARMHF_CHROOT_DIR/opt/ros/kinetic \ + --build-space ${workspace_path:-armhf/}build \ + --install-space ${install_path:-armhf/}opt/astrobee} \ + --devel-space ${workspace_path:-armhf/}devel \ + --log-space ${workspace_path:-armhf/}logs \ + --install \ + --blacklist astrobee_handrail_8_5 astrobee_handrail_21_5 astrobee_handrail_30 astrobee_handrail_41_5 astrobee_iss astrobee_granite \ + astrobee_dock astrobee_freeflyer astrobee_gazebo localization_rviz_plugins \ + --cmake-args -DARMHF_CHROOT_DIR=$ARMHF_CHROOT_DIR ${armhf_opts} ${use_ctc} ${enable_gazebo} ${build_loc_rviz_plugins} ${extra_opts} -DCMAKE_BUILD_TYPE=Release fi diff --git a/scripts/docker/astrobee.Dockerfile b/scripts/docker/astrobee.Dockerfile index 875ac6aa11..f5b0f91012 100755 --- a/scripts/docker/astrobee.Dockerfile +++ b/scripts/docker/astrobee.Dockerfile @@ -6,10 +6,15 @@ ARG UBUNTU_VERSION=16.04 ARG REMOTE=astrobee FROM ${REMOTE}/astrobee:base-latest-ubuntu${UBUNTU_VERSION} +ARG ROS_VERSION=kinetic + ENV USERNAME astrobee -COPY . /src/astrobee -RUN /src/astrobee/scripts/configure.sh -l -F -D -T -p /opt/astrobee -b /build/astrobee -RUN cd /build/astrobee && make -j`nproc` +COPY . /src/astrobee/src/ +RUN . /opt/ros/${ROS_VERSION}/setup.sh \ + && cd /src/astrobee \ + && ./src/scripts/configure.sh -l -F -D -T \ + && CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/src/astrobee/src/cmake \ + && catkin build COPY ./astrobee/resources /opt/astrobee/share/astrobee/resources diff --git a/scripts/docker/astrobee_base.Dockerfile b/scripts/docker/astrobee_base.Dockerfile index 227b5aecb7..fd99b942c3 100755 --- a/scripts/docker/astrobee_base.Dockerfile +++ b/scripts/docker/astrobee_base.Dockerfile @@ -68,7 +68,7 @@ RUN useradd -m $USERNAME && \ groupmod --gid 1000 $USERNAME #Add the entrypoint for docker -RUN echo "#!/bin/bash\nset -e\n\nsource \"/opt/ros/noetic/setup.bash\"\nsource \"/build/astrobee/devel/setup.bash\"\nexport ASTROBEE_CONFIG_DIR=\"/src/astrobee/astrobee/config\"\nexec \"\$@\"" > /astrobee_init.sh && \ +RUN echo "#!/bin/bash\nset -e\n\nsource \"/opt/ros/${ROS_VERSION}/setup.bash\"\nsource \"/src/astrobee/devel/setup.bash\"\nexport ASTROBEE_CONFIG_DIR=\"/src/astrobee/src/astrobee/config\"\nexec \"\$@\"" > /astrobee_init.sh && \ chmod +x /astrobee_init.sh && \ rosdep init && \ rosdep update 2>&1 | egrep -v 'as root|fix-permissions' diff --git a/scripts/docker/build.sh b/scripts/docker/build.sh index b776e5afc6..5a93aa1d64 100755 --- a/scripts/docker/build.sh +++ b/scripts/docker/build.sh @@ -76,4 +76,5 @@ docker build ${rootdir}/ \ docker build ${rootdir}/ \ -f ${rootdir}/scripts/docker/astrobee.Dockerfile \ --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \ + --build-arg ROS_VERSION=${ROS_VERSION} \ -t astrobee/astrobee:latest-ubuntu${UBUNTU_VERSION} \ No newline at end of file diff --git a/scripts/docker/test_astrobee.Dockerfile b/scripts/docker/test_astrobee.Dockerfile index 132d4e75a6..0ce4c93c44 100644 --- a/scripts/docker/test_astrobee.Dockerfile +++ b/scripts/docker/test_astrobee.Dockerfile @@ -6,4 +6,7 @@ ARG REMOTE=astrobee FROM ${REMOTE}/astrobee:latest-ubuntu${UBUNTU_VERSION} # Run tests -RUN cd /build/astrobee && make -j`nproc` tests && make -j`nproc` test +RUN cd /src/astrobee && catkin build --make-args tests \ + && catkin build --make-args test \ + && { . devel/setup.sh || true; } \ + && catkin_test_results build diff --git a/scripts/setup/debians/update_release.sh b/scripts/setup/debians/update_release.sh index 088a80ceac..303e2232ba 100755 --- a/scripts/setup/debians/update_release.sh +++ b/scripts/setup/debians/update_release.sh @@ -12,7 +12,7 @@ cd $DIR/../../.. dch -c debian/changelog -v $1 -sed -i -e "s/set(ASTROBEE_VERSION .*)/set(ASTROBEE_VERSION $1)/g" CMakeLists.txt +sed -i -e "s/set(ASTROBEE_VERSION .*)/set(ASTROBEE_VERSION $1)/g" astrobee/CMakeLists.txt sed -i -e "s/\# Astrobee Robot Software v1/\# Astrobee Robot Software v1\n\n\#\# Release $1\n\nINSERT DESCRIPTION HERE/g" RELEASE.md diff --git a/scripts/setup/packages_base_bionic.lst b/scripts/setup/packages_base_bionic.lst index 5b242bd0a2..982b2c902d 100644 --- a/scripts/setup/packages_base_bionic.lst +++ b/scripts/setup/packages_base_bionic.lst @@ -75,6 +75,7 @@ ros-melodic-xmlrpcpp ros-melodic-mavlink ros-melodic-xacro ros-melodic-octomap +ros-melodic-catkin libalvar2 libdbow21 libgtsam @@ -125,3 +126,4 @@ libdecomputil-dev libjps3d-dev libopencv3.3.1 libopencv-dev3.3.1 +python-catkin-tools diff --git a/scripts/setup/packages_base_focal.lst b/scripts/setup/packages_base_focal.lst index 2158eec519..0a016a8397 100644 --- a/scripts/setup/packages_base_focal.lst +++ b/scripts/setup/packages_base_focal.lst @@ -73,6 +73,7 @@ ros-noetic-xmlrpcpp ros-noetic-mavlink ros-noetic-xacro ros-noetic-octomap +ros-noetic-catkin libalvar2 libdbow21 libgtsam @@ -122,3 +123,4 @@ libdecomputil-dev libjps3d-dev libopencv3.3.1 libopencv-dev3.3.1 +python3-catkin-tools diff --git a/scripts/setup/packages_base_xenial.lst b/scripts/setup/packages_base_xenial.lst index aae3d2f495..478b33c25e 100644 --- a/scripts/setup/packages_base_xenial.lst +++ b/scripts/setup/packages_base_xenial.lst @@ -73,6 +73,7 @@ ros-kinetic-opencv3 ros-kinetic-mavlink ros-kinetic-xacro ros-kinetic-octomap +ros-kinetic-catkin libalvar2 libdbow21 libgtsam @@ -121,3 +122,4 @@ libsoracore-dev libmiro-dev libdecomputil-dev libjps3d-dev +python-catkin-tools diff --git a/shared/CMakeLists.txt b/shared/CMakeLists.txt deleted file mode 100644 index 5b256d3f05..0000000000 --- a/shared/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(ff_common) -add_subdirectory(config_reader) -add_subdirectory(jsonloader) -if(USE_ROS) - add_subdirectory(ff_util) - add_subdirectory(msg_conversions) -endif(USE_ROS) diff --git a/shared/config_reader/CMakeLists.txt b/shared/config_reader/CMakeLists.txt index cc2f9d9fee..f23ac4fcc1 100644 --- a/shared/config_reader/CMakeLists.txt +++ b/shared/config_reader/CMakeLists.txt @@ -15,21 +15,63 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(config_reader) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_common +) + +## System dependencies are found with CMake's conventions +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(Luajit20 REQUIRED) + catkin_package( - INCLUDE_DIRS include ${GFLAGS_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${LUAJIT_INCLUDE_DIR} - LIBRARIES config_reader - CATKIN_DEPENDS ff_common + INCLUDE_DIRS include ${LUAJIT_INCLUDE_DIR} + LIBRARIES config_reader ${LUAJIT_LIBRARY} ${LUAJIT_MATH_LIBRARY} + CATKIN_DEPENDS roscpp nodelet ff_common ) +########### +## Build ## +########### + +# Specify additional locations of header files +# Your package locations should be listed before other locations include_directories( include ${catkin_INCLUDE_DIRS} + ${LUAJIT_INCLUDE_DIR} +) + +# Declare C++ libraries +add_library(config_reader + src/config_reader.cc + src/watch_files.cc +) +add_dependencies(config_reader ${catkin_EXPORTED_TARGETS}) +target_link_libraries(config_reader gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET config_reader - INC ${GFLAGS_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${LUAJIT_INCLUDE_DIR} ff_common - ${CMAKE_CURRENT_BINARY_DIR}/include - LIBS ${GFLAGS_LIBRARIES} ${GLOG_LIBRARIES} ${LUAJIT_LIBRARIES} ff_common +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE ) diff --git a/shared/ff_common/CMakeLists.txt b/shared/ff_common/CMakeLists.txt index 84865de2e6..32a5fa9ea2 100644 --- a/shared/ff_common/CMakeLists.txt +++ b/shared/ff_common/CMakeLists.txt @@ -15,18 +15,49 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ff_common) + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + std_msgs + nodelet +) + +find_package(Eigen3 REQUIRED) + catkin_package( INCLUDE_DIRS include LIBRARIES ff_common - CATKIN_DEPENDS + CATKIN_DEPENDS roscpp std_msgs nodelet +) + +########### +## Build ## +########### + +# Specify additional locations of header files +# Your package locations should be listed before other locations +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ) -create_library(TARGET ff_common - INC ${GFLAGS_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR}/include - LIBS ${GFLAGS_LIBRARIES} ${GLOG_LIBRARIES}) +# Declare C++ libraries +add_library(ff_common + src/init.cc + src/thread.cc + src/utils.cc +) +add_dependencies(ff_common ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ff_common gflags glog ${catkin_LIBRARIES} ) + if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) @@ -41,8 +72,20 @@ if(CATKIN_ENABLE_TESTING) endif() -include_directories( - include - ${catkin_INCLUDE_DIRS} +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) diff --git a/shared/ff_common/package.xml b/shared/ff_common/package.xml index c14b84ddeb..388d39df21 100644 --- a/shared/ff_common/package.xml +++ b/shared/ff_common/package.xml @@ -15,10 +15,10 @@ catkin roscpp - roslib + std_msgs nodelet roscpp - roslib + std_msgs nodelet diff --git a/shared/ff_common/src/init.cc b/shared/ff_common/src/init.cc index f74dec2b13..5a839a2b05 100644 --- a/shared/ff_common/src/init.cc +++ b/shared/ff_common/src/init.cc @@ -40,7 +40,7 @@ namespace ff_common { google::InitGoogleLogging((*argv)[0]); logging_initialized = true; } - FREEFLYER_GFLAGS_NAMESPACE::ParseCommandLineFlags(argc, argv, true); + google::ParseCommandLineFlags(argc, argv, true); } // ros nodelets get commandline arguments in this form... @@ -57,7 +57,7 @@ namespace ff_common { if (main_thread) { InitFreeFlyerApplication(&argc, &casted_argv); } else { - FREEFLYER_GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &casted_argv, true); + google::ParseCommandLineFlags(&argc, &casted_argv, true); } free(argv); } diff --git a/shared/ff_common/test/test_thread.cc b/shared/ff_common/test/test_thread.cc index 7a1ed3c2fe..bd6ed85ae6 100644 --- a/shared/ff_common/test/test_thread.cc +++ b/shared/ff_common/test/test_thread.cc @@ -74,3 +74,9 @@ TEST(thread, thread_pool) { pool.Join(); EXPECT_EQ(4u, vec.size()); } + +// Run all the tests that were declared with TEST() +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/shared/ff_util/CMakeLists.txt b/shared/ff_util/CMakeLists.txt index 6d2942752e..cc1a72d969 100644 --- a/shared/ff_util/CMakeLists.txt +++ b/shared/ff_util/CMakeLists.txt @@ -15,46 +15,80 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ff_util) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + config_reader + roscpp + nodelet + dynamic_reconfigure + ff_msgs diagnostic_msgs + tf2_geometry_msgs + actionlib + msg_conversions +) + catkin_package( INCLUDE_DIRS include - LIBRARIES ff_nodelet config_server config_client perf_timer - CATKIN_DEPENDS config_reader roscpp nodelet dynamic_reconfigure ff_msgs diagnostic_msgs tf2_geometry_msgs actionlib + LIBRARIES ff_nodelet ff_flight config_server config_client perf_timer + CATKIN_DEPENDS config_reader roscpp nodelet dynamic_reconfigure ff_msgs diagnostic_msgs tf2_geometry_msgs actionlib msg_conversions +) + +########### +## Build ## +########### + +# Specify additional locations of header files +# Your package locations should be listed before other locations +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${JSONCPP_INCLUDE_DIRS} ) -create_library(TARGET ff_nodelet - DIR src/ff_nodelet - LIBS ${roscpp_LIBRARIES} ${nodelet_LIBRARIES} config_reader - INC ${catkin_INCLUDE_DIRS} - DEPS ff_msgs +# Declare C++ libraries +add_library(ff_nodelet + src/ff_nodelet/ff_nodelet.cc ) +add_dependencies(ff_nodelet ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ff_nodelet ${catkin_LIBRARIES}) -create_library(TARGET ff_flight - DIR src/ff_flight - LIBS ${catkin_LIBRARIES} ${EIGEN3_LIBRARIES} config_reader msg_conversions - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} - DEPS ff_msgs +# Declare C++ libraries +add_library(ff_flight + src/ff_flight/ff_flight.cc ) +add_dependencies(ff_flight ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ff_flight ${catkin_LIBRARIES}) -create_library(TARGET config_server - DIR src/config_server - LIBS ${catkin_LIBRARIES} config_reader - INC ${catkin_INCLUDE_DIRS} - DEPS config_reader diagnostic_msgs +# Declare C++ libraries +add_library(config_server + src/config_server/config_server.cc ) +add_dependencies(config_server ${catkin_EXPORTED_TARGETS}) +target_link_libraries(config_server ${catkin_LIBRARIES}) -create_library(TARGET config_client - DIR src/config_client - LIBS ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} +# Declare C++ libraries +add_library(config_client + src/config_client/config_client.cc ) +add_dependencies(config_client ${catkin_EXPORTED_TARGETS}) +target_link_libraries(config_client ${catkin_LIBRARIES}) -create_library(TARGET perf_timer - DIR src/perf_timer - LIBS ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} +# Declare C++ libraries +add_library(perf_timer + src/perf_timer/perf_timer.cc ) +add_dependencies(perf_timer ${catkin_EXPORTED_TARGETS}) +target_link_libraries(perf_timer ${catkin_LIBRARIES}) + +########## +## Test ## +########## # Only test if it is enabled if (CATKIN_ENABLE_TESTING) @@ -64,7 +98,6 @@ if (CATKIN_ENABLE_TESTING) include_directories(${catkin_INCLUDE_DIRS} include) # ff_action - add_rostest_gtest(ff_action_nominal_behaviour test/ff_action_nominal_behaviour.test test/ff_action_nominal_behaviour.cc) @@ -108,4 +141,25 @@ if (CATKIN_ENABLE_TESTING) endif() -install_launch_files() +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ff_nodelet ff_flight config_server config_client perf_timer + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/shared/ff_util/include/ff_util/ff_action.h b/shared/ff_util/include/ff_util/ff_action.h index fcf91001a8..8556c3eb48 100644 --- a/shared/ff_util/include/ff_util/ff_action.h +++ b/shared/ff_util/include/ff_util/ff_action.h @@ -26,7 +26,7 @@ #include #include -// C++11 includes +// C++ includes #include #include #include diff --git a/shared/ff_util/include/ff_util/ff_fsm.h b/shared/ff_util/include/ff_util/ff_fsm.h index 74a2a1f2b4..1294abfa00 100644 --- a/shared/ff_util/include/ff_util/ff_fsm.h +++ b/shared/ff_util/include/ff_util/ff_fsm.h @@ -19,7 +19,7 @@ #ifndef FF_UTIL_FF_FSM_H_ #define FF_UTIL_FF_FSM_H_ -// C++11 includes +// C++ includes #include #include #include diff --git a/shared/ff_util/include/ff_util/ff_service.h b/shared/ff_util/include/ff_util/ff_service.h index 24e41fbee1..d3b5b84e11 100644 --- a/shared/ff_util/include/ff_util/ff_service.h +++ b/shared/ff_util/include/ff_util/ff_service.h @@ -22,7 +22,7 @@ // ROS includes #include -// C++11 includes +// C++ includes #include #include #include diff --git a/shared/ff_util/package.xml b/shared/ff_util/package.xml index 4e42c11d7e..f31dcce699 100644 --- a/shared/ff_util/package.xml +++ b/shared/ff_util/package.xml @@ -24,6 +24,7 @@ ff_msgs tf2_geometry_msgs config_reader + msg_conversions roscpp roslib nodelet @@ -34,5 +35,6 @@ ff_msgs tf2_geometry_msgs config_reader + msg_conversions diff --git a/shared/ff_util/test/ff_action_active_timeout.cc b/shared/ff_util/test/ff_action_active_timeout.cc index a606552d80..3e0c2183b7 100644 --- a/shared/ff_util/test/ff_action_active_timeout.cc +++ b/shared/ff_util/test/ff_action_active_timeout.cc @@ -34,7 +34,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_cancel_own_goal.cc b/shared/ff_util/test/ff_action_cancel_own_goal.cc index 84639b4439..833fa444b7 100644 --- a/shared/ff_util/test/ff_action_cancel_own_goal.cc +++ b/shared/ff_util/test/ff_action_cancel_own_goal.cc @@ -35,7 +35,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_connect_timeout.cc b/shared/ff_util/test/ff_action_connect_timeout.cc index bf795afc66..1ebd79e9fe 100644 --- a/shared/ff_util/test/ff_action_connect_timeout.cc +++ b/shared/ff_util/test/ff_action_connect_timeout.cc @@ -33,7 +33,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_deadline_timeout.cc b/shared/ff_util/test/ff_action_deadline_timeout.cc index 2e2a78577b..74f19d9aba 100644 --- a/shared/ff_util/test/ff_action_deadline_timeout.cc +++ b/shared/ff_util/test/ff_action_deadline_timeout.cc @@ -34,7 +34,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_nominal_behaviour.cc b/shared/ff_util/test/ff_action_nominal_behaviour.cc index 8ff77372fd..9dbdea5121 100644 --- a/shared/ff_util/test/ff_action_nominal_behaviour.cc +++ b/shared/ff_util/test/ff_action_nominal_behaviour.cc @@ -33,7 +33,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_preempt_others_goal.cc b/shared/ff_util/test/ff_action_preempt_others_goal.cc index f56e4a9ca6..243a0303df 100644 --- a/shared/ff_util/test/ff_action_preempt_others_goal.cc +++ b/shared/ff_util/test/ff_action_preempt_others_goal.cc @@ -34,7 +34,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_preempt_own_goal.cc b/shared/ff_util/test/ff_action_preempt_own_goal.cc index d567cded15..97333782cb 100644 --- a/shared/ff_util/test/ff_action_preempt_own_goal.cc +++ b/shared/ff_util/test/ff_action_preempt_own_goal.cc @@ -36,7 +36,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/ff_util/test/ff_action_response_timeout.cc b/shared/ff_util/test/ff_action_response_timeout.cc index fc196fcf7a..4eb7c5713f 100644 --- a/shared/ff_util/test/ff_action_response_timeout.cc +++ b/shared/ff_util/test/ff_action_response_timeout.cc @@ -29,7 +29,7 @@ // Borrow the example from actionlib #include -// C++11 incliudes +// C++ includes #include #include diff --git a/shared/jsonloader/CMakeLists.txt b/shared/jsonloader/CMakeLists.txt index 5ee73a9285..2e4e496228 100644 --- a/shared/jsonloader/CMakeLists.txt +++ b/shared/jsonloader/CMakeLists.txt @@ -15,31 +15,116 @@ # License for the specific language governing permissions and limitations # under the License. -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-variable") - -set(LIBS - ff_common - ${GLOG_LIBRARIES} - ${JSONCPP_LIBRARIES} - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ) -set(INCLUDES - ff_common - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${EIGEN3_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} +cmake_minimum_required(VERSION 3.0) +project(jsonloader) + + +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + std_msgs + nodelet +) + +find_package(Eigen3 REQUIRED) +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(JsonCpp REQUIRED) + +catkin_package( + INCLUDE_DIRS include + LIBRARIES jsonloader + CATKIN_DEPENDS roscpp std_msgs nodelet +) + +########### +## Build ## +########### + +# Specify additional locations of header files +# Your package locations should be listed before other locations +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIRS} - ${Boost_INCLUDE_DIR} +) + +# Declare C++ libraries +add_library(jsonloader + src/command.cc + src/command_repo.cc + src/keepout.cc + src/keepoutio.cc + src/plan.cc + src/planio.cc + src/validation.cc +) +add_dependencies(jsonloader ${catkin_EXPORTED_TARGETS}) +target_link_libraries(jsonloader gflags glog ${JSONCPP_LIBRARIES} ${catkin_LIBRARIES} ) + + +if(CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) + + add_rostest_gtest(test_command + test/test_command.test + test/test_command.cxx + ) + target_link_libraries(test_command + jsonloader + ) + + add_rostest_gtest(test_keepout + test/test_keepout.test + test/test_keepout.cxx + ) + target_link_libraries(test_keepout + jsonloader + ) + + add_rostest_gtest(test_keepoutio + test/test_keepoutio.test + test/test_keepoutio.cxx + ) + target_link_libraries(test_keepoutio + jsonloader + ) + + add_rostest_gtest(test_plan + test/test_plan.test + test/test_plan.cxx ) + target_link_libraries(test_plan + jsonloader + ) + + add_rostest_gtest(test_validation + test/test_validation.test + test/test_validation.cxx + ) + target_link_libraries(test_validation + jsonloader + ) + +endif() + +############# +## Install ## +############# -create_library(TARGET jsonloader - LIBS ${LIBS} - INC ${INCLUDES} - DEPS ${DEPS}) -create_test_targets(DIR test - LIBS jsonloader - INC ${INCLUDES} - DEPS ${DEPS}) +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) diff --git a/shared/jsonloader/package.xml b/shared/jsonloader/package.xml new file mode 100644 index 0000000000..62ad5593f4 --- /dev/null +++ b/shared/jsonloader/package.xml @@ -0,0 +1,24 @@ + + jsonloader + 1.0.0 + + Package for loading json from fplans + + + Apache License, Version 2.0 + + + Astrobee Flight Software + + + Astrobee Flight Software + + catkin + roscpp + std_msgs + nodelet + roscpp + std_msgs + nodelet + + diff --git a/shared/jsonloader/test/test_command.cxx b/shared/jsonloader/test/test_command.cxx index 8348df0d89..3d38557e76 100644 --- a/shared/jsonloader/test/test_command.cxx +++ b/shared/jsonloader/test/test_command.cxx @@ -414,3 +414,9 @@ TEST(Command, ValidStartRecording) { ASSERT_STREQ(s_cmd->description().data(), "mom"); } + +// Run all the tests that were declared with TEST() +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/shared/jsonloader/test/test_command.test b/shared/jsonloader/test/test_command.test new file mode 100644 index 0000000000..f083b37a9d --- /dev/null +++ b/shared/jsonloader/test/test_command.test @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/shared/jsonloader/test/test_keepout.cxx b/shared/jsonloader/test/test_keepout.cxx index f8f62ca641..65847da773 100644 --- a/shared/jsonloader/test/test_keepout.cxx +++ b/shared/jsonloader/test/test_keepout.cxx @@ -63,3 +63,9 @@ TEST(Keepout, MergeCorrect) { a.Merge(b); EXPECT_EQ(a.GetBoxes().size(), 2); } + +// Run all the tests that were declared with TEST() +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/shared/jsonloader/test/test_keepout.test b/shared/jsonloader/test/test_keepout.test new file mode 100644 index 0000000000..d2a1607f83 --- /dev/null +++ b/shared/jsonloader/test/test_keepout.test @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/shared/jsonloader/test/test_keepoutio.cxx b/shared/jsonloader/test/test_keepoutio.cxx index 8d0522aab5..2141500276 100644 --- a/shared/jsonloader/test/test_keepoutio.cxx +++ b/shared/jsonloader/test/test_keepoutio.cxx @@ -27,7 +27,7 @@ #include // TEST_DIR is defined by cmake as the test directory of our module -const std::string kDataDir = std::string(TEST_DIR) + "/data/"; +const std::string kDataDir = std::string(std::getenv("DATA_DIR")); TEST(KeepoutIO, LoadGoodKeepout) { jsonloader::Keepout k(true); // opposite of what it should be @@ -63,3 +63,9 @@ TEST(KeepoutIO, LoadDir) { EXPECT_EQ(safeZone.GetBoxes().size(), 1); EXPECT_EQ(dangerZone.GetBoxes().size(), 2); } + +// Run all the tests that were declared with TEST() +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/shared/jsonloader/test/test_keepoutio.test b/shared/jsonloader/test/test_keepoutio.test new file mode 100644 index 0000000000..559baa9702 --- /dev/null +++ b/shared/jsonloader/test/test_keepoutio.test @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/shared/jsonloader/test/test_plan.cxx b/shared/jsonloader/test/test_plan.cxx index 2f47a60b8f..3d30ede81a 100644 --- a/shared/jsonloader/test/test_plan.cxx +++ b/shared/jsonloader/test/test_plan.cxx @@ -37,7 +37,7 @@ namespace fs = boost::filesystem; -const std::string kDataDir = std::string(TEST_DIR) + "/data/"; +const std::string kDataDir = std::string(std::getenv("DATA_DIR")); std::string SlurpFile(std::string const& f_name) { std::ifstream file(f_name, std::ios::in | std::ios::binary); @@ -315,3 +315,9 @@ TEST(PlanIO, PlanEvolution) { LOG(INFO) << "Operating Limits: " << ol.valid(); } } + +// Run all the tests that were declared with TEST() +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/management/cpu_mem_monitor/test/test_init_cpu_monitor.test b/shared/jsonloader/test/test_plan.test similarity index 62% rename from management/cpu_mem_monitor/test/test_init_cpu_monitor.test rename to shared/jsonloader/test/test_plan.test index 2dc120ff89..6b19ad8f80 100644 --- a/management/cpu_mem_monitor/test/test_init_cpu_monitor.test +++ b/shared/jsonloader/test/test_plan.test @@ -16,19 +16,6 @@ - - - - - - - - - - - - - - - + + diff --git a/shared/jsonloader/test/test_validation.cxx b/shared/jsonloader/test/test_validation.cxx index 23ec6a3e4c..d5fd191cf1 100644 --- a/shared/jsonloader/test/test_validation.cxx +++ b/shared/jsonloader/test/test_validation.cxx @@ -179,3 +179,8 @@ TEST(Validation, EnumField) { EXPECT_TRUE(optional.Validate(v)); } +// Run all the tests that were declared with TEST() +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/shared/jsonloader/test/test_validation.test b/shared/jsonloader/test/test_validation.test new file mode 100644 index 0000000000..6cada9502d --- /dev/null +++ b/shared/jsonloader/test/test_validation.test @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/shared/msg_conversions/CMakeLists.txt b/shared/msg_conversions/CMakeLists.txt index 47064ef145..4a66b1750e 100644 --- a/shared/msg_conversions/CMakeLists.txt +++ b/shared/msg_conversions/CMakeLists.txt @@ -15,27 +15,87 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(msg_conversions) -if (USE_ROS) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + message_runtime + std_msgs + geometry_msgs + config_reader + ff_msgs + tf2 + tf2_ros +) + +find_package(Eigen3 REQUIRED) catkin_package( LIBRARIES ${PROJECT_NAME} INCLUDE_DIRS include - CATKIN_DEPENDS roscpp message_runtime std_msgs geometry_msgs sensor_msgs - DEPENDS ff_msgs + CATKIN_DEPENDS roscpp message_runtime std_msgs geometry_msgs config_reader tf2 tf2_ros ) -create_library(TARGET msg_conversions - LIBS ${catkin_LIBRARIES} config_reader - DEPS ff_msgs eigen - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} +########### +## Build ## +########### + +# Specify additional locations of header files +# Your package locations should be listed before other locations +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} ${GFLAGS_LIBRARIES} ff_common - INC ${catkin_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS} - DEPS ff_msgs +# Declare C++ libraries +add_library(msg_conversions + src/msg_conversions.cc ) +add_dependencies(msg_conversions ${catkin_EXPORTED_TARGETS}) +target_link_libraries(msg_conversions ${EIGEN_LIBRARIES} ${catkin_LIBRARIES}) + +## Declare a C++ executable: inspection_tool +add_executable(landmark_msg_cnv tools/landmark_msg_cnv.cc) +add_dependencies(landmark_msg_cnv ${catkin_EXPORTED_TARGETS}) +target_link_libraries(landmark_msg_cnv + msg_conversions gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: inspection_tool +add_executable(pose_stamped_msg_cnv tools/pose_stamped_msg_cnv.cc) +add_dependencies(pose_stamped_msg_cnv ${catkin_EXPORTED_TARGETS}) +target_link_libraries(pose_stamped_msg_cnv + msg_conversions gflags ${catkin_LIBRARIES}) -endif (USE_ROS) +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Install C++ executables +install(TARGETS landmark_msg_cnv DESTINATION bin) +install(TARGETS pose_stamped_msg_cnv DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/landmark_msg_cnv share/${PROJECT_NAME} + COMMAND ln -s ../../bin/pose_stamped_msg_cnv share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) diff --git a/shared/msg_conversions/include/msg_conversions/msg_conversions.h b/shared/msg_conversions/include/msg_conversions/msg_conversions.h index b2012975ca..b40ffc4025 100644 --- a/shared/msg_conversions/include/msg_conversions/msg_conversions.h +++ b/shared/msg_conversions/include/msg_conversions/msg_conversions.h @@ -21,8 +21,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/shared/msg_conversions/package.xml b/shared/msg_conversions/package.xml index d926f2347c..3969db8423 100644 --- a/shared/msg_conversions/package.xml +++ b/shared/msg_conversions/package.xml @@ -15,14 +15,22 @@ catkin roscpp + message_runtime std_msgs sensor_msgs geometry_msgs ff_msgs + config_reader + tf2 + tf2_ros roscpp message_runtime + message_runtime std_msgs sensor_msgs geometry_msgs ff_msgs + config_reader + tf2 + tf2_ros diff --git a/simulation/CMakeLists.txt b/simulation/CMakeLists.txt index 84e2957837..6d8eefef24 100644 --- a/simulation/CMakeLists.txt +++ b/simulation/CMakeLists.txt @@ -15,8 +15,30 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(astrobee_gazebo) +if (ENABLE_GAZEBO) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + visualization_msgs + tf2 + tf2_ros + tf2_eigen + tf2_msgs + gazebo_ros + sensor_msgs + ff_msgs + ff_hw_msgs + tf2_geometry_msgs + ff_util + gnc_autocode + camera +) + # Find packages find_package(gazebo REQUIRED) @@ -62,477 +84,276 @@ catkin_package( sensor_msgs ff_msgs ff_hw_msgs + tf2_geometry_msgs ff_util + gnc_autocode + camera ) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${GAZEBO_INCLUDE_DIRS} +) + +link_directories(${GAZEBO_LIBRARY_DIRS}) +list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}") + # Create reusable classes for models and plugins -create_library( - DIR - src - TARGET - astrobee_gazebo - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - ff_nodelet - INC - ${GAZEBO_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(astrobee_gazebo + src/astrobee_gazebo.cc +) +add_dependencies(astrobee_gazebo ${catkin_EXPORTED_TARGETS}) +target_link_libraries(astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the EPS system -create_library( - DIR - src/gazebo_model_plugin_eps - TARGET - gazebo_model_plugin_eps - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_eps + src/gazebo_model_plugin_eps/gazebo_model_plugin_eps.cc +) +add_dependencies(gazebo_model_plugin_eps ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_eps astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for aerodynamic drag -create_library( - DIR - src/gazebo_model_plugin_drag - TARGET - gazebo_model_plugin_drag - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_model_plugin_drag + src/gazebo_model_plugin_drag/gazebo_model_plugin_drag.cc +) +add_dependencies(gazebo_model_plugin_drag ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_drag astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the ground truth -create_library( - DIR - src/gazebo_model_plugin_truth - TARGET - gazebo_model_plugin_truth - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_model_plugin_truth + src/gazebo_model_plugin_truth/gazebo_model_plugin_truth.cc +) +add_dependencies(gazebo_model_plugin_truth ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_truth astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the propulsion system -create_library( - DIR - src/gazebo_model_plugin_pmc - TARGET - gazebo_model_plugin_pmc - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - gnc_autocode - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_model_plugin_pmc + src/gazebo_model_plugin_pmc/gazebo_model_plugin_pmc.cc +) +add_dependencies(gazebo_model_plugin_pmc ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_pmc astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the perching arm -create_library( - DIR - src/gazebo_model_plugin_perching_arm - TARGET - gazebo_model_plugin_perching_arm - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_model_plugin_perching_arm + src/gazebo_model_plugin_perching_arm/gazebo_model_plugin_perching_arm.cc +) +add_dependencies(gazebo_model_plugin_perching_arm ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_perching_arm astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) -# Create a model plugin for the flashlight -create_library( - DIR - src/gazebo_model_plugin_flashlight - TARGET - gazebo_model_plugin_flashlight - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +# Create a model plugin for the front flashlight +add_library(gazebo_model_plugin_flashlight + src/gazebo_model_plugin_flashlight/gazebo_model_plugin_flashlight.cc +) +add_dependencies(gazebo_model_plugin_flashlight ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_flashlight astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the laser -create_library( - DIR - src/gazebo_model_plugin_laser - TARGET - gazebo_model_plugin_laser - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_laser + src/gazebo_model_plugin_laser/gazebo_model_plugin_laser.cc +) +add_dependencies(gazebo_model_plugin_laser ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_laser astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the LLP CPU mem monitor -create_library( - DIR - src/gazebo_model_plugin_llp_cpu_mem_monitor - TARGET - gazebo_model_plugin_llp_cpu_mem_monitor - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_llp_cpu_mem_monitor + src/gazebo_model_plugin_llp_cpu_mem_monitor/gazebo_model_plugin_llp_cpu_mem_monitor.cc +) +add_dependencies(gazebo_model_plugin_llp_cpu_mem_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_llp_cpu_mem_monitor astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the LLP disk monitor -create_library( - DIR - src/gazebo_model_plugin_llp_disk_monitor - TARGET - gazebo_model_plugin_llp_disk_monitor - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_llp_disk_monitor + src/gazebo_model_plugin_llp_disk_monitor/gazebo_model_plugin_llp_disk_monitor.cc +) +add_dependencies(gazebo_model_plugin_llp_disk_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_llp_disk_monitor astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the MLP CPU mem monitor -create_library( - DIR - src/gazebo_model_plugin_mlp_cpu_mem_monitor - TARGET - gazebo_model_plugin_mlp_cpu_mem_monitor - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_mlp_cpu_mem_monitor + src/gazebo_model_plugin_mlp_cpu_mem_monitor/gazebo_model_plugin_mlp_cpu_mem_monitor.cc +) +add_dependencies(gazebo_model_plugin_mlp_cpu_mem_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_mlp_cpu_mem_monitor astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the MLP disk monitor -create_library( - DIR - src/gazebo_model_plugin_mlp_disk_monitor - TARGET - gazebo_model_plugin_mlp_disk_monitor - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_mlp_disk_monitor + src/gazebo_model_plugin_mlp_disk_monitor/gazebo_model_plugin_mlp_disk_monitor.cc +) +add_dependencies(gazebo_model_plugin_mlp_disk_monitor ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_mlp_disk_monitor astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the speed camera -create_library( - DIR - src/gazebo_model_plugin_speed_cam - TARGET - gazebo_model_plugin_speed_cam - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_speed_cam + src/gazebo_model_plugin_speed_cam/gazebo_model_plugin_speed_cam.cc +) +add_dependencies(gazebo_model_plugin_speed_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_speed_cam astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for the signal lights -create_library( - DIR - src/gazebo_model_plugin_signal_lights - TARGET - gazebo_model_plugin_signal_lights - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_hw_msgs +add_library(gazebo_model_plugin_signal_lights + src/gazebo_model_plugin_signal_lights/gazebo_model_plugin_signal_lights.cc +) +add_dependencies(gazebo_model_plugin_signal_lights ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_model_plugin_signal_lights astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a sensor plugin for the IMU -create_library( - DIR - src/gazebo_sensor_plugin_imu - TARGET - gazebo_sensor_plugin_imu - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_sensor_plugin_imu + src/gazebo_sensor_plugin_imu/gazebo_sensor_plugin_imu.cc +) +add_dependencies(gazebo_sensor_plugin_imu ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_imu astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a sensor plugin for the perch camera -create_library( - DIR - src/gazebo_sensor_plugin_perch_cam - TARGET - gazebo_sensor_plugin_perch_cam - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_sensor_plugin_perch_cam + src/gazebo_sensor_plugin_perch_cam/gazebo_sensor_plugin_perch_cam.cc +) +add_dependencies(gazebo_sensor_plugin_perch_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_perch_cam astrobee_gazebo + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a sensor plugin for the handrail detection algorithm -#create_library( -# DIR -# src/gazebo_sensor_plugin_handrail_detect -# TARGET -# gazebo_sensor_plugin_handrail_detect -# LIBS -# ${GAZEBO_LIBRARIES} -# ${catkin_LIBRARIES} -# astrobee_gazebo -# camera -# INC -# ${GAZEBO_INCLUDE_DIRS} -# ${catkin_INCLUDE_DIRS} -# ${EIGEN3_INCLUDE_DIRS} -# DEPS -# ff_util -# ff_msgs -#) +# add_library(gazebo_sensor_plugin_handrail_detect +# src/gazebo_sensor_plugin_handrail_detect/gazebo_sensor_plugin_handrail_detect.cc +# ) +# add_dependencies(gazebo_sensor_plugin_handrail_detect ${catkin_EXPORTED_TARGETS}) +# target_link_libraries(gazebo_sensor_plugin_handrail_detect +# ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} +# ) # Create a sensor plugin for the hazard camera -create_library( - DIR - src/gazebo_sensor_plugin_haz_cam - TARGET - gazebo_sensor_plugin_haz_cam - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_sensor_plugin_haz_cam + src/gazebo_sensor_plugin_haz_cam/gazebo_sensor_plugin_haz_cam.cc +) +add_dependencies(gazebo_sensor_plugin_haz_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_haz_cam + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a sensor plugin for the nav cam -create_library( - DIR - src/gazebo_sensor_plugin_nav_cam - TARGET - gazebo_sensor_plugin_nav_cam - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_msgs +add_library(gazebo_sensor_plugin_nav_cam + src/gazebo_sensor_plugin_nav_cam/gazebo_sensor_plugin_nav_cam.cc +) +add_dependencies(gazebo_sensor_plugin_nav_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_nav_cam + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a sensor plugin for the dock cam -create_library( - DIR - src/gazebo_sensor_plugin_dock_cam - TARGET - gazebo_sensor_plugin_dock_cam - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util +add_library(gazebo_sensor_plugin_dock_cam + src/gazebo_sensor_plugin_dock_cam/gazebo_sensor_plugin_dock_cam.cc +) +add_dependencies(gazebo_sensor_plugin_dock_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_dock_cam + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a sensor plugin for the sci cam -create_library( - DIR - src/gazebo_sensor_plugin_sci_cam - TARGET - gazebo_sensor_plugin_sci_cam - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_msgs +add_library(gazebo_sensor_plugin_sci_cam + src/gazebo_sensor_plugin_sci_cam/gazebo_sensor_plugin_sci_cam.cc +) +add_dependencies(gazebo_sensor_plugin_sci_cam ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_sci_cam + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for sparse mapping -create_library( - DIR - src/gazebo_sensor_plugin_sparse_map - TARGET - gazebo_sensor_plugin_sparse_map - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - camera - INC - ${GAZEBO_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_msgs +add_library(gazebo_sensor_plugin_sparse_map + src/gazebo_sensor_plugin_sparse_map/gazebo_sensor_plugin_sparse_map.cc +) +add_dependencies(gazebo_sensor_plugin_sparse_map ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_sparse_map + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for AR localization -create_library( - DIR - src/gazebo_sensor_plugin_ar_tags - TARGET - gazebo_sensor_plugin_ar_tags - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - camera - msg_conversions - INC - ${GAZEBO_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_msgs +add_library(gazebo_sensor_plugin_ar_tags + src/gazebo_sensor_plugin_ar_tags/gazebo_sensor_plugin_ar_tags.cc +) +add_dependencies(gazebo_sensor_plugin_ar_tags ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_ar_tags + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) # Create a model plugin for optical flow -create_library( - DIR - src/gazebo_sensor_plugin_optical_flow - TARGET - gazebo_sensor_plugin_optical_flow - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - astrobee_gazebo - camera - INC - ${GAZEBO_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} - DEPS - ff_util - ff_msgs +add_library(gazebo_sensor_plugin_optical_flow + src/gazebo_sensor_plugin_optical_flow/gazebo_sensor_plugin_optical_flow.cc ) - -# Create a model plugin for sparse mapping -create_library( - DIR - src/gazebo_world_plugin_speed - TARGET - gazebo_world_plugin_speed - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} +add_dependencies(gazebo_sensor_plugin_optical_flow ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_sensor_plugin_optical_flow + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) +# Create a world plugin for speed +add_library(gazebo_world_plugin_speed + src/gazebo_world_plugin_speed/gazebo_world_plugin_speed.cc +) +add_dependencies(gazebo_world_plugin_speed ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_world_plugin_speed + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} +) -# Create a model plugin for the client gui -create_library( - DIR - src/gazebo_system_plugin_client - TARGET - gazebo_system_plugin_client - LIBS - ${GAZEBO_LIBRARIES} - ${catkin_LIBRARIES} - INC - ${GAZEBO_INCLUDE_DIRS} - ${catkin_INCLUDE_DIRS} +# Create a system plugin for the client gui +add_library(gazebo_system_plugin_client + src/gazebo_system_plugin_client/gazebo_system_plugin_client.cc +) +add_dependencies(gazebo_system_plugin_client ${catkin_EXPORTED_TARGETS}) +target_link_libraries(gazebo_system_plugin_client + ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ) +############# +## Install ## +############# -# Install our launch files -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) # Also install some other resources install(DIRECTORY worlds DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) catkin_install_python(PROGRAMS scripts/spawn_model scripts/perf_wrapper scripts/start_server scripts/common DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) + +else (ENABLE_GAZEBO) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() +endif (ENABLE_GAZEBO) diff --git a/simulation/package.xml b/simulation/package.xml index a0e6fa6be0..f1dbeaa26c 100644 --- a/simulation/package.xml +++ b/simulation/package.xml @@ -25,7 +25,10 @@ sensor_msgs ff_msgs ff_hw_msgs + tf2_geometry_msgs ff_util + gnc_autocode + camera visualization_msgs tf2 tf2_ros @@ -35,7 +38,10 @@ sensor_msgs ff_msgs ff_hw_msgs + tf2_geometry_msgs ff_util + gnc_autocode + camera diff --git a/submodules/platform b/submodules/platform index a7a92c4c4f..dc597f81f8 160000 --- a/submodules/platform +++ b/submodules/platform @@ -1 +1 @@ -Subproject commit a7a92c4c4ff15bd501d83243827a3eb379aea90e +Subproject commit dc597f81f8a5cf268d12cd2a350e7a6772cd0d4e diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt deleted file mode 100644 index f64c1178c2..0000000000 --- a/tools/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(ekf_bag) -add_subdirectory(graph_bag) -add_subdirectory(imu_bias_tester) -add_subdirectory(localization_rviz_plugins) -add_subdirectory(rviz_visualizer) -add_subdirectory(visualeyez) -add_subdirectory(simulator) - -if (FFMPEG_FOUND) - add_subdirectory(ekf_video) -endif (FFMPEG_FOUND) diff --git a/tools/ekf_bag/CMakeLists.txt b/tools/ekf_bag/CMakeLists.txt index 4b22c4f78a..3840dfe592 100644 --- a/tools/ekf_bag/CMakeLists.txt +++ b/tools/ekf_bag/CMakeLists.txt @@ -15,18 +15,89 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ekf_bag) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + config_reader + camera + ekf + lk_optical_flow + localization_node +) + + +# Find OpenCV +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(OpenCV331 REQUIRED) + catkin_package( - CATKIN_DEPENDS roscpp + INCLUDE_DIRS include + LIBRARIES ${PROJECT_NAME} + CATKIN_DEPENDS roscpp config_reader camera ekf lk_optical_flow localization_node +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -create_library(TARGET ekf_bag - LIBS ekf lk_optical_flow localization_node sparse_mapping interest_point camera ff_common config_reader ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} +# Declare C++ libraries +add_library(ekf_bag + src/ekf_bag.cc + src/ekf_bag_csv.cc + src/tracked_features.cc ) +add_dependencies(ekf_bag ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ekf_bag ${catkin_LIBRARIES} ${OpenCV_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(bag_to_csv tools/bag_to_csv.cc) +add_dependencies(bag_to_csv ${catkin_EXPORTED_TARGETS}) +target_link_libraries(bag_to_csv + ekf_bag gflags glog ${catkin_LIBRARIES}) + +## Declare a C++ executable: bag_to_csv +add_executable(sparse_map_bag tools/sparse_map_bag.cc) +add_dependencies(sparse_map_bag ${catkin_EXPORTED_TARGETS}) +target_link_libraries(sparse_map_bag + ekf_bag gflags glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# -create_tool_targets(DIR tools - LIBS ekf_bag - INC ${catkin_INCLUDE_DIRS} +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +# Install C++ executables +install(TARGETS bag_to_csv DESTINATION bin) +install(TARGETS sparse_map_bag DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/bag_to_csv share/${PROJECT_NAME} + COMMAND ln -s ../../bin/sparse_map_bag share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") diff --git a/tools/ekf_bag/package.xml b/tools/ekf_bag/package.xml index 8b73eecd62..10ffc14d6c 100644 --- a/tools/ekf_bag/package.xml +++ b/tools/ekf_bag/package.xml @@ -16,6 +16,16 @@ catkin roscpp + config_reader + camera + ekf + lk_optical_flow + localization_node roscpp + config_reader + camera + ekf + lk_optical_flow + localization_node diff --git a/tools/ekf_video/CMakeLists.txt b/tools/ekf_video/CMakeLists.txt index 19f9793bbb..58fbf025ca 100644 --- a/tools/ekf_video/CMakeLists.txt +++ b/tools/ekf_video/CMakeLists.txt @@ -15,24 +15,51 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(ekf_video) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ekf_bag +) + +# System dependencies are found with CMake's conventions +find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Gui) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../cmake") +find_package(FFMPEG REQUIRED ) + catkin_package( - CATKIN_DEPENDS roscpp + CATKIN_DEPENDS roscpp ekf_bag ) -# copied this from qp planner -find_package(catkin COMPONENTS rviz QUIET) -if(rviz_QT_VERSION) - find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Gui) - - create_library(TARGET ekf_video - LIBS ekf_bag ${FFMPEG_LIBRARIES} ${catkin_LIBRARIES} ${Qt5Gui_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} ${FFMPEG_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} - ) - - create_tool_targets(DIR tools - LIBS ekf_video ${Qt5Gui_LIBRARIES} - INC ${catkin_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} - ) -endif(rviz_QT_VERSION) +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${FFMPEG_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(ekf_video + src/ekf_bag_video.cc + src/video_writer.cc +) +add_dependencies(ekf_video ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ekf_video ${catkin_LIBRARIES} ${Qt5Gui_LIBRARIES} ${FFMPEG_LIBRARIES} +) + + +## Declare a C++ executable: inspection_tool +add_executable(ekf_to_video tools/ekf_to_video.cc) +add_dependencies(ekf_to_video ${catkin_EXPORTED_TARGETS}) +target_link_libraries(ekf_to_video + ekf_video gflags glog ${catkin_LIBRARIES}) diff --git a/tools/ekf_video/package.xml b/tools/ekf_video/package.xml index d9fef16565..9cf98e0fee 100644 --- a/tools/ekf_video/package.xml +++ b/tools/ekf_video/package.xml @@ -16,6 +16,8 @@ catkin roscpp + ekf_bag roscpp + ekf_bag diff --git a/tools/gds_helper/CMakeLists.txt b/tools/gds_helper/CMakeLists.txt index 3112012f10..323192567e 100644 --- a/tools/gds_helper/CMakeLists.txt +++ b/tools/gds_helper/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0) project(gds_helper) -## Compile as C++11, supported in ROS Kinetic and newer -# add_compile_options(-std=c++11) +# Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) diff --git a/tools/gnc_visualizer/CMakeLists.txt b/tools/gnc_visualizer/CMakeLists.txt index 22fa4fbed0..98b427c09d 100644 --- a/tools/gnc_visualizer/CMakeLists.txt +++ b/tools/gnc_visualizer/CMakeLists.txt @@ -15,10 +15,20 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(gnc_visualizer) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +find_package(catkin REQUIRED COMPONENTS + rospy + std_msgs + ff_msgs +) + catkin_package( LIBRARIES - DEPENDS rospy std_msgs vpp_msgs ff_msgs geometry_msgs + DEPENDS rospy std_msgs ff_msgs ) diff --git a/tools/gnc_visualizer/package.xml b/tools/gnc_visualizer/package.xml index 55381b26dc..087a6645de 100644 --- a/tools/gnc_visualizer/package.xml +++ b/tools/gnc_visualizer/package.xml @@ -15,11 +15,9 @@ catkin rospy - vpp_msgs ff_msgs std_msgs rospy - vpp_msgs ff_msgs std_msgs diff --git a/tools/graph_bag/CMakeLists.txt b/tools/graph_bag/CMakeLists.txt index c4982c61b3..827eb7bb1e 100644 --- a/tools/graph_bag/CMakeLists.txt +++ b/tools/graph_bag/CMakeLists.txt @@ -15,25 +15,110 @@ #License for the specific language governing permissions and limitations #under the License. -cmake_minimum_required(VERSION 2.8.3) - +cmake_minimum_required(VERSION 3.0) project(graph_bag) if (USE_ROS) -catkin_package( - CATKIN_DEPENDS roscpp rosbag -) + ## Compile as C++14, supported in ROS Kinetic and newer + add_compile_options(-std=c++14) -# include ff_nodelet to get ff_util header files since these aren't exposed elsewhere -create_library(TARGET ${PROJECT_NAME} - LIBS ff_common ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} camera ff_nodelet graph_localizer imu_augmentor imu_bias_tester imu_integration lk_optical_flow localization_common localization_measurements localization_node sparse_mapping msg_conversions - INC ${catkin_INCLUDE_DIRS} -) + ## Find catkin macros and libraries + find_package(catkin2 REQUIRED COMPONENTS + roscpp + rosbag + ff_util + ff_msgs + ff_common + graph_localizer + camera + lk_optical_flow + imu_bias_tester + localization_node + imu_augmentor + ) + + # Find GTSAM + find_package(GTSAM REQUIRED) + + catkin_package( + LIBRARIES ${PROJECT_NAME} + INCLUDE_DIRS include + CATKIN_DEPENDS roscpp rosbag ff_util ff_msgs ff_common graph_localizer camera lk_optical_flow imu_bias_tester localization_node imu_augmentor + ) + + ########### + ## Build ## + ########### + # Specify additional locations of header files + include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ) + + # Declare C++ libraries + add_library(${PROJECT_NAME} + src/bag_imu_filterer.cc + src/graph_bag.cc + src/graph_localizer_simulator.cc + src/imu_bias_tester_adder.cc + src/live_measurement_simulator.cc + src/parameter_reader.cc + src/sparse_mapping_pose_adder.cc + src/utilities.cc + ) + add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) + target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) -create_tool_targets(DIR tools - LIBS ${PROJECT_NAME} # profiler - INC ${catkin_INCLUDE_DIRS} + ## Declare a C++ executable: run_bag_imu_filterer + add_executable(run_bag_imu_filterer tools/run_bag_imu_filterer.cc) + add_dependencies(run_bag_imu_filterer ${catkin_EXPORTED_TARGETS}) + target_link_libraries(run_bag_imu_filterer + ${PROJECT_NAME} gflags gtsam ${catkin_LIBRARIES}) + + ## Declare a C++ executable: run_graph_bag + add_executable(run_graph_bag tools/run_graph_bag.cc) + add_dependencies(run_graph_bag ${catkin_EXPORTED_TARGETS}) + target_link_libraries(run_graph_bag + ${PROJECT_NAME} gflags gtsam ${catkin_LIBRARIES}) + + ## Declare a C++ executable: run_imu_bias_tester_adder + add_executable(run_imu_bias_tester_adder tools/run_imu_bias_tester_adder.cc) + add_dependencies(run_imu_bias_tester_adder ${catkin_EXPORTED_TARGETS}) + target_link_libraries(run_imu_bias_tester_adder + ${PROJECT_NAME} gflags gtsam ${catkin_LIBRARIES}) + + ## Declare a C++ executable: run_sparse_mapping_pose_adder + add_executable(run_sparse_mapping_pose_adder tools/run_sparse_mapping_pose_adder.cc) + add_dependencies(run_sparse_mapping_pose_adder ${catkin_EXPORTED_TARGETS}) + target_link_libraries(run_sparse_mapping_pose_adder + ${PROJECT_NAME} gflags gtsam ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) +# Install C++ executables +install(TARGETS run_bag_imu_filterer DESTINATION bin) +install(TARGETS run_graph_bag DESTINATION bin) +install(TARGETS run_imu_bias_tester_adder DESTINATION bin) +install(TARGETS run_sparse_mapping_pose_adder DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/run_bag_imu_filterer share/${PROJECT_NAME} + COMMAND ln -s ../../bin/run_graph_bag share/${PROJECT_NAME} + COMMAND ln -s ../../bin/run_imu_bias_tester_adder share/${PROJECT_NAME} + COMMAND ln -s ../../bin/run_sparse_mapping_pose_adder share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + endif (USE_ROS) diff --git a/tools/graph_bag/package.xml b/tools/graph_bag/package.xml index bf259d87db..0ca1691995 100644 --- a/tools/graph_bag/package.xml +++ b/tools/graph_bag/package.xml @@ -17,13 +17,26 @@ eigen_conversions roscpp rosbag - graph_localizer ff_util - tf + ff_msgs + ff_common + graph_localizer + camera + lk_optical_flow + imu_bias_tester + localization_node + imu_augmentor eigen_conversions graph_localizer roscpp rosbag ff_util - tf + ff_msgs + ff_common + graph_localizer + camera + lk_optical_flow + imu_bias_tester + localization_node + imu_augmentor diff --git a/tools/imu_bias_tester/CMakeLists.txt b/tools/imu_bias_tester/CMakeLists.txt index 23e44b5bca..1dab1ca189 100644 --- a/tools/imu_bias_tester/CMakeLists.txt +++ b/tools/imu_bias_tester/CMakeLists.txt @@ -15,23 +15,78 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(imu_bias_tester) if (USE_ROS) + ## Compile as C++14, supported in ROS Kinetic and newer + add_compile_options(-std=c++14) -catkin_package( - LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} ff_nodelet imu_integration localization_common localization_measurements - INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} ${GLOG_INCLUDE_DIRS} - CATKIN_DEPENDS - DEPENDS gtsam -) + ## Find catkin macros and libraries + find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + ff_util + ff_msgs + config_reader + imu_integration + ) -create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ff_nodelet imu_integration localization_common localization_measurements - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} - DEPS gtsam ff_msgs -) + catkin_package( + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} + INCLUDE_DIRS include ${GTSAM_INCLUDE_DIR} ${GLOG_INCLUDE_DIRS} + CATKIN_DEPENDS roscpp ff_util ff_msgs config_reader imu_integration + ) + + ########### + ## Build ## + ########### + # Specify additional locations of header files + include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ) -install_launch_files() + # Declare C++ libraries + add_library(${PROJECT_NAME} + src/imu_bias_tester.cc + src/imu_bias_tester_nodelet.cc + src/imu_bias_tester_wrapper.cc + ) + add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) + target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) + + ############# + ## Install ## + ############# + + # Mark libraries for installation + install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ) + + # Mark nodelet_plugin for installation + install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + ) + + # Mark cpp header files for installation + install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + # Mark launch files for installation + install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + +else (USE_ROS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() endif (USE_ROS) diff --git a/tools/imu_bias_tester/package.xml b/tools/imu_bias_tester/package.xml index 6a7d64ec0b..d12a9ccdd6 100644 --- a/tools/imu_bias_tester/package.xml +++ b/tools/imu_bias_tester/package.xml @@ -15,12 +15,18 @@ catkin catkin - ff_msgs - nodelet roscpp - ff_msgs - nodelet + nodelet + ff_util + ff_msgs + config_reader + imu_integration roscpp + nodelet + ff_util + ff_msgs + config_reader + imu_integration diff --git a/tools/localization_rviz_plugins/CMakeLists.txt b/tools/localization_rviz_plugins/CMakeLists.txt index de1d5dec8e..ab41a3037d 100644 --- a/tools/localization_rviz_plugins/CMakeLists.txt +++ b/tools/localization_rviz_plugins/CMakeLists.txt @@ -15,26 +15,60 @@ #License for the specific language governing permissions and limitations #under the License. +cmake_minimum_required(VERSION 3.0) project(localization_rviz_plugins) if (USE_ROS AND BUILD_LOC_RVIZ_PLUGINS) - # For Qt - set(CMAKE_AUTOMOC ON) - set(QT_LIBRARIES Qt5::Widgets) + ## Compile as C++14, supported in ROS Kinetic and newer + add_compile_options(-std=c++14) + + + ## Find catkin macros and libraries + find_package(catkin REQUIRED COMPONENTS + roscpp + localization_common + ff_util + graph_localizer + graph_bag + rviz + ) + + # For Qt + set(CMAKE_AUTOMOC ON) + find_package(Qt5 ${rviz_QT_VERSION} REQUIRED Core Widgets) + set(QT_LIBRARIES Qt5::Widgets) catkin_package( - LIBRARIES ${PROJECT_NAME} ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} ${QT_LIBRARIES} camera config_reader graph_bag graph_localizer imu_integration localization_common localization_measurements - INCLUDE_DIRS ${GTSAM_INCLUDE_DIR} ${GLOG_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} - CATKIN_DEPENDS rviz - DEPENDS gtsam + LIBRARIES ${PROJECT_NAME} ${GLOG_LIBRARIES} ${GTSAM_LIBRARIES} + INCLUDE_DIRS ${GTSAM_INCLUDE_DIR} ${GLOG_INCLUDE_DIRS} + CATKIN_DEPENDS roscpp localization_common ff_util graph_localizer graph_bag rviz ) - create_library(TARGET ${PROJECT_NAME} - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ${QT_LIBRARIES} camera config_reader graph_bag graph_localizer imu_integration localization_common localization_measurements - INC ${catkin_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} - ADD_SRCS src/localization_graph_display.cc src/localization_graph_panel.cc src/pose_display.cc src/utilities.cc src/imu_augmentor_display.cc src/sparse_mapping_display.cc ${MOC_FILES} - DEPS gtsam rviz - ) + ########### + ## Build ## + ########### + # Specify additional locations of header files + include_directories( + include + ${catkin_INCLUDE_DIRS} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ) + + # Declare C++ libraries + add_library(${PROJECT_NAME} + src/localization_graph_display.cc + src/localization_graph_panel.cc + src/pose_display.cc + src/utilities.cc + src/imu_augmentor_display.cc + src/sparse_mapping_display.cc + ) + add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) + target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_LIBRARIES}) +else (USE_ROS AND BUILD_LOC_RVIZ_PLUGINS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() endif (USE_ROS AND BUILD_LOC_RVIZ_PLUGINS) diff --git a/tools/localization_rviz_plugins/package.xml b/tools/localization_rviz_plugins/package.xml index 29af693ce5..0850cb201d 100644 --- a/tools/localization_rviz_plugins/package.xml +++ b/tools/localization_rviz_plugins/package.xml @@ -16,6 +16,10 @@ catkin roscpp rviz + localization_common + ff_util + graph_localizer + graph_bag diff --git a/tools/rviz_visualizer/CMakeLists.txt b/tools/rviz_visualizer/CMakeLists.txt index 0de925fdf4..02a22573a4 100644 --- a/tools/rviz_visualizer/CMakeLists.txt +++ b/tools/rviz_visualizer/CMakeLists.txt @@ -15,15 +15,61 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(rviz_visualizer) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + visualization_msgs + ff_util + config_reader +) catkin_package( - CATKIN_DEPENDS roscpp visualization_msgs + CATKIN_DEPENDS roscpp visualization_msgs ff_util config_reader ) -create_tool_targets(DIR tools - LIBS ${catkin_LIBRARIES} msg_conversions ff_common config_reader - INC ${catkin_INCLUDE_DIRS} +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} ) -install_launch_files() \ No newline at end of file +## Declare a C++ executable: overhead_info +add_executable(overhead_info tools/overhead_info.cc) +add_dependencies(overhead_info ${catkin_EXPORTED_TARGETS}) +target_link_libraries(overhead_info + gflags ${catkin_LIBRARIES}) + +## Declare a C++ executable: visualization_node +add_executable(visualization_node tools/visualization_node.cc) +add_dependencies(visualization_node ${catkin_EXPORTED_TARGETS}) +target_link_libraries(visualization_node + gflags ${catkin_LIBRARIES}) + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) + +############# +## Install ## +############# + +# Install C++ executables +install(TARGETS overhead_info DESTINATION bin) +install(TARGETS visualization_node DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/overhead_info share/${PROJECT_NAME} + COMMAND ln -s ../../bin/visualization_node share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") diff --git a/tools/rviz_visualizer/package.xml b/tools/rviz_visualizer/package.xml index ac9325d0e6..8a97463751 100644 --- a/tools/rviz_visualizer/package.xml +++ b/tools/rviz_visualizer/package.xml @@ -15,8 +15,11 @@ catkin roscpp visualization_msgs + ff_util + config_reader roscpp visualization_msgs - tf2_ros + ff_util + config_reader diff --git a/tools/simulator/CMakeLists.txt b/tools/simulator/CMakeLists.txt deleted file mode 100644 index 7ac0dfaec1..0000000000 --- a/tools/simulator/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2017, United States Government, as represented by the -# Administrator of the National Aeronautics and Space Administration. -# -# All rights reserved. -# -# The Astrobee platform is licensed under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -add_subdirectory(arm_sim) -add_subdirectory(dock_sim) -add_subdirectory(eps_sim) diff --git a/tools/simulator/arm_sim/CMakeLists.txt b/tools/simulator/arm_sim/CMakeLists.txt index dfeaf58549..b4050197e8 100644 --- a/tools/simulator/arm_sim/CMakeLists.txt +++ b/tools/simulator/arm_sim/CMakeLists.txt @@ -15,17 +15,59 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(arm_sim) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_util + ff_msgs + nodelet +) + catkin_package( LIBRARIES arm_sim - DEPENDS roscpp ff_msgs nodelet + DEPENDS roscpp ff_util ff_msgs nodelet +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(arm_sim + src/arm_sim.cc +) +add_dependencies(arm_sim ${catkin_EXPORTED_TARGETS}) +target_link_libraries(arm_sim ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET arm_sim - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ff_nodelet - INC ${catkin_INCLUDES} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/tools/simulator/arm_sim/package.xml b/tools/simulator/arm_sim/package.xml index dfacc7ced2..d0cfe501e3 100644 --- a/tools/simulator/arm_sim/package.xml +++ b/tools/simulator/arm_sim/package.xml @@ -16,10 +16,12 @@ catkin roscpp + ff_util ff_msgs nodelet - ff_msgs roscpp + ff_util + ff_msgs nodelet diff --git a/tools/simulator/dock_sim/CMakeLists.txt b/tools/simulator/dock_sim/CMakeLists.txt index dac1777c5e..cb8b282b0f 100644 --- a/tools/simulator/dock_sim/CMakeLists.txt +++ b/tools/simulator/dock_sim/CMakeLists.txt @@ -15,17 +15,59 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(dock_sim) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_util + ff_msgs + nodelet +) + catkin_package( LIBRARIES dock_sim - DEPENDS roscpp ff_msgs nodelet + DEPENDS roscpp ff_util ff_msgs nodelet +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(dock_sim + src/dock_sim.cc +) +add_dependencies(dock_sim ${catkin_EXPORTED_TARGETS}) +target_link_libraries(dock_sim ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET dock_sim - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ff_nodelet - INC ${catkin_INCLUDES} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/tools/simulator/dock_sim/package.xml b/tools/simulator/dock_sim/package.xml index 5f5f5aa010..b8532b2cd9 100644 --- a/tools/simulator/dock_sim/package.xml +++ b/tools/simulator/dock_sim/package.xml @@ -16,10 +16,12 @@ catkin roscpp + ff_util ff_msgs nodelet - ff_msgs roscpp + ff_util + ff_msgs nodelet diff --git a/tools/simulator/eps_sim/CMakeLists.txt b/tools/simulator/eps_sim/CMakeLists.txt index 5302a1aeb1..62c42e94fe 100644 --- a/tools/simulator/eps_sim/CMakeLists.txt +++ b/tools/simulator/eps_sim/CMakeLists.txt @@ -15,9 +15,18 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(eps_sim) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries find_package(catkin2 REQUIRED COMPONENTS + roscpp + ff_util + ff_msgs + ff_hw_msgs sensor_msgs message_generation ) @@ -28,22 +37,48 @@ add_service_files( ) generate_messages( - DEPENDENCIES sensor_msgs + DEPENDENCIES std_msgs sensor_msgs ) -#create_msg_targets(SDIR srv -# DEPS sensor_msgs -#) - catkin_package( LIBRARIES eps_sim - DEPENDS roscpp ff_msgs ff_nodelet + DEPENDS roscpp ff_util ff_msgs ff_hw_msgs +) + +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +# Declare C++ libraries +add_library(eps_sim + src/eps_sim.cc +) +add_dependencies(eps_sim ${catkin_EXPORTED_TARGETS} eps_sim_generate_messages_cpp) +target_link_libraries(eps_sim glog ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} ) -create_library(TARGET eps_sim - LIBS ${catkin_LIBRARIES} ${GLOG_LIBRARIES} ff_nodelet - INC ${catkin_INCLUDES} ${GLOG_INCLUDE_DIRS} - DEPS ff_msgs eps_sim_generate_messages_cpp +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -install_launch_files() +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/tools/simulator/eps_sim/package.xml b/tools/simulator/eps_sim/package.xml index 113ca79308..3b5f032c0a 100644 --- a/tools/simulator/eps_sim/package.xml +++ b/tools/simulator/eps_sim/package.xml @@ -16,10 +16,12 @@ catkin roscpp + ff_msgs ff_hw_msgs ff_util nodelet message_generation + ff_msgs ff_hw_msgs ff_util roscpp diff --git a/tools/visualeyez/CMakeLists.txt b/tools/visualeyez/CMakeLists.txt index aaf25d5ca0..397d708112 100644 --- a/tools/visualeyez/CMakeLists.txt +++ b/tools/visualeyez/CMakeLists.txt @@ -15,8 +15,32 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(visualeyez) +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + roscpp + nodelet + pluginlib + tf2 + tf2_ros + geometry_msgs + visualization_msgs + std_srvs + ff_util + config_reader +) + +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) + +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake") +find_package(Ceres REQUIRED) + catkin_package( CATKIN_DEPENDS roscpp @@ -27,17 +51,36 @@ catkin_package( geometry_msgs visualization_msgs std_srvs + ff_util + config_reader ) -create_library(TARGET visualeyez - LIBS ${catkin_LIBRARIES} ${EIGEN3_LIBRARIES} ${CERES_LIBRARIES} config_reader ff_nodelet - INC ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${CERES_INCLUDE_DIRS} +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + ${CERES_INCLUDE_DIRS} ) -create_tool_targets( - DIR tools - LIBS visualeyez +# Declare C++ libraries +add_library(visualeyez + src/visualeyez.cc + src/visualeyez_bridge.cc + src/visualeyez_server.cc ) +add_dependencies(visualeyez ${catkin_EXPORTED_TARGETS}) +target_link_libraries(visualeyez ${CERES_LIBRARIES} ${catkin_LIBRARIES}) + +## Declare a C++ executable: visualeyez_tool +add_executable(visualeyez_tool tools/visualeyez_tool.cc) +add_dependencies(visualeyez_tool ${catkin_EXPORTED_TARGETS}) +target_link_libraries(visualeyez_tool + visualeyez gflags ${EIGEN3_LIBRARIES} ${CERES_LIBRARIES} ${catkin_LIBRARIES}) # Only test if it is enabled if (CATKIN_ENABLE_TESTING) @@ -62,4 +105,32 @@ if (CATKIN_ENABLE_TESTING) endif() -install_launch_files() \ No newline at end of file +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) + +# Mark nodelet_plugin for installation +install(FILES nodelet_plugins.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +# Install C++ executables +install(TARGETS visualeyez_tool DESTINATION bin) +install(CODE "execute_process( + COMMAND ln -s ../../bin/visualeyez_tool share/${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + OUTPUT_QUIET + ERROR_QUIET + )") + +# Mark launch files for installation +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + PATTERN ".svn" EXCLUDE) diff --git a/tools/visualeyez/package.xml b/tools/visualeyez/package.xml index bd243490aa..875bc969da 100644 --- a/tools/visualeyez/package.xml +++ b/tools/visualeyez/package.xml @@ -23,6 +23,8 @@ std_srvs tf2 tf2_ros + ff_util + config_reader roscpp nodelet pluginlib @@ -31,6 +33,8 @@ std_srvs tf2 tf2_ros + ff_util + config_reader diff --git a/wdock/CMakeLists.txt b/wdock/CMakeLists.txt index 4e12e8cb9f..baeff9db04 100644 --- a/wdock/CMakeLists.txt +++ b/wdock/CMakeLists.txt @@ -15,42 +15,102 @@ # License for the specific language governing permissions and limitations # under the License. +cmake_minimum_required(VERSION 3.0) project(wdock) -set(DEPS - rapidExtAstrobee +## Compile as C++14, supported in ROS Kinetic and newer +add_compile_options(-std=c++14) + +if (USE_DDS) +## Find catkin macros and libraries +find_package(catkin2 REQUIRED COMPONENTS + nodelet + config_reader + ff_util + ff_msgs + ff_hw_msgs + dds_msgs ) -set(LIBS - Qt4::QtXml - rapidIo - rapidExtAstrobee - ff_common) +# System dependencies are found with CMake's conventions +find_package(Eigen3 REQUIRED) +find_package(Boost 1.54.0 QUIET REQUIRED COMPONENTS filesystem system iostreams thread program_options timer) -set(INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${SORACORE_INCLUDE_DIRS} +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") + +if (USE_CTC) + set(SORACORE_ROOT_DIR ${ARM_CHROOT_DIR}/usr) +else (USE_CTC) + set(SORACORE_ROOT_DIR /usr) +endif (USE_CTC) + +set(MIRO_ROOT_DIR ${SORACORE_ROOT_DIR}) + +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# just calls the normal one +find_package(Qt4 4.6.0 REQUIRED QtXml) +find_package(Miro REQUIRED) +find_package(RtiDds REQUIRED) +find_package(Soracore REQUIRED) + +catkin_package( + LIBRARIES wdock + CATKIN_DEPENDS nodelet config_reader ff_util ff_msgs ff_hw_msgs dds_msgs ) -create_library(TARGET wdock - LIBS ${LIBS} - INC ${INCLUDES} - DEPS ${DEPS} +########### +## Build ## +########### + +# Specify additional locations of header files +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ${RTIDDS_INCLUDE_DIR} + ${SORACORE_INCLUDE_DIRS} + ${MIRO_INCLUDE_DIR} + ${QT_INCLUDE_DIR} + ${QT_INCLUDE_DIR}/Qt + ${Boost_INCLUDE_DIRS} ) -create_tool_targets(DIR tools - LIBS ${LIBS} wdock - INC ${INCLUDES} - DEPS ${DEPS} +# Declare C++ libraries +add_library(wdock + src/wdock.cc ) +target_compile_definitions(wdock PUBLIC ${RTIDDS_DEFINE_FLAGS}) +add_dependencies(wdock ${catkin_EXPORTED_TARGETS}) +target_link_libraries(wdock rapidIo ${Boost_LIBRARIES} ${catkin_LIBRARIES}) -# Determine our module name -get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) +## Declare a C++ executable: wdock_main +add_executable(wdock_main tools/wdock_main.cc) +add_dependencies(wdock_main ${catkin_EXPORTED_TARGETS}) +target_link_libraries(wdock_main + wdock gflags ${catkin_LIBRARIES}) + +############# +## Install ## +############# + +# Mark libraries for installation +install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} +) +# Install C++ executables +install(TARGETS wdock_main DESTINATION bin) install(CODE "execute_process( - COMMAND mkdir -p share/${MODULE_NAME} - COMMAND ln -s ../../bin/dds_ros_bridge share/${MODULE_NAME} + COMMAND ln -s ../../bin/wdock_main share/${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} OUTPUT_QUIET ERROR_QUIET )") +else (USE_DDS) + find_package(catkin REQUIRED COMPONENTS) + catkin_package() +endif (USE_DDS) diff --git a/wdock/include/wdock/wdock.h b/wdock/include/wdock/wdock.h index a9db98318f..0b0e045398 100644 --- a/wdock/include/wdock/wdock.h +++ b/wdock/include/wdock/wdock.h @@ -27,11 +27,11 @@ #include #include -#include "AstrobeeConstants.h" +#include "dds_msgs/AstrobeeConstants.h" #include "ff_common/init.h" -#include "DockStateSupport.h" +#include "dds_msgs/DockStateSupport.h" #include "knDds/DdsEntitiesFactory.h" #include "knDds/DdsEntitiesFactorySvc.h" diff --git a/wdock/package.xml b/wdock/package.xml new file mode 100644 index 0000000000..876acfe2cb --- /dev/null +++ b/wdock/package.xml @@ -0,0 +1,30 @@ + + + wdock + 0.0.0 + + The wdock node. + + + Apache License, Version 2.0 + + + Astrobee Flight Software + + + Astrobee Flight Software + + catkin + nodelet + config_reader + ff_util + ff_msgs + ff_hw_msgs + dds_msgs + nodelet + config_reader + ff_util + ff_msgs + ff_hw_msgs + dds_msgs +