Skip to content

Commit 8aa4aaa

Browse files
JesusSilvaUtrerafrancocipollonegaryservinjballoffet
authored
Jesus/#169 camera info yaml (#231)
* Improves andino_navigation package. (#224) Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com> Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Add basic Platform IO instructions (#229) Signed-off-by: Gary Servin <gary@servin.dev> Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Modify Shell class API to allow dependency injection (#221) Signed-off-by: Javier Balloffet <javier.balloffet@gmail.com> Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Fixed wheel diameter in URDF (#93) Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Added YAML file for default camera intrinsics (#169) Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Adds references to o3de and isaac_sim simulations. (#232) Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com> Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Added README for andino_bringup (#233) Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Added binaries installation docs (#234) Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * andino_apps package created and andino_navigation package updated (#235) * andino_apps package created and andino_navigation package updated Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Minor changes from the PR Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Update andino_navigation README with changes from PR Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Add andino_apps package to ci.yaml Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Fixed minor issues from the PR Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Added 'andino_apps' to the general README Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> --------- Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Minimal change to test launch file Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Added webcam.yaml file and intrinsics are now publishing Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Added raspicam.yaml with camera intrinsics and updated instructions in andino_hardware/README Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> * Changed the 'camera_info_url' to be relative path Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> --------- Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com> Signed-off-by: JesusSilvaUtrera <jsilvautrera@gmail.com> Signed-off-by: Gary Servin <gary@servin.dev> Signed-off-by: Javier Balloffet <javier.balloffet@gmail.com> Co-authored-by: Franco Cipollone <53065142+francocipollone@users.noreply.github.com> Co-authored-by: Gary Servin <gary@servin.dev> Co-authored-by: Javier Balloffet <javier.balloffet@gmail.com>
1 parent e525af4 commit 8aa4aaa

File tree

4 files changed

+77
-6
lines changed

4 files changed

+77
-6
lines changed

andino_bringup/config/raspicam.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Calibration tutorial (from Nav2 docs): https://docs.nav2.org/tutorials/docs/camera_calibration.html
2+
# 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
3+
4+
image_width: 640
5+
image_height: 480
6+
camera_name: narrow_stereo
7+
camera_matrix:
8+
rows: 3
9+
cols: 3
10+
data: [502.10979, 0. , 315.89371,
11+
0. , 499.35622, 233.15895,
12+
0. , 0. , 1. ]
13+
distortion_model: plumb_bob
14+
distortion_coefficients:
15+
rows: 1
16+
cols: 5
17+
data: [0.150091, -0.263342, 0.002136, -0.004508, 0.000000]
18+
rectification_matrix:
19+
rows: 3
20+
cols: 3
21+
data: [1., 0., 0.,
22+
0., 1., 0.,
23+
0., 0., 1.]
24+
projection_matrix:
25+
rows: 3
26+
cols: 4
27+
data: [510.31363, 0. , 312.43595, 0. ,
28+
0. , 510.29425, 233.43648, 0. ,
29+
0. , 0. , 1. , 0. ]

andino_bringup/launch/camera.launch.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,32 @@
3030

3131
from launch import LaunchDescription
3232
from launch_ros.actions import Node
33+
from launch.actions import DeclareLaunchArgument
34+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, TextSubstitution
35+
from ament_index_python.packages import get_package_share_directory
36+
from os.path import join
37+
38+
pkg_andino_bringup = get_package_share_directory('andino_bringup')
3339

3440
def generate_launch_description():
35-
return LaunchDescription([
41+
# Declare launch argument for the path to the camera params YAML file (the 'file://' part is mandatory, you can't skip it)
42+
intrinsic_params_file = DeclareLaunchArgument(
43+
'intrinsic_params_file',
44+
default_value='file://' + join(pkg_andino_bringup, 'config', 'raspicam.yaml'),
45+
description='Path to camera intrinsics YAML file'
46+
)
3647

48+
return LaunchDescription([
49+
intrinsic_params_file,
3750
Node(
3851
package='v4l2_camera',
3952
executable='v4l2_camera_node',
53+
name='v4l2_camera_node',
4054
output='screen',
4155
parameters=[{
42-
'image_size': [640,480],
43-
'camera_frame_id': 'camera_link'
44-
}]
45-
)
56+
'image_size': [640, 480],
57+
'camera_frame_id': 'camera_link',
58+
'camera_info_url': LaunchConfiguration('intrinsic_params_file'),
59+
}],
60+
)
4661
])

andino_firmware/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Via `serial` connection (57600 baud) it is possible to interact with the microco
3737

3838
- Get encoder values: `'e'`
3939
- Set open-loop speed for the motors[pwm] `'o <left> <right>'`
40-
- Example to move forward full speed: `'o 255 255'`
40+
- Example to move forward full speed: `'o 255 255'`
4141
- Range `[-255 -> 255]`
4242
- Set closed-loop speed for the motors[ticks/sec] `'m <left> <right>'`
4343
- Important!: See the `Test it!` section.

andino_hardware/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,33 @@ Check camera status:
151151
vcgencmd get_camera
152152
```
153153

154+
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.
155+
156+
Modify the `config.txt` file for the boot:
157+
158+
```sh
159+
sudo nano /boot/firmware/config.txt
160+
```
161+
162+
And add these lines:
163+
164+
```
165+
# Autoload overlays for any recognized cameras or displays that are attached
166+
# to the CSI/DSI ports. Please note this is for libcamera support, *not* for
167+
# the legacy camera stack
168+
start_x=1
169+
gpu_mem=128
170+
```
171+
172+
Save and close the file. Then we need to enable the camera support for the raspberry:
173+
174+
```sh
175+
sudo raspi-config
176+
```
177+
178+
Go to `Interface Options`, select `camera` and enable it.
179+
180+
Finally, you just need to reboot and the camera should be working fine.
154181

155182
#### RPLidar installation
156183

0 commit comments

Comments
 (0)