Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Between and VariableDiff with RelativePoseError and PosePriorError #136

Merged
merged 9 commits into from
Apr 4, 2022
Prev Previous commit
Next Next commit
Update pose_graph using Between and VariableDiff
  • Loading branch information
fantaosha committed Mar 29, 2022
commit 63618c1f302abc8dd670ab45aed0f78299ba4309
17 changes: 9 additions & 8 deletions examples/pose_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
objective = th.Objective(torch.float64)

for edge in edges:
cost_function = theg.RelativePoseError(
verts[edge.i], verts[edge.j], edge.relative_pose, edge.weight
cost_function = th.eb.Between(
verts[edge.i], verts[edge.j], edge.weight, edge.relative_pose
)
objective.add(cost_function)

Expand All @@ -33,16 +33,17 @@
objective = th.Objective(torch.float64)

for edge in edges:
cost_func = theg.RelativePoseError(
verts[edge.i], verts[edge.j], edge.relative_pose, edge.weight
cost_func = th.eb.Between(
verts[edge.i], verts[edge.j], edge.weight, edge.relative_pose
)
objective.add(cost_func)

objective.add(
theg.PosePriorError(
pose=verts[0], pose_prior=verts[0].copy(new_name=verts[0].name + "PRIOR")
)
pose_prior = th.eb.VariableDifference(
luisenp marked this conversation as resolved.
Show resolved Hide resolved
var=verts[0],
cost_weight=th.ScaleCostWeight(torch.tensor(1e-6, dtype=torch.float64)),
target=verts[0].copy(new_name=verts[0].name + "PRIOR"),
)
objective.add(pose_prior)

optimizer = th.LevenbergMarquardt( # GaussNewton(
objective,
Expand Down