From e4a4f5c5ba6c5599311bc8586a4c686e3ef03d36 Mon Sep 17 00:00:00 2001 From: JesusSilvaUtrera Date: Mon, 27 May 2024 15:28:07 +0200 Subject: [PATCH] Added raspicam.yaml with camera intrinsics and updated instructions in andino_hardware/README Signed-off-by: JesusSilvaUtrera --- andino_bringup/config/camera_params.yaml | 2 +- andino_bringup/config/raspicam.yaml | 27 ++++++++++++++++++++++++ andino_bringup/config/webcam.yaml | 20 ------------------ andino_hardware/README.md | 27 ++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 andino_bringup/config/raspicam.yaml delete mode 100644 andino_bringup/config/webcam.yaml diff --git a/andino_bringup/config/camera_params.yaml b/andino_bringup/config/camera_params.yaml index fc16f34d..4a9138b6 100644 --- a/andino_bringup/config/camera_params.yaml +++ b/andino_bringup/config/camera_params.yaml @@ -2,5 +2,5 @@ v4l2_camera_node: ros__parameters: image_size: [640,480] camera_frame_id: "camera_link" - camera_info_url: file:///home/jesus-silva/ws/src/andino/andino_bringup/config/webcam.yaml + camera_info_url: file:///home/jesus-silva/ws/src/andino/andino_bringup/config/raspicam.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 diff --git a/andino_bringup/config/raspicam.yaml b/andino_bringup/config/raspicam.yaml new file mode 100644 index 00000000..e010e408 --- /dev/null +++ b/andino_bringup/config/raspicam.yaml @@ -0,0 +1,27 @@ +image_width: 640 +image_height: 480 +# camera_name: narrow_stereo +camera_name: hd_webcam:_hd_webcam +camera_matrix: + rows: 3 + cols: 3 + data: [502.10979, 0. , 315.89371, + 0. , 499.35622, 233.15895, + 0. , 0. , 1. ] +distortion_model: plumb_bob +distortion_coefficients: + rows: 1 + cols: 5 + data: [0.150091, -0.263342, 0.002136, -0.004508, 0.000000] +rectification_matrix: + rows: 3 + cols: 3 + data: [1., 0., 0., + 0., 1., 0., + 0., 0., 1.] +projection_matrix: + rows: 3 + cols: 4 + data: [510.31363, 0. , 312.43595, 0. , + 0. , 510.29425, 233.43648, 0. , + 0. , 0. , 1. , 0. ] diff --git a/andino_bringup/config/webcam.yaml b/andino_bringup/config/webcam.yaml deleted file mode 100644 index 86a9a5be..00000000 --- a/andino_bringup/config/webcam.yaml +++ /dev/null @@ -1,20 +0,0 @@ -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] diff --git a/andino_hardware/README.md b/andino_hardware/README.md index 54dda0e8..256779a1 100644 --- a/andino_hardware/README.md +++ b/andino_hardware/README.md @@ -144,6 +144,33 @@ Check camera status: vcgencmd get_camera ``` +If the output of the previous command is `supported=1 detected=1', everything is fine. If not, your camera won't work correctly, you need to perform some configuration first. + +Modify the `config.txt` file for the boot: + +```sh + sudo nano /boot/firmware/config.txt +``` + +And add these lines: + +``` +# Autoload overlays for any recognized cameras or displays that are attached +# to the CSI/DSI ports. Please note this is for libcamera support, *not* for +# the legacy camera stack +start_x=1 +gpu_mem=128 +``` + +Save and close the file. Then we need to enable the camera support for the raspberry: + +```sh +sudo raspi-config +``` + +Go to `Interface Options`, select `camera` and enable it. + +Finally, you just need to reboot and the camera should be working fine. #### RPLidar installation