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

Fix CMakeLists + package.xmls #548

Merged
merged 3 commits into from
Jul 31, 2017
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
7 changes: 5 additions & 2 deletions amcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ project(amcl)

find_package(catkin REQUIRED
COMPONENTS
message_filters
rosbag
roscpp
std_srvs
tf
dynamic_reconfigure
nav_msgs
Expand All @@ -23,11 +25,12 @@ catkin_package(
roscpp
dynamic_reconfigure
tf
CATKIN_DEPENDS nav_msgs std_srvs
INCLUDE_DIRS include
LIBRARIES amcl_sensors amcl_map amcl_pf
)

include_directories(include/amcl include/amcl/map include/amcl/sensors include/amcl/pf)
include_directories(include)
include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

add_library(amcl_pf
Expand All @@ -54,7 +57,7 @@ target_link_libraries(amcl_sensors amcl_map amcl_pf)

add_executable(amcl
src/amcl_node.cpp)
add_dependencies(amcl amcl_gencfg)
add_dependencies(amcl ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(amcl
amcl_sensors amcl_map amcl_pf
Expand Down
3 changes: 2 additions & 1 deletion amcl/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<build_depend>message_filters</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rostest</build_depend>
<build_depend>std_srvs</build_depend>
<build_depend>tf</build_depend>

Expand All @@ -36,6 +35,8 @@
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>tf</run_depend>
<run_depend>nav_msgs</run_depend>
<run_depend>std_srvs</run_depend>

<test_depend>rostest</test_depend>
<test_depend>map_server</test_depend>
</package>
2 changes: 1 addition & 1 deletion amcl/src/amcl/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <string.h>
#include <stdio.h>

#include "map.h"
#include "amcl/map/map.h"


// Create a new map
Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/map/map_cspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "map.h"
#include "amcl/map/map.h"

class CellData
{
Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/map/map_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <string.h>

#include <rtk.h>
#include "map.h"
#include "amcl/map/map.h"


////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/map/map_range.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <string.h>
#include <stdlib.h>

#include "map.h"
#include "amcl/map/map.h"

// Extract a single range reading from the map. Unknown cells and/or
// out-of-bound cells are treated as occupied, which makes it easy to
Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/map/map_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <stdlib.h>
#include <string.h>

#include "map.h"
#include "amcl/map/map.h"


////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions amcl/src/amcl/pf/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <stdlib.h>
#include <time.h>

#include "pf.h"
#include "pf_pdf.h"
#include "pf_kdtree.h"
#include "amcl/pf/pf.h"
#include "amcl/pf/pf_pdf.h"
#include "amcl/pf/pf_kdtree.h"


// Compute the required number of samples, given that there are k bins
Expand Down
4 changes: 2 additions & 2 deletions amcl/src/amcl/pf/pf_kdtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <string.h>


#include "pf_vector.h"
#include "pf_kdtree.h"
#include "amcl/pf/pf_vector.h"
#include "amcl/pf/pf_kdtree.h"


// Compare keys to see if they are equal
Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/pf/pf_pdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//#include <gsl/gsl_rng.h>
//#include <gsl/gsl_randist.h>

#include "pf_pdf.h"
#include "amcl/pf/pf_pdf.h"

// Random number generator seed value
static unsigned int pf_pdf_seed;
Expand Down
4 changes: 2 additions & 2 deletions amcl/src/amcl/pf/pf_vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
//#include <gsl/gsl_eigen.h>
//#include <gsl/gsl_linalg.h>

#include "pf_vector.h"
#include "eig3.h"
#include "amcl/pf/pf_vector.h"
#include "amcl/pf/eig3.h"


// Return a zero vector
Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/sensors/amcl_laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <assert.h>
#include <unistd.h>

#include "amcl_laser.h"
#include "amcl/sensors/amcl_laser.h"

using namespace amcl;

Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/sensors/amcl_odom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <sys/types.h> // required by Darwin
#include <math.h>

#include "amcl_odom.h"
#include "amcl/sensors/amcl_odom.h"

using namespace amcl;

Expand Down
2 changes: 1 addition & 1 deletion amcl/src/amcl/sensors/amcl_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
///////////////////////////////////////////////////////////////////////////


#include "amcl_sensor.h"
#include "amcl/sensors/amcl_sensor.h"

using namespace amcl;

Expand Down
8 changes: 4 additions & 4 deletions amcl/src/amcl_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
// Signal handling
#include <signal.h>

#include "map/map.h"
#include "pf/pf.h"
#include "sensors/amcl_odom.h"
#include "sensors/amcl_laser.h"
#include "amcl/map/map.h"
#include "amcl/pf/pf.h"
#include "amcl/sensors/amcl_odom.h"
#include "amcl/sensors/amcl_laser.h"

#include "ros/assert.h"

Expand Down
34 changes: 22 additions & 12 deletions base_local_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ project(base_local_planner)

find_package(catkin REQUIRED
COMPONENTS
angles
cmake_modules
roscpp
tf
message_generation
costmap_2d
dynamic_reconfigure
geometry_msgs
message_generation
nav_core
nav_msgs
pcl_conversions
costmap_2d
pcl_ros
pluginlib
angles
roscpp
rospy
std_msgs
tf
voxel_grid
)

find_package(Boost REQUIRED
Expand Down Expand Up @@ -55,14 +61,17 @@ catkin_package(
base_local_planner
trajectory_planner_ros
CATKIN_DEPENDS
roscpp
dynamic_reconfigure
message_generation
tf
pluginlib
angles
costmap_2d
dynamic_reconfigure
geometry_msgs
message_runtime
nav_core
angles
nav_msgs
pluginlib
roscpp
std_msgs
tf
)

#uncomment for profiling
Expand Down Expand Up @@ -103,11 +112,12 @@ target_link_libraries(base_local_planner
add_library(trajectory_planner_ros
src/trajectory_planner.cpp
src/trajectory_planner_ros.cpp)
add_dependencies(trajectory_planner_ros nav_msgs_gencpp)
add_dependencies(trajectory_planner_ros ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(trajectory_planner_ros
base_local_planner)

add_executable(point_grid src/point_grid.cpp)
add_dependencies(point_grid ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(point_grid ${catkin_LIBRARIES})

install(TARGETS
Expand Down
8 changes: 3 additions & 5 deletions base_local_planner/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
<build_depend>cmake_modules</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>rosconsole</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>tf</build_depend>
<build_depend>rospy</build_depend>
<build_depend>pluginlib</build_depend>
<build_depend>costmap_2d</build_depend>
<build_depend>voxel_grid</build_depend>
<build_depend>angles</build_depend>
<build_depend>visualization_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>nav_core</build_depend>
<build_depend>pcl_conversions</build_depend>
Expand All @@ -38,21 +36,21 @@

<run_depend>std_msgs</run_depend>
<run_depend>nav_msgs</run_depend>
<run_depend>rosconsole</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>tf</run_depend>
<run_depend>rospy</run_depend>
<run_depend>pluginlib</run_depend>
<run_depend>costmap_2d</run_depend>
<run_depend>voxel_grid</run_depend>
<run_depend>angles</run_depend>
<run_depend>visualization_msgs</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>nav_core</run_depend>
<run_depend>pcl_ros</run_depend>
<run_depend>eigen</run_depend>
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>message_generation</run_depend>
<run_depend>message_runtime</run_depend>

<test_depend>rosunit</test_depend>

<export>
<nav_core plugin="${prefix}/blp_plugin.xml" />
Expand Down
1 change: 1 addition & 0 deletions carrot_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ catkin_package(
)

add_library(carrot_planner src/carrot_planner.cpp)
add_dependencies(carrot_planner ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(carrot_planner
${catkin_LIBRARIES}
)
Expand Down
4 changes: 1 addition & 3 deletions clear_costmap_recovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ catkin_package(
)

add_library(clear_costmap_recovery src/clear_costmap_recovery.cpp)
add_dependencies(clear_costmap_recovery ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(clear_costmap_recovery ${catkin_LIBRARIES})


Expand All @@ -44,9 +45,6 @@ if(CATKIN_ENABLE_TESTING)
# Add the test folder to the include directories
include_directories(test)

include_directories(${GTEST_INCLUDE_DIRS})
link_directories(${GTEST_LIBRARY_DIRS})

# Create targets for test executables
add_rostest_gtest(clear_tester test/clear_tests.launch test/clear_tester.cpp)
add_dependencies(tests clear_tester ${catkin_LIBRARIES})
Expand Down
2 changes: 2 additions & 0 deletions clear_costmap_recovery/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<run_depend>pluginlib</run_depend>
<run_depend>eigen</run_depend>

<test_depend>rostest</test_depend>

<export>
<nav_core plugin="${prefix}/ccr_plugin.xml" />
</export>
Expand Down
18 changes: 7 additions & 11 deletions costmap_2d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ find_package(catkin REQUIRED
sensor_msgs
std_msgs
tf
visualization_msgs
voxel_grid
)

Expand Down Expand Up @@ -60,8 +61,6 @@ generate_dynamic_reconfigure_options(
catkin_package(
INCLUDE_DIRS
include
${EIGEN_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
LIBRARIES costmap_2d layers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there already is a catkin_package(DEPENDS PCL Eigen). This means that PCL + Eigen are already added as dependencies for any project that depends on costmap_2d, and it's Eigen's (resp. PCL's) job to export their own include dirs. The catkin_package(INCLUDE_DIRS) should only export our own include dirs.

Removing these two lines makes the following catkin_lint error go away:

costmap_2d: CMakeLists.txt(61): error: catkin_package() exports non-package include path
     * You listed one or more include paths in the INCLUDE_DIRS stanza
     * of your catkin_package() call which are not part of your
     * package. If you want to export include paths of other modules,
     * use find_package(), find_path(), and/or find_library() and add
     * the dependency to the DEPENDS stanza.

CATKIN_DEPENDS
dynamic_reconfigure
Expand All @@ -77,6 +76,7 @@ catkin_package(
sensor_msgs
std_msgs
tf
visualization_msgs
voxel_grid
DEPENDS
PCL
Expand All @@ -96,7 +96,7 @@ add_library(costmap_2d
src/footprint.cpp
src/costmap_layer.cpp
)
add_dependencies(costmap_2d geometry_msgs_gencpp)
add_dependencies(costmap_2d ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(costmap_2d
${PCL_LIBRARIES}
${Boost_LIBRARIES}
Expand All @@ -110,27 +110,26 @@ add_library(layers
plugins/voxel_layer.cpp
src/observation_buffer.cpp
)
add_dependencies(layers ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(layers
costmap_2d
)

add_dependencies(costmap_2d costmap_2d_gencfg)
add_dependencies(layers costmap_2d_gencfg)
add_dependencies(costmap_2d costmap_2d_gencpp)

add_executable(costmap_2d_markers src/costmap_2d_markers.cpp)
add_dependencies(costmap_2d_markers visualization_msgs_gencpp)
add_dependencies(costmap_2d_markers ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(costmap_2d_markers
costmap_2d
)

add_executable(costmap_2d_cloud src/costmap_2d_cloud.cpp)
add_dependencies(costmap_2d_cloud sensor_msgs_gencpp)
add_dependencies(costmap_2d_cloud ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(costmap_2d_cloud
costmap_2d
)

add_executable(costmap_2d_node src/costmap_2d_node.cpp)
add_dependencies(costmap_2d_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(costmap_2d_node
costmap_2d
)
Expand All @@ -143,9 +142,6 @@ if(CATKIN_ENABLE_TESTING)
# Add the test folder to the include directories
include_directories(test)

include_directories(${GTEST_INCLUDE_DIRS})
link_directories(${GTEST_LIBRARY_DIRS})

# Create targets for test executables
add_executable(costmap_tester EXCLUDE_FROM_ALL test/costmap_tester.cpp)
add_dependencies(tests costmap_tester)
Expand Down
Loading