Skip to content

Commit

Permalink
Merged binning into master
Browse files Browse the repository at this point in the history
  • Loading branch information
olzhas committed Oct 18, 2013
2 parents 4c08b2d + 5d37afe commit d43e60b
Show file tree
Hide file tree
Showing 4 changed files with 401 additions and 34 deletions.
10 changes: 2 additions & 8 deletions FNRedundantManipulator.m
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,12 @@ function update_link_position(this, ind)

function cost = calc_cost_euclidian(this, from_ind, dest_node)
% square root is not taken
temp_delta = this.tree.position(:, :, from_ind) - dest_node;
cost = sum((sum(temp_delta.^2, 2)));
cost = norm(this.tree.position(:, :, from_ind) - dest_node, 'fro');
end

function cost = calc_cost_angle(this, from_ind, dest_node)
% square root is not taken
temp_delta = this.tree.angle(:, from_ind) - dest_node;
cost = sum((sum(temp_delta.^2, 2)));
cost = norm(this.tree.angle(:, from_ind) - dest_node, 'fro');
end


Expand Down Expand Up @@ -661,13 +659,9 @@ function forced_removal(this)
this.cost(reused_node_ind) = this.calc_cost_euclidian(parent_node_ind, this.tree.position(:, :, reused_node_ind));
this.cumcost(reused_node_ind) = this.cumcost(parent_node_ind) + this.cost(reused_node_ind);
end

end

methods(Static)
function dist = euclidian_distance(src_pos, dest_pos)
dist = norm(src_pos - dest_pos);
end
function hCirc = plot_circle(x, y, r)
t = 0:0.001:2*pi;
cir_x = r*cos(t) + x;
Expand Down
Loading

0 comments on commit d43e60b

Please sign in to comment.