Skip to content

Commit

Permalink
Refactor package.xml and CMakeLits.txt for all pakcages to satisfy ca…
Browse files Browse the repository at this point in the history
…tkinlint
  • Loading branch information
tongtybj committed Jun 9, 2022
1 parent 3a44850 commit f2822a3
Show file tree
Hide file tree
Showing 22 changed files with 259 additions and 293 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/catkin_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
name: catkin_lint

steps:
- name: Setup OS
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
- name: Setup Git
run: |
sudo apt-get install -y git
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: catkin lint setup
run: |
sudo apt-get install -y -q python3-pip
sudo pip3 install catkin_lint rosdep
sudo rosdep init
rosdep update
- name: catkin lint test
run: |
ROS_DISTRO=noetic catkin_lint --resolve-env --strict $PWD
2 changes: 1 addition & 1 deletion aerial_robot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(aerial_robot)
find_package(catkin REQUIRED)
catkin_metapackage()
6 changes: 3 additions & 3 deletions aerial_robot/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<exec_depend>aerial_robot_control</exec_depend>
<exec_depend>aerial_robot_model</exec_depend>
<exec_depend>aerial_robot_msgs</exec_depend>
<exec_depend>motor_test</exec_depend>
<exec_depend>spinal</exec_depend>
<exec_depend>aerial_robot_simulation</exec_depend>
<exec_depend>dragon</exec_depend>
<exec_depend>hydrus</exec_depend>
<exec_depend>hydrus_xi</exec_depend>
<exec_depend>dragon</exec_depend>
<exec_depend>motor_test</exec_depend>
<exec_depend>spinal</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python-is-python3</exec_depend>

<export>
Expand Down
27 changes: 25 additions & 2 deletions aerial_robot_base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(aerial_robot_base)


Expand All @@ -14,11 +14,12 @@ find_package(catkin REQUIRED COMPONENTS

catkin_python_setup()

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_compile_options(-std=c++14)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS aerial_robot_control aerial_robot_estimation aerial_robot_model roscpp rospy
)

