From c82535d560d339d50a8995b5889084b6de9e4647 Mon Sep 17 00:00:00 2001 From: Dexton Anderson Date: Wed, 4 Sep 2024 10:56:50 -0500 Subject: [PATCH] :arrow_up: ihmc-pub-sub 0.20.0 --- build.gradle.kts | 6 ++-- .../guiRecorder/GUICaptureReceiver.java | 14 ++++----- .../guiRecorder/GUICaptureStreamer.java | 31 +++++++++---------- .../rtps/VariableChangeRequestTest.java | 25 +++++++-------- 4 files changed, 36 insertions(+), 40 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9f03fae..a728c1c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ import us.ihmc.idl.generator.IDLGenerator buildscript { dependencies { - classpath("us.ihmc:ihmc-pub-sub-generator:0.19.2") + classpath("us.ihmc:ihmc-pub-sub-generator:0.20.0") } } @@ -41,8 +41,8 @@ mainDependencies { api("us.ihmc:ihmc-video-codecs:2.1.6") api("us.ihmc:ihmc-realtime:1.6.0") api("us.ihmc:ihmc-java-decklink-capture:0.4.0") - api("us.ihmc:ihmc-pub-sub:0.19.2") - api("us.ihmc:ihmc-pub-sub-serializers-extra:0.19.2") + api("us.ihmc:ihmc-pub-sub:0.20.0") + api("us.ihmc:ihmc-pub-sub-serializers-extra:0.20.0") api("us.ihmc:ihmc-commons:0.32.0") api("us.ihmc:ihmc-graphics-description:0.25.1") api("us.ihmc:mecano:17-0.18.1") diff --git a/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureReceiver.java b/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureReceiver.java index 5494047..1a04c7b 100644 --- a/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureReceiver.java +++ b/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureReceiver.java @@ -1,13 +1,10 @@ package us.ihmc.robotDataLogger.guiRecorder; -import java.io.IOException; -import java.nio.ByteBuffer; - -import com.eprosima.xmlschemas.fastrtps_profiles.ReliabilityQosKindType; +import com.eprosima.xmlschemas.fastrtps_profiles.ReliabilityQosKindPolicyType; import us.ihmc.pubsub.Domain; import us.ihmc.pubsub.DomainFactory; import us.ihmc.pubsub.DomainFactory.PubSubImplementation; -import us.ihmc.pubsub.attributes.ParticipantAttributes; +import us.ihmc.pubsub.attributes.ParticipantProfile; import us.ihmc.pubsub.attributes.SubscriberAttributes; import us.ihmc.pubsub.common.MatchingInfo; import us.ihmc.pubsub.participant.Participant; @@ -15,6 +12,9 @@ import us.ihmc.pubsub.subscriber.SubscriberListener; import us.ihmc.pubsub.types.ByteBufferPubSubType; +import java.io.IOException; +import java.nio.ByteBuffer; + public class GUICaptureReceiver implements SubscriberListener { private final String topicName; @@ -28,7 +28,7 @@ public GUICaptureReceiver(int domainID, String topicName, GUICaptureHandler hand this.topicName = topicName; this.handler = handler; - ParticipantAttributes participantAttributes = domain.createParticipantAttributes(domainID, getClass().getSimpleName()); + ParticipantProfile participantAttributes = domain.createParticipantAttributes(domainID, getClass().getSimpleName()); participant = domain.createParticipant(participantAttributes); } @@ -39,7 +39,7 @@ public void start() throws IllegalArgumentException, IOException SubscriberAttributes attributes = domain.createSubscriberAttributes(participant, pubSubType, topicName, - ReliabilityQosKindType.BEST_EFFORT, + ReliabilityQosKindPolicyType.BEST_EFFORT, GUICaptureStreamer.partition); domain.createSubscriber(participant, attributes, this); diff --git a/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureStreamer.java b/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureStreamer.java index 1fedb98..cbde18c 100644 --- a/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureStreamer.java +++ b/src/main/java/us/ihmc/robotDataLogger/guiRecorder/GUICaptureStreamer.java @@ -1,19 +1,6 @@ package us.ihmc.robotDataLogger.guiRecorder; -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; - -import javax.swing.JFrame; - -import com.eprosima.xmlschemas.fastrtps_profiles.ReliabilityQosKindType; +import com.eprosima.xmlschemas.fastrtps_profiles.ReliabilityQosKindPolicyType; import us.ihmc.codecs.generated.RGBPicture; import us.ihmc.codecs.generated.YUVPicture; import us.ihmc.codecs.generated.YUVPicture.YUVSubsamplingType; @@ -24,13 +11,23 @@ import us.ihmc.pubsub.Domain; import us.ihmc.pubsub.DomainFactory; import us.ihmc.pubsub.DomainFactory.PubSubImplementation; -import us.ihmc.pubsub.attributes.ParticipantAttributes; +import us.ihmc.pubsub.attributes.ParticipantProfile; import us.ihmc.pubsub.attributes.PublisherAttributes; import us.ihmc.pubsub.participant.Participant; import us.ihmc.pubsub.publisher.Publisher; import us.ihmc.pubsub.types.ByteBufferPubSubType; import us.ihmc.robotDataLogger.rtps.LogParticipantSettings; +import javax.swing.*; +import java.awt.*; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + public class GUICaptureStreamer { public static final String topicType = "us::ihmc::robotDataLogger::gui::screenshot"; @@ -66,7 +63,7 @@ public GUICaptureStreamer(Supplier windowBoundsProvider, int fps, flo this.topicName = topicName; try { - ParticipantAttributes attributes = domain.createParticipantAttributes(domainID, getClass().getSimpleName()); + ParticipantProfile attributes = domain.createParticipantAttributes(domainID, getClass().getSimpleName()); participant = domain.createParticipant(attributes); } @@ -83,7 +80,7 @@ public synchronized void start() future.cancel(false); } ByteBufferPubSubType pubSubType = new ByteBufferPubSubType(topicType, MAXIMUM_IMAGE_DATA_SIZE); - PublisherAttributes attributes = domain.createPublisherAttributes(participant, pubSubType, topicName, ReliabilityQosKindType.BEST_EFFORT, partition); + PublisherAttributes attributes = domain.createPublisherAttributes(participant, pubSubType, topicName, ReliabilityQosKindPolicyType.BEST_EFFORT, partition); try { publisher = domain.createPublisher(participant, attributes); diff --git a/src/test/java/us/ihmc/robotDataLogger/rtps/VariableChangeRequestTest.java b/src/test/java/us/ihmc/robotDataLogger/rtps/VariableChangeRequestTest.java index c1228a9..4fba01a 100644 --- a/src/test/java/us/ihmc/robotDataLogger/rtps/VariableChangeRequestTest.java +++ b/src/test/java/us/ihmc/robotDataLogger/rtps/VariableChangeRequestTest.java @@ -1,16 +1,12 @@ package us.ihmc.robotDataLogger.rtps; -import java.io.IOException; -import java.util.concurrent.atomic.AtomicInteger; - -import com.eprosima.xmlschemas.fastrtps_profiles.ReliabilityQosKindType; +import com.eprosima.xmlschemas.fastrtps_profiles.ReliabilityQosKindPolicyType; import org.junit.jupiter.api.Test; - import us.ihmc.commons.thread.ThreadTools; import us.ihmc.pubsub.Domain; import us.ihmc.pubsub.DomainFactory; import us.ihmc.pubsub.DomainFactory.PubSubImplementation; -import us.ihmc.pubsub.attributes.ParticipantAttributes; +import us.ihmc.pubsub.attributes.ParticipantProfile; import us.ihmc.pubsub.common.LogLevel; import us.ihmc.pubsub.common.MatchingInfo; import us.ihmc.pubsub.common.SampleInfo; @@ -21,6 +17,9 @@ import us.ihmc.robotDataLogger.VariableChangeRequest; import us.ihmc.robotDataLogger.VariableChangeRequestPubSubType; +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; + import static org.junit.jupiter.api.Assertions.*; public class VariableChangeRequestTest @@ -76,12 +75,12 @@ public void onNewDataMessage(Subscriber subscriber) Publisher publisher = domain.createPublisher(participant, domain.createPublisherAttributes(participant, type, "testTopic", - ReliabilityQosKindType.RELIABLE, + ReliabilityQosKindPolicyType.RELIABLE, "us.ihmc")); domain.createSubscriber(participant, domain.createSubscriberAttributes(participant, type, "testTopic", - ReliabilityQosKindType.RELIABLE, + ReliabilityQosKindPolicyType.RELIABLE, "us.ihmc"), listener); ThreadTools.sleep(1000); @@ -149,7 +148,7 @@ public void onNewDataMessage(Subscriber subscriber) Domain domain = DomainFactory.getDomain(PubSubImplementation.FAST_RTPS); domain.setLogLevel(LogLevel.WARNING); - ParticipantAttributes attr = domain.createParticipantAttributes(1, "TestParticipant"); + ParticipantProfile attr = domain.createParticipantAttributes(1, "TestParticipant"); attr.useOnlySharedMemoryTransport(); Participant participant = domain.createParticipant(attr); @@ -158,24 +157,24 @@ public void onNewDataMessage(Subscriber subscriber) Publisher publisher1 = domain.createPublisher(participant, domain.createPublisherAttributes(participant, type, "testTopic", - ReliabilityQosKindType.RELIABLE, + ReliabilityQosKindPolicyType.RELIABLE, "us/ihmc")); Publisher publisher2 = domain.createPublisher(participant, domain.createPublisherAttributes(participant, type, "testTopic", - ReliabilityQosKindType.RELIABLE, + ReliabilityQosKindPolicyType.RELIABLE, "us/ihmc")); Publisher publisher3 = domain.createPublisher(participant, domain.createPublisherAttributes(participant, type, "testTopic", - ReliabilityQosKindType.RELIABLE, + ReliabilityQosKindPolicyType.RELIABLE, "us/ihmc")); domain.createSubscriber(participant, domain.createSubscriberAttributes(participant, type, "testTopic", - ReliabilityQosKindType.RELIABLE, + ReliabilityQosKindPolicyType.RELIABLE, "us/ihmc"), listener); ThreadTools.sleep(1000);