heethesh / lidar_camera_calibration

Light-weight camera LiDAR calibration package for ROS using OpenCV and PCL (PnP + LM optimization)
BSD 3-Clause "New" or "Revised" License
528 stars 117 forks source link

3D calibration issue #34

Open kubs0ne opened 3 years ago

kubs0ne commented 3 years ago

Hello, I have an issue whe running rosrun lidar_camera_calibration calibre_camera_lidar.py --calibrate. The 2D calibration windows open, but the 3D windows doesn't. The traceback looks like this:

/home/kuba/catkin_ws/src/lidar_camera_calibration/scripts/calibrate_camera_lidar.py:238: RuntimeWarning: invalid value encountered in less (np.abs(points[:, 1]) < 2.5) & (39, 1788, 4) [INFO] [1617966823.138861]: PCL points available: 39 /home/kuba/.local/lib/python2.7/site-packages/matplotlib/colors.py:507: RuntimeWarning: invalid value encountered in less xa[xa < 0] = -1 Process Process-2: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, self._kwargs) File "/home/kuba/catkin_ws/src/lidar_camera_calibration/scripts/calibrate_camera_lidar.py", line 258, in extract_points_3D ax.scatter(points[:, 0], points[:, 1], points[:, 2], c=colors, s=2, picker=5) File "/home/kuba/.local/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 2362, in scatter xs, ys, s=s, c=c, *args, *kwargs) File "/home/kuba/.local/lib/python2.7/site-packages/matplotlib/init.py", line 1870, in inner return func(ax, args, kwargs) File "/home/kuba/.local/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 4293, in scatter .format(c.shape, x.size, y.size)) ValueError: c of shape (39, 4, 4) not acceptable as a color sequence for x with size 156, y with size 156

I assume it's because of me using a different lidar than velodyne. I'm using a rslidar. But I don't understand where could I change the parameters of my lidar. Will be grateful for any help. Regards

heethesh commented 3 years ago

I think you might need to reshape your points array (guessing you need to merge the first two axes?), Follow the modifications for Ouster LiDAR in the code. See #26.