Skip to content

Commit

Permalink
SVO logging (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
ds58 authored Jan 31, 2025
1 parent 7deeb25 commit c2258a5
Show file tree
Hide file tree
Showing 9 changed files with 677 additions and 20 deletions.
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mainDependencies {
api("us.ihmc:ihmc-video-codecs:2.1.6")
api("us.ihmc:ihmc-realtime:1.7.0")
api("us.ihmc:ihmc-java-decklink-capture:0.4.0")
api("us.ihmc:ihmc-pub-sub:1.1.5")
api("us.ihmc:ros2-library:1.1.5")
api("us.ihmc:ihmc-pub-sub-serializers-extra:1.1.5")
api("us.ihmc:ihmc-commons:0.34.0")
api("us.ihmc:ihmc-graphics-description:0.26.0")
Expand All @@ -61,6 +61,10 @@ mainDependencies {
api("org.bytedeco:openblas:$openblasVersion:linux-x86_64")
api("org.bytedeco:openblas:$openblasVersion:linux-arm64")
api("org.bytedeco:openblas:$openblasVersion:windows-x86_64")
// ZED SDK for logging remote ZED data streams
api("us.ihmc:zed-java-api:4.2.0_1") {
exclude(group = "org.bytedeco")
}

api("org.freedesktop.gstreamer:gst1-java-core:1.4.0")

Expand Down
10 changes: 10 additions & 0 deletions src/main/idl/ZEDSDK.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module us{
module ihmc{
module robotDataLogger{
struct ZEDSDKAnnounce{
string address;
short port;
};
};
};
};
114 changes: 114 additions & 0 deletions src/main/java-generated/us/ihmc/robotDataLogger/ZEDSDKAnnounce.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
package us.ihmc.robotDataLogger;

import us.ihmc.communication.packets.Packet;
import us.ihmc.euclid.interfaces.Settable;
import us.ihmc.euclid.interfaces.EpsilonComparable;
import java.util.function.Supplier;
import us.ihmc.pubsub.TopicDataType;

public class ZEDSDKAnnounce extends Packet<ZEDSDKAnnounce> implements Settable<ZEDSDKAnnounce>, EpsilonComparable<ZEDSDKAnnounce>
{
public java.lang.StringBuilder address_;
public short port_;

public ZEDSDKAnnounce()
{
address_ = new java.lang.StringBuilder(255);
}

public ZEDSDKAnnounce(ZEDSDKAnnounce other)
{
this();
set(other);
}

public void set(ZEDSDKAnnounce other)
{
address_.setLength(0);
address_.append(other.address_);

port_ = other.port_;

}

public void setAddress(java.lang.String address)
{
address_.setLength(0);
address_.append(address);
}

public java.lang.String getAddressAsString()
{
return getAddress().toString();
}
public java.lang.StringBuilder getAddress()
{
return address_;
}

public void setPort(short port)
{
port_ = port;
}
public short getPort()
{
return port_;
}


public static Supplier<ZEDSDKAnnouncePubSubType> getPubSubType()
{
return ZEDSDKAnnouncePubSubType::new;
}

@Override
public Supplier<TopicDataType> getPubSubTypePacket()
{
return ZEDSDKAnnouncePubSubType::new;
}

@Override
public boolean epsilonEquals(ZEDSDKAnnounce other, double epsilon)
{
if(other == null) return false;
if(other == this) return true;

if (!us.ihmc.idl.IDLTools.epsilonEqualsStringBuilder(this.address_, other.address_, epsilon)) return false;

if (!us.ihmc.idl.IDLTools.epsilonEqualsPrimitive(this.port_, other.port_, epsilon)) return false;


return true;
}

@Override
public boolean equals(Object other)
{
if(other == null) return false;
if(other == this) return true;
if(!(other instanceof ZEDSDKAnnounce)) return false;

ZEDSDKAnnounce otherMyClass = (ZEDSDKAnnounce) other;

if (!us.ihmc.idl.IDLTools.equals(this.address_, otherMyClass.address_)) return false;

if(this.port_ != otherMyClass.port_) return false;


return true;
}

@Override
public java.lang.String toString()
{
StringBuilder builder = new StringBuilder();

builder.append("ZEDSDKAnnounce {");
builder.append("address=");
builder.append(this.address_); builder.append(", ");
builder.append("port=");
builder.append(this.port_);
builder.append("}");
return builder.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package us.ihmc.robotDataLogger;

/**
*
* Topic data type of the struct "ZEDSDKAnnounce" defined in "ZEDSDK.idl". Use this class to provide the TopicDataType to a Participant.
*
* This file was automatically generated from ZEDSDK.idl by us.ihmc.idl.generator.IDLGenerator.
* Do not update this file directly, edit ZEDSDK.idl instead.
*
*/
public class ZEDSDKAnnouncePubSubType implements us.ihmc.pubsub.TopicDataType<us.ihmc.robotDataLogger.ZEDSDKAnnounce>
{
public static final java.lang.String name = "us::ihmc::robotDataLogger::ZEDSDKAnnounce";

@Override
public final java.lang.String getDefinitionChecksum()
{
return "9f246f58e62fc3a5fa946f596f47987112d8e383291e0da8503af3ec09242643";
}

@Override
public final java.lang.String getDefinitionVersion()
{
return "local";
}

private final us.ihmc.idl.CDR serializeCDR = new us.ihmc.idl.CDR();
private final us.ihmc.idl.CDR deserializeCDR = new us.ihmc.idl.CDR();

@Override
public void serialize(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, us.ihmc.pubsub.common.SerializedPayload serializedPayload) throws java.io.IOException
{
serializeCDR.serialize(serializedPayload);
write(data, serializeCDR);
serializeCDR.finishSerialize();
}

@Override
public void deserialize(us.ihmc.pubsub.common.SerializedPayload serializedPayload, us.ihmc.robotDataLogger.ZEDSDKAnnounce data) throws java.io.IOException
{
deserializeCDR.deserialize(serializedPayload);
read(data, deserializeCDR);
deserializeCDR.finishDeserialize();
}

public static int getMaxCdrSerializedSize()
{
return getMaxCdrSerializedSize(0);
}

public static int getMaxCdrSerializedSize(int current_alignment)
{
int initial_alignment = current_alignment;

current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + 255 + 1;
current_alignment += 2 + us.ihmc.idl.CDR.alignment(current_alignment, 2);


return current_alignment - initial_alignment;
}

public final static int getCdrSerializedSize(us.ihmc.robotDataLogger.ZEDSDKAnnounce data)
{
return getCdrSerializedSize(data, 0);
}

public final static int getCdrSerializedSize(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, int current_alignment)
{
int initial_alignment = current_alignment;

current_alignment += 4 + us.ihmc.idl.CDR.alignment(current_alignment, 4) + data.getAddress().length() + 1;

current_alignment += 2 + us.ihmc.idl.CDR.alignment(current_alignment, 2);



return current_alignment - initial_alignment;
}

public static void write(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, us.ihmc.idl.CDR cdr)
{
if(data.getAddress().length() <= 255)
cdr.write_type_d(data.getAddress());else
throw new RuntimeException("address field exceeds the maximum length");

cdr.write_type_1(data.getPort());

}

public static void read(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, us.ihmc.idl.CDR cdr)
{
cdr.read_type_d(data.getAddress());
data.setPort(cdr.read_type_1());


}

@Override
public final void serialize(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, us.ihmc.idl.InterchangeSerializer ser)
{
ser.write_type_d("address", data.getAddress());
ser.write_type_1("port", data.getPort());
}

@Override
public final void deserialize(us.ihmc.idl.InterchangeSerializer ser, us.ihmc.robotDataLogger.ZEDSDKAnnounce data)
{
ser.read_type_d("address", data.getAddress());
data.setPort(ser.read_type_1("port"));
}

public static void staticCopy(us.ihmc.robotDataLogger.ZEDSDKAnnounce src, us.ihmc.robotDataLogger.ZEDSDKAnnounce dest)
{
dest.set(src);
}

@Override
public us.ihmc.robotDataLogger.ZEDSDKAnnounce createData()
{
return new us.ihmc.robotDataLogger.ZEDSDKAnnounce();
}
@Override
public int getTypeSize()
{
return us.ihmc.idl.CDR.getTypeSize(getMaxCdrSerializedSize());
}

@Override
public java.lang.String getName()
{
return name;
}

public void serialize(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, us.ihmc.idl.CDR cdr)
{
write(data, cdr);
}

public void deserialize(us.ihmc.robotDataLogger.ZEDSDKAnnounce data, us.ihmc.idl.CDR cdr)
{
read(data, cdr);
}

public void copy(us.ihmc.robotDataLogger.ZEDSDKAnnounce src, us.ihmc.robotDataLogger.ZEDSDKAnnounce dest)
{
staticCopy(src, dest);
}

@Override
public ZEDSDKAnnouncePubSubType newInstance()
{
return new ZEDSDKAnnouncePubSubType();
}
}
Loading

0 comments on commit c2258a5

Please sign in to comment.