Skip to content

Commit 98e2be6

Browse files
ferrolhoHenrique Ferrolho
authored andcommitted
Temporarily disable hard-coded body_name for orientation constraints in ipopt.jl
1 parent 948374d commit 98e2be6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/transcription/ipopt.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ function solve_with_ipopt(problem::Problem, robot::Robot;
9898
append!(g_U, vec(con_ee))
9999
end
100100

101-
body_name = "panda_link7" # TODO ... hard-coded for now.
102101
# We want to iterate only through the constrained knots for this robot body/link.
103102
knots = filter(1:problem.num_knots) do knotᵢ
104-
knotᵢ keys(problem.constraints_body_orientation) &&
105-
body_name keys(problem.constraints_body_orientation[knotᵢ])
103+
# body_name = "panda_link7" # TODO ... hard-coded for now.
104+
# knotᵢ ∈ keys(problem.constraints_body_orientation) &&
105+
# body_name ∈ keys(problem.constraints_body_orientation[knotᵢ])
106+
knotᵢ keys(problem.constraints_body_orientation)
106107
end
107108

108109
jacdata = JacobianData((out, x) -> body_orientation!(out, robot, x), rand(3), rand(robot.n_q))
@@ -111,7 +112,8 @@ function solve_with_ipopt(problem::Problem, robot::Robot;
111112
# These are the target values for the equalities of Knitro.
112113
con_vals = mapreduce(hcat, knots; init=Matrix{Float64}(undef, 3, 0)) do k
113114
dₖ = problem.constraints_body_orientation[k]
114-
mrp = MRP(dₖ[body_name])
115+
# mrp = MRP(dₖ[body_name])
116+
mrp = MRP(dₖ |> values |> only)
115117
[mrp.x, mrp.y, mrp.z]
116118
end
117119

0 commit comments

Comments
 (0)