In order to generate wrapper code for ROS functionality such as publishing and subscription, add the following line to your CMakeLists.txt:

rosbuild_gen_cs_msg()

This command, similar to rosbuild_genmsg() will generate and compile all neccessary code. The major difference to rosbuild_genmsg() is that code for all messages that occur in packages your package depends on will be generated and built. In other words, all messages stemming from the complete dependency graph, starting from your package will be wrapped.

If you want to use service or define services, additionally call

rosbuild_gensrv()from within the CMakeLists.txt

Using the wrapped API

Your targets will automatically be linked against the generated message libraries. The root namespace for all generated code is RosCS and each package defines its own sub-namespace, i.e., RosCS.std_msgs.

Known Issues and Limitations

Due to the fact that all messages that a package can possibly use given its dependency graph are wrapped, compilation takes a rather long time. In the future, this will probably be eliviated using proxy packages for non-c# packages.

There is a rare race-condition in the build chain, when multiple packages depend on the same package are built at the same time. If this happens, recompile or recompile with only one thread. Proxy packages as above will fix this issue.