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


Java NodeMainExecutor.execute方法代码示例

本文整理汇总了Java中org.ros.node.NodeMainExecutor.execute方法的典型用法代码示例。如果您正苦于以下问题:Java NodeMainExecutor.execute方法的具体用法?Java NodeMainExecutor.execute怎么用?Java NodeMainExecutor.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ros.node.NodeMainExecutor的用法示例。


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

示例1: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor nodeMainExecutor)
{
    cameraId = 0;

    rosCameraPreviewView.setCamera(getCamera());

    try {
        java.net.Socket socket = new java.net.Socket(getMasterUri().getHost(), getMasterUri().getPort());
        java.net.InetAddress local_network_address = socket.getLocalAddress();
        socket.close();
        NodeConfiguration nodeConfiguration =
                NodeConfiguration.newPublic(local_network_address.getHostAddress(), getMasterUri());
        nodeMainExecutor.execute(rosCameraPreviewView, nodeConfiguration);
    } catch (IOException e) {
        // Socket problem
        Log.e("Camera Tutorial", "socket error trying to get networking information from the master uri");
    }

}
 
开发者ID:radionavlab,项目名称:utmg-android-interface,代码行数:21,代码来源:ROSCam.java

示例2: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor node) {
    mSimpleNode = new SimpleNode();
    mSimpleNode.setListener(new SimpleNode.OnMessageListener() {
        @Override
        public void onMessage(final String msg) {
            mMainHandler.post(new Runnable() {
                @Override
                public void run() {
                    mRecvText.setText(msg);
                }
            });
        }
    });

    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(getRosHostname());
    nodeConfiguration.setMasterUri(getMasterUri());

    node.execute(mSimpleNode, nodeConfiguration);
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:21,代码来源:MainActivity.java

示例3: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
    protected void init(NodeMainExecutor nodeMainExecutor) {
//        rosTextView.setText("test");
//        rosTextView.setTopicName("testtopic");
//        rosTextView.setMessageType("std_msgs/String");

        node = new ROSNode();

        try {
            java.net.Socket socket = new java.net.Socket(getMasterUri().getHost(), getMasterUri().getPort());
            java.net.InetAddress local_network_address = socket.getLocalAddress();
            socket.close();
            NodeConfiguration nodeConfiguration =
                    NodeConfiguration.newPublic(local_network_address.getHostAddress(), getMasterUri());

            //nodeConfiguration.setNodeName()

            nodeMainExecutor.execute(node, nodeConfiguration);
        } catch (IOException e) {
            // Socket problem
            Log.e("MainActivity", "socket error trying to get networking information from the master uri");
        }

    }
 
开发者ID:radionavlab,项目名称:utmg-android-interface,代码行数:25,代码来源:MainActivity.java

示例4: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor node) {
    guestScienceDemoNode = GuestScienceRosMessages.getSingletonInstance();
    guestScienceDemoNode.setListener(new GuestScienceRosMessages.OnMessageListener() {
        @Override
        public void onMessage(final String msg) {
            mMainHandler.post(new Runnable() {
                @Override
                public void run() {
                    AndroidRosBridgeService.setMsgRobotToService(msg);
                }
            });
        }
    });

    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic("10.0.42.15");
    nodeConfiguration.setMasterUri(getMasterUri());

    node.execute(guestScienceDemoNode, nodeConfiguration);
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:21,代码来源:MainActivity.java

示例5: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(final NodeMainExecutor node) {
    NodeConfiguration nodeConfiguration =
            NodeConfiguration.newPublic(
                    ROS_HOSTNAME, ROS_MASTER_URI);

    final PointCloudNode pcn = new PointCloudNode();
    node.execute(pcn, nodeConfiguration);
    mShutdownFuture = node.getScheduledExecutorService().schedule(new Runnable() {
        @Override
        public void run() {
            node.shutdownNodeMain(pcn);
            MainActivity.this.nodeMainExecutorService.forceShutdown();
        }
    }, 3, TimeUnit.SECONDS);
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:17,代码来源:MainActivity.java

示例6: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
/**
* A rosjava callback for RosActivity which gives one the opportunity to spawn
* nodes (subclasses of NodeMain).
*/
@Override
protected void init(NodeMainExecutor nodeMainExecutor)
/*************************************************************************/
{
    NodeConfiguration nodeConfiguration1 =
        NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress(),
            getMasterUri());
    nodeConfiguration1.setNodeName("ShieldTeleop/ImageView");

    NodeConfiguration nodeConfiguration2 =
            NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress(),
                    getMasterUri());
    nodeConfiguration2.setNodeName("ShieldTeleop/JoystickNode");

    //Here we start each node thread (subclass of NodeMain) which run inside an Android service
    //(i.e. basically a persistent background daemon).
    nodeMainExecutor.execute(videoStreamView_, nodeConfiguration1);
    nodeMainExecutor.execute(joystickHandler_, nodeConfiguration2);
}
 
