2015년 8월 12일 수요일

Ros 나만의 정리(2)

Ros package 만들어보기
  1. manifest 파일 만들기
recommended format      
<package format="2">  
<name>foo_core</name> 
<version>1.2.4</version> 
<description> This package provides foo capability. </description> 
<maintainer email="ivana@osrf.org">Ivana Bildbotz</maintainer> <license>BSD</license> 
</package>

여러개의 패키지를 하나로 묶는 태그
<export> <metapackage /> </export>

2. CMakeList.txt 만들기
  structure
   1.version => cmake_minimum_required(VERSION 2.8.3)
   2. package name => project(robot_brain)
   3. 필요한 패키지 => find_package(catkin REQUIRED)
   4. catkin_package(
               INCLUDE_DIRS include
                 => The exported include paths (i.e. cflags) for the package
               LIBRARIES ${PROJECT_NAME}
                 => The exported libraries from the project 
               CATKIN_DEPENDS roscpp nodelet
                 => Other catkin projects that this project depends on
                DEPENDS eigen opencv)
                 => Non-catkin CMake projects that this project depends on
     5. set_target_properties(
               rviz_image_view
               PROPERTIES OUTPUT_NAME image_view
               PREFIX "")
     6. path
include_directories(include ${Boost_INCLUDE_DIRS}${catkin_INCLUDE_DIRS})
link_directories(~/my_libs)
     7. executable target을 정해준다.
add_executable(myProgram src/main.cpp src/some_file.cpp src/another_file.cpp)

     8.
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS})
     9.
 target_link_libraries(<executableTargetName>, <lib1>, <lib2>, ... <libN>)
 
 System dependency 관리
Ros package가 운영체제에 있는 라이브러리를 쓰고자 할 때 System Dependency를 추가해줘야한다.
How? rosdep install package

댓글 없음:

댓글 쓰기