feat: parameterize Yahboom camera identity for multiple cameras
This commit is contained in:
@@ -10,9 +10,29 @@ LMS 전용 템플릿 저장소입니다. 설치 폴더: `[lms-nav2-yahboom-camer
|
|||||||
LMS에서 설치 -> 빌드 -> 실행합니다.
|
LMS에서 설치 -> 빌드 -> 실행합니다.
|
||||||
- ROS_DOMAIN_ID는 ESP32 설정과 일치시킵니다. GPU 가속은 끕니다.
|
- ROS_DOMAIN_ID는 ESP32 설정과 일치시킵니다. GPU 가속은 끕니다.
|
||||||
- 컨테이너 장치: video_device (기본 /dev/video0)
|
- 컨테이너 장치: video_device (기본 /dev/video0)
|
||||||
|
- 노드명: camera_name (기본 yahboom_camera)
|
||||||
|
- 토픽 네임스페이스: camera_namespace (기본 빈 문자열)
|
||||||
|
- 영상 프레임: frame_id (기본 camera)
|
||||||
- SLAM과 Localization은 동시에 실행하지 않습니다.
|
- SLAM과 Localization은 동시에 실행하지 않습니다.
|
||||||
- 실차 검증 전 소스입니다. 바퀴를 띄우고 비상정지와 명령 타임아웃을 확인하세요.
|
- 실차 검증 전 소스입니다. 바퀴를 띄우고 비상정지와 명령 타임아웃을 확인하세요.
|
||||||
|
|
||||||
원본 소스: https://github.com/KingKiser/hkit_yahboom_ws
|
원본 소스: https://github.com/KingKiser/hkit_yahboom_ws
|
||||||
작성자 박승휘, 원본 package.xml 저작자 Leo Cho, 원본 라이선스 표기 Apache 2.0.
|
작성자 박승휘, 원본 package.xml 저작자 Leo Cho, 원본 라이선스 표기 Apache 2.0.
|
||||||
재배포 전 자산 라이선스를 확인하세요.
|
재배포 전 자산 라이선스를 확인하세요.
|
||||||
|
|
||||||
|
## 여러 카메라 사용
|
||||||
|
|
||||||
|
카메라별 모듈에 서로 다른 장치, 노드명, 네임스페이스, 프레임을 지정합니다.
|
||||||
|
|
||||||
|
```text
|
||||||
|
video_device:=/dev/video0 camera_name:=front_camera camera_namespace:=front frame_id:=front_camera_link
|
||||||
|
video_device:=/dev/video2 camera_name:=rear_camera camera_namespace:=rear frame_id:=rear_camera_link
|
||||||
|
```
|
||||||
|
|
||||||
|
영상 토픽은 `/front/image_raw`, `/rear/image_raw`로, 카메라 정보 토픽은
|
||||||
|
`/front/camera_info`, `/rear/camera_info`로 분리됩니다. 기본 파라미터로 실행하면
|
||||||
|
기존 토픽명과 프레임을 유지합니다. 장치 번호는 실제 기체에서 확인하세요.
|
||||||
|
|
||||||
|
각 모듈의 설치 폴더와 컨테이너 이름도 달라야 합니다. 현재 공통 LMS 실행기는
|
||||||
|
정식 야붐 카메라 폴더명을 기준으로 장치를 전달하므로, 임의 이름의 커스텀 모듈은
|
||||||
|
별도로 실행 스크립트의 장치 전달 및 빌드/런치 대상을 설정해야 합니다.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import os
|
|
||||||
from ament_index_python.packages import get_package_share_directory
|
|
||||||
from launch import LaunchDescription
|
from launch import LaunchDescription
|
||||||
from launch.actions import DeclareLaunchArgument
|
from launch.actions import DeclareLaunchArgument
|
||||||
from launch.substitutions import LaunchConfiguration
|
from launch.substitutions import LaunchConfiguration
|
||||||
@@ -8,10 +6,16 @@ from launch_ros.actions import Node
|
|||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
DeclareLaunchArgument("video_device", default_value="/dev/video0"),
|
DeclareLaunchArgument("video_device", default_value="/dev/video0"),
|
||||||
Node(package="usb_cam", executable="usb_cam_node_exe", name="yahboom_camera",
|
DeclareLaunchArgument("camera_name", default_value="yahboom_camera"),
|
||||||
|
DeclareLaunchArgument("camera_namespace", default_value=""),
|
||||||
|
DeclareLaunchArgument("frame_id", default_value="camera"),
|
||||||
|
Node(package="usb_cam", executable="usb_cam_node_exe",
|
||||||
|
name=LaunchConfiguration("camera_name"),
|
||||||
|
namespace=LaunchConfiguration("camera_namespace"),
|
||||||
output="screen", parameters=[{
|
output="screen", parameters=[{
|
||||||
"video_device": LaunchConfiguration("video_device"), "image_width": 640,
|
"video_device": LaunchConfiguration("video_device"), "image_width": 640,
|
||||||
"image_height": 480, "framerate": 15.0,
|
"image_height": 480, "framerate": 15.0,
|
||||||
"pixel_format": "mjpeg2rgb", "frame_id": "camera",
|
"pixel_format": "mjpeg2rgb",
|
||||||
|
"frame_id": LaunchConfiguration("frame_id"),
|
||||||
}]),
|
}]),
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user