You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm doing pose graph optimization with theseus. I get the following error:
4294 Traceback (most recent call last):
4295 File "/home/stud/lxuh/LoopClosure_for_Gaussian_Splatting_SLAM/run_slam.py", line 109, in <module>
4296 gslam.run()
4297 File "/home/stud/lxuh/LoopClosure_for_Gaussian_Splatting_SLAM/src/entities/gaussian_slam.py", line 259, in run
4298 self.pose_graph_optimization(frame_id, gaussian_model)
4299 File "/home/stud/lxuh/LoopClosure_for_Gaussian_Splatting_SLAM/src/entities/gaussian_slam.py", line 177, in pose_graph_optimization
4300 optimize_info = self.pose_graph.optimize()
4301 File "/home/stud/lxuh/LoopClosure_for_Gaussian_Splatting_SLAM/src/entities/pose_graph.py", line 141, in optimize
4302 _, info = layer.forward(optimizer_kwargs={
4303 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/theseus_layer.py", line 93, in forward
4304 vars, info = _forward(
4305 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/theseus_layer.py", line 171, in _forward
4306 info = optimizer.optimize(**optimizer_kwargs)
4307 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/optimizer/optimizer.py", line 51, in optimize
4308 return self._optimize_impl(**kwargs)
4309 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/optimizer/nonlinear/nonlinear_least_squares.py", line 251, in _optimize_impl
4310 self._optimize_loop(
4311 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/optimizer/nonlinear/nonlinear_least_squares.py", line 117, in _optimize_loop
4312 self.linear_solver.linearization.linearize(
4313 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/optimizer/linearization.py", line 56, in linearize
4314 self._linearize_hessian_impl(_detach_hessian=_detach_hessian)
4315 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/optimizer/sparse_linearization.py", line 155, in _linearize_hessian_impl
4316 self._linearize_jacobian_impl()
4317 File "/home/stud/lxuh/miniconda3/envs/gslam/lib/python3.10/site-packages/theseus/optimizer/sparse_linearization.py", line 136, in _linearize_jacobian_impl
4318 pointer = block_pointers[var_idx_in_cost_function]
4319 IndexError: index 1 is out of bounds for axis 0 with size 1
My pose graph contains SE(3) nodes, and node_0 is defined as aux_var, the others are all opt_var. Every time I add a constraint between node_0 and node_i, I get this error during optimization. What can be the reason that causes this and how can I avoid?
The text was updated successfully, but these errors were encountered:
EmeryLee97
changed the title
IndexError when optimizing an error function between
IndexError when add an error function to objective with only one opt_var
Sep 3, 2024
Hi @EmeryLee97. What kind of constraint you are adding between the two nodes? Not sure if this is the cause of your error, but if the cost function class you are using expects both variables to be optimization variables, this will eventually result in an error during the optimization process.
Hi @EmeryLee97. What kind of constraint you are adding between the two nodes? Not sure if this is the cause of your error, but if the cost function class you are using expects both variables to be optimization variables, this will eventually result in an error during the optimization process.
I'm using the AutoDiffCostFunction, and a custom error function. The custom error function takes two inputs: opt_var and aux_var.
❓ Questions and Help
Hi, I'm doing pose graph optimization with theseus. I get the following error:
My pose graph contains SE(3) nodes, and node_0 is defined as aux_var, the others are all opt_var. Every time I add a constraint between node_0 and node_i, I get this error during optimization. What can be the reason that causes this and how can I avoid?
The text was updated successfully, but these errors were encountered: