public ServiceChannelExtender(BundleContext context, String bindingConfigOSGiFilter, Properties bindingRegistrationProps){ super(ChannelBindingConfig.class, context, bindingConfigOSGiFilter); myManagerFactory = new OSGiComponentFactory(context); myManagerMap = new HashMap(); myBindingRegistrationProperties = bindingRegistrationProps; }
public SceneSpecExtender(BundleContext context, String bindingConfigOSGiFilter, Properties sceneRegistrationProps){ super(SceneSpec.class, context, bindingConfigOSGiFilter); myManagerFactory = new OSGiComponentFactory(context); mySceneRegistrationProperties = sceneRegistrationProps; myManagerMap = new HashMap(); }
public ServiceChannelExtender(BundleContext context, String bindingConfigOSGiFilter, Properties bindingRegistrationProps){ super(ChannelBindingConfig.class, context, bindingConfigOSGiFilter); myManagerFactory = new OSGiComponentFactory(context); myManagerMap = new HashMap(); myBindingRegistrationProperties = bindingRegistrationProps; }
public SceneSpecExtender(BundleContext context, String bindingConfigOSGiFilter, Properties sceneRegistrationProps){ super(SceneSpec.class, context, bindingConfigOSGiFilter); myManagerFactory = new OSGiComponentFactory(context); mySceneRegistrationProperties = sceneRegistrationProps; myManagerMap = new HashMap(); }
public DefaultBlenderServiceGroup( BundleContext context, Robot.Id robotId, long blenderIntervalMillisec, Properties registrationProperties){ super(new OSGiComponentFactory(context), getBlenderLifecycles(context, robotId, blenderIntervalMillisec), getIdBase(robotId), registrationProperties); }
public void startPumpingVisemeAnimation(BundleContext bunCtx, Ident speechOutChanID, Ident charBodyChanID, String visConfResPath, List<ClassLoader> clsForRKConf, Robot.Id robotId) throws Throwable { // As of 2012-11-23, the code below is based on sample code shown in comments of: // org.robokind.integration.motion_speech.Activator ManagedServiceFactory fact = new OSGiComponentFactory(bunCtx); String speechServiceId = RKConstants.DEFAULT_SPEECH_ID; // Old way required an actual filesystem file, i.e. java.io.File (or path to same) // String filePath = "path/to/VisemeConf.json"; // VisemeMotionUtils.startVisemeFrameSourceGroup(fact, new Robot.Id(RKConstants.VIRTUAL_R50_ID), speechServiceId, filePath); // New awesome-r way allows for any input stream. We typically use a classpath resource. URL visConfResURL = ClassLoaderUtils.findResourceURL(visConfResPath, clsForRKConf); InputStream visemeConfigStream = visConfResURL.openStream(); getLogger().info("Opened viseme conf stream from " + visConfResURL.toExternalForm()); ManagedServiceGroup visFrameSourceServGroup = VisemeMotionUtils.startVisemeFrameSourceStreamGroup(fact, robotId, speechServiceId, visemeConfigStream); } }
public void startPumpingVisemeAnimation(BundleContext bunCtx, Ident speechOutChanID, Ident charBodyChanID, String visConfResPath, List<ClassLoader> clsForRKConf, Robot.Id robotId) throws Throwable { // As of 2012-11-23, the code below is based on sample code shown in comments of: // org.mechio.integration.motion_speech.Activator ManagedServiceFactory fact = new OSGiComponentFactory(bunCtx); String speechServiceId = RKConstants.DEFAULT_SPEECH_ID; // Old way required an actual filesystem file, i.e. java.io.File (or path to same) // String filePath = "path/to/VisemeConf.json"; // VisemeMotionUtils.startVisemeFrameSourceGroup(fact, new Robot.Id(RKConstants.VIRTUAL_R50_ID), speechServiceId, filePath); // New awesome-r way allows for any input stream. We typically use a classpath resource. URL visConfResURL = ClassLoaderUtils.findResourceURL(visConfResPath, clsForRKConf); InputStream visemeConfigStream = visConfResURL.openStream(); getLogger().info("Opened viseme conf stream from " + visConfResURL.toExternalForm()); ManagedServiceGroup visFrameSourceServGroup = VisemeMotionUtils.startVisemeFrameSourceStreamGroup(fact, robotId, speechServiceId, visemeConfigStream); } }
protected static ManagedService loadRobotService( BundleContext context, Robot.Id robotId, String paramId){ ConfiguredServiceParams<Robot,ServoRobotConfig,File> params = new ConfiguredServiceParams( Robot.class, ServoRobotConfig.class, File.class, null, null, paramId, ServoRobot.VERSION, RobotConfigXMLReader.VERSION); ConfiguredServiceLifecycle lifecycle = new ServoRobotLifecycle( params, new OSGiComponentFactory(context)); Properties props = new Properties(); props.put(Robot.PROP_ID, robotId.getRobtIdString()); OSGiComponent robotComponent = new OSGiComponent(context, lifecycle, props); robotComponent.start(); return robotComponent; }
private void connect(String broker){ BundleContext context = OSGiUtils.getBundleContext(SpeechService.class); if(context == null){ theLogger.warning("Unable to connect speech Service. " + "Could not find BundleContext."); return; } bindSpeechPanel(context); ManagedServiceFactory fact = new OSGiComponentFactory(context); RKMessagingConfigUtils.registerConnectionConfig( CONNECTION_CONFIG_ID, broker, null, fact); RemoteSpeechUtils.connect( fact, SPEECH_SERVICE_ID, SPEECH_DEFAULT_PREFIX, CONNECTION_CONFIG_ID); }
public void makeModelRobotWithBlenderAndFrameSource(BoneRobotConfig config) throws Throwable { getLogger().info("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& START makeModelRobot__ for robot {} ", config.myRobotName); getLogger().debug("BoneRobtConfig details: {} ", config); //Create your Robot and register it ModelRobot br = ModelRobotFactory.buildRobot(config); if(br == null){ getLogger().warn("Error building ModelRobot from config {}", config); return; } Configuration<String> connectionConf = getValue(Configuration.class, MSGCONF_ROBOT_HOST); ManagedService connectionConfigService = RKMessagingConfigUtils.registerConnectionConfig( MSGCONF_ROBOT_HOST, connectionConf, null, new OSGiComponentFactory(myBundleCtx)); registeredConnectionConfigServices.add(connectionConfigService); registerAndStart(br, MSGCONF_ROBOT_HOST); getLogger().info("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& END makeModelRobotWithBlenderAndFrameSource "); }
private void startVisemes(BundleContext context){ ManagedServiceFactory fact = new OSGiComponentFactory(context); String speechServiceId = RKConstants.DEFAULT_SPEECH_ID; String path = getRoot() + "/robokind/resources/VisemeConf.json"; // Does "myRobot" indicate "use default"? If so, can we pull that as a constant from somewhere? // String robotName = "myRobot"; // 2012-03-30 : Stu temporarily set viseme-target robot name to match the Avatar. // 2012-11-19 : Matt is removing visemes for avatar. This is to be started in cogchar. // VisemeMotionUtils.startVisemeFrameSourceGroup( // fact, new Robot.Id(RKConstants.VIRTUAL_R50_ID), // speechServiceId, path); //"myRobot" is hardcoded for the physical robot //2012-04-09 : Matt is registering visemes for both VisemeMotionUtils.startVisemeFrameSourceGroup( fact, new Robot.Id(RKConstants.PHYSICAL_R50_ID), speechServiceId, path); }
@Override public void start(BundleContext context) throws Exception { RKMessagingConfigUtils.registerAvroSerializationConfig( SpeechRecConfig.class, SpeechRecConfigRecord.class, SpeechRecConfigRecord.SCHEMA$, new EmptyAdapter(), new EmptyAdapter(), JMSAvroServiceFacade.CONFIG_MIME_TYPE, null, new OSGiComponentFactory(context)); RKMessagingConfigUtils.registerAvroSerializationConfig( SpeechRecEventList.class, SpeechRecEventListRecord.class, SpeechRecEventListRecord.SCHEMA$, new EmptyAdapter(), new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); }
public void makeModelRobotWithBlenderAndFrameSource(BoneRobotConfig config ) throws Throwable { getLogger().info("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& START makeModelRobot__ for robot {} ", config.myRobotName); getLogger().debug("BoneRobtConfig details: {} ", config); //Create your Robot and register it ModelRobot br = ModelRobotFactory.buildRobot(config); if(br == null){ getLogger().warn("Error building ModelRobot from config {}", config); return; } getLogger().info("Fetching connectionConf = getValue(Configuration.class, MSGCONF_ROBOT_HOST [={}])", MSGCONF_ROBOT_HOST); Configuration<String> connectionConf = getValue(Configuration.class, MSGCONF_ROBOT_HOST); getLogger().info("Fetched connectionConf={}, and myBundleCtx.bundle={}", connectionConf, myBundleCtx.getBundle()); Properties noProps = null; OSGiComponentFactory osgiCompFactory = new OSGiComponentFactory(myBundleCtx); getLogger().info("Made OSGiComponentFactory={}, now calling RKMessagingConfigUtils.registerConnectionConfig.", osgiCompFactory); // Note that as of 2016-09-20, this step is what triggers the first wave of lifecycle dependency matches, // and thus leads to our first logged messages from the JFlux+OSGi Service Manager threads. ManagedService connectionConfigService = RKMessagingConfigUtils.registerConnectionConfig(MSGCONF_ROBOT_HOST, connectionConf, noProps, osgiCompFactory); // new OSGiComponentFactory(myBundleCtx)); getLogger().info("RKMessagingConfigUtils.registerConnectionConfig returned connConfigSvc={}", connectionConfigService); registeredConnectionConfigServices.add(connectionConfigService); registerAndStart(br, MSGCONF_ROBOT_HOST); getLogger().info("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& END makeModelRobotWithBlenderAndFrameSource "); }
@Override public void start(BundleContext context) throws Exception { theLogger.info("Connecting to Servo Robot."); startRobot(context, ROBOT_CONFIG_FILE); theLogger.info("Connection Successful."); String connectionConfigId = "remoteRobotConnectionConfig"; RKMessagingConfigUtils.registerConnectionConfig( connectionConfigId, "127.0.0.1", null, new OSGiComponentFactory(context)); new RemoteRobotHostServiceGroup( context, ROBOT_ID, "host", "client", connectionConfigId, null).start(); RobotUtils.startDefaultBlender( context, ROBOT_ID, theDefaultBlenderInterval); loadJointGroup(ROBOT_ID, context, "./resources/jointgroup.xml"); }
new EmptyAdapter(), JMSAvroServiceFacade.CONFIG_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.CONFIG_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); theLogger.info("VisionAPI Activation Complete.");
new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context));
@Override public void actionPerformed(ActionEvent e) { BundleContext context = OSGiUtils.getBundleContext(Robot.class); if(context == null){ theLogger.warning( "Unable to load Robot. Could not find BundleContext."); return; } Robot.Id robotId = new Robot.Id("myRobot"); launchRobot(context, robotId, "./resources/robot.xml"); RobotUtils.startDefaultBlender( context, robotId, theDefaultBlenderInterval); loadJointGroup(context, robotId, "./resources/jointgroup.xml"); String connectionConfigId = "remoteRobotConnectionConfig"; RKMessagingConfigUtils.registerConnectionConfig( connectionConfigId, "127.0.0.1", null, new OSGiComponentFactory(context)); new RemoteRobotHostServiceGroup( context, robotId, "host", "client", connectionConfigId, null, null, 100).start(); }
@Override public void start(BundleContext context) throws Exception { RKMessagingConfigUtils.registerAvroSerializationConfig( ServiceCommand.class, ServiceCommandRecord.class, ServiceCommandRecord.SCHEMA$, new EmptyAdapter(), new EmptyAdapter(), JMSAvroServiceFacade.COMMAND_MIME_TYPE, null, new OSGiComponentFactory(context)); RKMessagingConfigUtils.registerAvroSerializationConfig( ServiceError.class, ServiceErrorRecord.class, ServiceErrorRecord.SCHEMA$, new EmptyAdapter(), new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new OSGiComponent(context, new SimpleLifecycle(new PortableServiceCommand.Factory(), ServiceCommandFactory.class)).start(); }
new EmptyAdapter(), JMSAvroServiceFacade.CONFIG_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context)); new EmptyAdapter(), JMSAvroServiceFacade.AVRO_MIME_TYPE, null, new OSGiComponentFactory(context));
RKMessagingConfigUtils.registerConnectionConfig( "robotReceiverConnectionConfig", ip, null, new OSGiComponentFactory(context))); DisconnectAction.addComponents( startRemoteRobotClientServices(