Assignment threading synchronisation and data integrity -


General Information

Intent: Skills in utilising, classes, abstraction, data structures, threading, data synchronisation and documentation will be assessed.

Task:

Write a program in C++ using object oriented paradigms that shares data originating from a range of Mechatronics sensors between a number of threads. Ensure data integrity between threads and enable relating data between them via suitable data structure that enables time synchronisation and subsequently interpolation of data for task at hand. Supply appropriate auto-generated documentation utilising inline source mark-up.

Rationale: In a Mechatronics System, sensors produce data at varying rates. Decisions need to be made based on correctly associated data in near real-time. Threading and synchronisation are ways to ensure the system performs as intended, with guarantees on the responsiveness of the system to incoming data changes, processing constraints and system behaviour.

Your task is to (a) create a number of threads that can handle buffering incoming data in an agnostic manner (b) create a separate thread to process the data from the sensors that ensures synchronisation of the data between producers / consumers and produces an output by extrapolation of data (extrapolation is the process of estimating, beyond the original observation).

Specifics

An aircraft is patrolling space surrounding a base station. The aircrafts task is to localise an enemy aircraft (bogie) that enters the airspace and intercept the aircraft by shadowing it (keeping on top of it) for a period of time.

The aircraft is controlled by supplying desired linear velocity and angular velocity (V and ω) that the on-board systems immediately respond to, as long as they are within operational parameters of aircraft. The controlled linear velocity cannot be less than a terminal velocity (50 m/s), otherwise the aircraft will stall and fall from the sky, or above max velocity (1000 m/s). The combination of linear and angular velocity cannot exceed 6G (safety limit for the pilot : calculated as V * ω / g ; g being gravitational force). A watchdog timer in the control systems requires control input to be supplied every 50ms (5ms tolerance) or the control systems will fail.

The aircraft is equipment with:

- A high-precision INSGPS that provides the aircraft precise pose (x,y and θ)
- An omnidirectional radar that provides range to the bogie (from the aircraft) updating at 100Hz

Apart from the on-board Radar the aircraft can:

- Receive readings from a radar situated at the base station that provides range to the bogie (from the base station) at 10Hz (the base station is at location 0.0).

A library (libsimulator.a) and header files encompassing the simulator is provided (as part of skeleton code - details below).

To illustrate how to use the simulator a sample project containing: CMakeLists.txt and simple main exploiting the simulator are available under student git repository (skeleton/a3-skeleton).

The complete API for the Simulator is available under your git repository (skeleton/a3-skeleton- doc). To access the API specifics, open index.html within above noted folder (for instance "firefox index.html"). Peruse Class List and view the methods available under Simulator class.

Task

Create an instance of the simulation and a number of threads to achieve control of an aircraft with an aim of (1) estimating the position of an enemy aircraft (bogie) and (2) shadowing this aircraft : keeping the aircraft on top of the bogie (within 600m) for 2 seconds.

Your system will need to

1. Obtain radar data from the aircraft and the ground station

2. Utilise the radar data to estimate the bogie position (via intersect of the ranges - circles) and display the estimated position on the simulator

3. Linearly extrapolate the bogie position (determine what parameters are needed for this task)

4. Estimate a control action that will lead to your aircraft intercepting the bogie

5. Control the aircraft within the watchdog imposed limits and aircraft specification envelope (terminal velocity / max velocity / max G profile).

6. Continue to determine control actions that will allow you to shadow the bogie, be within 600m for 2 seconds.

Therefore, you will need to design classes mapped to the task and functionality (refer assessment criteria).

Create a Main that

1. Creates objects from your classes

2. Creates a suitable number of threads for the task

3. Handle concurrency using appropriate data protection

4. Achieves goals (1-6)

5. Waits until the threads are terminated with CTRL+C

Attachment:- Assignment Information.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Assignment threading synchronisation and data integrity -
Reference No:- TGS02910941

Expected delivery within 24 Hours