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

IndexError: tuple index out of range #3

Open
Parkeunseok opened this issue Jun 5, 2023 · 19 comments
Open

IndexError: tuple index out of range #3

Parkeunseok opened this issue Jun 5, 2023 · 19 comments

Comments

@Parkeunseok
Copy link

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
Copy link
Owner

ehong-tl commented Jun 5, 2023

Hi @Parkeunseok ,

May I know which version of ROS you are using?

I've no problem running it on ROS Melodic.

@ehong-tl
Copy link
Owner

ehong-tl commented Jun 5, 2023

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
Copy link
Author

안녕@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
Copy link
Author

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

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

@Parkeunseok
Copy link
Author

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

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

i'm using opencv 4.2.0

@ehong-tl
Copy link
Owner

ehong-tl commented Jun 5, 2023

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
Copy link
Author

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
Copy link
Owner

ehong-tl commented Jun 5, 2023

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
Copy link
Author

Parkeunseok commented Jun 5, 2023

안녕@Parkeunseok,

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

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

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

the following lidar Data results were obtained.

@ehong-tl
Copy link
Owner

ehong-tl commented Jun 5, 2023

May I know what is your calibration result?

@ehong-tl
Copy link
Owner

ehong-tl commented Jun 5, 2023

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
Copy link
Author

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
Copy link
Author

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

@ehong-tl
Copy link
Owner

ehong-tl commented Jun 8, 2023

They have their own coordinate system.

@Parkeunseok
Copy link
Author

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
Copy link
Owner

ehong-tl commented Jun 9, 2023

Hi @Parkeunseok ,

Sorry for misunderstanding your question.

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

@Parkeunseok
Copy link
Author

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
Copy link
Owner

ehong-tl commented Jun 9, 2023

Ah, in this case it is 2.

@Parkeunseok
Copy link
Author

Ah, in this case it is 2.

Thank you.

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

2 participants