Not yet thoroughly tested.

Overview

This guide illustrates how to set up your own workspace overlay to build on top of the Msvc SDK. In other word it teaches you how to use catkin to build your programms without using the Mscv Gui.

Prerequisites

Make sure you have either an installed SDK or compiled SDK. If you're setting up your overlay for the first time, make sure you have the win_python_build_tools installed.

For the purposes of this guide, we will assume your ros installation is located in C:/opt/ros/groovy/x86.

Workspace

> mkdir C:/work
> cd C:/work
> winros_init_workspace overlay
> cd C:/work/overlay
> winros_init_build --underlays="C:/opt/ros/groovy/x86"
> setup.bat

At this point the winros_init_build script has an error so you need to manually adapt C:\work\overlay\config.cmake, change

set(ROSDEPS_ROOT "C:/opt/rosdeps/hydro/x86" CACHE STRING "System root for ros dependency.")
set(INSTALL_ROOT "C:/opt/overlay/hydro/x86" CACHE PATH "Install root.")

to

set(ROSDEPS_ROOT "C:/opt/rosdeps/groovy/x86" CACHE STRING "System root for ros dependency.")
set(INSTALL_ROOT "C:/opt/ros/groovy/x86" CACHE PATH "Install root.")

Now you are ready to build the workspace

> winros_make

At this point, you should have a successfully configured an empty workspace.

Adding Sources

If you have pre-existing ros packages, or want to bring in an official ros repo, you can add them via wstool.

> cd C:/work/overlay/src
> wstool set rocon_msgs --git https://github.com/robotics-in-concert/rocon_msgs
> wstool update rocon_msgs
> cd C:/work/overlay
> setup.bat
> winros_make --pre-clean

Creating Packages

Note: the following scripts are yet to be made.

Otherwise, add packages of your own:

> cd C:/work/overlay/src
> winros_create_cpp_pkg my_cpp_pkg
> winros_create_msg_pkg my_msg_pkg
> winros_create_python_pkg my_python_pkg

Note that you can create the above packages directly below src, or embed them below a repo of your own.

Manual creation of a packet

In this section we will learn how to create a package from scratch. For me the winros_create_pkg script did not work, so here I show how I manually create the package.

cd c:\work\overlay\src
mkdir beginner_tutorials\src
cd c:\work\overlay\src\beginner_tutorials\

Create c:\work\overlay\src\beginner_tutorials\package.xml.

<?xml version="1.0"?>
<package>
  <name>beginner_tutorials</name>
  <version>0.1.0</version>
  <description>
     beginner_tutorials
  </description>
  <maintainer email="demo@gmail.com"></maintainer>
  <author></author>
  <license>BSD</license>
  
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>

  <run_depend>roscpp</run_depend>
  <run_depend>std_msgs</run_depend>

  <buildtool_depend>catkin</buildtool_depend>
 
</package>

Create c:\work\overlay\src\beginner_tutorials\CMakeLists.txt.

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

find_package(catkin REQUIRED COMPONENTS roscpp std_msgs)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES catkin_test
  CATKIN_DEPENDS roscpp std_msgs
#  DEPENDS system_lib
)
include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})

Finally create c:\work\overlay\src\beginner_tutorials\src\talker.cpp according to the example.

Wiki: win_ros/groovy/Msvc Overlays (last edited 2014-01-28 10:54:18 by FlavioFontana)