two nodes on ros android
Hello!
Do you know how can I run two nodes en a same activity on android?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hello!
Do you know how can I run two nodes en a same activity on android?
You can run any number of nodes within an activity.
Simply do something like this (assuming your activity is a RosActivity
):
@Override
protected void init(NodeMainExecutor nodeMainExecutor) {
NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(getRosHostname());
nodeConfiguration.setMasterUri(getMasterUri());
nodeConfiguration.setNodeName("node_1");
MyNode myNode1 = new MyNode(); // Something that extends AbstractNodeMain
nodeMainExecutor.execute(myNode1, nodeConfiguration);
nodeConfiguration.setNodeName("node_2");
MyNode myNode2 = new MyNode();
nodeMainExecutor.execute(myNode2, nodeConfiguration); // And so on...
}
Asked: 2015-04-27 09:26:18 -0600
Seen: 216 times
Last updated: Dec 04 '17
Generating messages for rosjava?
AssertionError: Test node [test_rosjava/tester]
How to develop Java sources in Eclipse when you use rosjava
Understanding rosjava, as recently announced by Google and Willow Garage
Rosjava + Android phone + Kinect, is it possible?