Chuyển đến nội dung chính
Phiên bản tài liệu: V1.0; ngày sửa đổi: 2024-10-12.

Tổng quan

Camera SDK MRDVS dành cho Linux bao gồm các ví dụ C/C++, Java (HTTP server), ROS và ROS 2. Các ví dụ minh họa quy trình cơ bản của SDK; hãy bổ sung logic dành riêng cho ứng dụng và xử lý lỗi cho dự án của bạn. Trước tiên hãy hoàn tất việc thiết lập môi trường, chạy script cài đặt và kiểm tra các thư mục ví dụ. Sau đó làm theo phần biên dịch và chạy dành cho ngôn ngữ mục tiêu. Phụ lục liệt kê cách cài đặt các dependency và package kiểm thử phổ biến.

Hệ thống và môi trường

Hệ thống tương thích và phiên bản dependency

Các hệ thống Linux sau được hỗ trợ. Phiên bản chương trình mặc định được liệt kê bên dưới:

2.2 Kiểm tra phiên bản hệ thống và ứng dụng

2.2.1 Kiểm tra phiên bản hệ thống

Kết quả:
Hình minh họa liên quan đến phiên bản hệ thống
Số phiên bản phát hành của hệ điều hành: 5.15.0
  • Số phiên bản chính: 5
  • Số phiên bản: 15 [Số lẻ là phiên bản phát triển, số chẵn là phiên bản ổn định]
  • Số bản sửa đổi: 0 [Số lần sửa đổi]
  • Lần sửa đổi thứ N của phiên bản này: 97
  • Phiên bản kernel: #107~20.0.4.1; thông thường phiên bản hệ thống chính là phiên bản kernel

2.2.2 Kiểm tra phiên bản CMake

kết quả:
View Cmake phiên bản liên quan hình minh họa
Đây là phiên bản CMake 3.16.3.

2.2.3 Kiểm tra phiên bản GCC

kết quả:
Hình minh họa liên quan đến phiên bản GCC
Số phiên bản nằm trong ô màu xanh ở góc dưới bên trái. Phiên bản ở đây là 9.4.0.

2.2.4 Xem phiên bản OpenCV

kết quả:
Xem phiên bản OpenCV liên quan hình minh họa
Phiên bản ở đây là 3.2.0

2.2.5 Kiểm tra phiên bản PCL

kết quả: Phiên bản ở đây là 1.8.1

2.2.6 Xem phiên bản ROS

kết quả:
Xem phiên bản ROS liên quan hình minh họa
Phiên bản ở đây là Eloquent, phiên bản ROS 2 tương ứng với Ubuntu 18.04.
Xem phiên bản ROS liên quan icon 2
Phiên bản ở đây là Noetic, phiên bản ROS 1 tương ứng với Ubuntu 20.04.

2.3 Thiết lập môi trường phát triển cơ bản

Bạn cần cập nhật danh sách cài đặt trước khi cài đặt:
Kết quả như sau:
Hình minh họa liên quan đến việc thiết lập môi trường phát triển cơ bản

2.3.1 Cài đặt CMake

Installation Cmake liên quan hình minh họa

2.3.2 Cài đặt GCC

Cài đặt GCC liên quan hình minh họa

2.4 Thiết lập môi trường phát triển tùy chọn

2.4.1 Cài đặt OpenCV [có thể hiển thị hình ảnh camera]

Hình minh họa cài đặt OpenCV [có thể hiển thị hình ảnh camera]

2.4.2 Cài đặt PCL [có thể hiển thị point cloud]

Hình minh họa cài đặt PCL [có thể hiển thị point cloud]

Chuẩn bị mã ví dụ

3.1 Chạy script cài đặt

  1. Giải nén Lanxin-MRDVS file và mở Lanxin-MRDVS thư mục
Illustrations liên quan đến executing  cài đặt script
  1. Nhấp chuột phải để mở console.
  2. Chạy install.sh script
Illustration liên quan đến executing  cài đặt script 2
  1. Enter /opt/ thư mục đến kiểm tra whether cài đặt là thành công.
Illustration liên quan đến executing  cài đặt script 3
  1. Nếu tìm thấy thư mục thì cài đặt đã thành công.
  2. Nếu cài đặt thất bại, you cần đến thủ công bổ sung it đến opt thư mục.
  3. Chạy đặt_socket_buffer_size.sh script
Illustrations liên quan đến executing  cài đặt script 4
  1. Đến đây script cài đặt đã chạy hoàn tất.

3.2 Giới thiệu mã ví dụ

Enter Sample thư mục. thư mục nội dung là như sau:
Illustrations liên quan đến ví dụ mã introduction
  • C thư mục chứa C và C++ liên quan mã
  • Java thư mục chứa an http server cho indirectly calling sdk
  • Ros thư mục chứa an ví dụ của ros
  • Ros2 thư mục chứa an ví dụ của ros2

3.2.1 C và C++ ví dụ mã

Enter C thư mục. thư mục nội dung là như sau:
Illustrations liên quan đến C và C++ ví dụ mã
Contains 9 các thư mục và 1 Cmakelist file, each thư mục chứa a cpp file roughly implemented functions của each cpp là như sau:
  • ứng dụng_obstacle: Obtain camera stream dữ liệu và enable obstacle avoidance algorithm, output algorithm các kết quả
  • ứng dụng_pallet: Obtain camera stream dữ liệu và enable pallet algorithm, output algorithm các kết quả
  • arm_local_camera: Call SDK trong camera [ARM] và obtain stream dữ liệu
  • frame_callback: Use callback method đến obtain camera stream dữ liệu
  • multi_cameras: mở multiple các camera và lấy streaming dữ liệu
  • single_camera: Open a single camera và lấy streaming dữ liệu
  • single_camera2: Get frame dữ liệu through structure
Có thể chọn các mã ví dụ khác nhau để kiểm thử và chỉnh sửa tùy theo nhu cầu.

3.2.2 Java ví dụ mã

Enter java thư mục. thư mục nội dung là như sau:
Illustrations liên quan đến Java ví dụ mã
thư mục chứa 2 các thư mục và a postman.json file và README
  • Config: Server-liên quan configurations là stored trong thư mục
  • Middleware: server theme
  • LxCamera.Postman_collection.json: Postman cấu hình file
  • README: java virtual server usage tutorial

3.2.3 ROS ví dụ mã

Enter ros thư mục. thư mục nội dung là như sau:
Illustrations liên quan đến ROS ví dụ mã
  • lx_camera_node_ws: thư mục chứa a standard ros driver
  • README.EN: explains trong English how đến biên dịch a node và create a new node

3.2.4 ROS2 ví dụ mã

Enter ros2 thư mục. thư mục nội dung là như sau:
ROS2 ví dụ mã liên quan hình ảnh
  • lx_camera_node_ws: thư mục chứa a standard ros2 driver
  • README.EN: explains trong English how đến biên dịch a node và create a new node

3.2.5 ros-v1pro ví dụ mã

Enter ros-v1pro thư mục. thư mục nội dung là như sau:
Illustrations liên quan đến ros-v1pro ví dụ mã
  • src: thư mục chứa a standard ros driver
  • README: explains how đến sử dụng này node
  • README.pdf: explains how đến sử dụng này node

Biên dịch và chạy các ví dụ

4.1 Compiling và chạy C và C++ ví dụ mã

Go đến C thư mục trong ví dụ:
Illustrations liên quan đến biên dịch và chạy C và C++ ví dụ mã
Open a terminal trong C thư mục và chạy:
After thành công chạy, mở build thư mục và it should be như sau:
Illustrations liên quan đến biên dịch và chạy C và C++ ví dụ mã 2
File thực thi nằm trong thư mục bin. Entering bin thư mục should be như sau:
Illustrations liên quan đến biên dịch và chạy C và C++ ví dụ mã 3
Except cho arm ví dụ, tất cả khác các ví dụ sẽ be compiled. executable file tên là giống nhau như ví dụ thư mục tên. You có thể chạy it directly.

4.2 Quy trình chạy ví dụ Java

Java là khác nhau từ khác ví dụ codes. It does not directly provide mã nguồn mã. It provides an http server và a Postman ví dụ. Nếu you cần đến control camera indirectly through http, you có thể select java ví dụ và mở java thư mục. thư mục content là như sau:
Illustrations liên quan đến  Quy trình chạy ví dụ Java
chạy process là như sau:
  • Enter config thư mục và modify http_sever_host trường và http_sever_port trường trong Configs.json file:
  • Enter middleware thư mục và execute start.sh script đến enable transfer server
