sot-hrp2-10-controller.cpp 1.22 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright 2011,
 *
 * Olivier Stasse
 *
 * LAAS, CNRS
 *
 * This file is part of HRP2Controller.
 * HRP2Controller is not a free software, 
 * it contains information related to HRP-2 which involves
 * that you either purchased the proper license to havec access to
 * those informations, or that you signed the appropriate
 * Non-Disclosure agreement.
 *
 *
 */

#include <sot/core/debug.hh>

#define ROBOTNAME std::string("HRP2JRL")

#include "sot-hrp2-10-controller.hh"

const std::string SoTHRP2_10_Controller::LOG_PYTHON_10="/tmp/HRP2Controller_10_python.out";

SoTHRP2_10_Controller::SoTHRP2_10_Controller():
  SoTHRP2Controller(ROBOTNAME)
{
  startupPython();
}

void SoTHRP2_10_Controller::startupPython()
{
  SoTHRP2Controller::startupPython();

  std::ofstream aof(LOG_PYTHON_10.c_str());
  runPython
    (aof,
     "from dynamic_graph.sot.hrp2_14.prologue import robot, solver",
     interpreter_);
  interpreter_.startCorbaServer ("openhrp", "", "stackOfTasks", "");
  aof.close();
}

extern "C" 
{
  dgsot::AbstractSotExternalInterface * createSotExternalInterface()
  {
    return new SoTHRP2_10_Controller;
  }
}

extern "C"
{
  void destroySotExternalInterface(dgsot::AbstractSotExternalInterface *p)
  {
    delete p;
  }
}