Create your own RoboKudo package

RoboKudo offers methods to separate your own perception routines, analysis engines and much more into separate ROS packages. Let us start by creating a package calledrk_tutorial. Make sure you are in the source folder of a catkin workspace and run:

rosrun robokudo rk_create_package rk_tutorial

The script will create a new ROS package that has the structure needed for RoboKudo:

   'rk_tutorial'
    |-src                       -> code and configuration base
       |-rk_tutorial            -> name of your package
          |-annotators
          |-descriptors
             |-analysis_engines -> Pipeline/Analysis Engine definitions (Behaviour Trees)
    |-package.xml               -> catkin package xml
    |-setup.py                  -> python install information
    |-CMakeLists.txt            -> CMake file

You can now add your own annotators and analysis engines(also called pipelines) that can use any component defined in the RoboKudo core package. If you want rk_tutorial to depend on other RoboKudo packages add them to the package.xml and CmakeLists.txt.

To verify your new package, let us create your very first own analysis engine. Please go to the src folder of your ROS workspace where RoboKudo is located. Then go to robokudo/robokudo/src/robokudo/descriptors/analysis_engines/demo.py and copy that file to your newly created package into rk_tutorial/src/rk_tutorial/descriptors/analysis_engines/my_demo.py (please note the renaming). Open the file and adapt in the name method the return value to ‘mydemo’ instead of ‘demo’. Please now make sure to catkin build your workspace and source your setup files. Otherwise the new package might not be found.

After that, you can start your own analysis engine by executing:

rosrun robokudo main.py _ae=my_demo _ros_pkg=rk_tutorial

It should show the same result as in the previous tutorial.