Zurück zur Startseite  
     
   
Downloads Kontakt Sitemap Druckversion Extranet
 
  Suchen
English
 
 
 
 
       
     
  Hardware Architecture
       
     
  Software/System Architecture
       
     
  API Documentation
       
     
  Code Snippets
       
     
  Linux Real Time
       
     
  Kernel
       
     
  Webservices / RPC
       
     
  Contact the Linux Team
 
 
 
 
           
 

Code Snippets

The Katana can operate in different modes, and depending on these, the manner of control requires different approaches. In the following sections, there are some brief examples for each of these modes, given in C++ and Python, which are both calling the same C++ library internally.

Python

Running Python directly on the robot in a Python shell is easy:

>>> import katana
>>> k=katana.Katana()
>>> k.calibrate()

The following code opens a connection to the XML-RPC server on the Katana and gives the user a Katana object to continue:

import sys
import xmlrpclib
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed()

serverIp = sys.argv[1]
katana = xmlrpclib.Server('http://'+ serverIp + ':8000')
methods = katana.system.listMethods()
for i in methods:
    print i
print "nAccess to Katana RPC methods through the object katana"
print "example: katana.calibrate()n"
ipshell()

C++

The Programming of the Katana in C++ is equally straightforward:
#include "katana.h"

int main(int argc, char **argv){
    Katana k;
    k.calibrate();
    for (int i=0; i<3; i++) {
        k.moveMotAndWait(1, 10000, 100);
        k.moveMotAndWait(1, 11000, 100);
    }
    return 0;
}

 
Katana Produktbroschüre und Anwendungsbeispiele:

 
 
 
 

Mitglied von:

Swiss Mobile Robotics Consortium

swissT.net

swissRobotics.net

EUROP - European Robotics Platform

 
Neuronics AG
Neuronics AG . Im Hoelderli 26
CH-8405 Winterthur . Schweiz
T +41 (0)52 235 24 40 . F +41 (0)52 235 24 44
© 2010 Neuronics AG
 
Frankreich Schweiz Deutschland Österreich Niederlande Tschechien Portugal Finnland Italien Italien Italien Frankreich Spanien Kanada Argentinien China Japan Malaysia Malaysia Südkorea