PathConsumerComp.java
Go to the documentation of this file.
1 // -*- Java -*-
9 package jp.go.aist.hrp.simulator;
10 
12 
14 import jp.go.aist.rtm.RTC.Manager;
15 import jp.go.aist.rtm.RTC.ModuleInitProc;
16 import jp.go.aist.rtm.RTC.RTObject_impl;
17 import jp.go.aist.rtm.RTC.util.Properties;
18 
19 public class PathConsumerComp implements ModuleInitProc {
20 
22  public PathPlanner getImpl(){
23  return impl.m_PathBase._ptr();
24  }
25 
26  public String getInstanceName(){
27  return impl.getInstanceName();
28  }
29 
31  impl.setConnectedCallback(item);
32  }
33 
34  public void myModuleInit(Manager mgr) {
36  mgr.registerFactory(prop, new PathConsumer(), new PathConsumer());
37 
38  // Create a component
39  RTObject_impl comp = mgr.createComponent("PathConsumer");
40  if( comp==null ) {
41  System.err.println("Component create failed.");
42  System.exit(0);
43  }
44 
45  impl = (PathConsumerImpl) comp;
46 
47  // Example
48  // The following procedure is examples how handle RT-Components.
49  // These should not be in this function.
50 
51 // // Get the component's object reference
52 // Manager manager = Manager.instance();
53 // RTObject rtobj = null;
54 // try {
55 // rtobj = RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp));
56 // } catch (ServantNotActive e) {
57 // e.printStackTrace();
58 // } catch (WrongPolicy e) {
59 // e.printStackTrace();
60 // }
61 //
62 // // Get the port list of the component
63 // PortListHolder portlist = new PortListHolder();
64 // portlist.value = rtobj.get_ports();
65 //
66 // // getting port profiles
67 // System.out.println( "Number of Ports: " );
68 // System.out.println( portlist.value.length );
69 // for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) {
70 // Port port = portlist.value[intIdx];
71 // System.out.println( "Port" + intIdx + " (name): ");
72 // System.out.println( port.get_port_profile().name );
73 //
74 // PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder();
75 // iflist.value = port.get_port_profile().interfaces;
76 // System.out.println( "---interfaces---" );
77 // for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) {
78 // System.out.println( "I/F name: " );
79 // System.out.println( iflist.value[intIdx2].instance_name );
80 // System.out.println( "I/F type: " );
81 // System.out.println( iflist.value[intIdx2].type_name );
82 // if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) {
83 // System.out.println( "Polarity: PROVIDED" );
84 // } else {
85 // System.out.println( "Polarity: REQUIRED" );
86 // }
87 // }
88 // System.out.println( "---properties---" );
89 // NVUtil.dump( new NVListHolder(port.get_port_profile().properties) );
90 // System.out.println( "----------------" );
91 // }
92  }
93 /*
94  public static void main(String[] args) {
95  // Initialize manager
96  final Manager manager = Manager.init(args);
97 
98  // Set module initialization proceduer
99  // This procedure will be invoked in activateManager() function.
100  PathConsumerComp init = new PathConsumerComp();
101  manager.setModuleInitProc(init);
102 
103  // Activate manager and register to naming service
104  manager.activateManager();
105 
106  // run the manager in blocking mode
107  // runManager(false) is the default.
108  manager.runManager();
109 
110  // If you want to run the manager in non-blocking mode, do like this
111  // manager.runManager(true);
112  }
113 */
114 
115 
116 }
void(* ModuleInitProc)(Manager *manager)
#define null
our own NULL pointer
Definition: IceTypes.h:57
void setConnectedCallback(GrxPathPlanningAlgorithmItem item)
void setConnectedCallback(GrxPathPlanningAlgorithmItem item)
prop


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:04