Skip to content
hojonathanho edited this page Sep 13, 2012 · 1 revision

Adding new components

If you want to add a new component--let's call it Tracking for the purposes of this section--that uses the core libraries (simulation, robots, etc), then follow these steps:

  1. In $BULLETSIM_SOURCE_DIR/CMakeLists.txt, go to the section marked Build Options, and add an option for the Tracking component.

     option(BUILD_TRACKING "Build tracking code" on)
    
  2. Append a conditional to the end of $BULLETSIM_SOURCE_DIR/src/CMakeLists.txt

     if (BUILD_TRACKING)
       add_subdirectory(tracking)
     endif (BUILD_TRACKING)
    
  3. Create the directory $BULLETSIM_SOURCE_DIR/src/tracking. Your code will go here.

  4. You also need a $BULLETSIM_SOURCE_DIR/src/tracking/CMakeLists.txt to specify how your code will be built. Here is a rough template:

     include_directories(
       ${BULLETSIM_SOURCE_DIR}/src # this lets you include simulation headers
       # any other include directories
     )
    
     # Your code's targets go here. For example:
     add_library(tracking algorithm_common.cpp config_tracking.cpp .....)
     target_link_libraries(tracking simulation clouds robots)
    
     add_executable(.....)
    
Clone this wiki locally