Illustrations liên quan đến  Quy trình chạy ví dụ Java 3
  • Use Postman đến mở LxCamera.Postman_collection.json file đến send dữ liệu đến ví dụ port

4.3 Biên dịch và chạy mã ví dụ ROS

Enter ROS thư mục, mở a console, và chạy:
Illustrations liên quan đến biên dịch và chạy ROS ví dụ mã
Illustrations liên quan đến biên dịch và chạy ROS ví dụ mã 2
Right-click đến mở a console, mở lx_camera_node_ws thư mục, và chạy:
Illustrations liên quan đến biên dịch và chạy ROS ví dụ mã 3
Sau khi chạy thành công, sẽ hiển thị như sau:
Illustrations liên quan đến biên dịch và chạy ROS ví dụ mã 4
At này time devel và build trong thư mục là compiled và generated:
Illustrations liên quan đến biên dịch và chạy ROS ví dụ mã 5
Run sau các command đến mã nguồn môi trường và bắt đầu a node với roslaunch:
From top đến bottom, they là: chạy ordinary nodes, chạy obstacle avoidance algorithm 2 nodes, chạy obstacle avoidance algorithm nodes, chạy pallet algorithm nodes. Không thể bật các node cùng lúc.

4.4 Biên dịch và chạy mã ví dụ ROS2

Enter ros2 thư mục. nội dung của thư mục là như sau:
Illustrations liên quan đến biên dịch và chạy ROS2 ví dụ mã
Example ros node là compiled using colcon Trước tiên, cài đặt các công cụ biên dịch:
Illustrations liên quan đến biên dịch và chạy ROS2 ví dụ mã 2
Sau đó cài đặt ros-pcl dependency package. Replace foxy với ROS 2 distribution installed on của bạn hệ thống:
After cài đặt, mở lx_camera_node_ws thư mục và build dự án:
Depending on computer performance, biên dịch thông thường takes 30 seconds đến 120 seconds. After thành công biên dịch, it sẽ be displayed như sau:
Illustrations liên quan đến biên dịch và chạy ROS2 ví dụ mã 3
Một số cảnh báo do vấn đề tương thích phiên bản và không cần xử lý. After biên dịch là completed, nội dung của thư mục là như sau:
Illustrations liên quan đến biên dịch và chạy ROS2 ví dụ mã 4
Run sau các command đến mã nguồn môi trường và bắt đầu a node với ros2 launch:
From top đến bottom, they là: chạy ordinary nodes, chạy obstacle avoidance algorithm 2 nodes, chạy obstacle avoidance algorithm nodes, chạy pallet algorithm nodes. Không thể bật các node cùng lúc.

4.5 Biên dịch và chạy mã ví dụ ros-v1pro

ros-v1pro là a dedicated ros driver cho V1PRO camera. There là a README.pdf trong ros-v1pro thư mục that describes driver trong detail. Tài liệu này document chỉ gives a brief introduction đến it: Enter ros-v1pro thư mục và biên dịch it:
Illustrations liên quan đến biên dịch và chạy  ros-v1pro ví dụ mã 2
Nạp môi trường:
Illustrations liên quan đến biên dịch và chạy  ros-v1pro ví dụ mã 3
Cuối cùng chạy node:
  • roslaunch lx_camera_ros localization.launch
  • roslaunch lx_camera_ros mapping.launch
  • roslaunch lx_camera_ros sensor_sim.launch
From top đến bottom: chạy positioning node, chạy mapping node, và chạy virtual dữ liệu node. Không thể bật các node cùng lúc.

Tham khảo mã ví dụ

In này phần, tất cả codes và pseudocode sẽ be divided into several parts. Generally speaking, everything trong a phần belongs đến giống nhau file. Except cho special các file với detailed explanations, mã nguồn mã các file chỉ explain general modules. Detailed explanations là commented trong mã.

5.1 C và C++

5.1.1 CMakeLists

5.1.2 ứng dụng_obstacle và ứng dụng_pallet

5.1.3 arm_local_camera

5.1.4 frame_callback

5.1.5 multi_cameras

5.1.6 single_camera

5.1.7 single_camera2

5.2 java

Java ví dụ provides chỉ an HTTP server, so mô tả là chỉ a mô tả của interface và message format. Use Postman đến mở ví dụ file như shown below: các message là tất cả trong post mode. Before sending, remember đến change IP đến server’s IP, but do not modify URL. URL là hard-coded internally trong server. response message format và content là both trong body. interface provided trong ví dụ là như sau:
java liên quan hình minh họa 2
1.DcGetApiVersion: Get phiên bản số của SDK, no tham số input
java liên quan hình minh họa 3
2.DcSetInfoOutput: Set đường dẫn cho SDK log output. các tham số là như sau:
  • log_path: đường dẫn của log output
  • print_level: log printing level
  • enable_screen_print: whether log là printed on console
3.DcLog: Output log đến SDK log. Any input content sẽ be printed đến SDK log. 4.DcGetDeviceList: Get thiết bị danh sách, no input, input là JSON 5.DcOpenDevice: Open thiết bị và mở sau:
java liên quan hình minh họa 4
  • mở_mode: mở camera mode
  • param: các tham số cho opening camera
6.DcStartStream: Let a certain camera bắt đầu pushing streaming dữ liệu. input các tham số là như sau:
java liên quan hình minh họa 5
  • handle: handle của camera, which sẽ be returned trong DcOpenDevice
7.DcSetCmd: Issue các command đến camera, mở như sau:
java liên quan hình minh họa 6
  • handle: handle của camera đến be đặt
  • cmd: command số
8.DcGetPtrValue: Get pointer dữ liệu (hình ảnh, các tham số, etc.), mở như sau:
  • handle: handle của camera đến be đặt
  • cmd: command số
9.DcSetIntValue: Set camera int kiểu các tham số, input như sau:
java liên quan hình minh họa 7
  • handle: handle của camera đến be đặt
  • cmd: command số
  • giá trị: giá trị đến be đặt
10.DcGetIntValue: Get int kiểu tham số của thiết bị, input như sau:
  • handle: handle của camera đến be đặt
  • cmd: command số
  1. Please see table below cho khác relevant instructions:

5.3 ROS1 & ROS2

In ros mô tả, we sẽ not talk about driver mã nguồn mã, but about content tương ứng đến cấu hình trong launch file, how đến adjust cấu hình, và how đến send và subscribe đến các message. provided ros node already chứa most của functions, so it là not khuyến nghị đến directly modify driver mã nguồn mã. Nếu you have special needs, you có thể trước tiên understand mã flow trong C++ ví dụ và then modify driver mã nguồn mã. When executing ros driver, you phải ensure that các phiên bản của opencv và pcl trong hệ thống mặc định đường dẫn là unique, otherwise an lỗi sẽ occur khi linking ros library, which may cause biên dịch thất bại hoặc runtime crash.

5.3.1 ROS1 launch file mô tả

5.3.1.1 All launch các file
  1. There là sau các file trong src/launch thư mục:
All launch file liên quan hình minh họa
  • localization.launch: Run file cho visual positioning nodes
  • lx_camera_ros.launch: chạy file của ordinary nodes
  • mapping.launch: chạy file cho visual positioning mapping
  • obstacle.launch: chạy file của obstacle avoidance algorithm
  • obstacleV2.launch: chạy file của obstacle avoidance algorithm V2
  • pallet.launch: pallet algorithm chạy file
  • sensor_sim.launch: chạy file cho simulating positioning dữ liệu
  1. You có thể execute khác nhau functions của node bằng chạy khác nhau launch các file. Except cho localization, mapping và sensor, tham số nội dung là giống nhau trong tất cả nodes, but cấu hình là khác nhau. Tài liệu này sẽ be introduced trong detail trong sau sections. For a detailed introduction đến các tham số của three launch các file của localization, mapping và sensor, please see introduction trong ros-v1pro node.
5.3.1.2 Camera IP, stream cấu hình, working mode cấu hình, point cloud unit, etc.
  • ip: camera IP that needs đến be connected. Nếu it là 0, trước tiên one sẽ be connected bằng mặc định.
  • log_path: SDK log storage đường dẫn, absolute đường dẫn needs đến be filled trong
  • là_xyz: whether đến push point cloud dữ liệu
  • là_depth: whether đến push độ sâu dữ liệu
  • là_amp: whether đến push cường độ map dữ liệu
  • là_rgb: whether đến push RGB hình ảnh dữ liệu
  • lx_work_mode: work mode
  • lx_application: whether đến enable algorithm, 0: off, 1: obstacle avoidance algorithm, 2: pallet algorithm, 3: positioning algorithm, 4: obstacle avoidance algorithm V2
  • lx_tof_unit: point cloud unit, 1 là meter, 0 là millimeter, needs đến be changed đến 1 khi viewing với rviz
