当前位置: 首页>>代码示例>>Java>>正文


Java Node类代码示例

本文整理汇总了Java中org.ros.node.Node的典型用法代码示例。如果您正苦于以下问题:Java Node类的具体用法?Java Node怎么用?Java Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Node类属于org.ros.node包,在下文中一共展示了Node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startMoveBaseNode

import org.ros.node.Node; //导入依赖的package包/类
private void startMoveBaseNode() {
    // Create ROS node for base move
    mLog.info("Starting move base native node");
    mRosNavigationStatusIndicator.updateStatus(ModuleStatusIndicator.Status.LOADING);
    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(mHostName);
    nodeConfiguration.setMasterUri(mMasterUri);
    nodeConfiguration.setNodeName(MoveBaseNode.NODE_NAME);
    mMoveBaseNode = new MoveBaseNode();
    mNodeMainExecutor.execute(mMoveBaseNode, nodeConfiguration,
            new ArrayList<NodeListener>(){{
                add(new DefaultNodeListener() {
                    @Override
                    public void onStart(ConnectedNode connectedNode) {
                        mRosNavigationStatusIndicator.updateStatus(ModuleStatusIndicator.Status.OK);
                    }

                    @Override
                    public void onError(Node node, Throwable throwable) {
                        mRosNavigationStatusIndicator.updateStatus(ModuleStatusIndicator.Status.ERROR);
                    }
                });
            }});
}
 
开发者ID:ekumenlabs,项目名称:tangobot,代码行数:24,代码来源:MainActivity.java

示例2: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
    synchronized (mPublisherLock) {
        mColorPublisher = null;
    }

    super.onShutdown(node);
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:9,代码来源:MainActivity.java

示例3: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
  for (Layer layer : layers) {
    layer.onShutdown(this, node);
  }
  this.connectedNode = null;
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:8,代码来源:VisualizationView.java

示例4: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
    this.logI("Stop node !");

    if (this.serverReconfig != null)
        this.serverReconfig.close();

    if (this.threadZeroconf != null && this.threadZeroconf.isAlive()) {
        this.threadZeroconf.interrupt();
    }

    super.onShutdown(node);
    this.connectedNode = null;
}
 
开发者ID:rosalfred,项目名称:smarthome_common_driver,代码行数:15,代码来源:BaseNodeMain.java

示例5: startTangoRosNode

