Matlab Yarp Interface

Hardware

  • Works on our tomlinson machine. On your machine you have to compile the yarp bindings enabling the java flag.
  • Follow the instructions given here
  • icub@tomlinson:~/software/codyco-superbuild/external/YARP/bindings/build$ export JAVA_HOME=/usr/lib/jdk/jdk1.5.0_22
  • ccmake .. and BUILD_JAVA=on
  • run make
  • cd generated_src, i.e., compile all the Java classes in example/swig/generated_src:
  • javac -source 1.3 -target 1.3 *.java
  • Next, copy the *.class files in two directories as follows. LoadYarp.class and YarpImageHelper.class go to (say) ~/jyarp; all the remaining files go to ~/jyarp/yarp. (This is because the latter files have to be in a directory called "yarp", like the corresponding Java package.) Add ~/jyarp to MATLAB's classpath.txt file (read below for further information about this).
  • Add these lines to the end of Matlab's Classpath.txt (run which classpath.txt in Matlab, e.g., /usr/local/MATLAB/R2012a/toolbox/local/classpath.txt):
  • # iCub YARP Matlab interface
  • /home/icub/software/codyco-superbuild/external/YARP/bindings/build/jyarp
  • /home/icub/software/codyco-superbuild/external/YARP/bindings/build/generated_src
  • /home/icub/software/codyco-superbuild/external/YARP/bindings/build
  • Add the three lines above also to the librarypath.txt (e.g., in /usr/local/MATLAB/R2012a/toolbox/local/librarypath.txt)

Yarp Commands for testing

  • List active ports: yarp name list
  • Sniff streaming ports: yarp read /localPortToRead /icub/skin/left_arm
  • List registered devices: yarpdev --list

Matlab demos

  • Download the Matlab Demos
  • The Demos show how the skin sensors can be processed, how to read and how to set the joint angles

Matlab Inverse Kinematic Control

  • Start the cartesian controller model, e.g., iKinCartesianSolver --part left_arm