5.3.1.3 Camera pose cấu hình
rotation angle và translation vector của point cloud có thể be configured.
  • X: X translation amount của camera từ center của point cloud
  • Y: Y translation amount của camera từ center của point cloud
  • Z: Z translation amount của camera từ center của point cloud
  • Yaw: angle của rotation của point cloud around Z axis
  • Roll: angle của rotation của point cloud around X-axis
  • Pitch: angle của rotation của point cloud around Y axis
5.3.1.4 Whether đến sử dụng launch cấu hình
You có thể choose whether đến sử dụng camera tham số cấu hình trong launch file.
  • raw_param: 0: sử dụng cấu hình trong camera, 1: sử dụng cấu hình trong launch file
Regardless của whether này tham số là đặt đến 0 hoặc 1, tất cả các tham số trước này tham số sẽ be đặt, 0 và 1 là chỉ valid cho các tham số sau này tham số.
5.3.1.5 2D tham số cấu hình
  • lx_2d_binning:0:1x1,1:2x2,2:4x4
  • lx_2d_undistort: ​​2d anti-distortion, 0: off, 1: on
  • lx_2d_undistort_scale: 2D anti-distortion coefficient
  • lx_2d_auto_exposure: 2D automatic exposure, 0: off, 1: on
  • lx_2d_auto_exposure_value: 2D automatic exposure mục tiêu cường độ
  • lx_2d_exposure: 2D exposure giá trị
  • lx_2d_gain: 2D gain
5.3.1.6 3D tham số cấu hình
  • lx_rgb_to_tof: RGB alignment
  • lx_3d_binning:0:1x1,1:2x2,2:4x4
  • lx_mulit_mode: multi-machine mode, which có thể eliminate multi-machine interference, 0: off, 1: on
  • lx_3d_undistort: ​​3d anti-distortion, 0: off, 1: on
  • lx_3d_undistort_scale: 3D anti-distortion coefficient
  • lx_hdr: hdr, 0: off, 1: on
  • lx_3d_auto_exposure: 3D automatic exposure, 0: off, 1: on
  • lx_3d_auto_exposure_value: 3D automatic exposure mục tiêu cường độ
  • lx_3d_first_exposure: 3D high points
  • lx_3d_second_exposure: 3D low points
  • lx_3d_gain: 3D gain
5.3.1.7 Maximum và tối thiểu độ sâu
  • lx_min_depth: tối thiểu độ sâu
  • lx_max_depth: tối đa độ sâu

5.3.2 ROS2 launch file mô tả

5.3.2.1 All launch các file
There là sau các file trong src/launch thư mục:
All launch file liên quan hình minh họa
  • localization.launch.py: chạy file của visual positioning node
  • lx_camera_ros.launch.py: chạy file của ordinary node
  • mapping.launch.py: chạy file cho visual positioning mapping
  • obstacle.launch.py: chạy file của obstacle avoidance algorithm
  • obstacleV2.launch.py: chạy file của obstacle avoidance algorithm V2
  • pallet.launch.py: pallet algorithm chạy file
  • sensor_sim.launch.py: chạy file cho simulating positioning dữ liệu
You có thể execute khác nhau functions của node bằng chạy khác nhau launch các file. Except cho localization, mapping và sensor, tham số content là giống nhau trong tất cả nodes, but cấu hình là khác nhau. It sẽ be introduced trong detail trong sau sections. For a detailed introduction đến các tham số của three launch các file của localization, mapping và sensor, please see introduction trong ros-v1pro node.
5.3.2.2 Camera IP, stream cấu hình, working mode cấu hình, point cloud unit, etc.
  • ip: camera IP that needs đến be connected. Nếu it là 0, trước tiên one sẽ be connected bằng mặc định.
  • log_path: SDK log storage đường dẫn, absolute đường dẫn needs đến be filled trong
  • là_xyz: whether đến push point cloud dữ liệu
  • là_depth: whether đến push độ sâu dữ liệu
  • là_amp: whether đến push cường độ map dữ liệu
  • là_rgb: whether đến push RGB hình ảnh dữ liệu
  • lx_work_mode: work mode
  • lx_application: whether đến enable algorithm, 0: off, 1: obstacle avoidance algorithm, 2: pallet algorithm, 3: positioning algorithm, 4: obstacle avoidance algorithm V2
  • lx_tof_unit: point cloud unit, 1 là meter, 0 là millimeter, needs đến be changed đến 1 khi viewing với rviz
5.3.2.3 Camera pose cấu hình
rotation angle và translation vector của point cloud có thể be configured.
  • X: X translation amount của camera từ center của point cloud
  • Y: Y translation amount của camera từ center của point cloud
  • Z: Z translation amount của camera từ center của point cloud
  • Yaw: angle của rotation của point cloud around Z axis
  • Roll: angle của rotation của point cloud around X-axis
  • Pitch: angle của rotation của point cloud around Y axis
5.3.2.4 Whether đến sử dụng launch cấu hình
You có thể choose whether đến sử dụng camera tham số cấu hình trong launch file.
  • raw_param: 0: sử dụng cấu hình trong camera, 1: sử dụng cấu hình trong launch file
Regardless của whether này tham số là đặt đến 0 hoặc 1, tất cả các tham số trước này tham số sẽ be đặt, 0 và 1 là chỉ valid cho các tham số sau này tham số.
5.3.2.5 2D tham số cấu hình
  • lx_2d_binning:0:1x1,1:2x2,2:4x4
  • lx_2d_undistort: ​​2d anti-distortion, 0: off, 1: on
  • lx_2d_undistort_scale: 2D anti-distortion coefficient
  • lx_2d_auto_exposure: 2D automatic exposure, 0: off, 1: on
  • lx_2d_auto_exposure_value: 2D automatic exposure mục tiêu cường độ
  • lx_2d_exposure: 2D exposure giá trị
  • lx_2d_gain: 2D gain
5.3.2.6 3D tham số cấu hình
  • lx_rgb_to_tof: RGB alignment
  • lx_3d_binning:0:1x1,1:2x2,2:4x4
  • lx_mulit_mode: multi-machine mode, which có thể eliminate multi-machine interference, 0: off, 1: on
  • lx_3d_undistort: ​​3d anti-distortion, 0: off, 1: on
  • lx_3d_undistort_scale: 3D anti-distortion coefficient
  • lx_hdr: hdr, 0: off, 1: on
  • lx_3d_auto_exposure: 3D automatic exposure, 0: off, 1: on
  • lx_3d_auto_exposure_value: 3D automatic exposure mục tiêu cường độ
  • lx_3d_first_exposure: 3D high points
  • lx_3d_second_exposure: 3D low points
  • lx_3d_gain: 3D gain
5.3.2.7 Maximum và tối thiểu độ sâu
  • lx_min_depth: tối thiểu độ sâu
  • lx_max_depth: tối đa độ sâu

5.3.3 Unique theme mô tả

Since unique topic types của ROS1 và ROS2 là giống nhau, ROS1 là used như an ví dụ here. There là sau các file trong src/msg thư mục:
Illustrations liên quan đến unique theme descriptions
5.3.3.1 FrameRate.msg
Tài liệu này node outputs frame rate thông tin. message format là như sau:
FrameRate.msg liên quan hình minh họa
  • header: frame thông tin và timestamp của hiện tại dữ liệu
  • độ sâu: When độ sâu map là turned on, output độ sâu map frame rate
  • amp: When cường độ map là turned on, output cường độ map frame rate
  • rgb: When rgb là on, output rgb frame rate
  • temperature: output camera temperature
After node starts chạy (except cho nodes liên quan đến visual positioning), you có thể subscribe đến LxCamera_FrameRate node đến obtain relevant thông tin. output là như sau:
FrameRate.msg liên quan hình minh họa 2
5.3.3.2 Obstacle.msg
obstacle outputs thông tin liên quan đến obstacle avoidance algorithm các kết quả. obstacle message format là như sau:
Obstacle.msg liên quan hình minh họa
  • header: frame thông tin và timestamp của hiện tại dữ liệu
  • trạng thái: trạng thái thông tin returned bằng obstacle avoidance
