The goal here is to generate headers and modules for your custom messages. These, with the sdk, will allow you to use ros comms to its full extent as your inter-process and network communications transport. Note this procedure is only neccesary if you use Msvc, if you build the catkin way you can build your messages as used from catkin on linux.
- Make sure you install Windows Headers and Libraries, Tools and Visual C++ Compilers. To choose Visual C++ Compilers, .NET Framework 4(or over) SDK or runtime should be installed first.
MSysGit 1.7.9 - select 'Run git and unix tools from windows command prompt'
Install Official Packages
> cd C:\work > winros_init_workspace ws > cd C:\work\ws > setup.bat > winros_init_build > cd src > wstool merge https://raw.github.com/ros-windows/win_ros/hydro-devel/msvc_hydro_comms.rosinstall > wstool update
These will download catkin package and common messages which are required to build your own message package.
Create Your Own Message Package
Create a package for your own custom msg/srv files using winros_create_msg_pkg tool.
> cd C:\work\ws\src > winros_create_msg_pkg custom_msgs
The script automatically sets up a simple msg/srv (Dude.msg, HelloDude.srv) in custom_msgs.
Build your own message package to generate messages.
> cd C:\work\ws > winros_make
If your message package does not build delete your build and devel folders from C:\work\ws and build again.
Once you build fully, you can build only your own message package.
> cd C:\work\ws\build\custom_msgs > nmake
Install your own message into ros sdk.
> cd C:\work\ws\build\custom_msgs > nmake install
Then generated c++ headers of your own message are placed into C:\opt\ros\hydro\x86\include\custom_msgs, also python modules are place into C:\opt\ros\hydro\x86\lib\site-packages\custom_msgs.
Use Your Own Message
If you add the win_ros header paths to a development environment, you can simply include your own headers and use them.
#include <custom_msgs/Dude.h> #include <custom_msgs/HelloDude.h>