Skip to content

Commit

Permalink
Merge branch 'master' into cleanup
Browse files Browse the repository at this point in the history
Conflicts:
	Contents.m
	configure.m
	examples/Acrobot/runDircol.m
	runAllTests.m
	systems/@DynamicalSystem/runLCM.m
	systems/@PolynomialSystem/PolynomialSystem.m
	systems/@PolynomialTrajectorySystem/PolynomialTrajectorySystem.m
	systems/plants/Manipulator.m

git-svn-id: https://svn.csail.mit.edu/locomotion/robotlib/branches/class-hierarchy-cleanup@3351 c9849af7-e679-4ec6-a44e-fc146a885bd3
  • Loading branch information
russt committed Jul 21, 2012
1 parent d46ab2f commit e7beec7
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Contents.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% Drake Toolbox
% Version 3.1.0 11-May-2012
% Version 4.0.0 (2019b) 21-July-2012
%
% MIT Robot Locomotion Group
% Drake Main Directory
Expand Down
30 changes: 30 additions & 0 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
All components of Drake are licensed under the BSD 3-Clause
License.

Copyright (c) 2012, Robot Locomotion Group @ CSAIL All rights
reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. Neither the name of
the Massachusetts Institute of Technology nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 21 additions & 2 deletions configure.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
end
end
end
end
end


% add drake directories to the matlab path
% add package directories to the matlab path
addpath([conf.root,'/systems']);
addpath([conf.root,'/systems/plants']);
addpath([conf.root,'/systems/controllers']);
Expand Down Expand Up @@ -108,6 +108,25 @@
end

conf.sedumi_enabled = logical(exist('sedumi'));
if (conf.sedumi_enabled)
disp('You seem to have SeDuMi installed, so I am just going to check that it runs properly.');
disp('-------------------------------------------------------------------------------------');
sedumiA=[10,2,3,4;5,7,6,4];
sedumib=[4;6];
sedumic=[0;1;0;1];
sedumiT=sedumi(sedumiA,sedumib,sedumic);
if(~sedumiT)
disp('-------------------------------------------------------------------------------------');
error('SeDuMi seems to have encountered a problem. Please verify that your SeDuMi install is working.');
disp('-------------------------------------------------------------------------------------');
else
disp('-------------------------------------------------------------------------------------');
disp('SeDuMi seems to be working - that''s what all the output, above, is showing.');
disp('-------------------------------------------------------------------------------------');
end

end

if (~conf.sedumi_enabled)
disp(' SeDuMi not found. SeDuMi support will be disabled. To re-enable, add SeDuMi to your matlab path and rerun configure. SeDuMi can be downloaded for free from http://sedumi.ie.lehigh.edu/ ');
end
Expand Down
77 changes: 77 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash

## deploy.sh - a bash script that generates a
## deployable PUBLIC bundle of Drake.

## DO NOT RUN THIS FROM THE TRUNK!!!!!
## You will need to run this from a working copy
## of the "drake" branch of robotlib.

## You need to always make sure that the following
## number actually matches the last version
## before copy - svn log --verbose --stop-on-copy
## will tell you what that is

SVN_LAST_REV_BEFORE_COPY=2845
SVN_SRC="https://svn.csail.mit.edu/locomotion/robotlib/trunk"

## TODO: change this once script is working
## this needs to be a working copy of the
## "drake" branch.

SVN_WORKING_COPY=`pwd`

## TODO: use credentials here. probably won't need this
## if we run from Hudson, or manually.
# SVN_USERNAME=""
# SNV_PASSWORD=""

## start by getting trunk merged over to us
echo "Going to svn merge trunk over to us..."
cd $SVN_WORKING_COPY
svn merge -r $SVN_LAST_REV_BEFORE_COPY:HEAD $SVN_SRC
echo "Done."

## Remove .svn directories.
echo "Removing all SVN housekeeping files..."
find . -depth -type d -name .svn -exec rm -rf {} \;
echo "Done."

# Remove dev directories
echo "Removing all dev directories..."
find . -depth -type d -name dev -exec rm -rf {} \;
echo "Done."