0: Normal obstacle avoidance -1: No ground đặt -2: Input not đặt -3: No point cloud within range -4: point cloud là empty sau filtering ground -5: point cloud là empty sau radius filtering -6: No segmentation kết quả was obtained -99: undefined lỗi
  • io_output: Obstacle avoidance thông tin output bằng io interface
0: normal 1: warning 2: Shutdown
  • ô_number: số của obstacles
  • ô: obstacle thông tin, variable length array, length là determined bằng ô_number
After node starts chạy ( obstacle avoidance algorithm needs đến be turned on), you có thể subscribe đến LxCamera_Obstacel node đến obtain relevant thông tin. output là như sau ( dữ liệu trong picture là simulated dữ liệu):
Obstacle.msg liên quan hình minh họa 2
5.3.3.3 Obstacle_box.msg
obstacle_box outputs obstacle-liên quan thông tin, và obstacle_box message format là như sau:
Obstacle\_box.msg liên quan hình minh họa
  • center: center của mass của obstacle trong point cloud
  • rotation: rotation matrix của obstacle point cloud
  • translation: translation vector của obstacle point cloud
  • chiều rộng: chiều rộng của obstacle frame
  • chiều cao: chiều cao của obstacle frame
  • độ sâu: độ sâu của obstacle frame
After starting operation ( obstacle avoidance algorithm needs đến be turned on), you có thể subscribe đến LxCamera_Obstacel node đến obtain relevant thông tin. output là như sau:
Obstacle\_box.msg liên quan icon 2
5.3.3.4 Result.msg
return giá trị obtained sau sending command message đến servic trong node là stored trong Result:
Result.msg liên quan hình minh họa
  • ret: return giá trị obtained bằng executing SDK
  • msg: Description của return giá trị obtained bằng executing SDK
5.3.3.5 Pallet.msg
pallet outputs thông tin liên quan đến pallet algorithm các kết quả. pallet message format là như sau:
Pallet.msg liên quan hình minh họa
  • header: frame thông tin và timestamp của hiện tại dữ liệu
  • trạng thái: trạng thái thông tin returned bằng pallet recognition:
0: Detection thành công -1: No ground detected -2: Pallet legs not detected -3: distance between pallets là too far -4: unknown lỗi
  • x: X distance between tray và optical center của camera
  • y: Y distance between tray và optical center của camera
  • yaw: theta angle between center của tray và optical center của camera
After node starts chạy ( pallet algorithm needs đến be turned on), you có thể subscribe đến LxCamera_Pallet node đến obtain relevant thông tin. output là như sau:
Pallet.msg liên quan hình minh họa 2

5.3.4 Unique Service Description

Since unique service types của ROS1 và ROS2 là giống nhau, ROS1 là used như an ví dụ here. There là sau các file trong src/srv thư mục:
Illustrations liên quan đến unique service descriptions
These các message là used đến đặt hoặc obtain certain tham số các giá trị ​​của camera. Above [---] là sent dữ liệu, below [---] là returned dữ liệu
5.3.4.1 LxBool.srv
LxBool.srv liên quan hình minh họa
  • cmd: tham số số that needs đến be obtained hoặc đặt
  • val: giá trị đặt khi setting
  • là_set: Whether đến đặt tham số. When it là true, giá trị trong val sẽ be đặt đến camera. When it là false, giá trị của này tham số sẽ be read từ camera và displayed.
  • val: giá trị của camera’s hiện tại tham số returned khi getting hoặc setting it
  • kết quả: giá trị và thông tin returned bằng calling SDK interface
5.3.4.2 LxCmd.srv
LxCmd.srv liên quan hình minh họa
  • cmd: tham số số that needs đến be obtained hoặc đặt. When it là 0, tất cả tham số số sẽ be returned.
  • kết quả: giá trị và thông tin returned bằng calling SDK interface, cmd may have multiple return các giá trị
5.3.4.3 LxFloat.srv
LxFloat.srv liên quan hình minh họa
  • cmd: tham số số that needs đến be obtained hoặc đặt
  • val: giá trị đặt khi setting
  • là_set: Whether đến đặt tham số. When it là true, giá trị trong val sẽ be đặt đến camera. When it là false, giá trị của này tham số sẽ be read từ camera và displayed.
  • max_value: tối đa giá trị that có thể be đặt cho này tham số
  • min_value: tối thiểu giá trị that có thể be đặt cho này tham số
  • cur_value: hiện tại giá trị của này tham số trong camera
  • khả dụng: whether này tham số supports setting
  • kết quả: giá trị và thông tin returned bằng calling SDK interface
5.3.4.4 LxInt.srv
LxInt.srv liên quan hình minh họa
  • cmd: tham số số that needs đến be obtained hoặc đặt
  • val: giá trị đặt khi setting
  • là_set: Whether đến đặt tham số. When it là true, giá trị trong val sẽ be đặt đến camera. When it là false, giá trị của này tham số sẽ be read từ camera và displayed.
  • max_value: tối đa giá trị that có thể be đặt cho này tham số
  • min_value: tối thiểu giá trị that có thể be đặt cho này tham số
  • cur_value: hiện tại giá trị của này tham số trong camera
  • khả dụng: whether này tham số supports setting
  • kết quả: giá trị và thông tin returned bằng calling SDK interface
5.3.4.5 LxString.srv
LxString.srv liên quan hình minh họa
  • cmd: tham số số that needs đến be obtained hoặc đặt
  • val: giá trị đặt khi setting
  • là_set: Whether đến đặt tham số. When it là true, giá trị trong val sẽ be đặt đến camera. When it là false, giá trị của này tham số sẽ be read từ camera và displayed.
  • val: giá trị của camera’s hiện tại tham số returned khi getting hoặc setting it
  • kết quả: giá trị và thông tin returned bằng calling SDK interface

5.3.5 Description của topic subscription cách

