本文整理汇总了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);
}
});
}});
}
示例2: onShutdown
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
synchronized (mPublisherLock) {
mColorPublisher = null;
}
super.onShutdown(node);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例7: onShutdown
import org.ros.node.Node; //导入依赖的package包/类
@Override
public synchronized void onShutdown(Node node) {
m_node = null;
m_cmdPublisher = null;
}
示例8: onShutdown
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
super.onShutdown(node);
}
示例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();
}
示例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;
}
示例11: onShutdown
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(Node node) {
}
示例12: onShutdownComplete
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdownComplete(Node node) {
}
示例13: onError
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onError(Node node, Throwable throwable) {
}
示例14: onShutdownComplete
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdownComplete(Node node) {
publisherTimer.cancel();
publisherTimer.purge();
}
示例15: onShutdown
import org.ros.node.Node; //导入依赖的package包/类
@Override
public void onShutdown(VisualizationView view, Node node) {
posePublisher.shutdown();
}