本次代写是C++传感器测试的一个assignment
Assignment Specifics
Students are provided skeleton code in a1_skeleton folder that they need to use and develop from.
The physical sensors are collocated; the spatial separation of sensors can be disregarded. For the purpose of this
assignment assume that all sensor data is obtained instantaneously (disregard acquisition time).
A) Create a Base Sensor Class (called Ranger) and two derived Sensor Classes (Laser and Sonar) that contain:
- Pose Offset of Sensor (X,Y and angle relative to centre [Y axis] – anticlockwise positive)
- Field of View of Sensor
- Angular Resolution
- Number of Samples
- Sensing Type
- Data
The Ranger will need to inherit (use as base class) the RangerInterface header and implement its virtual functions
without changing the function declarations (signatures).
B) Each Sensor will need to
1. Initialise all the required variables to enable using the sensor
2. Enable obtaining all the hardware specific fixed parameters of the sensor
3. Enable setting configurable parameters of the sensor
4. Inform if the values to be set are sane, otherwise use previous values
5. Obtain sample sensor data at specific sensor angular resolution and within sensing range (Generated as
random numbers within sensor specifications, normal distribution: mean 5m standard deviation 6m).
C) The RangerFusion Class will need to
- Accept a STL container of Sensors
- Accept a STL container of Cells (cells are essentially squares)
- Determines the area to be covered by cone type sensors (as a union of sensing area). Solely for this task
approximating the cone with a triangle is acceptable. - Produce a fusion of sensor readings at the supplied cells, dealing with readings that are on the boundary of
the sensing range (max range). Cell Fusion is discussed in subsequent pages of this document. For this task
the cone-based sensors can NOT be approximated as a triangle. - Return an STL container of raw unfused data (data must be that of raw data used for fusion)
- You will need to inherit (use as base class) the RangerFusionInterface header and implement its virtual
functions without changing the function declarations (signatures)
D) Create a static library called ranger_lib, from the classes specified.
E) Create a Main that
- Initialises the sensors (for instance 1 Laser, 3 Sonars)
- Queries the fixed sensor parameters
- Sets sensor parameters (variable parameters, and offset)
- Asks the user for number of cells and generates them
- Reports the area to be covered by cone type sensors
- Continuously calls (each second) the RangerFusion class grabAndFuse method (which that invokes
generating data and fusion) and prints to screen the status of the cells (free , occupied, unknown)