YARP and CSHARP

From Wiki for iCub and Friends
Revision as of 08:28, 10 May 2013 by Matteo.brunettini@iit.it (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: in order to have the C# bindings to work under linux you need yarp to be compiled in shared mode.

The current supported method for using YARP from C# is via SWIG. See:

 $YARP_ROOT/bindings

README in that directory contains information.

In theory you can just do:

 cd $YARP_ROOT/bindings
 mkdir buildCS
 cd buildCS
 ccmake ..
 make

You should end with a dynamic library (yarp.dll in windows, libyarp.so in linux) move that somewhere in your path (windows) or $LD_LIBRARY_PATH (linux).

You should also have a bunch of .cs files in the /generated_src directory, they will serve to generate the .NET dll.

Create a directory /YarpCS Open Visual Studio / monodevelop and start a new Classes Library project named YarpCS in /YarpCS.

From this project, remove the "Class1.cs" generated by visual studio and add all the .cs file generated by swig earlier.

Generate the solution.

It will product a file called YarpCS.dll, this is the dll that your CS project will reference.

Try to create a new project, click on add reference and add YarpCS.dll ; intellisense should give you access to Yarp.