ehong-tl / camera_2d_lidar_calibration

ROS camera 2D Lidar extrinsic calibration tool
58 stars 19 forks source link

IndexError: tuple index out of range #3

Open Parkeunseok opened 1 year ago

Parkeunseok commented 1 year ago

Hello, I'm using your code.

The following error occurs in roslaunch camera_2d_lidar_calibration reproduction.launch.

camera_topic : /usb_cam/image_raw/compressed lidar_topic : /scan

I am attaching the calibration result below and the yaml file as well.

Please reply quickly. Thank you. error result yaml

ehong-tl commented 1 year ago

Hi @Parkeunseok ,

May I know which version of ROS you are using?

I've no problem running it on ROS Melodic.

ehong-tl commented 1 year ago

Hi @Parkeunseok ,

Can you try edit line 35 in reprojection.py to the followings?

objPoints = np.array(list(map(extract, points)))

I believe you are using ROS Noetic (Python 3), which has different map() output from ROS Melodic (Python 2).

Parkeunseok commented 1 year ago

안녕@Parkeunseok,

reprojection.py에서 35행을 다음과 같이 편집할 수 있습니까?

objPoints = np.array(list(map(extract, points)))

ROS Melodic(Python 2)과 다른 map() 출력을 가진 ROS Noetic(Python 3)을 사용하고 있다고 생각합니다.

I'm using ROS Noetic (Python 3).

Parkeunseok commented 1 year ago

objPoints = np.array(list(map(extract, points)))

error Now you get this error. I'm a beginner in this part.

Parkeunseok commented 1 year ago

objPoints = np.array(list(map(extract, points)))

오류 이제 이 오류가 발생합니다. 나는이 부분에서 초보자입니다.

i'm using opencv 4.2.0

ehong-tl commented 1 year ago

Can you try to

print((int(round(img_points[i][0])),int(round(img_points[i][1]))))

before the cv2.circle?

I want to see what kind of output you are getting.

Parkeunseok commented 1 year ago

Can you try to

print((int(round(img_points[i][0])),int(round(img_points[i][1]))))

before the cv2.circle?

I want to see what kind of output you are getting.

It comes out as follows. errir111 error111

ehong-tl commented 1 year ago

Hi @Parkeunseok ,

Did you properly calibrate your camera and lidar setup?

When the img_points value is too big, cv2.circle has problem parsing the argument.

Parkeunseok commented 1 year ago

안녕@Parkeunseok,

카메라와 라이더 설정을 올바르게 보정했습니까?

img_points 값이 너무 크면 cv2.circle이 인수를 구문 분석하는 데 문제가 있습니다.

the following lidar Data results were obt ㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴ ained.

the following lidar Data results were obtained.

ehong-tl commented 1 year ago

May I know what is your calibration result?

ehong-tl commented 1 year ago

Hi, I tried to calibrate using the data you provided, and the RMSE is 20 which is quite huge.

You can try to collect more data and collect the data properly to get a better calibration result.

Parkeunseok commented 1 year ago

Hi, I tried to calibrate using the data you provided, and the RMSE is 20 which is quite huge.

You can try to collect more data and collect the data properly to get a better calibration result.

I'll try it. Thank you.

Parkeunseok commented 1 year ago

Is this program a calibration of the lidar based on the camera coordinate system?

ehong-tl commented 1 year ago

They have their own coordinate system.

Parkeunseok commented 1 year ago

Is the standard coordinate system for calibration a lidar or a camera? Which one is it?

  1. Do I adjust the lidar coordinate system based on the camera?
  2. Do I adjust the camera coordinate system based on the lidar?
ehong-tl commented 1 year ago

Hi @Parkeunseok ,

Sorry for misunderstanding your question.

The calibration result is transformation from camera to lidar (position of lidar from camera coordinate system).

Parkeunseok commented 1 year ago

I'm a beginner in this field, so I'm sorry to ask you many questions.

  1. I know that there is a calibration that fits the camera image to the lidar -> Customize the camera based on the lidar

  2. I know that there is a calibration that fits the lidar pointcloud to the camera_image -> Customize the lidar based on the camera

May I know which one this is? I'm sorry to ask you the same question many times. I certainly don't understand.

Please tell me which one is correct, (1) or (2)

ehong-tl commented 1 year ago

Ah, in this case it is 2.

Parkeunseok commented 1 year ago

Ah, in this case it is 2.

Thank you.