5.3.5.1 Subscription frame rate, tray algorithm, obstacle avoidance algorithm output dữ liệu
Subscribe Frame Rate In lx_camera_node_ws thư mục, mở: bash rate.sh
Illustrations liên quan đến subscription frame rate, tray algorithm, và obstacle avoidance algorithm output dữ liệu
After lx_camera_node node hình ảnh runs normally và là refreshed, you có thể see sau thông tin:
Illustrations liên quan đến subscription frame rate, pallet algorithm, và obstacle avoidance algorithm output dữ liệu 2
Subscribe đến pallet algorithm output In lx_camera_node_ws thư mục, mở: bash pallet.sh
Illustrations liên quan đến subscription frame rate, pallet algorithm, và obstacle avoidance algorithm output dữ liệu 3
After lx_camera_node node hình ảnh runs normally và là refreshed, you có thể see sau thông tin:
Illustrations liên quan đến subscription frame rate, pallet algorithm, và obstacle avoidance algorithm output dữ liệu 4
Subscribe đến obstacle avoidance algorithm output In lx_camera_node_ws thư mục, mở: bash obstacle.sh
Illustrations liên quan đến subscription frame rate, pallet algorithm, và obstacle avoidance algorithm output dữ liệu 5
After lx_camera_node node hình ảnh runs normally và là refreshed, you có thể see sau thông tin:
Illustrations liên quan đến subscription frame rate, tray algorithm, và obstacle avoidance algorithm output dữ liệu 6
5.3.5.2 Subscribe đến hình ảnh dữ liệu (ROS1)
You có thể view hình ảnh thông tin output bằng node through hình ảnh tool that comes với ros: Console input command: rqt_image_view After entering command, sau window sẽ pop up:
Illustrations liên quan đến subscribing hình ảnh dữ liệu (ROS1)
red ô có thể select hình ảnh trong tất cả nodes. picture shows MRDVS camera RGB hình ảnh. You có thể cũng select độ sâu map hoặc cường độ map (provided that stream has been turned on):
Subscription hình ảnh dữ liệu (ROS1) liên quan diagram 2
In figure, trước tiên red ô là RGB thông tin output bằng positioning algorithm node, và remaining three là hình ảnh thông tin output bằng ordinary nodes. amp là cường độ map, độ sâu là độ sâu map, và rgb là rgb map. Select khác nhau items đến view khác nhau hình ảnh hoặc sử dụng rviz đến view hình ảnh dữ liệu. Enter command on console: rviz sẽ pop up sau window:
Subscription hình ảnh dữ liệu (ROS1) liên quan diagram 3
After clicking Add button at bottom trái, a window sẽ pop up:
Subscription hình ảnh dữ liệu (ROS1) liên quan diagram 4
Select desired hình ảnh topic và select Image và click OK trong dưới right góc. You có thể see hình ảnh dữ liệu on trái side của main interface, như shown below:
Subscription hình ảnh dữ liệu (ROS1) liên quan diagram 5
5.3.5.3 Subscribe đến hình ảnh dữ liệu (ROS2)
You có thể view hình ảnh thông tin output bằng node through hình ảnh tool that comes với ros2: Enter command on console: rqt After entering command, sau window sẽ pop up:
Illustrations liên quan đến subscribing hình ảnh dữ liệu (ROS2)
Select trước tiên Image View của second option at bottom của menu bar. After selection, sau interface sẽ pop up:
Subscription hình ảnh dữ liệu (ROS2) liên quan diagram 2
red ô có thể select hình ảnh trong tất cả nodes. picture shows MRDVS camera RGB hình ảnh. You có thể cũng select độ sâu map hoặc cường độ map (provided that stream has been turned on):
Subscription hình ảnh dữ liệu (ROS2) liên quan diagram 3
In figure, trước tiên red ô là RGB thông tin output bằng positioning algorithm node, và remaining three là hình ảnh thông tin output bằng ordinary nodes. amp là cường độ map, độ sâu là độ sâu map, và rgb là rgb map. Select khác nhau items đến view khác nhau hình ảnh hoặc sử dụng rviz2 đến view hình ảnh dữ liệu. Enter command on console: rviz2 sẽ pop up sau window:
Subscription hình ảnh dữ liệu (ROS2) liên quan diagram 4
After clicking Add button at bottom trái, a window sẽ pop up:
Subscription hình ảnh dữ liệu (ROS2) liên quan diagram 5
Select desired hình ảnh topic và select Image và click OK trong dưới right góc. You có thể see hình ảnh dữ liệu on trái side của main interface, như shown below:
Subscription hình ảnh dữ liệu (ROS2) liên quan diagram 6
Some các hệ thống cần đến fill trong [mrdvs] trong [map] trong above picture đến see hình ảnh
5.3.5.4 Subscribe đến point cloud dữ liệu
point cloud thông tin output bằng node có thể be viewed through point cloud tool provided bằng ros hoặc ros2: Command: rviz【ROS1】, rviz2【ROS2】 After entering command, sau window sẽ pop up:
Illustrations liên quan đến subscribing đến point cloud dữ liệu
Click button trong red ô below và sau ô sẽ pop up:
Illustration liên quan đến subscribing đến point cloud dữ liệu 2
Select second tab, và there sẽ be a node named lx_camera_node. There là a topic named LxCamera_Cloud trong node. There là a message named PointCloud2 trong topic. After selecting, click OK. interface sau completion là như sau:
Illustrations liên quan đến subscribing đến point cloud dữ liệu 3
(ROS1 interface)
Illustrations liên quan đến subscribing đến point cloud dữ liệu 4
(ROS2 interface) At này time, point cloud cannot be displayed normally. Fill trong mrdvs trong red và green ô map above đến see point cloud. effect là như sau:
Illustrations liên quan đến subscribing đến point cloud dữ liệu 5
mặc định point cloud unit trong ROS là meters, so khi viewing using rviz, you cần đến modify lx_tof_unit trong launch file đến 1 [ mặc định là 1]

5.3.6 Description của service communication cách

