|
|
|
#+TITLE: Memo on catkin tools and vcs for the SoT
|
|
|
|
|
|
|
|
* Introduction
|
|
|
|
This memo explains how to handle super build (set of packages) with catkin tools.
|
|
|
|
catkin tools should not confused with catkin_make. They can be installed independently from ROS.
|
|
|
|
|
|
|
|
|
|
|
|
* Handling the repositories (VCS)
|
|
|
|
|
|
|
|
** Checking out the SoT infra-structure
|
|
|
|
|
|
|
|
The set of repositories can be handled using the vcs software
|
|
|
|
[https://github.com/dirk-thomas/vcstool]
|
|
|
|
|
|
|
|
The repositories for the SoT can be specified in a file sot_talos.repos as follows:
|
|
|
|
#+begin_src yaml
|
|
|
|
repositories:
|
|
|
|
others/robotpkg_helpers:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/olivier-stasse/robotpkg_helpers.git
|
|
|
|
version: master
|
|
|
|
src/dynamic-graph:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/dynamic-graph.git
|
|
|
|
version: cmake-export
|
|
|
|
src/dynamic-graph-python:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/dynamic-graph-python.git
|
|
|
|
version: cmake-export
|
|
|
|
src/dynamic_graph_bridge:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/dynamic_graph_bridge.git
|
|
|
|
version: cmake-export
|
|
|
|
src/dynamic_graph_bridge_msgs:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/dynamic_graph_bridge_msgs.git
|
|
|
|
version: master
|
|
|
|
src/jrl-walkgen:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/jrl-walkgen.git
|
|
|
|
version: cmake-export
|
|
|
|
src/roscontrol_sot:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/roscontrol_sot.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-core:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/sot-core.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-dynamic-pinocchio:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/sot-dynamic-pinocchio.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-pattern-generator:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/sot-pattern-generator.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-talos:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/sot-talos.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-talos-balance:
|
|
|
|
type: git
|
|
|
|
url: git@gepgitlab.laas.fr:loco-3d/sot-talos-balance.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-tools:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/sot-tools.git
|
|
|
|
version: cmake-export
|
|
|
|
src/sot-torque-control:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/sot-torque-control.git
|
|
|
|
version: cmake-export
|
|
|
|
src/talos_data:
|
|
|
|
type: git
|
|
|
|
url: git@github.com:stack-of-tasks/talos_data.git
|
|
|
|
version: cmake-export
|
|
|
|
src/talos_metapkg_ros_control_sot:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/stack-of-tasks/talos_metapkg_roscontrol_sot.git
|
|
|
|
version: pal
|
|
|
|
src/tsid:
|
|
|
|
type: git
|
|
|
|
url: https://github.com/olivier-stasse/tsid.git
|
|
|
|
version: cmake-export
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src bash
|
|
|
|
vcs import < sot_talos.repos
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
You can create your own file by going in the src directory of your workspace, and then type:
|
|
|
|
#+begin_src bash
|
|
|
|
vcs export --repos > sot_talos.repos
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Getting the current status of the repos
|
|
|
|
In the src directory of the workspace
|
|
|
|
#+begin_src bash
|
|
|
|
vcs status -quiet
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
* Compiling and testing the packages
|
|
|
|
** Setting the cmake args
|
|
|
|
For instance we want to force the system to be in debug mode
|
|
|
|
and to set some variables we can use the following command:
|
|
|
|
#+begin_src bash
|
|
|
|
catkin config --install --cmake-args -DCMAKE_BUILD_TYPE=DEBUG
|
|
|
|
#+end_src
|
|
|
|
It forces the package to be installed in the install folder,
|
|
|
|
and forces all the CMake aware packages to be compiled in DEBUG mode.
|
|
|
|
|
|
|
|
A more involved example is the following:
|
|
|
|
|
|
|
|
#+begin_src bash
|
|
|
|
local_cmake_args="--cmake-args -DCMAKE_BUILD_TYPE=DEBUG "
|
|
|
|
local_cmake_args="${local_cmake_args} -DPYTHON_STANDARD_LAYOUT:BOOL=ON"
|
|
|
|
local_cmake_args="${local_cmake_args} -DPYTHON_DEB_LAYOUT:BOOL=OFF"
|
|
|
|
local_cmake_args="${local_cmake_args} -DSETUPTOOLS_DEB_LAYOUT:BOOL=OFF"
|
|
|
|
catkin_config_args="--install -w $HOME/devel-src/sot_bionic_ws"
|
|
|
|
catkin_config_args="${catking_config_args} ${local_cmake_args}"
|
|
|
|
catkin config ${catkin_config_args} --
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Compiling
|
|
|
|
*** Compiling everything
|
|
|
|
#+begin_src
|
|
|
|
catkin build
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
*** Compiling a specific package with its dependencies
|
|
|
|
For instance the following command is compiling the dynamic-graph-python
|
|
|
|
package:
|
|
|
|
#+begin_src
|
|
|
|
catkin build dynamic-graph-python
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Clean all the build part
|
|
|
|
#+begin_src bash
|
|
|
|
catkin clean
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Running tests
|
|
|
|
Example running the test programs of the package dynamic-graph-python in the workspace root directory:
|
|
|
|
#+begin_src bash
|
|
|
|
catkin test dynamic-graph-python
|
|
|
|
#+end_src
|
|
|
|
Note: make sure that the install directory is specified in the environment variables: LD_LIBRARY_PATH, PYTHONPATH for instance.
|
|
|
|
|
|
|
|
** Computing coverage
|
|
|
|
|
|
|
|
You need to add to the CXX_FLAGS and the LD_FLAGS the value --coverage:
|
|
|
|
|
|
|
|
#+begin_src bash
|
|
|
|
catkin config --append --cmake-args -DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_LD_FLAGS="--coverage"
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
Then run the test:
|
|
|
|
#+begin_src bash
|
|
|
|
catkin test dynamic-graph-python
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
And in the workspace root directory you need to run:
|
|
|
|
#+begin_src bash
|
|
|
|
gcovr -r .
|
|
|
|
#+end_src |
|
|
|
\ No newline at end of file |