Task Autosar

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Name :Dina Ahmed Elessawy

Code : 18x0062

AUTOSAR TASK

Submitted to :dr / Diaa Eldien Khalil


/*
============================================================================
Name : task.c
Author : Dina Elessawy
Version :
Date : Created on: Oct 12, 2021
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/

#include <stdio.h>

#define SIZE 10

void bubbleSort( int array[], const int size ); /* prototype */


int removeDuplicates(int arr[], int n);

int main( void )


{
/* initialize array a */
int a[ SIZE ] = { 2, 6, 4, 8, 10, 2, 8, 68, 4, 37 };

int i; /* counter */

printf( "Data items in original order\n" );

/* loop through array a */


for ( i = 0; i < SIZE; i++ )
{
printf( "%4d", a[ i ] );
} /* end for */

bubbleSort( a, SIZE ); /* sort the array */

printf( "\nData items in ascending order\n" );

int n = sizeof(a) / sizeof(a[0]);

// removeDuplicates() returns new size of


// array.
n = removeDuplicates(a, n);

// Print updated array

/* loop through array a */


for ( i = 0; i < n; i++ )
{
printf( "%4d", a[ i ] );
} /* end for */
printf( "\n" );
return 0; /* indicates successful termination */
} /* end main */
/* sort an array of integers using bubble sort algorithm */
void bubbleSort( int * const array, const int size )
{

int i; /* pass counter */


int j; /* comparison counter */
int temp;
/* loop to control passes */
for ( i = 0; i < size - 1; i++ )
{
/* loop to control comparisons during each pass */
for ( j = 0; j < size - 1; j++ )
{
/* swap adjacent elements if they are out of order */
if ( array[ j ] > array[ j + 1 ] )
{
temp = array[ j ];
array[ j ] = array[ j + 1];
array[ j + 1] = temp;
} /* end if */
} /* end inner for */
} /* end outer for */
} /* end function bubbleSort */
int removeDuplicates(int arr[], int n)
{
// Return, if array is empty
// or contains a single element
if (n==0 || n==1)
return n;

int temp[n];

// Start traversing elements


int j = 0;
for (int i=0; i<n-1; i++)

// If current element is not equal


// to next element then store that
// current element
if (arr[i] != arr[i+1])
temp[j++] = arr[i];

// Store the last element as whether


// it is unique or repeated, it hasn't
// stored previously
temp[j++] = arr[n-1];

// Modify original array


for (int i=0; i<j; i++)
arr[i] = temp[i];

return j;
}
/*
============================================================================
Name : task.c
Author : Dina Elessawy
Version :
Date : Created on: Oct 12, 2021
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/

#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, n1, k=4;
int *array1, *array2;
scanf("%d", &n1);
array1 = (int *)malloc(sizeof(int)*n1);
for (i = 0; i < n1; i++)
{
scanf("%d", &array1[i]);
}

double tmp = 0;
for (int i = 0; i < n1; i++)
{
tmp += array1[i];
// now tmp contains exactly k + 1 elements sum
// so subtract elements outside of k sized window(leftmost element)
if(i >= k) {
tmp -= array1[i - k];
}
if(i >= k - 1) {
double average = tmp / k;
printf("%lf\n", average);
}
}
return 0;
}
Automotive Radar
Abstract
A medium range radar sensor adapted from an automotive parking assistance
system has been tested for obstacle detection in the agricultural environment.
The radar sensor is capable of detecting both machines and organic material, but
it was not possible to distinguish between the different types of material. The
accuracy of the distance measurement is ± 0.15 m which is sufficient for an
obstacle detection. The correlation of the target detection with real objects was
not satisfactory. The radar sensor detects more targets than existing objects. By
post processing the data the correlation could be improved.
Keywords: Radar, Collision Avoidance, Overloading, Driver Assistance System.

Introduction
Steering aids are intended to relieve the machine operator from the driving task in order to
focus the operators attention on the process control of the agricultural machine. While the
automatic steering is in control the driver is relying on the system, which results in a
reduction of the vigilance. To keep up a safe machine control and to avoid collisions it is
necessary to assure an additional observation of the drive path. This could improve the
safety for automized vehicle actuation. New safety features and hence new sensor
technologies are required. To set up an obstacle detection, measurement methods need to
be tested for applicability and reliability in rough agricultural environment.
An overloading assistance system (ASÜL) has been developed at the Technical University of
Braunschweig [1, 2]. Therefore the application in the focus of interest was the parallel
overloading between a forage harvester and the transport unit.
Material and methods

The ‘Universal Medium Range Radar’ sensor (UMRR, figure 1) was developed for
an automotive parking assistant system. It is a pulse doppler radar, specialised for
dynamic measurements of moving targets, capable of detecting up to 30 targets
at a time. The signal frequency is 24 GHz. The detection range of the sensor lasts
from 1 m to 20 m. The output dataset consists of the power density of the
reflection, the polar coordinates, the radial speed of each target and the number
of detected targets. The radar beam has a quasi two dimensional directional radio
pattern (figure 2, elevation ~45°, azimuth

Test setup

The test setup I (figure 3) was intended to prove the basic abilities of the sensor.
Different test runs have been executed to analyse the accuracy of the distance
measurement and the reliability of the object detection.
Table 1 shows the parameters for test setup I.

The test object was a metal tube with a length of 1.5 m and circular diameter of Ø
0.35 m standing upright. The round shape was to guarantee an evenly strong
reflection of the radar beam under all angles of incident. For the static tests it has
been placed at various spots in the rnage of the radar beam (figure 3). During the
dynamic tests the object was pushed transversally across the main direction of
the radar beam from the right to the left hand side. The ‘single-object-test’ was
executed in an open, unobstructed site. For the ‘multiple-objectstest’ the single
object was positioned in front of a wall with metal shades (figure 3). Vehicle
based tests (figure 4) have been executed to prove the ability of vehicle detection
and the accuracy of the distance measurement between the vehicles. Additional
tests have been executed to measure the reflection of the radar beam on
inhomogeneous organic material. A laser scanner ‘Sick LMS 291-S05’ with an
accuracy of ± 35 mm was used to reference the distance measurement [4].

Results
The test results show that the chosen sensor detects moving objects without
major problems in agricultural environment. Dust or dirt particles do not affect
the measurement results significantly. The radar sensor is able to detect objects
of organic material as well as metal or “machine” material. The accuracy of the
measured distance is ± 0.15 m Std.
Static / dynamic measurements

As the sensor was developed for dynamic measurements it shows some problems
while stationary. The false detection of virtual objects caused by internal signal
interferences can only be reduced while the sensor or the target is moving. The
reason for this is inherent of the radar principle. The Puls-Doppler-Radar uses
special comb filtering methods to inhibit the strong reflection of stationary
objects in order to improve the detection of the weaker signals of moving targets.
This method can only be applied when the true target is in motion.
Power density of the signal reflection

The radar sensor is able to detect organic matter both as solid and bulk material.
Besides the material itself the power density of the reflection depends also on the
distance, the angle of incidence, the geometric dimensions and the structure of
the object in question. During field applications the distance and the angle of
incidence of the radar beam vary constantly. As a result the power density of the
reflection of each material varies across the whole scale. A clear distinction of
different materials during the field application proved impossible. Whereas the
accuracy of the distance measurement is not affected significantly by the
material.
Vehicle detection

Because the transport unit is a large and solid reflector the vehicle is detected
without any problems. The accuracy of the lateral distance measurement
between two vehicles is ± 0.14 m Std.
Distance measurements

The ‘single-object-test’ shows that the radar sensor is capable of detecting strong
reflecting targets with a good accuracy. The deviation of the radar sensor
compared to the laser scanner reference is depicted in figure 5. The standard
deviation (Std) for the ‘single-objecttest’ is ± 90 mm including all results from
stationary and dynamic tests (figure 5, right side). Regarding only dynamic
measurements the Std improves to ± 35 mm whereas a Std of ± 110 mm results
from solely stationary measurements. This reflects the influence of the sensor
movement on the measurement accuracy.
Figure 5: Results from the distance measurement tests. Deviation between the laser scanner
reference data and radar sensor reading. The left side of figure 5 illustrates the results from the
‘multiple-objects-test’. Comparing the left side of figure 5 to it’s right side (‘single-object-test’)
it becomes obvious that the radar sensor is influenced strongly by multipath effects between
the targets during the ‘multiple- object-test’. The standard deviation for the ‘multiple-object-
test’ is ± 700 mm including all results. In this case the dynamic situation does not improve the
performance.
References
[1] C. Weltzien, F. Graefe, I. Bönig, N. Diekhans, “Automatisierte Überladung bei selbstfahrenden
Feldhäckslern”, Tagungsband 62. VDI-MEG Jahrestagung Landtechnik, VDI Berichte Nr. 1855, pp. S.123 -
130, 2004.

[2] F. Graefe, C. Weltzien, H.-H. Harms, “Füllstandsermittlung zur automatisierten Überladung bei
selbstfahrenden Feldhäckslern”, Tagungsband 63. VDI-MEG Jahrestagung Landtechnik, VDI-Berichte Nr.
1895, pp. 260 - 261, 2005.

[3] s.m.s. smart microwave sensors GmbH, Full Documentation Universal Medium Range Radar “UMRR”,
2005 [4] N.N., “Lasermesssysteme LMS 2xx”, Technische Beschreibung, SICK AG, Division Auto Ident
Düsseldorf, 2003.

You might also like