In ROS1, tất cả các command có thể be completed using Tab key, but trong ROS2, chỉ topics có thể be completed, và message part needs đến be entered thủ công. When inputting dữ liệu trong ROS1, you có thể input it trong completion format. When inputting dữ liệu trong ROS2, you cần đến input it trong format của yaml file. After node là chạy, mở a terminal under lx_camera_node_ws thư mục, configure môi trường trong terminal, và mở command: mã nguồn devel/thiết lập.bash
5.3.6.1 Get danh sách của tất cả tham số số (Lx_Cmd)
ros1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxCmd “cmd: 0”
Get tất cả tham số số danh sách (Lx\_Cmd) liên quan hình minh họa
You có thể see output:
Get tất cả tham số số danh sách (Lx\_Cmd) liên quan icon 2
ret là số của tham số. msg describes tham số kiểu và mô tả, cho ví dụ: 1001. Tài liệu này tham số là của kiểu int. tham số là used đến obtain và modify trước tiên exposure giá trị. ros2 Enter trong terminal: ros2 service call /LxCamera_LxCmd lx_camera_ros/srv/LxCmd ‘cmd: 0’
Get tất cả tham số số danh sách (Lx\_Cmd) liên quan icon 3
You có thể see sau output:
Get tất cả tham số số danh sách (Lx\_Cmd) liên quan icon 4
Since it là not convenient đến view tham số chi tiết trong ROS2, số, types và descriptions của tất cả các tham số là cũng listed trong sau table: Some các tham số cần đến dừng flow trước they có thể be đặt, hoặc there là a sequence của settings. Please contact technical support staff cho specific needs.
5.3.6.2 Get Int tham số (Lx_Int)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxInt “cmd: 1001 val: 0 là_set: false”
Get liên quan hình minh họa của Int các tham số (Lx\_Int)
You có thể see output:
Get  liên quan icon của Int tham số (Lx\_Int) 2
What là trong red ô là return giá trị. What là obtained trong figure là high integration time. According đến return kết quả, you có thể see that tối đa giá trị là 3600, tối thiểu giá trị là 1, hiện tại giá trị là 1010, whether setting là được hỗ trợ là được hỗ trợ, interface call return giá trị là 0, và return giá trị thông tin là thành công.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxInt lx_camera_ros/srv/LxInt '{cmd: 1001,val: 0,is_set: false}'
Get  liên quan icon của Int tham số (Lx\_Int) 3
You có thể see output:
Get  liên quan icon của Int tham số (Lx\_Int) 4
What là obtained trong figure là high integration time. According đến returned các kết quả, we có thể see that tối đa giá trị là 3600, tối thiểu giá trị là 1, hiện tại giá trị là 1010, whether setting là được hỗ trợ là được hỗ trợ, return giá trị của interface call là 0, và return giá trị thông tin là thành công.
5.3.6.3 Set Int các tham số (Lx_Int)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxInt “cmd: 1001 val: 2000 là_set: true”
Illustrations liên quan đến setting Int các tham số (Lx\_Int)
You có thể see output:
Illustration 2 liên quan đến setting Int các tham số (Lx\_Int)
What là trong red ô là return giá trị. high integration time là đặt trong figure. According đến return kết quả, you có thể see that tối đa giá trị là 3600, tối thiểu giá trị là 1, hiện tại giá trị has been modified đến 2000, whether support setting là được hỗ trợ, interface call return giá trị là 0, và return giá trị thông tin là thành công.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxInt lx_camera_ros/srv/LxInt '{cmd: 1001,val: 3000,is_set: true}'
Illustration 3 liên quan đến setting Int các tham số (Lx\_Int)
You có thể see output:
Illustration 4 liên quan đến setting Int các tham số (Lx\_Int)
What là obtained trong figure là high integration time. According đến returned các kết quả, we có thể see that tối đa giá trị là 3600, tối thiểu giá trị là 1, hiện tại giá trị has been modified đến 3000, whether setting là được hỗ trợ là được hỗ trợ, interface call return giá trị là 0, và return giá trị thông tin là thành công.
5.3.6.4 Get Float các tham số (Lx_Float)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxFloat “cmd: 2007 val: 0.0 là_set: false”
Get liên quan hình minh họa của Float các tham số (Lx\_Float)
You có thể see output:
Get  liên quan icon của Float tham số (Lx\_Float) 2
What là trong red ô là return giá trị. What là obtained trong picture là camera temperature. According đến return kết quả, you có thể see that tối đa giá trị là 120, tối thiểu giá trị là -40, hiện tại giá trị là 49.6875, whether setting là được hỗ trợ là not được hỗ trợ, interface call return giá trị là 0, và return giá trị thông tin là thành công.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxFloat lx_camera_ros/srv/LxFloat '{cmd: 2007,val: 0,is_set: false}'
Obtain liên quan hình minh họa của Float các tham số (Lx\_Float) 3
You có thể see output:
Get  liên quan icon của Float tham số (Lx\_Float) 4
What là obtained trong picture là camera temperature. According đến returned các kết quả, you có thể see that tối đa giá trị là 120, tối thiểu giá trị là -40, hiện tại giá trị là 50.4375, whether setting là được hỗ trợ là not được hỗ trợ, return giá trị của interface call là 0, và return giá trị thông tin là thành công.
5.3.6.5 Set Float các tham số (Lx_Float)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxFloat “cmd: 2007 val: 5.0 là_set: true”
Illustrations liên quan đến setting Float các tham số (Lx\_Float)
You có thể see output:
Illustration 2 liên quan đến setting Float các tham số (Lx\_Float)
red ô là return giá trị. camera temperature là đặt trong picture. According đến return kết quả, you có thể see that tối đa giá trị là 120, tối thiểu giá trị là -40, hiện tại giá trị là 50.9375, whether setting là được hỗ trợ là not được hỗ trợ, interface call return giá trị là -2, return giá trị thông tin là not được hỗ trợ, giá trị đặt here là 5, hiện tại giá trị và đặt giá trị là inconsistent because tham số does not support setting.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxFloat lx_camera_ros/srv/LxFloat '{cmd: 2007,val: 5.0,is_set: true}'
Illustration 3 liên quan đến setting Float các tham số (Lx\_Float)
You có thể see output:
Illustrations liên quan đến setting Float các tham số (Lx\_Float) 4
camera temperature là đặt trong picture. According đến returned các kết quả, you có thể see that tối đa giá trị là 120, tối thiểu giá trị là -40, hiện tại giá trị là 51.125, whether setting là được hỗ trợ là not được hỗ trợ, return giá trị của interface call là -2, return giá trị thông tin là not được hỗ trợ, giá trị đặt here là 5, hiện tại giá trị và đặt giá trị là inconsistent because tham số does not support setting.
5.3.6.6 Get Bool các tham số (Lx_Bool)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxBool “cmd: 3012 val: false là_set: false”
Get liên quan hình minh họa của Bool các tham số (Lx\_Bool)
You có thể see output:
Get Bool tham số (Lx\_Bool) liên quan icon 2
What là trong red ô là return giá trị. What là obtained trong picture là 2D automatic exposure. According đến return kết quả, we có thể see that hiện tại giá trị là false, return giá trị của interface call là 0, và return giá trị thông tin là thành công.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxBool lx_camera_ros/srv/LxBool '{cmd: 3012,val: false,is_set: false}'
Get Bool tham số (Lx\_Bool) liên quan icon 3
You có thể see output:
Get Bool tham số (Lx\_Bool) liên quan icon 4
What là obtained trong figure là 2D automatic exposure. According đến return kết quả, we có thể see that hiện tại giá trị là false, return giá trị của interface call là 0, và return giá trị thông tin là thành công.
5.3.6.7 Set Bool các tham số (Lx_Bool)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxBool “cmd: 3012 val: true là_set: true”
Illustrations liên quan đến setting Bool các tham số (Lx\_Bool)
You có thể see output:
Illustration 2 liên quan đến setting Bool các tham số (Lx\_Bool)
What là trong red ô là return giá trị. 2D automatic exposure là đặt trong picture. According đến return kết quả, we có thể see that hiện tại giá trị là true, return giá trị của interface call là 0, return giá trị thông tin là thành công, và hiện tại giá trị là consistent với đặt giá trị.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxBool lx_camera_ros/srv/LxBool '{cmd: 3012,val: true,is_set: true}'
Illustration 3 liên quan đến setting Bool các tham số (Lx\_Bool)
You có thể see output:
Illustrations liên quan đến setting Bool các tham số (Lx\_Bool) 4
setting trong picture là 2D automatic exposure. According đến return kết quả, we có thể see that hiện tại giá trị là true, return giá trị của interface call là 0, return giá trị thông tin là thành công, và hiện tại giá trị là consistent với đặt giá trị.
5.3.6.8 Get String tham số (Lx_String)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxString “cmd: 4001 val: ” là_set: false”
Get liên quan hình minh họa của String các tham số (Lx\_String)
You có thể see output:
Obtain String tham số (Lx\_String) liên quan icon 2
What là trong red ô là return giá trị. What là obtained trong figure là thiết bị phiên bản số. According đến return kết quả, we có thể see that hiện tại giá trị là V1.1.33_231201, return giá trị của interface call là 0, và return giá trị thông tin là thành công.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxString lx_camera_ros/srv/LxString '{cmd: 4001,val: '',is_set: false}'
Obtain String tham số (Lx\_String) liên quan icon 3
You có thể see output:
Get  liên quan icon của String tham số (Lx\_String) 4
What là obtained trong figure là thiết bị phiên bản số. According đến return kết quả, we có thể see that hiện tại giá trị là V1.1.33_231201, return giá trị của interface call là 0, và return giá trị thông tin là thành công.
5.3.6.9 Set String các tham số (Lx_String)
ROS1 Enter trong terminal: rosservice call /lx_camera_node/LxCamera_LxString “cmd: 4001 val: ‘put:\“123\”’ là_set: true”
Illustrations liên quan đến setting String các tham số (Lx\_String)
You có thể see output:
Illustration 2 liên quan đến setting String các tham số (Lx\_String)
red ô là return giá trị. thiết bị phiên bản số là đặt trong figure. According đến return kết quả, we có thể see that hiện tại giá trị là V1.1.33_231201, return giá trị của interface call là -2, và return giá trị thông tin là not được hỗ trợ. hiện tại giá trị và đặt giá trị là inconsistent because này tham số does not support setting.
ROS2 Enter trong terminal: ros2 service call /LxCamera_LxString lx_camera_ros/srv/LxString '{cmd: 4001,val: "put:\\"123\\"",is_set: true}'
Illustration 3 liên quan đến setting String các tham số (Lx\_String)
You có thể see output:
Illustrations liên quan đến setting String các tham số (Lx\_String) 4
thiết bị phiên bản số là đặt trong figure. According đến returned kết quả, we có thể see that hiện tại giá trị là V1.1.33_231201, return giá trị của interface call là -2, và return giá trị thông tin là not được hỗ trợ. hiện tại giá trị là inconsistent với đặt giá trị because này tham số does not support setting. When setting a giá trị của String kiểu, escape characters phải be added đến single quotes và double quotes, except cho initial double quotes trong ROS2 và initial single quotes trong ROS1. For ví dụ, if you want đến input string [PUT”123”], you phải bổ sung escape characters đến become: [PUT\”123\”].

Phần cứng ROS khuyến nghị và mức sử dụng tài nguyên

6.1 Cấu hình phần cứng khuyến nghị

In khuyến nghị hardware cấu hình, analysis là based on CPU core count, CPU usage, và bộ nhớ size. These là khuyến nghị configurations, not tối thiểu requirements. Nếu của bạn hardware là below recommendation, ổn định operation may still be possible bằng reducing stream output, disabling point-cloud computation, hoặc lowering algorithm load. Running a workload above khả dụng cấu hình may crash ROS core hoặc Ubuntu. second và third sections của này chapter provide detailed usage dữ liệu. Choose operating môi trường và stream cấu hình that best fits của bạn hệ thống. All dữ liệu here was collected trong a VM using an M4 Pro camera. Ubuntu16.04 Ubuntu18.04 Ubuntu20.04 Ubuntu22.04

6.2 Chi tiết CPU

Chi tiết CPU sẽ minh họa amount của CPU resources occupied bằng node under khác nhau operating conditions. kiểm thử là based on AMD64 [8 cores], 8G bộ nhớ hardware môi trường, kiểm thử camera là M4 Pro, kiểm thử algorithm là tray algorithm, 2D chiều rộng và chiều cao là 1280*960, và 3D chiều rộng và chiều cao là 640*480, 2D anti-distortion là on, 3D anti-distortion là off, và integration 110 - 3000, độ sâu 0 - 8000, ToF frame rate 14, streaming mode, smoothing level 1, noise level 1, time domain level 0, statistics command là TOP. Because kiểm thử soft môi trường là VM virtual machine, it là normal cho dữ liệu displayed bằng physical machine đến fluctuate compared với that trong document. For some các camera, such như S2, some algorithms là calculated on host computer, which các kết quả trong a large amount của resource usage, which là normal.
1. Some nouns là explained như sau: -Single stream: refers đến turning on any stream của RGB, độ sâu, và cường độ
  • Dual stream: refers đến turning on any two streams của RGB, độ sâu và cường độ