## Remove NORELEASE directories
echo "Getting rid of NORELEASE directories..."
for dir in `find . -type d -print`;
do
if [ -e $dir/.NORELEASE ]
then
echo "Removing $dir"
rm -rf $dir
fi
done
echo "Done."

## Remove NORELEASE files
echo "Getting rid of NORELEASE files..."
for file in `find . -type f`
do grep -q NORELEASE $file && rm $file
done

echo "Done."
echo "Release stripping is complete."

echo "Making a .tar.gz now..."
cd ../
tar cvf /tmp/drake.tar drake && gzip /tmp/drake.tar
echo "Done."
echo "The tar.gz is now at /tmp/drake.tar.gz."

echo "Making a .zip file now..."
zip -r /tmp/drake.zip drake
echo "Done."
echo "The zipfile is now at /tmp/drake.zip."

echo "All packaging is complete. Enjoy!"
22 changes: 17 additions & 5 deletions systems/@DrakeSystem/DrakeSystem.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% A DynamicalSystem with the functionality (dynamics, update, outputs,
% etc) implemented in matlab, so that it is amenable to, for instance, symbolic
% manipulations. These functions are wrapped as an S-Function in
% RLCSFunction.cpp.
% DCSFunction.cpp.

% constructor
methods
Expand Down Expand Up @@ -136,6 +136,13 @@
obj.direct_feedthrough_flag = tf;
end
function mdl = getModel(obj)
% First, make sure we have a compiled DCSFunction
if(exist('DCSFunction') ~=3)
errorMsg={'Sorry, you have not run ''make'' yet in the drake root,'
'which means you do not have the compiled MEX files needed to run this program.'
'Running configure and make in the drake root directory will fix this.'};
error(sprintf('%s\n',errorMsg{:}))
end
% make a simulink model from this block
mdl = [class(obj),'_',obj.uid]; % use the class name + uid as the model name
close_system(mdl,0); % close it if there is an instance already open
Expand Down Expand Up @@ -171,16 +178,17 @@
end
end

function x = resolveConstraints(obj,x0,v)
function [x,success] = resolveConstraints(obj,x0,v)
% attempts to find a x which satisfies the constraints,
% using x0 as the initial guess.
%
% @param x0 initial guess for state satisfying constraints
% @param v (optional) a visualizer that should be called while the
% solver is doing it's thing

if (obj.num_con < 1)
if (obj.num_xcon < 1)
x=x0;
success=true;
return;
end

Expand All @@ -189,12 +197,16 @@
v.draw(0,x);
end

if (nargin>1 && ~isempty(v)) % useful for debugging (only but only works for URDF manipulators)
if (nargin>2 && ~isempty(v)) % useful for debugging (only but only works for URDF manipulators)
options=optimset('Display','iter','Algorithm','levenberg-marquardt','OutputFcn',@drawme,'TolX',1e-9);
else
options=optimset('Display','off','Algorithm','levenberg-marquardt');
end
x = fsolve(@(x)stateConstraints(obj,x),x0,options);
[x,~,exitflag] = fsolve(@(x)stateConstraints(obj,x),x0,options);
success=(exitflag==1);
if (nargout<2 && ~success)
error('failed to resolve constraints');
end
end
end

Expand Down
4 changes: 4 additions & 0 deletions systems/@DynamicalSystem/simulate.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
% For variable step solver only
% @option OutputTimes to generate output in the time sequence options.OutputTimes

if(exist('DCSFunction') ~=3)
error('Sorry, it looks like yo have not run make yet. Please run configure and make, then rerun drake.')
end

typecheck(tspan,'double');
if (length(tspan)<2) error('length(tspan) must be > 1'); end
if (nargin<4) options=struct([]); end
Expand Down
2 changes: 1 addition & 1 deletion util/TaylorVar.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
d = reshape(obj.f,obj.dim);
for o=1:length(obj.df)
if (any(obj.df{o}(:)))
warning('converting taylorvar to double even though it has non-zero gradients. gradient information will be lost!');
warning('Drake:TaylorVar:DoubleConversion','converting taylorvar to double even though it has non-zero gradients. gradient information will be lost!');
end
end
end
Expand Down

0 comments on commit e7beec7

Please sign in to comment.