KITProsthesisIceDriverExample.cpp
Go to the documentation of this file.
1 #include <thread>
2 
3 #include <QCoreApplication>
4 
5 #include <Ice/Ice.h>
6 
8 #include <RobotAPI/interface/units/KITProstheticHandInterface.h>
9 
10 int
11 main(int argc, char* argv[])
12 {
13  for (int i = 0; i < argc; ++i)
14  {
15  if (std::string(argv[i]) == "-h" ||
16  std::string(argv[i]) == "--print-options") // needed for ArmarX Doc generation
17  {
18  // TODO: print help
19  return 0;
20  }
21  }
22 
23  QCoreApplication a(argc, argv);
24  try
25  {
26  Ice::CommunicatorHolder iceServer(argc, argv);
27  Ice::ObjectAdapterPtr adapter = iceServer->createObjectAdapterWithEndpoints(
28  "KITProsthesisControlAdapter", "default -h localhost -p 10000");
29  KITProsthesis::KITProstheticHandInterfacePtr object = new KITProsthesisIceDriver;
30  Ice::ObjectPrx prx = adapter->add(object, Ice::stringToIdentity("KITProsthesisControl"));
31  std::cout << prx->ice_toString() << std::endl;
32  adapter->activate();
33  iceServer->waitForShutdown();
34  }
35  catch (const std::exception& e)
36  {
37  std::cerr << e.what() << std::endl;
38  return 1;
39  }
40  return 0;
41 }
IceInternal::Handle<::Ice::ObjectAdapter >
KITProsthesisIceDriver.h
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
main
int main(int argc, char *argv[])
Definition: KITProsthesisIceDriverExample.cpp:11
KITProsthesisIceDriver
Definition: KITProsthesisIceDriver.h:39