include_directories(
Expand All @@ -31,3 +32,25 @@ target_link_libraries (aerial_robot_base ${catkin_LIBRARIES})

add_executable(aerial_robot_base_node src/aerial_robot_base_node.cpp)
target_link_libraries (aerial_robot_base_node ${catkin_LIBRARIES} aerial_robot_base)


install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(TARGETS aerial_robot_base
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(TARGETS aerial_robot_base_node
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY bin
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
USE_SOURCE_PERMISSIONS
)

install(DIRECTORY launch scripts
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)
2 changes: 2 additions & 0 deletions aerial_robot_base/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>rostest</run_depend>
<run_depend>ublox_gps</run_depend>
<run_depend>ntrip_ros</run_depend>

</package>
16 changes: 14 additions & 2 deletions aerial_robot_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(aerial_robot_control)

add_compile_options(-std=c++11)
Expand Down Expand Up @@ -38,7 +38,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
catkin_package(
INCLUDE_DIRS include
LIBRARIES control_utils flight_control_pluginlib flight_navigation
CATKIN_DEPENDS aerial_robot_estimation aerial_robot_model aerial_robot_msgs roscpp spinal
CATKIN_DEPENDS aerial_robot_estimation aerial_robot_model aerial_robot_msgs dynamic_reconfigure pluginlib roscpp spinal tf
DEPENDS EIGEN3
)

Expand Down Expand Up @@ -66,3 +66,15 @@ add_dependencies(flight_control_pluginlib ${PROJECT_NAME}_gencfg)
### flight navigation
add_library (flight_navigation src/flight_navigation.cpp)
target_link_libraries (flight_navigation ${catkin_LIBRARIES})

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(TARGETS control_utils flight_control_pluginlib flight_navigation
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(DIRECTORY scripts plugins
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)
25 changes: 17 additions & 8 deletions aerial_robot_estimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(aerial_robot_estimation)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_compile_options(-std=c++14)

find_package(catkin REQUIRED COMPONENTS
aerial_robot_model
Expand All @@ -14,11 +14,9 @@ find_package(catkin REQUIRED COMPONENTS
kalman_filter
nav_msgs
nodelet
roscpp
rospy
pluginlib
sensor_msgs
spinal
std_msgs
tf
tf_conversions
jsk_recognition_msgs
Expand All @@ -33,7 +31,7 @@ generate_dynamic_reconfigure_options(
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} sensor_pluginlib
CATKIN_DEPENDS geodesy kalman_filter nodelet spinal tf tf_conversions
CATKIN_DEPENDS aerial_robot_model aerial_robot_msgs cv_bridge dynamic_reconfigure geodesy geographic_msgs geometry_msgs kalman_filter nav_msgs nodelet pluginlib sensor_msgs spinal tf tf_conversions jsk_recognition_msgs
)

include_directories(
Expand All @@ -43,7 +41,7 @@ include_directories(

### state estimation
add_library(aerial_robot_estimation
src/state_estimation)
src/state_estimation.cpp)
target_link_libraries(aerial_robot_estimation ${catkin_LIBRARIES})

### sensor plugins
Expand All @@ -66,11 +64,22 @@ target_link_libraries(kf_baro_bias_pluginlib ${catkin_LIBRARIES})
add_dependencies(kf_baro_bias_pluginlib ${PROJECT_NAME}_gencfg)

set(USE_GPU OFF)
set(CMAKE_BUILD_TYPE Release)

if(USE_GPU)
add_definitions(-DUSE_GPU)
endif()

add_library(optical_flow src/vision/optical_flow.cpp)
target_link_libraries(optical_flow ${catkin_LIBRARIES})

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(TARGETS aerial_robot_estimation sensor_pluginlib kf_baro_bias_pluginlib optical_flow
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(DIRECTORY launch plugins config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)
6 changes: 0 additions & 6 deletions aerial_robot_estimation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
<build_depend>nav_msgs</build_depend>
<build_depend>nodelet</build_depend>
<build_depend>pluginlib</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>spinal</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>tf_conversions</build_depend>
<build_depend>jsk_recognition_msgs</build_depend>
Expand All @@ -41,11 +38,8 @@
<run_depend>nav_msgs</run_depend>
<run_depend>nodelet</run_depend>
<run_depend>pluginlib</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>spinal</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>std_srvs</run_depend>
<run_depend>tf</run_depend>
<run_depend>tf_conversions</run_depend>
Expand Down
28 changes: 20 additions & 8 deletions aerial_robot_model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(aerial_robot_model)

add_compile_options(-std=c++14)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
Expand All @@ -12,7 +14,6 @@ find_package(catkin REQUIRED COMPONENTS
kdl_parser
message_generation
pluginlib
roscpp
sensor_msgs
spinal
std_msgs
Expand All @@ -32,9 +33,6 @@ find_package(urdfdom_headers REQUIRED)
find_package(Eigen3 REQUIRED)

include_directories(${orocos_kdl_INCLUDE_DIRS} ${urdfdom_headers_INCLUDE_DIRS})
link_directories(${orocos_kdl_LIBRARY_DIRS})

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
Expand All @@ -55,7 +53,8 @@ generate_messages(
catkin_package(
INCLUDE_DIRS include test
LIBRARIES transformable_aerial_robot_model transformable_aerial_robot_model_ros numerical_jacobians
CATKIN_DEPENDS eigen_conversions interactive_markers spinal tf tf_conversions
CATKIN_DEPENDS eigen_conversions geometry_msgs interactive_markers kalman_filter kdl_parser message_runtime pluginlib sensor_msgs spinal std_msgs tf tf_conversions tf2_eigen tf2_geometry_msgs tf2_kdl tf2_ros tf_conversions urdf visualization_msgs
DEPENDS Eigen3 orocos_kdl urdfdom_headers
)

###########
Expand Down Expand Up @@ -102,5 +101,18 @@ add_library(numerical_jacobians test/aerial_robot_model/numerical_jacobians.cpp)
target_link_libraries(numerical_jacobians transformable_aerial_robot_model ${catkin_LIBRARIES})


install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY include/${PROJECT_NAME}/ test/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(TARGETS transformable_aerial_robot_model transformable_aerial_robot_model_ros servo_bridge numerical_jacobians
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(TARGETS rotor_tf_publisher interactive_marker_tf_broadcaster servo_bridge_node
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY launch script
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)
3 changes: 1 addition & 2 deletions aerial_robot_model/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<build_depend>liburdfdom-headers-dev</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>pluginlib</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>spinal</build_depend>
<build_depend>std_msgs</build_depend>
Expand All @@ -42,7 +41,7 @@
<run_depend>message_runtime</run_depend>
<run_depend>pluginlib</run_depend>
<run_depend>robot_state_publisher</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rviz</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>spinal</run_depend>
<run_depend>std_msgs</run_depend>
Expand Down
12 changes: 8 additions & 4 deletions aerial_robot_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(aerial_robot_msgs)

## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs geometry_msgs message_generation)
find_package(catkin REQUIRED COMPONENTS
std_msgs
geometry_msgs
message_generation
)

## Declare ROS messages and services
add_message_files(FILES
Expand All @@ -19,11 +23,11 @@ add_message_files(FILES
)

## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs std_msgs geometry_msgs)
generate_messages(DEPENDENCIES std_msgs geometry_msgs)

## Declare a catkin package
catkin_package(
CATKIN_DEPENDS message_runtime
CATKIN_DEPENDS std_msgs geometry_msgs message_runtime
)


Expand Down
4 changes: 0 additions & 4 deletions aerial_robot_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@

<buildtool_depend>catkin</buildtool_depend>

<build_depend>roscpp</build_depend>
<!-- <build_depend>rospy</build_depend> -->
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>message_generation</build_depend>

<run_depend>roscpp</run_depend>
<!-- <run_depend>rospy</run_depend> -->
<run_depend>std_msgs</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>message_runtime</run_depend>
Expand Down
Loading

0 comments on commit f2822a3

Please sign in to comment.