Skip to content

Commit

Permalink
⬆️ ihmc-pub-sub 0.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ds58 committed Sep 4, 2024
1 parent c1190c1 commit c82535d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 40 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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;
import us.ihmc.pubsub.subscriber.Subscriber;
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;
Expand All @@ -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);

}
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -66,7 +63,7 @@ public GUICaptureStreamer(Supplier<Rectangle> 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);

}
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit c82535d

Please sign in to comment.