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

fixed the rotation and translation order in pgo datasets #560

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed the rotation and translation order in pgo datasets
  • Loading branch information
fantaosha committed Jun 27, 2023
commit b152c08a6c9c3f258c452f5a9e99055de549b474
4 changes: 2 additions & 2 deletions examples/configs/pose_graph/pose_graph_synthetic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ profile: True
savemat: True

num_poses: 256
rotation_noise: 0.05
translation_noise: 0.02
rotation_noise: 0.02
translation_noise: 0.05
mhmukadam marked this conversation as resolved.
Show resolved Hide resolved
loop_closure_ratio: 0.2
loop_closure_outlier_ratio: 0.25
dataset_size: 256
Expand Down
2 changes: 1 addition & 1 deletion examples/pose_graph/pose_graph_synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def run(cfg: omegaconf.OmegaConf):
dtype = torch.float64
pg, _ = theg.PoseGraphDataset.generate_synthetic_3D(
num_poses=cfg.num_poses,
rotation_noise=cfg.rotation_noise,
translation_noise=cfg.translation_noise,
rotation_noise=cfg.rotation_noise,
mhmukadam marked this conversation as resolved.
Show resolved Hide resolved
loop_closure_ratio=cfg.loop_closure_ratio,
loop_closure_outlier_ratio=cfg.loop_closure_outlier_ratio,
batch_size=cfg.batch_size,
Expand Down
24 changes: 12 additions & 12 deletions tests/theseus_tests/test_pgo_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def default_cfg():
def test_pgo_losses(default_cfg, linear_solver_cls):
# for everything except cholmod (need to turn off adaptive damping for that one)
expected_losses = [
-0.052539531380404174,
-0.0692269852973897,
-0.036454724975527056,
-0.0611037305508654,
-0.29886279606812166,
-0.3054215856589109,
-0.27485602196709225,
-0.3005231105990632,
]

default_cfg.inner_optim.linear_solver_cls = linear_solver_cls
Expand All @@ -47,10 +47,10 @@ def test_pgo_losses(default_cfg, linear_solver_cls):
if linear_solver_cls == "CholmodSparseSolver":
default_cfg.inner_optim.optimizer_kwargs.adaptive_damping = False
expected_losses = [
-0.05253953280865485,
-0.0692269853141562,
-0.036454725860367604,
-0.06110373100778682,
-0.2988627961673474,
-0.30542158576120654,
-0.27485602213117594,
-0.3005231108739672,
]
default_cfg.device = "cpu"
losses = pgo.run(default_cfg)
Expand All @@ -64,10 +64,10 @@ def test_pgo_losses(default_cfg, linear_solver_cls):
def test_pgo_losses_baspacho(default_cfg):
# for everything except cholmod (need to turn off adaptive damping for that one)
expected_losses = [
-0.05253953137899042,
-0.06922698529800682,
-0.03645472497536786,
-0.061103730548485655,
-0.2988627960682926,
-0.30542158565900696,
-0.27485602196705955,
-0.3005231105991407,
]

default_cfg.inner_optim.linear_solver_cls = "BaspachoSparseSolver"
Expand Down
14 changes: 7 additions & 7 deletions theseus/utils/examples/pose_graph/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def histogram(self) -> str:
@staticmethod
def generate_synthetic_3D(
num_poses: int,
rotation_noise: float = 0.05,
translation_noise: float = 0.1,
translation_noise: float = 0.05,
rotation_noise: float = 0.1,
loop_closure_ratio: float = 0.2,
loop_closure_outlier_ratio: float = 0.05,
max_num_loop_closures: int = 10,
Expand Down Expand Up @@ -282,10 +282,10 @@ def generate_synthetic_3D(
noise_relative_pose = th.SE3.exp_map(
torch.cat(
[
rotation_noise
* (2 * torch.rand(dataset_size, 3, dtype=dtype) - 1),
translation_noise
* (2.0 * torch.rand(dataset_size, 3, dtype=dtype) - 1),
rotation_noise
mhmukadam marked this conversation as resolved.
Show resolved Hide resolved
* (2.0 * torch.rand(dataset_size, 3, dtype=dtype) - 1),
],
dim=1,
)
Expand Down Expand Up @@ -322,10 +322,10 @@ def generate_synthetic_3D(
noise_relative_pose = th.SE3.exp_map(
torch.cat(
[
rotation_noise
* (2 * torch.rand(1, 3, dtype=dtype) - 1),
translation_noise
* (2.0 * torch.rand(1, 3, dtype=dtype) - 1),
rotation_noise
* (2.0 * torch.rand(1, 3, dtype=dtype) - 1),
],
dim=1,
)
Expand Down Expand Up @@ -354,8 +354,8 @@ def generate_synthetic_3D(
noise_pose = th.SE3.exp_map(
torch.cat(
[
rotation_noise * (2 * torch.rand(1, 3, dtype=dtype) - 1),
translation_noise * (2.0 * torch.rand(1, 3, dtype=dtype) - 1),
rotation_noise * (2.0 * torch.rand(1, 3, dtype=dtype) - 1),
],
dim=1,
)
Expand Down