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

ValueError: need at least one array to concatenate #8

Open
zhh2005757 opened this issue Mar 30, 2024 · 0 comments
Open

ValueError: need at least one array to concatenate #8

zhh2005757 opened this issue Mar 30, 2024 · 0 comments

Comments

@zhh2005757
Copy link

When I try use multical to calibrate one camera and one lidar in my own dataset, I met this problem. The command is "multical_calibrate_sensors --cams multical_ws/hunter_sensor/cameras.yaml --lidars multical_ws/hunter_sensor/lidar.yaml --bag camera0_ouster_2024-03-29-17-19-21.bag --targets multical_ws/hunter_sensor/april_6x6.yaml
"

And the log is as follows

Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.1205 [m]
Spacing 0.0369935 [m]
Initializing LiDAR rosbag dataset reader:
Dataset: camera0_ouster_2024-03-29-17-19-21.bag
Topic: /ouster/points
Number of messages: 333
Reading LiDAR data (/ouster/points)
Read 333000 LiDAR readings from 333 frames over -1810558291.4 seconds, and detect target by tapes from 0 frames
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [1243.2159276212237, 1242.4174264569228]
Principal point: [971.5373680187001, 472.4919541350854]
Distortion model: equidistant
Distortion coefficients: [-0.03374305997414122, -0.43771560692756084, 0.8824088121967412, -0.5562322707174343]
baseline: no data available
Initializing camera rosbag dataset reader:
Dataset: camera0_ouster_2024-03-29-17-19-21.bag
Topic: /v4l2_camera0/image_raw
Number of images: 500
Extracting calibration target corners
Extracted corners for 494 images (of 500 images)

Building the problem
Spline order: 6
Pose knots per second: 100
Do pose motion regularization: True
xddot translation variance: 1000000.000000
xddot rotation variance: 1000000.000000
Bias knots per second: 5
Do bias motion regularization: True
Blake-Zisserman on reprojection errors -1
Acceleration Huber width (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000

Estimating initial extrinsic parameters between primary camera and all other sensors
time interval threshold 0.36
The data gathering will break because of too large time interval (0.466620206833s)
Time span of gathered data is 1.93314290047s

Initializing a pose spline with 97 knots (50.000000 knots per second over 1.933143 seconds)
No initial extrinsic parameter is waited to estimate

Initializing a pose spline with 3338 knots (100.000000 knots per second over 33.383380 seconds)

Adding camera error terms (/v4l2_camera0/image_raw)
Added 494 camera error terms

Before Optimization

Normalized Residuals

Reprojection error (cam0): count: 62899, mean: 0.862456711376, median: 0.780583735608, std: 0.503506325411

Residuals

Reprojection error (cam0) [px]: count: 62899, mean: 0.862456711376, median: 0.780583735608, std: 0.503506325411

Optimizing...
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Initializing
Optimization problem initialized with 3346 design variables and 66237 error terms
The Jacobian matrix is 245966 x 20065
[0.0]: J: 62732.3
[1]: J: 53591.4, dJ: 9140.91, deltaX: 0.0321084, LM - lambda:10 mu:2
[2]: J: 53586.4, dJ: 5.00457, deltaX: 0.0178859, LM - lambda:3.33333 mu:2
[3]: J: 53586.4, dJ: 0.00950571, deltaX: 0.00598802, LM - lambda:1.11111 mu:2
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Initializing
Optimization problem initialized with 3345 design variables and 66237 error terms
The Jacobian matrix is 245966 x 20064
[0.0]: J: 53586.4
[1]: J: 53586.4, dJ: 0.0277072, deltaX: 0.000194194, LM - lambda:10 mu:2
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Initializing
Optimization problem initialized with 3346 design variables and 66237 error terms
The Jacobian matrix is 245966 x 20065
[0.0]: J: 53586.4
[1]: J: 53586.4, dJ: 0.000594912, deltaX: 0.000142072, LM - lambda:10 mu:2
Traceback (most recent call last):
File "/home/zhh2005757/multical_ws/devel/bin/multical_calibrate_sensors", line 15, in
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/zhh2005757/multical_ws/src/multical-master/aslam_offline_calibration/kalibr/python/multical_calibrate_sensors", line 361, in
main()
File "/home/zhh2005757/multical_ws/src/multical-master/aslam_offline_calibration/kalibr/python/multical_calibrate_sensors", line 302, in main
iCal.optimize(maxIterations=parsed.max_iter, recoverCov=parsed.recover_cov)
File "/home/zhh2005757/multical_ws/src/multical-master/aslam_offline_calibration/kalibr/python/kalibr_sensor_calibration/calibrator.py", line 88, in optimize
lidar.filterLiDARErrorTerms(self.problem, 1.0)
File "/home/zhh2005757/multical_ws/src/multical-master/aslam_offline_calibration/kalibr/python/kalibr_sensor_calibration/sensors_and_targets.py", line 309, in filterLiDARErrorTerms
residuals = np.hstack([error_terms.error() for error_terms in obs.errorTerms])
File "/home/zhh2005757/.local/lib/python2.7/site-packages/numpy/core/shape_base.py", line 340, in hstack
return _nx.concatenate(arrs, 1)
ValueError: need at least one array to concatenate

Could you help me? Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant