public override void deserialize(MemoryStream stream, halodi_msgs.msg.WholeBodyTrajectoryPoint data)
 {
     using (BinaryReader reader = new BinaryReader(stream))
     {
         Halodi.CDR.CDRDeserializer cdr = new Halodi.CDR.CDRDeserializer(reader);
         read(data, cdr);
     }
 }
 public override void serialize(halodi_msgs.msg.WholeBodyTrajectoryPoint data, MemoryStream stream)
 {
     using (BinaryWriter writer = new BinaryWriter(stream))
     {
         Halodi.CDR.CDRSerializer cdr = new Halodi.CDR.CDRSerializer(writer);
         write(data, cdr);
     }
 }
Beispiel #3
0
        public static void read(halodi_msgs.msg.WholeBodyTrajectory data, Halodi.CDR.CDRDeserializer cdr)
        {
            data.trajectory_id = unique_identifier_msgs.msg.UUIDPubSubType.Create();
            unique_identifier_msgs.msg.UUIDPubSubType.read(data.trajectory_id, cdr);


            int start_time_length = cdr.read_type_2();

            data.start_time = new System.Collections.Generic.List <builtin_interfaces.msg.Time>(start_time_length);
            for (int i = 0; i < start_time_length; i++)
            {
                builtin_interfaces.msg.Time new_start_time = builtin_interfaces.msg.TimePubSubType.Create();
                builtin_interfaces.msg.TimePubSubType.read(new_start_time, cdr);
                data.start_time.Add(new_start_time);
            }



            int balance_mode_length = cdr.read_type_2();

            data.balance_mode = new System.Collections.Generic.List <halodi_msgs.msg.BalanceMode>(balance_mode_length);
            for (int i = 0; i < balance_mode_length; i++)
            {
                halodi_msgs.msg.BalanceMode new_balance_mode = halodi_msgs.msg.BalanceModePubSubType.Create();
                halodi_msgs.msg.BalanceModePubSubType.read(new_balance_mode, cdr);
                data.balance_mode.Add(new_balance_mode);
            }


            data.append_trajectory = cdr.read_type_7();

            data.interpolation_mode = halodi_msgs.msg.TrajectoryInterpolationPubSubType.Create();
            halodi_msgs.msg.TrajectoryInterpolationPubSubType.read(data.interpolation_mode, cdr);

            data.low_pass_filter_break_frequency = cdr.read_type_6();


            int trajectory_points_length = cdr.read_type_2();

            data.trajectory_points = new System.Collections.Generic.List <halodi_msgs.msg.WholeBodyTrajectoryPoint>(trajectory_points_length);
            for (int i = 0; i < trajectory_points_length; i++)
            {
                halodi_msgs.msg.WholeBodyTrajectoryPoint new_trajectory_points = halodi_msgs.msg.WholeBodyTrajectoryPointPubSubType.Create();
                halodi_msgs.msg.WholeBodyTrajectoryPointPubSubType.read(new_trajectory_points, cdr);
                data.trajectory_points.Add(new_trajectory_points);
            }
        }
        public static int getCdrSerializedSize(halodi_msgs.msg.WholeBodyTrajectoryPoint data, int current_alignment)
        {
            int initial_alignment = current_alignment;

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

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

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

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

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

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

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


            return(current_alignment - initial_alignment);
        }
