Skip to content

Instantly share code, notes, and snippets.

@lucbettaieb
Created September 22, 2015 16:04
Show Gist options
  • Save lucbettaieb/7ebe239dd8ad8256d7be to your computer and use it in GitHub Desktop.
Save lucbettaieb/7ebe239dd8ad8256d7be to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 2.8.3)
# Here is what your project (package) is called. Should be the same as your package.xml package name.
project(<PACKAGE NAME>)
## This is where you put all of the dependencies for the package.
## When using catkin_create_pkg, this is one of the places where
## the dependencies are auto-placed. If you need to add more later
## on, you need to put them in manually.
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
)
## Tell catkin about your services here so it will properly generate
## the required header files
add_service_files(
FILES
<YOUR_SERVICE_HERE>.srv
)
## Message / service dependencies go here! Ie, if you have a
## geometry_msgs/Twist in your message / service, you should
## put 'geometry_msgs' here.
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package()
include_directories(
${catkin_INCLUDE_DIRS}
)
## This stuff tells catkin to compile your node!
add_executable(<NAME OF THE NODE HERE> src/<NAME OF THE CPP FILE>.cpp)
target_link_libraries(<NAME OF THE NODE HERE>
${catkin_LIBRARIES}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment