www.gusucode.com > ros 工具箱 matlab源码程序 > ros/+robotics/+ros/+msggen/+ardrone_autonomy/matrix33.m
classdef matrix33 < robotics.ros.Message %matrix33 MATLAB implementation of ardrone_autonomy/matrix33 % This class was automatically generated by % robotics.ros.msg.internal.gen.MessageClassGenerator. % Copyright 2014-2016 The MathWorks, Inc. %#ok<*INUSD> properties (Constant) MessageType = 'ardrone_autonomy/matrix33' % The ROS message type end properties (Constant, Hidden) MD5Checksum = 'd6abfd8481fcb7c359a8d5d9388fa257' % The MD5 Checksum of the message definition end properties (Access = protected) JavaMessage % The Java message object end properties (Dependent) M11 M12 M13 M21 M22 M23 M31 M32 M33 end properties (Constant, Hidden) PropertyList = {'M11', 'M12', 'M13', 'M21', 'M22', 'M23', 'M31', 'M32', 'M33'} % List of non-constant message properties ROSPropertyList = {'m11', 'm12', 'm13', 'm21', 'm22', 'm23', 'm31', 'm32', 'm33'} % List of non-constant ROS message properties end methods function obj = matrix33(msg) %matrix33 Construct the message object matrix33 import com.mathworks.toolbox.robotics.ros.message.MessageInfo; % Support default constructor if nargin == 0 obj.JavaMessage = obj.createNewJavaMessage; return; end % Construct appropriate empty array if isempty(msg) obj = obj.empty(0,1); return; end % Make scalar construction fast if isscalar(msg) % Check for correct input class if ~MessageInfo.compareTypes(msg(1), obj.MessageType) error(message('robotics:ros:message:NoTypeMatch', obj.MessageType, ... char(MessageInfo.getType(msg(1))) )); end obj.JavaMessage = msg(1); return; end % Check that this is a vector of scalar messages. Since this % is an object array, use arrayfun to verify. if ~all(arrayfun(@isscalar, msg)) error(message('robotics:ros:message:MessageArraySizeError')); end % Check that all messages in the array have the correct type if ~all(arrayfun(@(x) MessageInfo.compareTypes(x, obj.MessageType), msg)) error(message('robotics:ros:message:NoTypeMatchArray', obj.MessageType)); end % Construct array of objects if necessary objType = class(obj); for i = 1:length(msg) obj(i,1) = feval(objType, msg(i)); %#ok<AGROW> end end function m11 = get.M11(obj) %get.M11 Get the value for property M11 m11 = single(obj.JavaMessage.getM11); end function set.M11(obj, m11) %set.M11 Set the value for property M11 validateattributes(m11, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M11'); obj.JavaMessage.setM11(m11); end function m12 = get.M12(obj) %get.M12 Get the value for property M12 m12 = single(obj.JavaMessage.getM12); end function set.M12(obj, m12) %set.M12 Set the value for property M12 validateattributes(m12, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M12'); obj.JavaMessage.setM12(m12); end function m13 = get.M13(obj) %get.M13 Get the value for property M13 m13 = single(obj.JavaMessage.getM13); end function set.M13(obj, m13) %set.M13 Set the value for property M13 validateattributes(m13, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M13'); obj.JavaMessage.setM13(m13); end function m21 = get.M21(obj) %get.M21 Get the value for property M21 m21 = single(obj.JavaMessage.getM21); end function set.M21(obj, m21) %set.M21 Set the value for property M21 validateattributes(m21, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M21'); obj.JavaMessage.setM21(m21); end function m22 = get.M22(obj) %get.M22 Get the value for property M22 m22 = single(obj.JavaMessage.getM22); end function set.M22(obj, m22) %set.M22 Set the value for property M22 validateattributes(m22, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M22'); obj.JavaMessage.setM22(m22); end function m23 = get.M23(obj) %get.M23 Get the value for property M23 m23 = single(obj.JavaMessage.getM23); end function set.M23(obj, m23) %set.M23 Set the value for property M23 validateattributes(m23, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M23'); obj.JavaMessage.setM23(m23); end function m31 = get.M31(obj) %get.M31 Get the value for property M31 m31 = single(obj.JavaMessage.getM31); end function set.M31(obj, m31) %set.M31 Set the value for property M31 validateattributes(m31, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M31'); obj.JavaMessage.setM31(m31); end function m32 = get.M32(obj) %get.M32 Get the value for property M32 m32 = single(obj.JavaMessage.getM32); end function set.M32(obj, m32) %set.M32 Set the value for property M32 validateattributes(m32, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M32'); obj.JavaMessage.setM32(m32); end function m33 = get.M33(obj) %get.M33 Get the value for property M33 m33 = single(obj.JavaMessage.getM33); end function set.M33(obj, m33) %set.M33 Set the value for property M33 validateattributes(m33, {'numeric'}, {'nonempty', 'scalar'}, 'matrix33', 'M33'); obj.JavaMessage.setM33(m33); end end methods (Access = protected) function cpObj = copyElement(obj) %copyElement Implements deep copy behavior for message % Call default copy method for shallow copy cpObj = copyElement@robotics.ros.Message(obj); % Create a new Java message object cpObj.JavaMessage = obj.createNewJavaMessage; % Iterate over all primitive properties cpObj.M11 = obj.M11; cpObj.M12 = obj.M12; cpObj.M13 = obj.M13; cpObj.M21 = obj.M21; cpObj.M22 = obj.M22; cpObj.M23 = obj.M23; cpObj.M31 = obj.M31; cpObj.M32 = obj.M32; cpObj.M33 = obj.M33; end function reload(obj, strObj) %reload Called by loadobj to assign properties obj.M11 = strObj.M11; obj.M12 = strObj.M12; obj.M13 = strObj.M13; obj.M21 = strObj.M21; obj.M22 = strObj.M22; obj.M23 = strObj.M23; obj.M31 = strObj.M31; obj.M32 = strObj.M32; obj.M33 = strObj.M33; end end methods (Access = ?robotics.ros.Message) function strObj = saveobj(obj) %saveobj Implements saving of message to MAT file % Return an empty element if object array is empty if isempty(obj) strObj = struct.empty; return end strObj.M11 = obj.M11; strObj.M12 = obj.M12; strObj.M13 = obj.M13; strObj.M21 = obj.M21; strObj.M22 = obj.M22; strObj.M23 = obj.M23; strObj.M31 = obj.M31; strObj.M32 = obj.M32; strObj.M33 = obj.M33; end end methods (Static, Access = {?matlab.unittest.TestCase, ?robotics.ros.Message}) function obj = loadobj(strObj) %loadobj Implements loading of message from MAT file % Return an empty object array if the structure element is not defined if isempty(strObj) obj = robotics.ros.msggen.ardrone_autonomy.matrix33.empty(0,1); return end % Create an empty message object obj = robotics.ros.msggen.ardrone_autonomy.matrix33; obj.reload(strObj); end end end