Ejemplo n.º 1
0
        public static int getCdrSerializedSize(trajectory_msgs.msg.MultiDOFJointTrajectoryPoint data, int current_alignment)
        {
            int initial_alignment = current_alignment;

            current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4);
            for (int i0 = 0; i0 < data.transforms.Count; ++i0)
            {
                current_alignment += geometry_msgs.msg.TransformPubSubType.getCdrSerializedSize(data.transforms[i0], current_alignment);
            }

            current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4);
            for (int i0 = 0; i0 < data.velocities.Count; ++i0)
            {
                current_alignment += geometry_msgs.msg.TwistPubSubType.getCdrSerializedSize(data.velocities[i0], current_alignment);
            }

            current_alignment += 4 + Halodi.CDR.CDRCommon.alignment(current_alignment, 4);
            for (int i0 = 0; i0 < data.accelerations.Count; ++i0)
            {
                current_alignment += geometry_msgs.msg.TwistPubSubType.getCdrSerializedSize(data.accelerations[i0], current_alignment);
            }

            current_alignment += builtin_interfaces.msg.DurationPubSubType.getCdrSerializedSize(data.time_from_start, current_alignment);


            return(current_alignment - initial_alignment);
        }
Ejemplo n.º 2
0
        public static void read(trajectory_msgs.msg.MultiDOFJointTrajectory data, Halodi.CDR.CDRDeserializer cdr)
        {
            data.header = std_msgs.msg.HeaderPubSubType.Create();
            std_msgs.msg.HeaderPubSubType.read(data.header, cdr);


            int joint_names_length = cdr.read_type_2();

            data.joint_names = new System.Collections.Generic.List <string>(joint_names_length);
            for (int i = 0; i < joint_names_length; i++)
            {
                data.joint_names.Add(cdr.read_type_d());
            }



            int points_length = cdr.read_type_2();

            data.points = new System.Collections.Generic.List <trajectory_msgs.msg.MultiDOFJointTrajectoryPoint>(points_length);
            for (int i = 0; i < points_length; i++)
            {
                trajectory_msgs.msg.MultiDOFJointTrajectoryPoint new_points = trajectory_msgs.msg.MultiDOFJointTrajectoryPointPubSubType.Create();
                trajectory_msgs.msg.MultiDOFJointTrajectoryPointPubSubType.read(new_points, cdr);
                data.points.Add(new_points);
            }
        }
Ejemplo n.º 3
0
 public override void deserialize(MemoryStream stream, trajectory_msgs.msg.MultiDOFJointTrajectoryPoint data)
 {
     using (BinaryReader reader = new BinaryReader(stream))
     {
         Halodi.CDR.CDRDeserializer cdr = new Halodi.CDR.CDRDeserializer(reader);
         read(data, cdr);
     }
 }
Ejemplo n.º 4
0
 public override void serialize(trajectory_msgs.msg.MultiDOFJointTrajectoryPoint data, MemoryStream stream)
 {
     using (BinaryWriter writer = new BinaryWriter(stream))
     {
         Halodi.CDR.CDRSerializer cdr = new Halodi.CDR.CDRSerializer(writer);
         write(data, cdr);
     }
 }
Ejemplo n.º 5
0
 public static void write(trajectory_msgs.msg.MultiDOFJointTrajectoryPoint data, Halodi.CDR.CDRSerializer cdr)
 {
     if (data.transforms == null)
     {
         cdr.write_type_2(0);
     }
     else
     {
         int transforms_length = data.transforms.Count;
         cdr.write_type_2(transforms_length);
         for (int i0 = 0; i0 < transforms_length; i0++)
         {
             geometry_msgs.msg.TransformPubSubType.write(data.transforms[i0], cdr);
         }
     }
     if (data.velocities == null)
     {
         cdr.write_type_2(0);
     }
     else
     {
         int velocities_length = data.velocities.Count;
         cdr.write_type_2(velocities_length);
         for (int i0 = 0; i0 < velocities_length; i0++)
         {
             geometry_msgs.msg.TwistPubSubType.write(data.velocities[i0], cdr);
         }
     }
     if (data.accelerations == null)
     {
         cdr.write_type_2(0);
     }
     else
     {
         int accelerations_length = data.accelerations.Count;
         cdr.write_type_2(accelerations_length);
         for (int i0 = 0; i0 < accelerations_length; i0++)
         {
             geometry_msgs.msg.TwistPubSubType.write(data.accelerations[i0], cdr);
         }
     }
     builtin_interfaces.msg.DurationPubSubType.write(data.time_from_start, cdr);
 }
