Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[as2_state_estimator] As2 state estimator unify #119

Merged
merged 2 commits into from
Jan 12, 2023
Merged
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
4 changes: 0 additions & 4 deletions .github/workflows/build-galactic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ jobs:
as2_msgs
as2_platform_behaviors
as2_state_estimator
as2_state_estimator_plugin_base
as2_state_estimator_plugin_external_odom
as2_state_estimator_plugin_ground_truth
as2_state_estimator_plugin_mocap
as2_platform_tello
as2_movement_behaviors
as2_trajectory_generator
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-humble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ jobs:
as2_msgs
as2_platform_behaviors
as2_state_estimator
as2_state_estimator_plugin_base
as2_state_estimator_plugin_external_odom
as2_state_estimator_plugin_ground_truth
as2_state_estimator_plugin_mocap
as2_platform_tello
as2_movement_behaviors
as2_trajectory_generator
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/codecov_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ jobs:
as2_msgs
as2_platform_behaviors
as2_state_estimator
as2_state_estimator_plugin_base
as2_state_estimator_plugin_external_odom
as2_state_estimator_plugin_ground_truth
as2_state_estimator_plugin_mocap
as2_platform_tello
as2_movement_behaviors
as2_trajectory_generator
Expand Down
137 changes: 137 additions & 0 deletions as2_state_estimator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
cmake_minimum_required(VERSION 3.5)
set(PROJECT_NAME as2_state_estimator)
project(${PROJECT_NAME} VERSION 0.2.0)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

# set Release as default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# find dependencies
set(PROJECT_DEPENDENCIES
ament_cmake
rclcpp
pluginlib
as2_core
nav_msgs
geometry_msgs
tf2
tf2_ros
)

foreach(DEPENDENCY ${PROJECT_DEPENDENCIES})
find_package(${DEPENDENCY} REQUIRED)
endforeach()

include_directories(
include
include/${PROJECT_NAME}
)

# Plugins
set(PLUGIN_LIST
external_odom
ground_truth
mocap
)

# Create a list of all the plugin files
foreach(PLUGINS ${PLUGIN_LIST})
list(APPEND PLUGINS_CPP_FILES
plugins/${PLUGINS}/src/${PLUGINS}.cpp
)

include_directories(
plugins/${PLUGINS}/include
plugins/${PLUGINS}/include/${PLUGINS}
)
endforeach()

# Library
add_library(${PROJECT_NAME} SHARED ${PLUGINS_CPP_FILES})

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

ament_target_dependencies(${PROJECT_NAME} ${PROJECT_DEPENDENCIES})
pluginlib_export_plugin_description_file(${PROJECT_NAME} plugins.xml)

install(
DIRECTORY include/
DESTINATION include
)

install(
TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

ament_export_include_directories(
include
)
ament_export_libraries(
${PROJECT_NAME}
)
ament_export_targets(
export_${PROJECT_NAME}
)

# Executable
add_executable(${PROJECT_NAME}_node src/state_estimator_node.cpp src/state_estimator.cpp)
target_include_directories(${PROJECT_NAME}_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

ament_target_dependencies(${PROJECT_NAME}_node ${PROJECT_DEPENDENCIES})

install(TARGETS ${PROJECT_NAME}_node
DESTINATION lib/${PROJECT_NAME})

# For each plugin, install config files
foreach(PLUGINS ${PLUGIN_LIST})
if(EXISTS plugins/${PLUGINS}/config)
install(
DIRECTORY plugins/${PLUGINS}/config
DESTINATION share/${PROJECT_NAME}/plugins/${PLUGINS}
)
endif()
endforeach()

install(
DIRECTORY launch
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_cmake_cppcheck REQUIRED)
find_package(ament_cmake_clang_format REQUIRED)
ament_cppcheck(src/ include/ tests/ plugins/)
ament_clang_format(src/ include/ tests/ plugins/ --config ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format)

# Create a list of all the source files to be tested
# from /plugins/plugin_name/tests/plugin_test.cpp if file exists
foreach(PLUGINS ${PLUGIN_LIST})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/plugins/${PLUGINS}/tests/${PLUGINS}_test.cpp)
list(APPEND TEST_SOURCE_CPP_FILES
plugins/${PLUGINS}/tests/${PLUGINS}_test.cpp
)
endif()
endforeach()

if(TEST_SOURCE_CPP_FILES)
ament_add_gtest(${PROJECT_NAME}_test ${TEST_SOURCE_CPP_FILES})
ament_target_dependencies(${PROJECT_NAME}_test ${PROJECT_DEPENDENCIES})
endif()
endif()

ament_package()
3 changes: 3 additions & 0 deletions as2_state_estimator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# as2_state_estimator

AS2 State Estimator
9 changes: 0 additions & 9 deletions as2_state_estimator/as2_state_estimator/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions as2_state_estimator/as2_state_estimator/CHANGELOG.rst

This file was deleted.

61 changes: 0 additions & 61 deletions as2_state_estimator/as2_state_estimator/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions as2_state_estimator/as2_state_estimator/README.md

This file was deleted.

40 changes: 0 additions & 40 deletions as2_state_estimator/as2_state_estimator/src/state_estimator.cpp

This file was deleted.

This file was deleted.

Loading