diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f76d6ed6a8b158bc8acbfb52aa1c62c32a79856..2fc69c758823727a4658be7d2a5e197eae52f8a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,22 +133,22 @@ include_directories( ## Declare a C++ executable ## With catkin_make all packages are built within a single CMake context ## The recommended prefix ensures that target names across packages don't collide -# add_executable(${PROJECT_NAME}_node src/intro_package_node.cpp) +add_executable(${PROJECT_NAME}_intro_package src/intro_package.cpp) ## Rename C++ executable without prefix ## The above recommended prefix causes long target names, the following renames the ## target back to the shorter version for ease of user use ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" -# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") +set_target_properties(${PROJECT_NAME}_intro_package PROPERTIES OUTPUT_NAME intro_package PREFIX "") ## Add cmake target dependencies of the executable ## same as for the library above # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) ## Specify libraries to link a library or executable target against -# target_link_libraries(${PROJECT_NAME}_node -# ${catkin_LIBRARIES} -# ) +target_link_libraries(${PROJECT_NAME}_intro_package + ${catkin_LIBRARIES} +) ############# ## Install ## diff --git a/src/intro_package.cpp b/src/intro_package.cpp new file mode 100644 index 0000000000000000000000000000000000000000..adfd6a4e3f0655f94ddea101f1c6ffbfcdaaccfb --- /dev/null +++ b/src/intro_package.cpp @@ -0,0 +1,10 @@ +#include <ros/ros.h> + +int main(int argc, char** argv) +{ + ros::init(argc, argv, "intro_package_node"); + ros::NodeHandle node_handle("intro_package_ns"); + + ROS_INFO("HELLO WORLD"); +} +