ros-perception / image_pipeline

An image processing pipeline for ROS.
Other
762 stars 715 forks source link

Update for compatibility with image_geometry 4.1.0 #968

Closed ScottMonaghan closed 1 month ago

ScottMonaghan commented 2 months ago

This is a PR to fix:

As noted in #966, as of writing image_geometry 4.1.0 has been released, is updated on index.ros.org, but it has not yet been migrated to packages.ros.org.

As such camera_calibration will also require the source of image_geometry 4.1.0 or higher to successfully build.

I tested to ensure successful build with colcon build & colcon test.

Note that colcon test has the following warning that is out of scope of this PR:

=============================== warnings summary ===============================

src/camera_calibration/calibrator.py:47

  Warning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

Please let me know if there are any questions, concerns, or requested changes.

ahcorde commented 2 months ago

Thank you @ScottMonaghan for the contribution.

CI is broken, we need to wait to have a osrf/ros2:testing docker image based on noble. It should be available in the following weeks. Added to my TODO list

ahcorde commented 1 month ago

@ros-pull-request-builder retest this please

mikeferguson commented 1 month ago

It appears this may not be complete? The latest dev job has a failed test:

Error Message
AttributeError: 'StereoCameraModel' object has no attribute 'from_camera_info'. Did you mean: 'fromCameraInfo'?
Stacktrace
test/test_directed.py:132: in test_stereo
    self.assertAlmostEqual(sc.chessboard_size_from_images(self.l[dim][0], self.r[dim][0]), .108, 2)
src/camera_calibration/calibrator.py:1308: in chessboard_size_from_images
    return self.chessboard_size(lundistorted, rundistorted, board)
src/camera_calibration/calibrator.py:1320: in chessboard_size
    cam.from_camera_info(*msg)
E   AttributeError: 'StereoCameraModel' object has no attribute 'from_camera_info'. Did you mean: 'fromCameraInfo'?

https://build.ros2.org/job/Jdev__image_pipeline__ubuntu_noble_amd64/2/testReport/junit/camera_calibration.test.test_directed/TestDirected/test_stereo/

ScottMonaghan commented 1 month ago

Hmm... that means we're referencing an image_geometry package older than the current 4.1 release: https://index.ros.org/p/image_geometry/github-ros-perception-vision_opencv/#rolling

In 4.1 from_camera_info replaces FromCameraInfo which has been deprecated.

mikeferguson commented 1 month ago

Looks like Rolling has 4.1 - but Jazzy only has 4.0? Is that expected?

ScottMonaghan commented 1 month ago

Certainly not what I expected, but I'm new here and may have made a mistake.

@ijnek, can you offer some insight here? image-geometry should be 4.1 for Jazzy correct?