{"action":"created","issue":{"url":"https://api.github.com/repos/ethz-asl/kalibr/issues/236","repository_url":"https://api.github.com/repos/ethz-asl/kalibr","labels_url":"https://api.github.com/repos/ethz-asl/kalibr/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/ethz-asl/kalibr/issues/236/comments","events_url":"https://api.github.com/repos/ethz-asl/kalibr/issues/236/events","html_url":"https://github.com/ethz-asl/kalibr/issues/236","id":373654617,"node_id":"MDU6SXNzdWUzNzM2NTQ2MTc=","number":236,"title":"Optimizer Eigen assertion when calibrating with \"none\" distortion models","user":{"login":"caselitz","id":13644101,"node_id":"MDQ6VXNlcjEzNjQ0MTAx","avatar_url":"https://avatars3.githubusercontent.com/u/13644101?v=4","gravatar_id":"","url":"https://api.github.com/users/caselitz","html_url":"https://github.com/caselitz","followers_url":"https://api.github.com/users/caselitz/followers","following_url":"https://api.github.com/users/caselitz/following{/other_user}","gists_url":"https://api.github.com/users/caselitz/gists{/gist_id}","starred_url":"https://api.github.com/users/caselitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caselitz/subscriptions","organizations_url":"https://api.github.com/users/caselitz/orgs","repos_url":"https://api.github.com/users/caselitz/repos","events_url":"https://api.github.com/users/caselitz/events{/privacy}","received_events_url":"https://api.github.com/users/caselitz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-10-24T20:04:05Z","updated_at":"2018-10-30T17:56:13Z","closed_at":null,"author_association":"NONE","body":"Hi all,\r\n\r\nI experienced the following issue when trying to `kalibr_calibrate_cameras`:\r\n\r\n```\r\nkalibr_calibrate_cameras --bag ~/Downloads/BF2M2020S23-1.bag --topics /cam0/image_raw --models ds-none --target ~/Desktop/target.yaml --verbose\r\nimporting libraries\r\nInitializing cam0:\r\n\tCamera model:\t  ds-none\r\n\tDataset:          /home/caselitz/Downloads/BF2M2020S23-1.bag\r\n\tTopic:            /cam0/image_raw\r\n\tNumber of images: 253\r\nExtracting calibration target corners\r\n\r\n... \r\n\r\n  Extracted corners for 253 images (of 253 images)                              \r\n[DEBUG] [1540407694.373795]: calibrateIntrinsics: intrinsics guess: [  0.           0.5        328.19045165 328.19045165 639.5\r\n 511.5       ]\r\n[DEBUG] [1540407694.378700]: calibrateIntrinsics: distortion guess: []\r\n[DEBUG] [1540407694.387976]: calibrateIntrinsics: adding camera error terms for 253 calibration targets\r\n[DEBUG] [1540407703.494753]: calibrateIntrinsics: added 35793 camera error terms\r\nNo linear system solver set in the options. Defaulting to the sparse_cholesky solver\r\nUsing the sparse_cholesky linear system solver\r\nUsing the levenberg_marquardt trust region policy\r\n[DEBUG] [1540407703.499829]: Before optimization:\r\n[DEBUG] [1540407705.404647]:  Reprojection error squarred (camL):  mean 49.7943951178, median 3.70118328943, std: 171.027015386\r\nNo linear system solver set in the options. Defaulting to the sparse_cholesky solver\r\nUsing the sparse_cholesky linear system solver\r\nUsing the levenberg_marquardt trust region policy\r\nInitializing\r\nOptimization problem initialized with 508 design variables and 35793 error terms\r\nThe Jacobian matrix is 71586 x 1524\r\n[0.0]: J: 1.78229e+06\r\npython: /usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:408: Eigen::DenseCoeffsBase<Derived, 1>::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator[](Eigen::Index) [with Derived = Eigen::Matrix<double, -1, 1>; Eigen::DenseCoeffsBase<Derived, 1>::Scalar = double; Eigen::Index = long int]: Assertion `index >= 0 && index < size()' failed.\r\nAborted (core dumped)\r\n```\r\n\r\nSo I guess the assertion is raised somewhere in [this function](https://github.com/ethz-asl/kalibr/blob/master/aslam_optimizer/aslam_backend/src/Optimizer2.cpp#L183).\r\n\r\nI tried the available camera models (except pinhole) and all `*-none` models gave me the error. Interestingly, `omni-radtan` did not!\r\n\r\nI tried with my own dataset but then switched to another one from [this site (BF2M2020S23)](https://vision.in.tum.de/research/vslam/double-sphere). Error also occurs here, so I guess the dataset is not the reason.\r\n\r\nDo you think it might be related to the OS (Ubuntu 18.04) or Eigen version (3.3.4)?\r\n@VladyslavUsenko and @NikolausDemmel - when you did the calibrations for your paper, e.g. `ds-none`, which versions did you use? Do you think the issue could be related to `none` distortion model, as - if I remember correctly - this was introduced with the [PR for the new camera models](https://github.com/ethz-asl/kalibr/pull/210) (thanks for contributing this to kalibr!)?\r\n\r\nThanks for your help!\r\nBest, Tim\r\n\r\nPS: I will investigate were the assertion is raised exactly and see if using an older Eigen version helps. Just wanted to open this issue in case someone with more insight can help already. :)"},"comment":{"url":"https://api.github.com/repos/ethz-asl/kalibr/issues/comments/434405994","html_url":"https://github.com/ethz-asl/kalibr/issues/236#issuecomment-434405994","issue_url":"https://api.github.com/repos/ethz-asl/kalibr/issues/236","id":434405994,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDQwNTk5NA==","user":{"login":"VladyslavUsenko","id":2621267,"node_id":"MDQ6VXNlcjI2MjEyNjc=","avatar_url":"https://avatars1.githubusercontent.com/u/2621267?v=4","gravatar_id":"","url":"https://api.github.com/users/VladyslavUsenko","html_url":"https://github.com/VladyslavUsenko","followers_url":"https://api.github.com/users/VladyslavUsenko/followers","following_url":"https://api.github.com/users/VladyslavUsenko/following{/other_user}","gists_url":"https://api.github.com/users/VladyslavUsenko/gists{/gist_id}","starred_url":"https://api.github.com/users/VladyslavUsenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladyslavUsenko/subscriptions","organizations_url":"https://api.github.com/users/VladyslavUsenko/orgs","repos_url":"https://api.github.com/users/VladyslavUsenko/repos","events_url":"https://api.github.com/users/VladyslavUsenko/events{/privacy}","received_events_url":"https://api.github.com/users/VladyslavUsenko/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T17:56:13Z","updated_at":"2018-10-30T17:56:13Z","author_association":"CONTRIBUTOR","body":"I could reproduce the issue. Looks like it hits this assert only when compiled with default flags. The pull request above should fix it even for default flags, but you should in general use `Release` otherwise it is very slow.."}}
{"actor":{"display_login":"VladyslavUsenko"}}