Ejemplo n.º 6
0
        public static void read(trajectory_msgs.msg.MultiDOFJointTrajectoryPoint data, Halodi.CDR.CDRDeserializer cdr)
        {
            int transforms_length = cdr.read_type_2();

            data.transforms = new System.Collections.Generic.List <geometry_msgs.msg.Transform>(transforms_length);
            for (int i = 0; i < transforms_length; i++)
            {
                geometry_msgs.msg.Transform new_transforms = geometry_msgs.msg.TransformPubSubType.Create();
                geometry_msgs.msg.TransformPubSubType.read(new_transforms, cdr);
                data.transforms.Add(new_transforms);
            }



            int velocities_length = cdr.read_type_2();

            data.velocities = new System.Collections.Generic.List <geometry_msgs.msg.Twist>(velocities_length);
            for (int i = 0; i < velocities_length; i++)
            {
                geometry_msgs.msg.Twist new_velocities = geometry_msgs.msg.TwistPubSubType.Create();
                geometry_msgs.msg.TwistPubSubType.read(new_velocities, cdr);
                data.velocities.Add(new_velocities);
            }



            int accelerations_length = cdr.read_type_2();

            data.accelerations = new System.Collections.Generic.List <geometry_msgs.msg.Twist>(accelerations_length);
            for (int i = 0; i < accelerations_length; i++)
            {
                geometry_msgs.msg.Twist new_accelerations = geometry_msgs.msg.TwistPubSubType.Create();
                geometry_msgs.msg.TwistPubSubType.read(new_accelerations, cdr);
                data.accelerations.Add(new_accelerations);
            }


            data.time_from_start = builtin_interfaces.msg.DurationPubSubType.Create();
            builtin_interfaces.msg.DurationPubSubType.read(data.time_from_start, cdr);
        }
Ejemplo n.º 7
0
        public void Set(MultiDOFJointTrajectory other)
        {
            std_msgs.msg.HeaderPubSubType.Copy(other.header, header);


            if (other.joint_names == null)
            {
                joint_names = null;
            }
            else
            {
                joint_names = new System.Collections.Generic.List <string>(other.joint_names.Count);
                for (int i1 = 0; i1 < other.joint_names.Count; i1++)
                {
                    joint_names.Add(other.joint_names[i1]);
                }
            }

            if (other.points == null)
            {
                points = null;
            }
            else
            {
                points = new System.Collections.Generic.List <trajectory_msgs.msg.MultiDOFJointTrajectoryPoint>(other.points.Count);
                for (int i2 = 0; i2 < other.points.Count; i2++)
                {
                    if (other.points[i2] == null)
                    {
                        points.Add(null);
                    }
                    else
                    {
                        trajectory_msgs.msg.MultiDOFJointTrajectoryPoint newElement = trajectory_msgs.msg.MultiDOFJointTrajectoryPointPubSubType.Create();
                        trajectory_msgs.msg.MultiDOFJointTrajectoryPointPubSubType.Copy(other.points[i2], newElement);
                        points.Add(newElement);
                    }
                }
            }
        }
Ejemplo n.º 8
0
 public static int getCdrSerializedSize(trajectory_msgs.msg.MultiDOFJointTrajectoryPoint data)
 {
     return(getCdrSerializedSize(data, 0));
 }
Ejemplo n.º 9
0
 public static void Copy(trajectory_msgs.msg.MultiDOFJointTrajectoryPoint src, trajectory_msgs.msg.MultiDOFJointTrajectoryPoint target)
 {
     target.Set(src);
 }