public override void deserialize(MemoryStream stream, halodi_msgs.msg.JointStatus 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.JointStatus data, MemoryStream stream)
 {
     using (BinaryWriter writer = new BinaryWriter(stream))
     {
         Halodi.CDR.CDRSerializer cdr = new Halodi.CDR.CDRSerializer(writer);
         write(data, cdr);
     }
 }
        public static void write(halodi_msgs.msg.JointStatus data, Halodi.CDR.CDRSerializer cdr)
        {
            halodi_msgs.msg.JointNamePubSubType.write(data.joint, cdr);

            cdr.write_type_9(data.status_level);

            cdr.write_type_7(data.critical_for_balance);

            cdr.write_type_7(data.output_encoder_fault);

            cdr.write_type_7(data.tension_ropes);
        }
        public static void read(halodi_msgs.msg.JointStatus data, Halodi.CDR.CDRDeserializer cdr)
        {
            data.joint = halodi_msgs.msg.JointNamePubSubType.Create();
            halodi_msgs.msg.JointNamePubSubType.read(data.joint, cdr);

            data.status_level = cdr.read_type_9();

            data.critical_for_balance = cdr.read_type_7();

            data.output_encoder_fault = cdr.read_type_7();

            data.tension_ropes = cdr.read_type_7();
        }
Esempio n. 5
0
        public static void read(halodi_msgs.msg.RobotStatus data, Halodi.CDR.CDRDeserializer cdr)
        {
            data.header = std_msgs.msg.HeaderPubSubType.Create();
            std_msgs.msg.HeaderPubSubType.read(data.header, cdr);

            data.robot_status_level = cdr.read_type_9();

            data.battery_status = halodi_msgs.msg.BatteryStatusPubSubType.Create();
            halodi_msgs.msg.BatteryStatusPubSubType.read(data.battery_status, cdr);

            data.backpack_estop_enabled = cdr.read_type_7();

            data.wireless_estop_enabled = cdr.read_type_7();

            data.over_temperature = cdr.read_type_7();

            data.driving_disabled = cdr.read_type_7();


            int joint_status_length = cdr.read_type_2();

            data.joint_status = new System.Collections.Generic.List <halodi_msgs.msg.JointStatus>(joint_status_length);
            for (int i = 0; i < joint_status_length; i++)
            {
                halodi_msgs.msg.JointStatus new_joint_status = halodi_msgs.msg.JointStatusPubSubType.Create();
                halodi_msgs.msg.JointStatusPubSubType.read(new_joint_status, cdr);
                data.joint_status.Add(new_joint_status);
            }



            int motor_status_length = cdr.read_type_2();

            data.motor_status = new System.Collections.Generic.List <halodi_msgs.msg.MotorStatus>(motor_status_length);
            for (int i = 0; i < motor_status_length; i++)
            {
                halodi_msgs.msg.MotorStatus new_motor_status = halodi_msgs.msg.MotorStatusPubSubType.Create();
                halodi_msgs.msg.MotorStatusPubSubType.read(new_motor_status, cdr);
                data.motor_status.Add(new_motor_status);
            }


            data.runtime_since_start = cdr.read_type_4();

            data.total_runtime = cdr.read_type_4();

            data.numberOfRuns = cdr.read_type_4();
        }
        public static int getCdrSerializedSize(halodi_msgs.msg.JointStatus data, int current_alignment)
        {
            int initial_alignment = current_alignment;

            current_alignment += halodi_msgs.msg.JointNamePubSubType.getCdrSerializedSize(data.joint, current_alignment);

            current_alignment += 1 + Halodi.CDR.CDRCommon.alignment(current_alignment, 1);


            current_alignment += 1 + Halodi.CDR.CDRCommon.alignment(current_alignment, 1);


            current_alignment += 1 + Halodi.CDR.CDRCommon.alignment(current_alignment, 1);


            current_alignment += 1 + Halodi.CDR.CDRCommon.alignment(current_alignment, 1);



            return(current_alignment - initial_alignment);
        }
Esempio n. 7
0
        public void Set(RobotStatus other)
        {
            std_msgs.msg.HeaderPubSubType.Copy(other.header, header);

            robot_status_level = other.robot_status_level;

            halodi_msgs.msg.BatteryStatusPubSubType.Copy(other.battery_status, battery_status);

            backpack_estop_enabled = other.backpack_estop_enabled;

            wireless_estop_enabled = other.wireless_estop_enabled;

            over_temperature = other.over_temperature;

            driving_disabled = other.driving_disabled;


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

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

            total_runtime = other.total_runtime;

            numberOfRuns = other.numberOfRuns;
        }
 public static void Copy(halodi_msgs.msg.JointStatus src, halodi_msgs.msg.JointStatus target)
 {
     target.Set(src);
 }
 public static int getCdrSerializedSize(halodi_msgs.msg.JointStatus data)
 {
     return(getCdrSerializedSize(data, 0));
 }