Skip to content

fix(launch): resolve Pydantic v2 compatibility and update build instructions - #387

Open
jwsung91 wants to merge 1 commit into
ros-drivers:mainfrom
jwsung91:fix/pydantic-v2-compatibility
Open

fix(launch): resolve Pydantic v2 compatibility and update build instructions#387
jwsung91 wants to merge 1 commit into
ros-drivers:mainfrom
jwsung91:fix/pydantic-v2-compatibility

Conversation

@jwsung91

Copy link
Copy Markdown

Description

This Pull Request addresses two main issues related to building and launching the usb_cam package on newer environments (specifically ROS 2 Jazzy on Ubuntu 24.04):

  1. Pydantic v2 Compatibility:

    • ROS 2 Jazzy uses Pydantic v2, which deprecates/breaks the older Pydantic v1 validator syntax (@root_validator) used in launch/camera_config.py.
    • Updated the imports in launch/camera_config.py to import from pydantic.v1 with a fallback to pydantic. This maintains backward compatibility with ROS 2 Humble/Pydantic v1 while fixing the crash on ROS 2 Jazzy.
  2. Build and Sourcing Documentation:

    • Updated README.md to explicitly guide users through sourcing their ROS 2 installation.
    • Added steps for installing and initializing rosdep if it is missing on the system.
    • Updated dependency installation commands to dynamically use ${ROS_DISTRO} for convenience.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

How Has This Been Tested?

  • Tested building under ROS 2 Jazzy with a clean workspace (colcon build).
  • Verified that ros2 launch usb_cam camera.launch.py starts correctly without throwing Pydantic-related Python exceptions.

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.

1 participant