-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmain2.cpp
More file actions
81 lines (74 loc) · 2.44 KB
/
Copy pathmain2.cpp
File metadata and controls
81 lines (74 loc) · 2.44 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <orocos_cpp_base/ProxyPort.hpp>
#include <rtt/transports/corba/TaskContextProxy.hpp>
#include <rtt/Property.hpp>
#include "PluginHelper.hpp"
class MirrorProxy: public RTT::corba::TaskContextProxy
{
public:
MirrorProxy(std::string location, bool is_ior) : TaskContextProxy(location, is_ior)
, input(getPort("input"))
, output(getPort("output"))
, testProp(*dynamic_cast<RTT::Property<std::string> *>(getProperty("testProp")))
{
};
InputProxyPort<std::string> input;
OutputProxyPort<std::string> output;
RTT::Property<std::string> &testProp;
};
int main(int argc, char**argv)
{
orocos_cpp::PluginHelper::loadAllPluginsInDir("/home/scotch/coyote/install/lib/orocos/gnulinux/types/");
orocos_cpp::PluginHelper::loadAllPluginsInDir("/home/scotch/coyote/install/lib/orocos/types/");
// std::cout << "Plugin load done" << std::endl;
// MirrorProxy *mirrorProxy;
//
// CorbaAccess::init(argc, argv);
//
// std::cout << "Corba init done" << std::endl;
//
// corba::NameServiceClient client;
//
// std::vector<std::string> taskList;
// try {
// taskList = client.getTaskContextNames();
// } catch (CosNaming::NamingContext::NotFound e)
// {
// std::cout << "Could not get Task Context list." << std::endl;
// exit(EXIT_FAILURE);
// }
//
// for(std::vector<std::string>::const_iterator it = taskList.begin(); it != taskList.end(); it++)
// {
// if(*it == "orogen_default_mirror__Task")
// {
// std::string curIOR = client.getIOR(*it);
//
// mirrorProxy = new MirrorProxy(curIOR, true);
// }
// }
//
// std::cout << "Configuring " << std::endl;
// mirrorProxy->configure();
// std::cout << "Starting " << std::endl;
// mirrorProxy->start();
//
// RTT::OutputPort<std::string> &writer(mirrorProxy->input.getWriter());
// RTT::InputPort<std::string> &reader(mirrorProxy->output.getReader());
//
// writer.write(std::string("Testooo"));
// std::cout << "Wrote sample " << std::endl;
//
// std::string result;
//
// while(reader.read(result) != RTT::NewData)
// {
// usleep(10000);
// }
//
//
//
// std::cout << "result is " << result << std::endl;
//
// std::cout << "Property is " << mirrorProxy->testProp.get() << std::endl;
return 0;
}