Skip to content

Commit

Permalink
Added webcam.yaml file and intrinsics are now publishing
Browse files Browse the repository at this point in the history
Signed-off-by: JesusSilvaUtrera <[email protected]>
  • Loading branch information
JesusSilvaUtrera committed Apr 24, 2024
1 parent 3fc0aab commit d0c3249
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ v4l2_camera_node:
ros__parameters:
image_size: [640,480]
camera_frame_id: "camera_link"
# Other info for this Raspberry Pi Camera Module V2 can be found here: https://elinux.org/Rpi_Camera_Module#Technical_Parameters_.28v.2_board.29
camera_info_url: file:///home/jesus-silva/ws/src/andino/andino_bringup/config/webcam.yaml
# Other info for this Raspberry Pi Camera Module V2 can be found here: https://elinux.org/Rpi_Camera_Module#Technical_Parameters_.28v.2_board.29
20 changes: 20 additions & 0 deletions andino_bringup/config/webcam.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
image_width: 640
image_height: 480
camera_name: hd_webcam:_hd_webcam # imposed by the hardware, there is no easy way to change this name
camera_matrix:
rows: 3
cols: 3
data: [752.509200, 0.000000, 301.733582, 0.000000, 715.922468, 269.603484, 0.000000, 0.000000, 1.000000]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.143335, 0.127413, -0.017265, 0.003433, 0.000000]
rectification_matrix:
rows: 3
cols: 3
data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000]
projection_matrix:
rows: 3
cols: 4
data: [737.296875, 0.000000, 302.288860, 0.000000, 0.000000, 706.384155, 265.509636, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]
13 changes: 7 additions & 6 deletions andino_bringup/launch/camera.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,20 @@
pkg_andino_bringup = get_package_share_directory('andino_bringup')

def generate_launch_description():
# Declare launch argument for the path to the camera intrinsics YAML file
camera_intrinsics_file = DeclareLaunchArgument(
'camera_intrinsics_file',
default_value=join(pkg_andino_bringup, 'config', 'camera_intrinsics.yaml'),
# Declare launch argument for the path to the camera params YAML file
camera_params_file = DeclareLaunchArgument(
'camera_params_file',
default_value=join(pkg_andino_bringup, 'config', 'camera_params.yaml'),
description='Path to camera intrinsics YAML file'
)

return LaunchDescription([
camera_intrinsics_file,
camera_params_file,
Node(
package='v4l2_camera',
executable='v4l2_camera_node',
name='v4l2_camera_node',
output='screen',
parameters=[LaunchConfiguration('camera_intrinsics_file')],
parameters=[LaunchConfiguration('camera_params_file')],
)
])

0 comments on commit d0c3249

Please sign in to comment.