• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Node类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onShutdown

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


示例17: onShutdown

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


示例18: onShutdownComplete

import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdownComplete(Node node) {
  // Save the existing settings before exiting.
  distanceRenderer.savePreferences(this.getContext());
}
 
开发者ID:frankjoshua,项目名称:AndroidRosJava,代码行数:6,代码来源:DistanceView.java


示例19: onError

import org.ros.node.Node; //导入依赖的package包/类
/**
 * On node error is throw.
 */
@Override
public void onError(Node node, Throwable throwable) {
    super.onError(node, throwable);
    this.logE(throwable.getMessage());
}
 
开发者ID:rosalfred,项目名称:smarthome_common_driver,代码行数:9,代码来源:BaseNodeMain.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Convertible类代码示例发布时间:2022-05-22
下一篇:
Java DelaunayTriangle类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap