1. Trang chủ
  2. » Giáo Dục - Đào Tạo

TÌM HIỂU 1 ví dụ CU THỂ về đầu vào, đầu RA,THUẬT TOÁN CHO 1 ỨNG DỤNG với FPRIMECÁCH THỨC VIẾT CODE KHÔNG có lỗi

12 33 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

NHĨM TÌM HIỂU VÍ DỤ CU THỂ VỀ ĐẦU VÀO, ĐẦU RA, THUẬT TOÁN CHO ỨNG DỤNG VỚI FPRIME CÁCH THỨC VIẾT CODE KHƠNG CĨ LỖI Giảng viên hướng dẫn: Danh sách thành viên: PhD Huy-Dzung Han Hồng Bích Phượng – 20172763 Lê Cơng Luận – 20172673 Phạm Thị Phượng – 20172764 Phan Doãn Đức – 20172486 Lê Đình Minh – 20172698 9/2/21 Nhóm Part 1: MARS HELICOPTER [1] Input: • Các lệnh từ mặt đất • Cảm biến đo lường Output: Các lệnh truyền động 9/2/21 Nhóm Dựa lệnh từ trạm mặt đất thì: • Mơ-đun Mode Commander chịu trách nhiệm thiết lập chế độ mô-đun phần mềm khác theo giai đoạn chuyến bay, đồng thời khởi động hành động liên quan đến chuyển đổi chế độ • Mô-đun Navigation sử dụng liệu cảm biến để ước tính trạng thái phương tiện • Mơ-đun Guidance tạo quỹ đạo tham chiếu tín hiệu điều khiển chuyển tiếp dựa giai đoạn chuyến bay • Mơ-đun Control bổ sung điều khiển phản hồi dựa khác biệt quỹ đạo tham chiếu trạng thái ước tính => Đưa lệnh truyền động 9/2/21 Nhóm NAVIGATION ALGORITHM [1, 2] Thuật toán chọn cho ứng dụng Mars Helicopter MAVeN (Minimal Augmented state algorithm for Vision-based Navigation) • • Hoạt động tương tự SLAM, trừ việc tránh tang cường vector đăc trưng MAVeN khí hoá lọc Kalman mở rộng (EKF) có số ưu điểm so với phương pháp đo vận tốc dựa tầm nhìn khác Vector lọc 21 trạng thái liên kết với MAVeN: 9/2/21 Nhóm Các thuộc tính độc MAVeN: chiếu đặc điểm hình ảnh lên mơ hình hình dạng bề mặt đất để sử dụng làm điểm mốc giả cho hình ảnh Cụ thể: Xác định hình ảnh hình ảnh sở (Base Image) Sử dụng kết ước tính pB, qB để ánh xạ đối tượng địa lý hình ảnh sở lên mơ hình bề mặt phẳng Ví dụ: f1; f2; f3 Các vị trí đặc trưng đóng vai trị điểm mốc giả Xác định hình ảnh hình ảnh tìm kiếm (Search image) Khớp tính hình ảnh tìm kiếm với địa danh giả ánh xạ từ hình ảnh sở gần Kết hợp m mốc giả với hình học để tạo thành phép đo hàm trạng thái Cơ sở Tìm kiếm tại: Nếu số lượng tính phù hợp giảm xuống ngưỡng => khai báo hình ảnh làhình ảnh Cơ sở thực [1] Nếu khơng, khai báo hình ảnh hình ảnh Tìm kiếm chuyển đến [3] 9/2/21 Nhóm 5 Part Cách thức viết code khơng có lỗi [3] Avoid complex flow constructs, such as goto and recursion • Do not use “ go to” statements, setjmp or longjmp contructs, and direct or indirect recursion • ”switch contructs” requires “ break” to close the block There will be bugs All loops must have fixed bounds This prevents runaway code • To make sure that the loop won't exceed a given number of iterations • Make sure that you always work with pages that are of a reasonable size and this way you won't need loops that could run forever 9/2/21 Nhóm Avoid heap memory allocation • Do not use dynamic memory allocation after initialization • Given any accepted input the memory consumption won't go beyond a certain point Restrict functions to a single printed page • No more than about 60 lines of code per function • You can easily organize your code into functions of about that size or smaller and that you can easily understand those functions • Nobody likes to land on a 1000-lines function that seems to a gazillion things at the same time 9/2/21 Nhóm Use a minimum of two runtime assertions per function • The assertion density of the code should average to a minimum of two assertions per function • Assertions must always be side-effect free and should be defined as Boolean tests Restrict the scope of data to the smallest possible • In short, don't use global variables • You can hide your data in classes, modules, second-order functions, etc 9/2/21 Nhóm Check the return value of all non-void functions, or cast to void to indicate the return value is useless • The return value of non-void functions must be checked by each calling function, and the validity of parameters must be checked inside each function • Let exceptions bubble up until you properly recover and/or report them Use the preprocessor sparingly • The use of the preprocessor must be limited to the inclusion of header files and simple macro definitions • If you use transpilers, make sure that they solve more problems than they bring 9/2/21 Nhóm 9 Limit pointer use to a single dereference, and not use function pointers • Don't use references even if your language supports it • Copy arguments instead of mutating them, unless it's the explicit purpose of the function • Use as many type-safety features as you can 10 Compile with all possible warnings active; all warnings should then be addressed before release of the software • The warnings are very smart and helpful • Spell checkers are also surprisingly important because they will allow you to sniff out typos regardless of type analysis or any complicated static code analysis • Use several linters and tools to analyze your code No warning shall be ignored 9/2/21 Nhóm 10 REFERENCES [1] J (Bob) Balaram, Timothy Canham, Courtney Duncan, Matt Golombek, Håvard Fjær Grip, Wayne Johnson, Justin Maki?, Amelia Quon?, Ryan Stern and David Zhu, Mars Helicopter Technology Demonstrator DOI: 10.2514/6.2018-0023 [2] David S Bayard, Dylan T Conway, Roland Brockers, Jeff Delaune, Larry Matthies, Havard F Grip, k Gene Merewether, Travis Brown, A Miguel San Martin, Vision-Based Navigation for the NASA Mars Helicopter DOI: 10.2514/6.2019-1411 [3] https://dev.to/xowap/10-rules-to-code-like-nasa-applied-to-interpreted-languages-40dd? fbclid=IwAR3jf4fC2gLYi9T0YU9vLCDBAB8vRMkyNOt0n_in-PvJfbOpHK7fMRhH7Cg 9/2/21 Nhóm 11 ... sử dụng làm điểm mốc giả cho hình ảnh Cụ thể: Xác định hình ảnh hình ảnh sở (Base Image) Sử dụng kết ước tính pB, qB để ánh xạ đối tượng địa lý hình ảnh sở lên mơ hình bề mặt phẳng Ví dụ: f1;... Cơ sở thực [1] Nếu khơng, khai báo hình ảnh hình ảnh Tìm kiếm chuyển đến [3] 9/2/ 21 Nhóm 5 Part Cách thức viết code khơng có lỗi [3] Avoid complex flow constructs, such as goto and recursion •... DOI: 10 .2 514 /6.2 019 -14 11 [3] https://dev.to/xowap /10 -rules-to -code- like-nasa-applied-to-interpreted-languages-40dd? fbclid=IwAR3jf4fC2gLYi9T0YU9vLCDBAB8vRMkyNOt0n_in-PvJfbOpHK7fMRhH7Cg 9/2/ 21 Nhóm

Ngày đăng: 02/09/2021, 06:37

Xem thêm:

TỪ KHÓA LIÊN QUAN

Mục lục

    Part 2. Cách thức viết code không có lỗi [3]

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w