www.gusucode.com > ros 工具箱 matlab源码程序 > ros/+robotics/+ros/+msggen/+pr2_mechanism_controllers/SetProfileRequest.m
classdef SetProfileRequest < robotics.ros.Message %SetProfileRequest MATLAB implementation of pr2_mechanism_controllers/SetProfileRequest % This class was automatically generated by % robotics.ros.msg.internal.gen.MessageClassGenerator. % Copyright 2014-2016 The MathWorks, Inc. %#ok<*INUSD> properties (Constant) MessageType = 'pr2_mechanism_controllers/SetProfileRequest' % The ROS message type end properties (Constant, Hidden) MD5Checksum = '309001fc196b0094f23b1ae2bd672fb2' % The MD5 Checksum of the message definition end properties (Access = protected) JavaMessage % The Java message object end properties (Dependent) UpperTurnaround LowerTurnaround UpperDecelBuffer LowerDecelBuffer Profile Period Amplitude Offset end properties (Constant, Hidden) PropertyList = {'Amplitude', 'LowerDecelBuffer', 'LowerTurnaround', 'Offset', 'Period', 'Profile', 'UpperDecelBuffer', 'UpperTurnaround'} % List of non-constant message properties ROSPropertyList = {'amplitude', 'lowerDecelBuffer', 'LowerTurnaround', 'offset', 'period', 'profile', 'upperDecelBuffer', 'UpperTurnaround'} % List of non-constant ROS message properties end methods function obj = SetProfileRequest(msg) %SetProfileRequest Construct the message object SetProfileRequest 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 upperturnaround = get.UpperTurnaround(obj) %get.UpperTurnaround Get the value for property UpperTurnaround upperturnaround = double(obj.JavaMessage.getUpperTurnaround); end function set.UpperTurnaround(obj, upperturnaround) %set.UpperTurnaround Set the value for property UpperTurnaround validateattributes(upperturnaround, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'UpperTurnaround'); obj.JavaMessage.setUpperTurnaround(upperturnaround); end function lowerturnaround = get.LowerTurnaround(obj) %get.LowerTurnaround Get the value for property LowerTurnaround lowerturnaround = double(obj.JavaMessage.getLowerTurnaround); end function set.LowerTurnaround(obj, lowerturnaround) %set.LowerTurnaround Set the value for property LowerTurnaround validateattributes(lowerturnaround, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'LowerTurnaround'); obj.JavaMessage.setLowerTurnaround(lowerturnaround); end function upperdecelbuffer = get.UpperDecelBuffer(obj) %get.UpperDecelBuffer Get the value for property UpperDecelBuffer upperdecelbuffer = double(obj.JavaMessage.getUpperDecelBuffer); end function set.UpperDecelBuffer(obj, upperdecelbuffer) %set.UpperDecelBuffer Set the value for property UpperDecelBuffer validateattributes(upperdecelbuffer, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'UpperDecelBuffer'); obj.JavaMessage.setUpperDecelBuffer(upperdecelbuffer); end function lowerdecelbuffer = get.LowerDecelBuffer(obj) %get.LowerDecelBuffer Get the value for property LowerDecelBuffer lowerdecelbuffer = double(obj.JavaMessage.getLowerDecelBuffer); end function set.LowerDecelBuffer(obj, lowerdecelbuffer) %set.LowerDecelBuffer Set the value for property LowerDecelBuffer validateattributes(lowerdecelbuffer, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'LowerDecelBuffer'); obj.JavaMessage.setLowerDecelBuffer(lowerdecelbuffer); end function profile = get.Profile(obj) %get.Profile Get the value for property Profile profile = double(obj.JavaMessage.getProfile); end function set.Profile(obj, profile) %set.Profile Set the value for property Profile validateattributes(profile, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'Profile'); obj.JavaMessage.setProfile(profile); end function period = get.Period(obj) %get.Period Get the value for property Period period = double(obj.JavaMessage.getPeriod); end function set.Period(obj, period) %set.Period Set the value for property Period validateattributes(period, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'Period'); obj.JavaMessage.setPeriod(period); end function amplitude = get.Amplitude(obj) %get.Amplitude Get the value for property Amplitude amplitude = double(obj.JavaMessage.getAmplitude); end function set.Amplitude(obj, amplitude) %set.Amplitude Set the value for property Amplitude validateattributes(amplitude, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'Amplitude'); obj.JavaMessage.setAmplitude(amplitude); end function offset = get.Offset(obj) %get.Offset Get the value for property Offset offset = double(obj.JavaMessage.getOffset); end function set.Offset(obj, offset) %set.Offset Set the value for property Offset validateattributes(offset, {'numeric'}, {'nonempty', 'scalar'}, 'SetProfileRequest', 'Offset'); obj.JavaMessage.setOffset(offset); 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.UpperTurnaround = obj.UpperTurnaround; cpObj.LowerTurnaround = obj.LowerTurnaround; cpObj.UpperDecelBuffer = obj.UpperDecelBuffer; cpObj.LowerDecelBuffer = obj.LowerDecelBuffer; cpObj.Profile = obj.Profile; cpObj.Period = obj.Period; cpObj.Amplitude = obj.Amplitude; cpObj.Offset = obj.Offset; end function reload(obj, strObj) %reload Called by loadobj to assign properties obj.UpperTurnaround = strObj.UpperTurnaround; obj.LowerTurnaround = strObj.LowerTurnaround; obj.UpperDecelBuffer = strObj.UpperDecelBuffer; obj.LowerDecelBuffer = strObj.LowerDecelBuffer; obj.Profile = strObj.Profile; obj.Period = strObj.Period; obj.Amplitude = strObj.Amplitude; obj.Offset = strObj.Offset; 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.UpperTurnaround = obj.UpperTurnaround; strObj.LowerTurnaround = obj.LowerTurnaround; strObj.UpperDecelBuffer = obj.UpperDecelBuffer; strObj.LowerDecelBuffer = obj.LowerDecelBuffer; strObj.Profile = obj.Profile; strObj.Period = obj.Period; strObj.Amplitude = obj.Amplitude; strObj.Offset = obj.Offset; 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.pr2_mechanism_controllers.SetProfileRequest.empty(0,1); return end % Create an empty message object obj = robotics.ros.msggen.pr2_mechanism_controllers.SetProfileRequest; obj.reload(strObj); end end end