unityで VideoMsg.msgをビルドすると自動でできるコード特にいじらない
//Do not edit! This file was generated by Unity-ROS MessageGeneration.
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Unity.Robotics.ROSTCPConnector.MessageGeneration;
namespace RosMessageTypes.CppPubsub
{
[Serializable]
public class VideoMsgMsg : Message
{
public const string k_RosMessageName = "cpp_pubsub/VideoMsg";
public override string RosMessageName => k_RosMessageName;
public byte[] img_data_l;
public byte[] img_data_r;
public short[] audio_data;
public VideoMsgMsg()
{
this.img_data_l = new byte[0];
this.img_data_r = new byte[0];
this.audio_data = new short[0];
}
public VideoMsgMsg(byte[] img_data_l, byte[] img_data_r, short[] audio_data)
{
this.img_data_l = img_data_l;
this.img_data_r = img_data_r;
this.audio_data = audio_data;
}
public static VideoMsgMsg Deserialize(MessageDeserializer deserializer) => new VideoMsgMsg(deserializer);
private VideoMsgMsg(MessageDeserializer deserializer)
{
deserializer.Read(out this.img_data_l, sizeof(byte), deserializer.ReadLength());
deserializer.Read(out this.img_data_r, sizeof(byte), deserializer.ReadLength());
deserializer.Read(out this.audio_data, sizeof(short), deserializer.ReadLength());
}
public override void SerializeTo(MessageSerializer serializer)
{
serializer.WriteLength(this.img_data_l);
serializer.Write(this.img_data_l);
serializer.WriteLength(this.img_data_r);
serializer.Write(this.img_data_r);
serializer.WriteLength(this.audio_data);
serializer.Write(this.audio_data);
}
public override string ToString()
{
return "VideoMsgMsg: " +
"\nimg_data_l: " + System.String.Join(", ", img_data_l.ToList()) +
"\nimg_data_r: " + System.String.Join(", ", img_data_r.ToList()) +
"\naudio_data: " + System.String.Join(", ", audio_data.ToList());
}
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
#else
[UnityEngine.RuntimeInitializeOnLoadMethod]
#endif
public static void Register()
{
MessageRegistry.Register(k_RosMessageName, Deserialize);
}
}
}