public override void deserialize(MemoryStream stream, std_msgs.msg.Float64MultiArray data)
 {
     using (BinaryReader reader = new BinaryReader(stream))
     {
         Halodi.CDR.CDRDeserializer cdr = new Halodi.CDR.CDRDeserializer(reader);
         read(data, cdr);
     }
 }
 public override void serialize(std_msgs.msg.Float64MultiArray data, MemoryStream stream)
 {
     using (BinaryWriter writer = new BinaryWriter(stream))
     {
         Halodi.CDR.CDRSerializer cdr = new Halodi.CDR.CDRSerializer(writer);
         write(data, cdr);
     }
 }
        public static int getCdrSerializedSize(std_msgs.msg.Float64MultiArray data, int current_alignment)
        {
            int initial_alignment = current_alignment;

            current_alignment += std_msgs.msg.MultiArrayLayoutPubSubType.getCdrSerializedSize(data.layout, current_alignment);

            current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4);
            current_alignment += (data.data.Count * 8) + Halodi.CDR.CDRCommon.alignment(current_alignment, 8);



            return(current_alignment - initial_alignment);
        }
        public static void read(std_msgs.msg.Float64MultiArray data, Halodi.CDR.CDRDeserializer cdr)
        {
            data.layout = std_msgs.msg.MultiArrayLayoutPubSubType.Create();
            std_msgs.msg.MultiArrayLayoutPubSubType.read(data.layout, cdr);


            int data_length = cdr.read_type_2();

            data.data = new System.Collections.Generic.List <double>(data_length);
            for (int i = 0; i < data_length; i++)
            {
                data.data.Add(cdr.read_type_6());
            }
        }
Exemplo n.º 5
0
        public void SubscriptionTriggerCallback()
        {
            bool callbackTriggered = false;

            subscriptionNode.CreateSubscription <std_msgs.msg.Float64MultiArray>("subscription_test_topic", (msg) => { callbackTriggered = true; });

            std_msgs.msg.Float64MultiArray largeMsg = new std_msgs.msg.Float64MultiArray();
            double[] data = new double[1024];
            largeMsg.data = data.OfType <double>().ToList();

            publisher.Publish(largeMsg);
            Rclcs.SpinOnce(subscriptionNode, 0.1);

            Assert.That(callbackTriggered, Is.True);
        }
        public static void write(std_msgs.msg.Float64MultiArray data, Halodi.CDR.CDRSerializer cdr)
        {
            std_msgs.msg.MultiArrayLayoutPubSubType.write(data.layout, cdr);

            if (data.data == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int data_length = data.data.Count;
                cdr.write_type_2(data_length);
                for (int i0 = 0; i0 < data_length; i0++)
                {
                    cdr.write_type_6(data.data[i0]);
                }
            }
        }
 public static void Copy(std_msgs.msg.Float64MultiArray src, std_msgs.msg.Float64MultiArray target)
 {
     target.Set(src);
 }
 public static int getCdrSerializedSize(std_msgs.msg.Float64MultiArray data)
 {
     return(getCdrSerializedSize(data, 0));
 }