ties
            cpObj.resetCache;
            
            % Create a new Java message object
            cpObj.JavaMessage = obj.createNewJavaMessage;
            
            % Recursively copy compound properties
            cpObj.Header = copy(obj.Header);
            cpObj.Footsteps = copy(obj.Footsteps);
        end
        
        function reload(obj, strObj)
            %reload Called by loadobj to assign properties
            obj.Header = robotics.ros.msggen.std_msgs.Header.loadobj(strObj.Header);
            FootstepsCell = arrayfun(@(x) robotics.ros.msggen.jsk_footstep_msgs.Footstep.loadobj(x), strObj.Footsteps, 'UniformOutput', false);
            obj.Footsteps = vertcat(FootstepsCell{:});
        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.Header = saveobj(obj.Header);
            strObj.Footsteps = arrayfun(@(x) saveobj(x), obj.Footsteps);
        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.jsk_footstep_msgs.FootstepArray.empty(0,1);
                return
            end
            
            % Create an empty message object
            obj = robotics.ros.msggen.jsk_footstep_msgs.FootstepArray;
            obj.reload(strObj);
        end
    end
end
