Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ ament_export_dependencies(
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)

if(BUILD_TESTING)
add_test(NAME test_public_headers
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_public_headers.cmake
)

find_package(ament_cmake_gtest REQUIRED)

ament_add_gtest(test_torque_rate_saturation
Expand Down
2 changes: 0 additions & 2 deletions include/crisp_controllers/utils/friction_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Based in
// https://github.com/marcocognetti/FrankaEmikaPandaDynModel/tree/master

#include <Eigen/src/Core/GlobalFunctions.h>
#include <Eigen/src/Core/Matrix.h>
#include <Eigen/Core>

inline Eigen::VectorXd get_friction(
Expand Down
2 changes: 1 addition & 1 deletion src/cartesian_admittance_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <cmath>
#include <cstddef>

#include <Eigen/src/Core/Matrix.h> // NOLINT(build/include_order)
#include <Eigen/Core>
#include <fmt/format.h>
#include <controller_interface/controller_interface_base.hpp>
#include <rclcpp/logging.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/cartesian_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <cmath>
#include <cstddef>

#include <Eigen/src/Core/Matrix.h> // NOLINT(build/include_order)
#include <Eigen/Core>
#include <fmt/format.h>
#include <controller_interface/controller_interface_base.hpp>
#include <rclcpp/logging.hpp>
Expand Down
3 changes: 1 addition & 2 deletions src/pose_broadcaster.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include <binders.h>
#include <cassert>
#include <cmath>
#include <memory>

#include <Eigen/src/Core/Matrix.h> // NOLINT(build/include_order)
#include <Eigen/Geometry>
#include <crisp_controllers/pose_broadcaster.hpp>
#include "crisp_controllers/utils/ros2_version.hpp"

Expand Down
3 changes: 1 addition & 2 deletions src/twist_broadcaster.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include <binders.h>
#include <cassert>
#include <cmath>
#include <memory>

#include <Eigen/src/Core/Matrix.h> // NOLINT(build/include_order)
#include <Eigen/Core>
#include <crisp_controllers/twist_broadcaster.hpp>
#include "crisp_controllers/utils/ros2_version.hpp"

Expand Down
14 changes: 14 additions & 0 deletions tests/check_public_headers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Production headers must not depend on Eigen or libstdc++ implementation headers.
file(GLOB_RECURSE production_sources
"${SOURCE_DIR}/src/*.cpp"
"${SOURCE_DIR}/include/*.hpp"
"${SOURCE_DIR}/include/*.h"
)
foreach(source IN LISTS production_sources)
file(STRINGS "${source}" includes REGEX "^[ \t]*#[ \t]*include")
foreach(include IN LISTS includes)
if(include MATCHES "[<\"](Eigen/src/|binders[.]h[>\"]|backward/|bits/)")
message(FATAL_ERROR "Private implementation header in ${source}: ${include}")
endif()
endforeach()
endforeach()