www.gusucode.com > robotsimulink 工具箱 matlab源码程序 > robotsimulink/robotslros/+robotics/+slros/+internal/+diag/recoverROSFolderFromWorkspace.m

    function returnInfo = recoverROSFolderFromWorkspace( hostname, sshPort, username, password, catkinWs )
%This function is for internal use only. It may be removed in the future.

%recoverROSFolderFromWorkspace Recover the ROS installation folder from a Catkin workspace
%   This function is called by the "FixIt" diagnostic action if the ROS
%   folder is not valid and the user wants to use the Catkin workspace
%   to recover it.

%   Copyright 2016 The MathWorks, Inc.

% Connect to device
diag = robotics.slros.internal.diag.DeviceDiagnostics;
diag.connect(hostname, sshPort, username, password);

% Recover the ROS folder. This will return empty if the operation fails.
rosFolder = diag.recoverROSFolderFromCatkinWorkspace(catkinWs);

if ~isempty(rosFolder)
    % Found ROS installation folder
    distName = diag.getROSDistribution(rosFolder);
    returnInfo = message('robotics:robotslros:devicediag:ROSFolderRecoverySuccess', upper(distName), rosFolder).getString;
else
    % Did not find a install ROS folder. Throw an exception.
    error(message('robotics:robotslros:devicediag:ROSFolderCatkinRecoveryFailure', catkinWs));
end

end