public static void main(String[] arg) throws URISyntaxException { RosMainNode mainNode = new RosMainNode(new URI("http://localhost:11311"), "testImu"); mainNode.attachSubscriber("/multisense/imu/imu_data", new RosImuSubscriber() { @Override protected void onNewMessage(long timeStamp, int seqId, Quat4d orientation, Vector3d angularVelocity, Vector3d linearAcceleration) { System.out.println("Gravity:"+ linearAcceleration); } }); mainNode.execute(); }
public void run() { //mainNode.attachSubscriber("/multisense/image_points2_color", subscriber); mainNode.attachSubscriber("/multisense/lidar_points2", subscriber); mainNode.attachPublisher("/testCloud", publisher); mainNode.attachPublisher("/tf", tfPublisher); mainNode.execute(); }
public RosLocalizationServiceClient(RosMainNode rosMainNode) { this.rosMainNode = rosMainNode; rosMainNode.attachServiceClient("/mapper_humanoid/set_mode", localizationClient); rosMainNode.attachServiceClient("/mapper_humanoid/reset", resetClient); }
public void run() { mainNode.attachPublisher("/tf", tfPublisher); mainNode.execute(); }
List<Map.Entry<String, RosTopicPublisher<? extends Message>>> customPublishers, String... additionalMessagePackages) throws IOException this.rosMainNode = new RosMainNode(rosUri, namespace + nodeName); this.robotModel = robotModel; this.controllerCommunicationBridge = rosAPI_communicator; rosMainNode.attachSubscriber(sub.getKey(), sub.getValue()); rosMainNode.attachPublisher(pub.getKey(), pub.getValue()); rosMainNode.execute(); while (!rosMainNode.isStarted())
public static void main(String[] args) throws URISyntaxException { RosMainNode mainNode = new RosMainNode(new URI("http://cpu0:11311"), "testDC"); RosDynamicReconfigure testDynamicReconfigure = new RosDynamicReconfigure("/left/camera/camera_nodelet", mainNode); mainNode.execute(); System.out.println("exposure:" + testDynamicReconfigure.setParameters(null).get("exposure")); testDynamicReconfigure.setDouble("exposure", -0.2); Map<String,Object> param = new HashMap<>(), ret; param.put("exposure", -0.1); ret=testDynamicReconfigure.setParameters(param); System.out.println(ret.get("exposure")); System.out.println("exposure:" + testDynamicReconfigure.setParameters(null).get("exposure")); System.exit(0); }
rosMainNode = new RosMainNode(rosUri, namespace + nodeName); rosMainNode.execute(); while(!rosMainNode.isStarted())
public RosFaceDetectionSubscriber(String topicName, RosMainNode node, PacketCommunicator packetCommunicator, ReferenceFrame cameraFrame) { super(PositionMeasurementArray._TYPE); this.packetCommunicator = packetCommunicator; this.cameraFrame = cameraFrame; node.attachSubscriber(topicName, this); }
public EchoPublisher(String messageType, boolean latched) { super(messageType, latched); }
@Override public void attachToRosMainNode(RosMainNode rosMainNode) { rosMainNode.attachPublisher("/clock", clockPubisher); }
public void receiveLidarFromROS(String lidarScanROSTopic, URI rosCoreURI) { String graphName = robotName + "/" + name; RosMainNode rosMainNode = new RosMainNode(rosCoreURI, graphName, true); receiveLidarFromROS(lidarScanROSTopic, rosMainNode); }
@Override public void updateRigidbodies(ArrayList<MocapRigidBody> listOfRigidbodies) { if(!mainNode.isStarted()) return; for (MocapRigidBody rigidBody : listOfRigidbodies) { Transform3d tmpTransform = new Transform3d(); tmpTransform.setTranslation(rigidBody.xPosition,rigidBody.yPosition,rigidBody.zPosition); tmpTransform.setRotation(new Quat4d(rigidBody.qx, rigidBody.qy, rigidBody.qz, rigidBody.qw)); tfPublisher.publish(tmpTransform, mainNode.getCurrentTime().totalNsecs(), "/mocap_world", "mocap/rigidBody"+rigidBody.getId()); } //System.out.println("Update rate: " + frequencyCalculator.determineCallFrequency() + " Hz"); }
@Override public void run() { if (Thread.interrupted()) { scheduler.shutdown(); } else if (rosMainNode.isStarted()) { statePublisher.publish(currentState); } } }
public void handleMultisenseParameters(MultisenseParameterPacket object) { if (object.isInitialize()) { if (rosMainNode.isStarted()) { params = rosMainNode.getParameters(); send(); } } else setMultisenseParameters(object); }
public void detach() { lidarSpriteGenerator.clear(); rosMainNode.removeSubscriber(pointCloudReceiver); }
public void publish(byte level, String message) { rosgraph_msgs.Log logMessage = getMessage(); std_msgs.Header header = logMessage.getHeader(); header.setStamp(rosMainNode.getCurrentTime()); header.setSeq(sequenceID++); logMessage.setHeader(header); logMessage.setLevel(level); logMessage.setMsg(message); publish(logMessage); } }
List<Map.Entry<String, RosTopicPublisher<? extends Message>>> customPublishers, String... additionalMessagePackages) throws IOException this.rosMainNode = new RosMainNode(rosUri, namespace + nodeName); this.robotModel = robotModel; this.controllerCommunicationBridge = rosAPI_communicator; rosMainNode.attachSubscriber(sub.getKey(), sub.getValue()); rosMainNode.attachPublisher(pub.getKey(), pub.getValue()); rosMainNode.execute(); while (!rosMainNode.isStarted())
public static void main(String[] args) throws URISyntaxException { RosMainNode mainNode = new RosMainNode(new URI("http://cpu0:11311"), "testDC"); RosDynamicReconfigure testDynamicReconfigure = new RosDynamicReconfigure("/left/camera/camera_nodelet", mainNode); mainNode.execute(); System.out.println("exposure:" + testDynamicReconfigure.setParameters(null).get("exposure")); testDynamicReconfigure.setDouble("exposure", -0.2); Map<String,Object> param = new HashMap<>(), ret; param.put("exposure", -0.1); ret=testDynamicReconfigure.setParameters(param); System.out.println(ret.get("exposure")); System.out.println("exposure:" + testDynamicReconfigure.setParameters(null).get("exposure")); System.exit(0); }
public RosPointCloudReceiver(String rosTopic, RosMainNode rosMainNode, ReferenceFrame cloudFrame, ReferenceFrame sensorframe, PointCloudDataReceiverInterface pointCloudDataReceiver, PointCloudSource... pointCloudSource) { this.rosTopic = rosTopic; this.cloudFrame = cloudFrame; this.pointCloudDataReceiver = pointCloudDataReceiver; this.sensorframe = sensorframe; this.pointCloudSource = pointCloudSource; rosMainNode.attachSubscriber(rosTopic, this); }
public EchoPublisher(String messageType, boolean latched) { super(messageType, latched); }