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

updated linear_error function to handle partial board views #561

Merged

Conversation

JStech
Copy link
Contributor

@JStech JStech commented Jul 7, 2020

Modified linear_error to work with partial board views, which are now possible with a ChArUco target.

@SteveMacenski
Copy link
Member

@PfeifferMicha does this fix your issue?

@JStech were these changes made to ROS2 too to fix? (two too to)

@JStech
Copy link
Contributor Author

JStech commented Jul 8, 2020

Whoops, some of the fixes were just in my branch and hadn't been put in a PR yet. I've added them here (and #560). They are all for stereo calibration, though, so I'm unable to test it. I'm just basing it on the discussion on #550 .

None of the ChArUco stuff was ever implemented for ROS2. I believe this is everything that's relevant: #548 #549 #556 #558 #560 #561

@PfeifferMicha
Copy link
Contributor

Hey, thanks for fixing this!

It almost works, I get one last error which is an easy fix:

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/user/Projects/ROS/catkin_ws_noetic/src/image_pipeline/camera_calibration/src/camera_calibration/camera_calibrator.py", line 107, in run
    self.function(m)
  File "/home/user/Projects/ROS/catkin_ws_noetic/src/image_pipeline/camera_calibration/src/camera_calibration/camera_calibrator.py", line 188, in handle_monocular
    drawable = self.c.handle_msg(msg)
  File "/home/user/Projects/ROS/catkin_ws_noetic/src/image_pipeline/camera_calibration/src/camera_calibration/calibrator.py", line 964, in handle_msg
    linear_error = self.linear_error(undistorted, ids, board)
  File "/home/user/Projects/ROS/catkin_ws_noetic/src/image_pipeline/camera_calibration/src/camera_calibration/calibrator.py", line 917, in linear_error
    if len(pts_in_row) <= 2: continue
TypeError: object of type 'filter' has no len()

Can be fixed by replacing line 914 with:

            #pts_in_row = filter(lambda x: row_min <= x < row_max, ids)
            pts_in_row = [x for x in ids if row_min <= x < row_max]

After that, monocular calibration works! :)

@JWhitleyWork
Copy link
Collaborator

@JStech See the fix from @PfeifferMicha. This is causing the CI tests to fail too.

@JStech
Copy link
Contributor Author

JStech commented Jul 11, 2020

Thanks for the fix, @PfeifferMicha .

@JWhitleyWork JWhitleyWork merged commit 07b8739 into ros-perception:noetic Jul 17, 2020
wep21 pushed a commit to wep21/image_pipeline that referenced this pull request Oct 17, 2021
…eption#561)

* updated linear_error function to handle partial board views

* more charuco fixes

* filter len fix
JWhitleyWork pushed a commit that referenced this pull request Nov 11, 2021
* updated linear_error function to handle partial board views

* more charuco fixes

* filter len fix
JWhitleyWork pushed a commit that referenced this pull request Apr 14, 2022
* updated linear_error function to handle partial board views

* more charuco fixes

* filter len fix
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

Successfully merging this pull request may close these issues.

4 participants