import org.ros.node.Node; //导入依赖的package包/类
public void startTangoRosNode() {
    mTangoStatusIndicator.updateStatus(ModuleStatusIndicator.Status.LOADING);

    if (TangoInitializationHelper.loadTangoSharedLibrary() != TangoInitializationHelper.ARCH_ERROR &&
            TangoInitializationHelper.loadTangoRosNodeSharedLibrary() != TangoInitializationHelper.ARCH_ERROR) {

        // Remap topic names from default Tango ROS Node to those used in the standard
        // Turtlebot demos and apps.
        String[] topicMap = {
                "/tango/laser_scan:=/scan",
                "/tango/camera/color_1/image_raw/compressed:=/compressed_image"
        };

        mTangoNodeletManager = new TangoNodeletManager(topicMap);
        TangoInitializationHelper.bindTangoService(this, mTangoServiceConnection);
        if (TangoInitializationHelper.isTangoVersionOk()) {
            mLog.info("Tango Core version is supposedly OK, starting Tango node.");

            // ServiceClient node which is responsible for calling ros services.
            mTangoServiceClient = new TangoServiceClientNode();
            mTangoServiceClient.setCallbackListener(this);
            NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(mHostName);
            nodeConfiguration.setMasterUri(mMasterUri);
            nodeConfiguration.setNodeName(mTangoServiceClient.getDefaultNodeName());
            mNodeMainExecutor.execute(mTangoServiceClient, nodeConfiguration);

            // Create and start Tango ROS Node
            nodeConfiguration.setNodeName(TangoNodeletManager.NODE_NAME);
            ArrayList<NodeListener> listeners = new ArrayList<>();
            listeners.add(new DefaultNodeListener() {
                @Override
                public void onStart(ConnectedNode connectedNode) {
                    boolean connected = false;
                    try {
                        for (int i = 0; i < MAX_TANGO_CONNECTION_TRIES; i++) {
                            if (mTangoServiceClient.callTangoConnectService(TangoConnectRequest.CONNECT)) {
                                mLog.info("Successfully connected to Tango");
                                connected = true;
                                break;
                            }
                            mLog.warn("Failed to connect to Tango, try " + i);
                            Thread.sleep(200);
                        }
                    } catch (InterruptedException e) {
                        mLog.warn("Tango connection loop interrupted.", e);
                    }
                    if (!connected) {
                        mLog.error("Failed to connect to Tango.");
                        mTangoStatusIndicator.updateStatus(ModuleStatusIndicator.Status.ERROR);
                    }
                }

                @Override
                public void onError(Node node, Throwable throwable) {
                    mLog.error("Error running TangoRosNode", throwable);
                    mTangoStatusIndicator.updateStatus(ModuleStatusIndicator.Status.ERROR);
                }
            });
            mNodeMainExecutor.execute(mTangoNodeletManager, nodeConfiguration, listeners);
        } else {
            mLog.error(getString(R.string.tango_version_error));
            mTangoStatusIndicator.updateStatus(ModuleStatusIndicator.Status.ERROR);
            displayToastMessage(R.string.tango_version_error);
        }
    } else {
        mLog.error(getString(R.string.tango_lib_error));
        mTangoStatusIndicator.updateStatus(ModuleStatusIndicator.Status.ERROR);
        displayToastMessage(R.string.tango_lib_error);
    }
}
 
开发者ID:ekumenlabs,项目名称:tangobot,代码行数:71,代码来源:MainActivity.java

示例6: onError

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onError(Node node, Throwable throwable) {
    if (super.executeReturnCode != 0 && mLog != null) {
        mLog.error("Execute error code: " + Integer.toString(super.executeReturnCode), throwable);
    }
}
 
开发者ID:ekumenlabs,项目名称:tangobot,代码行数:7,代码来源:MoveBaseNode.java

示例7: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public synchronized void onShutdown(Node node) {
    m_node = null;
    m_cmdPublisher = null;
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:6,代码来源:RobotNodeMain.java

示例8: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
    super.onShutdown(node);
}
 
开发者ID:rosalfred,项目名称:smarthome_media_onkyo_driver,代码行数:5,代码来源:OnkyoNode.java

示例9: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
/**
 * Callback for when the RobotController is shutdown.
 * @param node The Node
 */
@Override
public void onShutdown(Node node) {
    shutdownTopics();
}
 
开发者ID:mtbii,项目名称:RobotCA,代码行数:9,代码来源:RobotController.java

示例10: onShutdownComplete

import org.ros.node.Node; //导入依赖的package包/类
/**
 * Callback for when the shutdown is complete.
 * @param node The Node
 */
@Override
public void onShutdownComplete(Node node) {
    this.connectedNode = null;
}
 
开发者ID:mtbii,项目名称:RobotCA,代码行数:9,代码来源:RobotController.java

示例11: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:4,代码来源:RosTextView.java

示例12: onShutdownComplete

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdownComplete(Node node) {
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:4,代码来源:RosTextView.java

示例13: onError

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onError(Node node, Throwable throwable) {
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:4,代码来源:RosTextView.java

示例14: onShutdownComplete

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdownComplete(Node node) {
  publisherTimer.cancel();
  publisherTimer.purge();
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:6,代码来源:VirtualJoystickView.java

示例15: onShutdown

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(VisualizationView view, Node node) {
  posePublisher.shutdown();
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:5,代码来源:PosePublisherLayer.java


注:本文中的org.ros.node.Node类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。