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

Jesus/#169 camera info yaml #231

Merged
merged 16 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions andino_bringup/config/camera_params.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions andino_bringup/config/raspicam.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Calibration tutorial (from Nav2 docs): https://docs.nav2.org/tutorials/docs/camera_calibration.html
# 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

image_width: 640
JesusSilvaUtrera marked this conversation as resolved.
Show resolved Hide resolved
image_height: 480
# camera_name: narrow_stereo
camera_name: hd_webcam:_hd_webcam
camera_name: narrow_stereo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure where this name is being used however it catches my attention it says stereo when it is actually mono

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but the name is fixed by the hardware (happens the same when I used my webcam) so there is anything we can do about that. If I change the name on the YAML it won't use that file because it doesn't have the right name.

camera_matrix:
rows: 3
cols: 3
Expand Down
18 changes: 11 additions & 7 deletions andino_bringup/launch/camera.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,31 @@
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, TextSubstitution
from ament_index_python.packages import get_package_share_directory
from os.path import join

pkg_andino_bringup = get_package_share_directory('andino_bringup')

def generate_launch_description():
# 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'),
# Declare launch argument for the path to the camera params YAML file (the 'file://' part is mandatory, you can't skip it)
intrinsic_params_file = DeclareLaunchArgument(
'intrinsic_params_file',
default_value='file://' + join(pkg_andino_bringup, 'config', 'raspicam.yaml'),
description='Path to camera intrinsics YAML file'
)

return LaunchDescription([
camera_params_file,
intrinsic_params_file,
Node(
package='v4l2_camera',
executable='v4l2_camera_node',
name='v4l2_camera_node',
output='screen',
parameters=[LaunchConfiguration('camera_params_file')],
parameters=[{
'image_size': [640, 480],
'camera_frame_id': 'camera_link',
'camera_info_url': LaunchConfiguration('intrinsic_params_file'),
}],
)
])
Loading