Skip to content

Commit

Permalink
prefix only on matlab side
Browse files Browse the repository at this point in the history
  • Loading branch information
RussTedrake committed Aug 19, 2015
1 parent 8c29c49 commit aa912e6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 4 additions & 2 deletions drake/systems/frames/@CoordinateFrame/CoordinateFrame.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
% explicit about these coordinate systems when they make combinations of
% systems.

properties (Access=private)
properties (Access=protected)
prefix='';
transforms={}; % handles to CoordinateTransform objects
poly=[]; % optional msspoly variables for this frame
end
Expand Down Expand Up @@ -67,8 +68,9 @@
end

mex_ptr_args = cell(1,3);
[mex_ptr_args{:}] = CoordinateFrame.new(name,dim,prefix(1),coordinates);
[mex_ptr_args{:}] = CoordinateFrame.new(name,dim,coordinates);
obj = obj@DrakeMexPointer(mex_ptr_args{:});
obj.prefix = prefix;
end

function tf = hasSamePrefix(frame1,frame2)
Expand Down
7 changes: 3 additions & 4 deletions drake/systems/frames/@CoordinateFrame/new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ void mexFunction( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] ) {
return;
}

if (nrhs<4) mexErrMsgIdAndTxt("Drake:CoordinateFrame:BadInputs","Usage: new(name,dim,prefix,coordinates)");
if (nrhs<3) mexErrMsgIdAndTxt("Drake:CoordinateFrame:BadInputs","Usage: new(name,dim,coordinates)");

string name = mxGetStdString(prhs[0]);
unsigned int dim = static_cast<unsigned int>(mxGetScalar(prhs[1]));
string prefix = mxGetStdString(prhs[2]);
vector<string> coordinates = mxGetVectorOfStdStrings(prhs[3]);
vector<string> coordinates = mxGetVectorOfStdStrings(prhs[2]);

CoordinateFrame* frame = new CoordinateFrame(name,dim,prefix,coordinates);
CoordinateFrame* frame = new CoordinateFrame(name,dim,coordinates);

populateDrakeMexPointerArguments(nlhs, plhs, frame, name,0,NULL,"CoordinateFrame.");
}
5 changes: 2 additions & 3 deletions drake/systems/frames/CoordinateFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

class DLLEXPORT_FRAME CoordinateFrame {
public:
CoordinateFrame(std::string& _name, unsigned int _dim, std::string& _prefix, std::vector<std::string>& _coordinates)
: name(_name), dim(_dim), prefix(_prefix), coordinates(_coordinates) {};
CoordinateFrame(std::string& _name, unsigned int _dim, std::vector<std::string>& _coordinates)
: name(_name), dim(_dim), coordinates(_coordinates) {};
virtual ~CoordinateFrame(void) {};

const std::string& getName() const { return name; };
Expand All @@ -40,7 +40,6 @@ class DLLEXPORT_FRAME CoordinateFrame {
private:
std::string name;
unsigned int dim;
std::string prefix;
std::vector<std::string> coordinates;
};

Expand Down
2 changes: 1 addition & 1 deletion drake/systems/plants/@Manipulator/Manipulator.m
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ function num_contacts(obj)
obj.joint_limit_max = jl_max;

con = BoundingBoxConstraint(jl_min,jl_max);
con = setName(con,cellfun(@(a) [a,'_limit'],obj.getPositionFrame.coordinates,'UniformOutput',false));
con = setName(con,cellfun(@(a) [a,'_limit'],obj.getPositionFrame.getCoordinateNames(),'UniformOutput',false));
if isempty(obj.joint_limit_constraint_id)
if any(jl_min~=-inf) || any(jl_max~=inf)
[obj,id] = addStateConstraint(obj,con,1:obj.getNumPositions);
Expand Down
2 changes: 1 addition & 1 deletion drake/util/DrakeMexPointer.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
end

function delete(obj)
if ~isempty(obj.delete_fcn) % useful for debugging
if 0 %~isempty(obj.delete_fcn) % useful for debugging
fprintf(1,'Calling %s(',obj.delete_fcn);
celldisp(obj.delete_fcn_additional_inputs);
fprintf(1,') to delete ');
Expand Down
2 changes: 1 addition & 1 deletion drake/util/drakeMexUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mxArray* stdStringToMatlab(const std::string& str)
}

mxArray* vectorOfStdStringsToMatlab(const std::vector<std::string>& strs) {
mxArray* cell = mxCreateCellMatrix(1,strs.size());
mxArray* cell = mxCreateCellMatrix(strs.size(),1);
for (int i=0; i<strs.size(); i++) {
mxSetCell(cell,i,mxCreateString(strs[i].c_str()));
}
Expand Down

0 comments on commit aa912e6

Please sign in to comment.