开发者ID:willowgarage,项目名称:shield_teleop,代码行数:24,代码来源:MainActivity.java

示例7: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor nodeMainExecutor) {
    this.getBaseContext();
    final ManagerNode node = ManagerNode.INSTANCE();
    final NodeConfiguration config = NodeConfiguration.newPublic(ROS_HOSTNAME, ROS_MASTER_URI);
    node.setContext(this.getBaseContext());
    node.setStartTimer(mStartTimer);
    nodeMainExecutor.execute(node, config);
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:10,代码来源:ManagerService.java

示例8: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor node) {
    RGBLEDNode listener = new RGBLEDNode();

    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(getRosHostname());
    nodeConfiguration.setMasterUri(getMasterUri());

    node.execute(listener, nodeConfiguration);
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:10,代码来源:MainActivity.java

示例9: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor nodeMainExecutor) {
    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress());
    nodeConfiguration.setMasterUri(getMasterUri());

    nodeMainExecutor.execute(objectDetectionClient, nodeConfiguration);

    //if found faster_rcnn service
    mCameraView.setCvCameraViewListener(this);
}
 
开发者ID:kazuto1011,项目名称:ros-tms-perception,代码行数:11,代码来源:FasterRcnnClient.java

示例10: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor nodeMainExecutor) {
    NodeMain node = new SimplePublisherNode();

    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress());
    nodeConfiguration.setMasterUri(getMasterUri());

    nodeMainExecutor.execute(node, nodeConfiguration);
}
 
开发者ID:ollide,项目名称:rosjava_android_template,代码行数:10,代码来源:MainActivity.java

示例11: init

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
@Override
protected void init(NodeMainExecutor nodeMainExecutor) {
    // At this point, the user has already been prompted to either enter the URI
    // of a master to use or to start a master locally.
    String host = InetAddressFactory.newNonLoopback().getHostName();
    NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(host, getMasterUri());

    //Execute the location node
    locationNode = new AndroidLocationNode();
    nodeMainExecutor.execute(locationNode, nodeConfiguration);
}
 
开发者ID:gtagency,项目名称:android_nav,代码行数:12,代码来源:AndroidNavActivity.java

示例12: initialize

import org.ros.node.NodeMainExecutor; //导入方法依赖的package包/类
/**
 * Initializes the RobotController.
 * @param nodeMainExecutor The NodeMainExecutor on which to execute the NodeConfiguration.
 * @param nodeConfiguration The NodeConfiguration to execute
 */
public void initialize(NodeMainExecutor nodeMainExecutor, NodeConfiguration nodeConfiguration) {
    nodeMainExecutor.execute(this, nodeConfiguration.setNodeName("android/robot_controller"));
}
 
开发者ID:mtbii,项目名称:RobotCA,代码行数:9,代码来源:RobotController.java


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