Beispiel #5
0
        public void Set(WholeBodyTrajectory other)
        {
            unique_identifier_msgs.msg.UUIDPubSubType.Copy(other.trajectory_id, trajectory_id);


            if (other.start_time == null)
            {
                start_time = null;
            }
            else
            {
                start_time = new System.Collections.Generic.List <builtin_interfaces.msg.Time>(other.start_time.Count);
                for (int i1 = 0; i1 < other.start_time.Count; i1++)
                {
                    if (other.start_time[i1] == null)
                    {
                        start_time.Add(null);
                    }
                    else
                    {
                        builtin_interfaces.msg.Time newElement = builtin_interfaces.msg.TimePubSubType.Create();
                        builtin_interfaces.msg.TimePubSubType.Copy(other.start_time[i1], newElement);
                        start_time.Add(newElement);
                    }
                }
            }

            if (other.balance_mode == null)
            {
                balance_mode = null;
            }
            else
            {
                balance_mode = new System.Collections.Generic.List <halodi_msgs.msg.BalanceMode>(other.balance_mode.Count);
                for (int i2 = 0; i2 < other.balance_mode.Count; i2++)
                {
                    if (other.balance_mode[i2] == null)
                    {
                        balance_mode.Add(null);
                    }
                    else
                    {
                        halodi_msgs.msg.BalanceMode newElement = halodi_msgs.msg.BalanceModePubSubType.Create();
                        halodi_msgs.msg.BalanceModePubSubType.Copy(other.balance_mode[i2], newElement);
                        balance_mode.Add(newElement);
                    }
                }
            }
            append_trajectory = other.append_trajectory;

            halodi_msgs.msg.TrajectoryInterpolationPubSubType.Copy(other.interpolation_mode, interpolation_mode);

            low_pass_filter_break_frequency = other.low_pass_filter_break_frequency;


            if (other.trajectory_points == null)
            {
                trajectory_points = null;
            }
            else
            {
                trajectory_points = new System.Collections.Generic.List <halodi_msgs.msg.WholeBodyTrajectoryPoint>(other.trajectory_points.Count);
                for (int i3 = 0; i3 < other.trajectory_points.Count; i3++)
                {
                    if (other.trajectory_points[i3] == null)
                    {
                        trajectory_points.Add(null);
                    }
                    else
                    {
                        halodi_msgs.msg.WholeBodyTrajectoryPoint newElement = halodi_msgs.msg.WholeBodyTrajectoryPointPubSubType.Create();
                        halodi_msgs.msg.WholeBodyTrajectoryPointPubSubType.Copy(other.trajectory_points[i3], newElement);
                        trajectory_points.Add(newElement);
                    }
                }
            }
        }
        public static void write(halodi_msgs.msg.WholeBodyTrajectoryPoint data, Halodi.CDR.CDRSerializer cdr)
        {
            builtin_interfaces.msg.DurationPubSubType.write(data.time_from_start, cdr);

            if (data.task_space_commands == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int task_space_commands_length = data.task_space_commands.Count;
                cdr.write_type_2(task_space_commands_length);
                for (int i0 = 0; i0 < task_space_commands_length; i0++)
                {
                    halodi_msgs.msg.TaskSpaceCommandPubSubType.write(data.task_space_commands[i0], cdr);
                }
            }
            if (data.joint_space_commands == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int joint_space_commands_length = data.joint_space_commands.Count;
                cdr.write_type_2(joint_space_commands_length);
                for (int i0 = 0; i0 < joint_space_commands_length; i0++)
                {
                    halodi_msgs.msg.JointSpaceCommandPubSubType.write(data.joint_space_commands[i0], cdr);
                }
            }
            if (data.contact_point_commands == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int contact_point_commands_length = data.contact_point_commands.Count;
                cdr.write_type_2(contact_point_commands_length);
                for (int i0 = 0; i0 < contact_point_commands_length; i0++)
                {
                    halodi_msgs.msg.ContactPointCommandPubSubType.write(data.contact_point_commands[i0], cdr);
                }
            }
            if (data.icp_offset_command == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int icp_offset_command_length = data.icp_offset_command.Count;
                cdr.write_type_2(icp_offset_command_length);
                for (int i0 = 0; i0 < icp_offset_command_length; i0++)
                {
                    geometry_msgs.msg.Vector3PubSubType.write(data.icp_offset_command[i0], cdr);
                }
            }
            if (data.left_hand_command == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int left_hand_command_length = data.left_hand_command.Count;
                cdr.write_type_2(left_hand_command_length);
                for (int i0 = 0; i0 < left_hand_command_length; i0++)
                {
                    halodi_msgs.msg.HandCommandPubSubType.write(data.left_hand_command[i0], cdr);
                }
            }
            if (data.right_hand_command == null)
            {
                cdr.write_type_2(0);
            }
            else
            {
                int right_hand_command_length = data.right_hand_command.Count;
                cdr.write_type_2(right_hand_command_length);
                for (int i0 = 0; i0 < right_hand_command_length; i0++)
                {
                    halodi_msgs.msg.HandCommandPubSubType.write(data.right_hand_command[i0], cdr);
                }
            }
        }
 public static int getCdrSerializedSize(halodi_msgs.msg.WholeBodyTrajectoryPoint data)
 {
     return(getCdrSerializedSize(data, 0));
 }
 public static void Copy(halodi_msgs.msg.WholeBodyTrajectoryPoint src, halodi_msgs.msg.WholeBodyTrajectoryPoint target)
 {
     target.Set(src);
 }
        public static void read(halodi_msgs.msg.WholeBodyTrajectoryPoint data, Halodi.CDR.CDRDeserializer cdr)
        {
            data.time_from_start = builtin_interfaces.msg.DurationPubSubType.Create();
            builtin_interfaces.msg.DurationPubSubType.read(data.time_from_start, cdr);


            int task_space_commands_length = cdr.read_type_2();

            data.task_space_commands = new System.Collections.Generic.List <halodi_msgs.msg.TaskSpaceCommand>(task_space_commands_length);
            for (int i = 0; i < task_space_commands_length; i++)
            {
                halodi_msgs.msg.TaskSpaceCommand new_task_space_commands = halodi_msgs.msg.TaskSpaceCommandPubSubType.Create();
                halodi_msgs.msg.TaskSpaceCommandPubSubType.read(new_task_space_commands, cdr);
                data.task_space_commands.Add(new_task_space_commands);
            }



            int joint_space_commands_length = cdr.read_type_2();

            data.joint_space_commands = new System.Collections.Generic.List <halodi_msgs.msg.JointSpaceCommand>(joint_space_commands_length);
            for (int i = 0; i < joint_space_commands_length; i++)
            {
                halodi_msgs.msg.JointSpaceCommand new_joint_space_commands = halodi_msgs.msg.JointSpaceCommandPubSubType.Create();
                halodi_msgs.msg.JointSpaceCommandPubSubType.read(new_joint_space_commands, cdr);
                data.joint_space_commands.Add(new_joint_space_commands);
            }



            int contact_point_commands_length = cdr.read_type_2();

            data.contact_point_commands = new System.Collections.Generic.List <halodi_msgs.msg.ContactPointCommand>(contact_point_commands_length);
            for (int i = 0; i < contact_point_commands_length; i++)
            {
                halodi_msgs.msg.ContactPointCommand new_contact_point_commands = halodi_msgs.msg.ContactPointCommandPubSubType.Create();
                halodi_msgs.msg.ContactPointCommandPubSubType.read(new_contact_point_commands, cdr);
                data.contact_point_commands.Add(new_contact_point_commands);
            }



            int icp_offset_command_length = cdr.read_type_2();

            data.icp_offset_command = new System.Collections.Generic.List <geometry_msgs.msg.Vector3>(icp_offset_command_length);
            for (int i = 0; i < icp_offset_command_length; i++)
            {
                geometry_msgs.msg.Vector3 new_icp_offset_command = geometry_msgs.msg.Vector3PubSubType.Create();
                geometry_msgs.msg.Vector3PubSubType.read(new_icp_offset_command, cdr);
                data.icp_offset_command.Add(new_icp_offset_command);
            }



            int left_hand_command_length = cdr.read_type_2();

            data.left_hand_command = new System.Collections.Generic.List <halodi_msgs.msg.HandCommand>(left_hand_command_length);
            for (int i = 0; i < left_hand_command_length; i++)
            {
                halodi_msgs.msg.HandCommand new_left_hand_command = halodi_msgs.msg.HandCommandPubSubType.Create();
                halodi_msgs.msg.HandCommandPubSubType.read(new_left_hand_command, cdr);
                data.left_hand_command.Add(new_left_hand_command);
            }



            int right_hand_command_length = cdr.read_type_2();

            data.right_hand_command = new System.Collections.Generic.List <halodi_msgs.msg.HandCommand>(right_hand_command_length);
            for (int i = 0; i < right_hand_command_length; i++)
            {
                halodi_msgs.msg.HandCommand new_right_hand_command = halodi_msgs.msg.HandCommandPubSubType.Create();
                halodi_msgs.msg.HandCommandPubSubType.read(new_right_hand_command, cdr);
                data.right_hand_command.Add(new_right_hand_command);
            }
        }