-Three streams: refers đến RGB, độ sâu, và cường độ tất cả three streams là turned on
  • Four streams: means RGB, độ sâu, cường độ, và point cloud là tất cả turned on
2. algorithm has a binding relationship với some streams. binding relationship là như sau:
  • To enable pallet algorithm, độ sâu phải be enabled
  • To turn on obstacle avoidance algorithm, you phải turn on độ sâu
  • To turn on positioning algorithm, you phải turn on RGB

light xanh background trong table là chạy cấu hình với point cloud enabled, và colorless background là chạy cấu hình không có point cloud enabled. All kiểm thử dữ liệu below have algorithm shifted down bằng mặc định, so cho S2 series các camera, tất cả kiểm thử các giá trị ​​may be too small [some algorithms của S2 series các camera là forced đến move up]. Ubuntu16.04 Ubuntu18.04 Ubuntu20.04 Ubuntu22.04

6.3 Chi tiết bộ nhớ

bộ nhớ chi tiết sẽ minh họa amount của bộ nhớ resources occupied bằng node under khác nhau operating conditions. kiểm thử là based on AMD64 [8 cores], 8G bộ nhớ hardware môi trường, kiểm thử camera là M4 Pro, kiểm thử algorithm là tray algorithm, 2D chiều rộng và chiều cao là 1280*960, và 3D chiều rộng và chiều cao là 640*480, 2D anti-distortion là on, 3D anti-distortion là off, points 110 - 3000, độ sâu 0 - 8000, ToF frame rate 14, streaming mode, smoothing level 1, noise level 1, time domain level 0, statistics command là TOP. Because kiểm thử soft môi trường là VM virtual machine, it là normal cho dữ liệu displayed bằng physical machine đến fluctuate compared với that trong document. For some các camera, such như S2, some algorithms là calculated on host computer, which các kết quả trong a large amount của resource usage, which là normal.
1. Some nouns là explained như sau: -Single stream: refers đến turning on any stream của RGB, độ sâu, và cường độ
  • Dual stream: refers đến turning on any two streams của RGB, độ sâu và cường độ
-Three streams: refers đến RGB, độ sâu, và cường độ tất cả three streams là turned on
  • Four streams: means RGB, độ sâu, cường độ, và point cloud là tất cả turned on
2. algorithm has a binding relationship với some streams. binding relationship là như sau:
  • To enable pallet algorithm, độ sâu phải be enabled
  • To turn on obstacle avoidance algorithm, you phải turn on độ sâu
  • To turn on positioning algorithm, you phải turn on RGB
  1. light xanh background trong table là chạy cấu hình với point cloud enabled, và colorless background là chạy cấu hình không có point cloud enabled. All kiểm thử dữ liệu below have algorithm shifted down bằng mặc định, so cho S2 series các camera, tất cả kiểm thử các giá trị ​​may be too small [some algorithms của S2 series các camera là forced đến move up].
Ubuntu16.04 Ubuntu18.04 Ubuntu20.04
Ubuntu22.04

Phụ lục

Tài liệu này phụ lục provides cài đặt cách cho some tools. When using these cách, you cần đến have at least some cơ bản knowledge của Linux. There là no guarantee that every computer có thể be successfully installed through cách shown trong phụ lục của này document. môi trường của each computer là khác nhau, và problems encountered may not be consistent. Nếu you encounter problems not shown trong này phụ lục, please search cho solutions yourself.

1. Cmake specified phiên bản cài đặt method

Mở https://cmake.org/download/, tải xuống phiên bản CMake cần thiết và giải nén gói bằng tar -zxvf cmake-XXX.tar.gz. Mở thư mục đã giải nén, sau đó biên dịch và cấu hình CMake: ./bootstrap make sudo make install Check Cmake phiên bản đến see if cài đặt là thành công: cmake —version

2. Opencv specified phiên bản cài đặt method

  1. Download bắt buộc phiên bản của opencv: Releases-OpenCV
Illustrations liên quan đến  cài đặt method của  specified phiên bản của Opencv
  1. Environment cấu hình, execute sau các command trong sequence:
sudo apt-get install build-essential sudo apt-getinstallcmake gitlibgtk2.0-devpkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
  1. Create a new opencv thư mục và extract downloaded mã nguồn mã into opencv thư mục.
  2. Chạy sau các command trong sequence:
  3.   cd opencv
  4.   mkdir build && cd build
  5.   sudocmake-DCMAKE_BUILD_TYPE=Release-D
  6.   CMAKE_INSTALL_PREFIX=/usr/local ..
  7.   sudo make -j4
  8. sudo make cài đặt và wait cho cài đặt đến complete

3. Pcl specified phiên bản cài đặt method

  1. Check được hỗ trợ pcl phiên bản:
apt-cache madison libpcl-dev
  1. Cài đặt specified pcl phiên bản (where 1.10.0 needs đến be replaced với bắt buộc phiên bản số):
sudo apt-get install libpcl-dev=1.10.0

4. Cài đặt ROS

Ubuntu16.04
  1. Add software mã nguồn và đặt secret key:
sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’ sudoapt-keyadv—keyserver’hkp://keyserver.ubuntu.com:80’—recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  1. Add secret key:
curl -sSL ‘http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654’ | sudo apt-key add -
  1. Update mã nguồn:
sudo apt-get update
  1. Cài đặt complete ros:
sudo apt-get install ros-kinetic-desktop-full
  1. Configure môi trường variables:
echo “mã nguồn /opt/ros/kinetic/thiết lập.bash” >> ~/.bashrc source ~/.bashrc
  1. Hoàn tất ROS-liên quan tools:
sudoaptinstallpython-rosinstallpython-rosinstall-generatorpython-wstool build-essential
  1. Now that cài đặt của ROS1 là complete, chạy ví dụ that comes với ROS đến kiểm tra whether cài đặt là correct:
Open a terminal và mở: roscore Open another terminal và mở: rosrun turtlesim turtlesim_node Open another terminal: rosrun turtlesim turtle_teleop_key In third terminal, you có thể control little turtle through arrow keys Nếu it có thể chạy normally như shown below, it means that ros has been installed correctly: Installation ROS liên quan hình minh họa
Ubuntu18.04
  1. Set up software mã nguồn:
sudo sh -c ’. /etc/lsb-release && echo “deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main” > /etc/apt/sources.danh sách.d/ros-latest.danh sách’ 2.Set public key: sudoapt-keyadv—keyserver’hkp://keyserver.ubuntu.com:80’—recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  1. Update software danh sách:
sudo apt update
  1. Cài đặt Ubuntu18.04 phiên bản của ROS1:
sudo apt install ros-melodic-desktop-full
  1. Set môi trường variables:
echo “mã nguồn /opt/ros/melodic/thiết lập.bash” >> ~/.bashrc source ~/.bashrc if it is zsh: echo “mã nguồn /opt/ros/melodic/thiết lập.bash” >> ~/.zshrc source ~/.zshrc
  1. Hoàn tất ROS-liên quan tools:
sudoaptinstallpython-rosdeppython-rosinstallpython-rosinstall-generator python-wstool build-essential
  1. Now that cài đặt của ROS1 là complete, chạy ví dụ that comes với ROS đến kiểm tra whether cài đặt là correct:
Open a terminal và mở: roscore Open another terminal và mở: rosrun turtlesim turtlesim_node Open another terminal: rosrun turtlesim turtle_teleop_key In third terminal, you có thể control little turtle through arrow keys Nếu it có thể chạy normally như shown below, it means that ros has been installed correctly:
Installation ROS liên quan hình minh họa 2
Ubuntu20.04
  1. Configure public key:
sudoapt-keyadv—keyserver’hkp://keyserver.ubuntu.com:80’—recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  1. Nếu it shows that it cannot connect đến server hoặc times out, please cập nhật software mã nguồn danh sách trước tiên:
sudo apt-get update sudo apt-get upgrade
  1. After configuring public key, cập nhật software danh sách again:
sudo apt-get update install ros: sudo apt install ros-noetic-desktop-full
  1. Set môi trường variables:
echo “mã nguồn /opt/ros/noetic/thiết lập.bash” >> ~/.bashrc source ~/.bashrc
  1. Cài đặt ROS tools:
sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
  1. Now that cài đặt của ROS1 là complete, chạy ví dụ that comes với ROS đến kiểm tra whether cài đặt là correct:
