Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
import com.github.robotics_in_concert.rocon_rosjava_core.rosjava_utils.RosTopicInfo;
import com.google.common.collect.Lists;

import org.ros.exception.RosRuntimeException;
import org.ros.internal.loader.CommandLineLoader;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.DefaultNodeMainExecutor;
import org.ros.node.Node;
import org.ros.node.NodeConfiguration;
import org.ros.node.NodeMainExecutor;

Expand All @@ -25,18 +27,25 @@

public class MasterInfo extends AbstractNodeMain {

private ListenerNode<rocon_std_msgs.MasterInfo> masterInfoListener;
private ListenerNode<rocon_std_msgs.MasterInfo> masterInfoListener;
public MasterInfo() {
this.masterInfoListener = new ListenerNode<rocon_std_msgs.MasterInfo>();
}

public MasterInfo() {
this.masterInfoListener = new ListenerNode<rocon_std_msgs.MasterInfo>();
}
@Override
public void onStart(final ConnectedNode connectedNode) {
RosTopicInfo topicInformation = new RosTopicInfo(connectedNode);
String topicName = topicInformation.findTopic("rocon_std_msgs/MasterInfo");
this.masterInfoListener.connect(connectedNode, topicName, rocon_std_msgs.MasterInfo._TYPE);
public void onStart (final ConnectedNode connectedNode) {
try{
RosTopicInfo topicInformation = new RosTopicInfo(connectedNode);
String topicName = topicInformation.findTopic("rocon_std_msgs/MasterInfo");
this.masterInfoListener.connect(connectedNode, topicName, rocon_std_msgs.MasterInfo._TYPE);
} catch (RosRuntimeException e){
try {
throw new MasterInfoException(e.getMessage());
} catch (MasterInfoException e1) {
e1.printStackTrace();
}
}
}

/**
* Wait for data to come in. This uses a default timeout
* set by ListenerNode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void waitForResponse() throws ListenerException, TimeoutException {
throw new ListenerException(e);
}
// timeout.
if ( count == 20 ) {
if ( count == 50 ) {
this.errorMessage = "timed out waiting for a " + subscriber.getTopicName() + "publication";
throw new TimeoutException(this.errorMessage);
}
Expand Down