Open a terminal và mở: roscore Open another terminal và mở: rosrun turtlesim turtlesim_node Open another terminal: rosrun turtlesim turtle_teleop_key In third terminal, you có thể control little turtle through arrow keys Nếu it có thể chạy normally như shown below, it means that ros has been installed correctly:
Installation ROS liên quan hình minh họa 3
Ubuntu22.04 It là not khuyến nghị đến cài đặt ros1 trong Ubuntu22.04. It là not officially được hỗ trợ. Nếu you want đến cài đặt it, you sẽ encounter a lot của dependency problems.

5. Cách tạo package kiểm thử mới trong ROS

  1. Create a new thư mục ws, create a new src thư mục trong ws thư mục, mở src thư mục và execute:
catkin_create_pkg example std_msgs rospy roscpp
  1. Tài liệu này creates a new package named ví dụ, which depends on std_msgs rospy roscpp
  2. Sau đó biên dịch này new package: catkin_make Tài liệu này là an empty package, there sẽ not be any executable program, it là just a package
  3. Next, we sẽ demonstrate how đến create a package that có thể output ‘Hellow world’
  4. Based on package just now, we mở src thư mục (src trong package) và create a new main.cpp, như shown below (pay attention đến đường dẫn):
Illustration của how đến create a new kiểm thử package trong Ros
  1. In main.cpp, we mở some codes:
Ros How đến Create a New Test Package Related Illustration 2
  1. Sau đó we change outside CMakeLists.txt và bổ sung a line at bottom: bổ sung_executable(ví dụ src/main.cpp)
Ros How đến Create a New Test Package Related Illustration 3
  1. Sau đó return đến ws thư mục đến biên dịch và execute command: catkin_make
Ros How đến Create a New Test Package Related Illustration 4
  1. Seeing these means biên dịch là thành công.
  2. Next we configure môi trường:
source devel/setup.bash
Ros How đến Create a New Test Package Related Illustrations 5
  1. Sau đó execute program và you có thể see output:
rosrun example example
Ros How đến Create a New Test Package Related Illustrations 6

6. Cài đặt ROS2

Ubuntu16.04
  1. Add secret key:
sudo apt-get update && sudo apt-get install curl curl http://repo.ros2.org/repos.key | sudo apt-key add -
  1. Add permissions:
sudo apt update && sudo apt install curl gnupg2 lsb-release curl-shttps://raw.githubusercontent.com/ros/rosdistro/master/ros.asc|sudo apt-key add -
  1. Nếu an lỗi là reported trong này step, sử dụng VPN đến bypass wall và then mở browser, mở URL, và copy content, then create a new ros.asc và copy content đến file. After copy là completed, sau là như sau:
  2. Sau đó re-execute step 3: sudo apt-key bổ sung ros.asc
  3. Continue chạy:
sudo sh -c ‘echo “deb [arch=amd64] http://packages.ros.org/ros2/ubuntu bionic main” > /etc/apt/sources.list.d/ros2-latest.list’
  1. Cài đặt ROS2:
sudo apt update sudo apt install ros-ardent-desktop
  1. Configure môi trường variables:
source /opt/ros/ardent/setup.bash
  1. Cài đặt chức năng package:
sudo apt-get update sudo apt-get install ros-ardent-ros1-bridge sudo apt-get install ros-ardent-turtlebot2-*
  1. Try chạy ví dụ program, mở a terminal và chạy:
source ~/.bashrc ros2 run demo_nodes_cpp talker
  1. Open another interrupt đến chạy:
source~/.bashrc ros2 run demo_nodes_cpp talker
  1. sau terminal output proves that cài đặt là thành công:
Ubuntu18.04:
  1. Add software mã nguồn
sudo apt update && sudo apt install curl gnupg2 lsb-release curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc sudo apt-key add ros.asc
  1. Nếu này step reports an lỗi như sau:
  2. Use VPN đến bypass wall, then mở browser, mở URL, và copy content, then create a new ros.asc và copy content đến file. After copy là completed, it là như sau:
  3. Sau đó re-execute step 3: sudo apt-key bổ sung ros.asc
  4. Continue chạy:
sudo sh -c ‘echo “deb [arch=amd64] http://packages.ros.org/ros2/ubuntu bionic main” > /etc/apt/sources.list.d/ros2-latest.list’
  1. After completion, bắt đầu downloading ros2, trong which red fonts cần đến be replaced với khác nhau các phiên bản (see table above):
sudo apt update sudo apt install ros-eloquent-desktop
  1. Wait cho cài đặt đến complete và continue đến cài đặt python library. Chạy: sudo apt cài đặt -y libpython3-dev python3-pip pip3 cài đặt -U argcomplete
Sau đó configure môi trường variables: echo “mã nguồn /opt/ros/eloquent/thiết lập.bash” >> ~/.bashrc source ~/.bashrc
  1. Try chạy ví dụ program, mở a terminal và chạy:
source ~/.bashrc ros2 run demo_nodes_cpp talker
  1. Open another interrupt đến chạy:
source ~/.bashrc ros2 run demo_nodes_py listener
  1. sau terminal output proves that cài đặt là thành công:
Ubuntu20.04
  1. Add software mã nguồn
sudo apt update && sudo apt install curl gnupg2 lsb-release sudo curl -sSL [https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o](https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o) /usr/share/keyrings/ros-archive-keyring.gpg
  1. Nếu you encounter lỗi “ailed đến connect đến raw.githubusercontent.com port 443 sau 13 ms: connection refused”
Installation ROS2 liên quan hình minh họa 6
sudo vi /etc/hosts
  1. Add sau analysis
185.199.108.133raw.githubusercontent.com
  1. added các file là như sau:
Installation ROS2 liên quan hình minh họa 7
echo”deb[arch=(mã nguồn/etc/os-phát hành&&echo$UBUNTU_CODENAME) main” | sudo tee /etc/apt/sources.danh sách.d/ros2.danh sách > /dev/null
  1. Continue chạy:
sudo sh -c ‘echo “deb [arch=amd64] http://packages.ros.org/ros2/ubuntu bionicmain” > /etc/apt/sources.list.d/ros2-latest.list’
  1. After completion, bắt đầu downloading ros2:
sudo apt update sudo apt install ros-foxy-desktop
  1. Wait cho cài đặt đến complete và continue đến cài đặt python library. Chạy: sudo apt cài đặt -y libpython3-dev python3-pip pip3 cài đặt -U argcomplete
  2. Sau đó configure môi trường variables:
echo “mã nguồn /opt/ros/foxy/thiết lập.bash” >> ~/.bashrc source ~/.bashrc
  1. Try chạy ví dụ program, mở a terminal và chạy:
source ~/.bashrc ros2 run demo_nodes_cpp talker
  1. Open another interrupt đến chạy:
source ~/.bashrc ros2 run demo_nodes_py listener
  1. sau terminal output proves that cài đặt là thành công:
Ubuntu22.04
  1. Add software mã nguồn
sudo apt update && sudo apt install curl gnupg lsb-release sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpgecho”deb[arch=(source/etc/os-release&&echo$UBUNTU_CODENAME) main” | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
  1. Nếu you encounter lỗi “ailed đến connect đến raw.githubusercontent.com port 443 sau 13 ms: connection refused”
Installation ROS2 liên quan hình minh họa 9
sudo vi /etc/hosts adds the following analysis 185.199.108.133raw.githubusercontent.com added các file là như sau:
Installation ROS2 liên quan hình minh họa 10
  1. After completion, bắt đầu downloading ros2: sudo apt cập nhật
sudo apt install ros-humble-desktop
  1. Wait cho cài đặt đến complete và continue đến cài đặt python library. Chạy: sudo apt cài đặt -y libpython3-dev python3-pip pip3 cài đặt -U argcomplete
  2. Sau đó configure môi trường variables:
echo “mã nguồn /opt/ros/humble/thiết lập.bash” >> ~/.bashrc source ~/.bashrc
  1. Try chạy ví dụ program, mở a terminal và chạy:
source ~/.bashrc ros2 run demo_nodes_cpp talker
  1. Open another interrupt đến chạy:
source ~/.bashrc ros2 run demo_nodes_py listener
  1. sau terminal output proves that cài đặt là thành công:

7. Cách tạo package kiểm thử mới trong ROS2

  1. Chạy command:
mkdir example_ws && cd example_ws ros2 pkg create —build-type ament_cmake —node-name example_n example_p colcon build source install/setup.bash ros2 run example_p example_n
  1. You có thể create a new package named ví dụ_p và a node named ví dụ_n. After chạy, it sẽ output: hello world ví dụ_p package