Signal & System
CEP
BSC-EE-F18
Name:
Zahid Saleem Anjam
Adil Husain
M Bilal
Osama Shakoor Abbasi
Zohaib Idrees
Submitted to: Sir Asad
Roll No: UET # 49, 53,15,23,45
Washington Accord Knowledge Profile
Knowledge profile is based on all Program learning outcomes
SNO Knowledge
1 WK1: A systematic, theory-based understanding of the natural sciences applicable
2 to the discipline
WK2: Conceptually-based mathematics, numerical analysis, statistics and formal
3 aspects of computer and information science to support analysis and modelling
4 applicable to the discipline
WK3: A systematic, theory-based formulation of engineering fundamentals
5 required in the engineering discipline
6 WK4: Engineering specialist knowledge that provides theoretical frameworks and
7 bodies of knowledge for the accepted practice areas in the engineering discipline;
much is at the forefront of the discipline.
8 WK5: Knowledge that supports engineering design in a practice area
WK6: Knowledge of engineering practice (technology) in the practice areas in the
engineering discipline
WK7: Comprehension of the role of engineering in society and identified issues in
engineering practice in the discipline: ethics and the professional responsibility of an
engineer to public safety; the impacts of engineering activity: economic, social,
cultural, environmental and sustainability
WK8: Engagement with selected knowledge in the research literature of the
discipline
Complex Engineering Activities
Complex activities mean (engineering) activities or projects that have some or all of the
following characteristics:
SNO Attributes Complex Activities
1 Range of resources EA1: Involve the use of diverse resources (and for this
purpose resources includes people, money, equipment,
2 Level of interactions materials, information
3 Innovation and technologies)
EA2: Require resolution of significant problems arising
from interactions between wide ranging or conflicting
technical, engineering or other issues
EA3: Involve creative use of engineering principles and
research-based knowledge in novel ways
4 Consequences to society EA4: Have significant consequences in a range of
and the environment contexts, characterized by difficulty of prediction and
mitigation
5 Familiarity EA5: Can extend beyond previous experiences by
applying principles-based approaches
Complex Engineering Problem Solving
Engineering problems which cannot be resolved without in-depth engineering knowledge, much
of which is at, or informed by, the forefront of the professional discipline, and have some or all
of the following characteristics listed below:
Attribute Complex Engineering Problems have characteristic WP1 and some or
all of WP2 to WP7:
Depth of Knowledge WP1: Cannot be resolved without in-depth engineering knowledge at
Required the level of one or more of WK3, WK4, WK5, WK6 or WK8 which
allows a fundamentals-based, first principles analytical approach
Range of conflicting WP2: Involve wide-ranging or conflicting technical, engineering and
requirements other issues
Depth of analysis WP3: Have no obvious solution and require abstract thinking,
required originality in analysis to formulate suitable models
Familiarity of issues WP4: Involve infrequently encountered issues
Extent of applicable WP5: Are outside problems encompassed by standards and codes of
codes practice for professional engineering
Extent of stakeholder
involvement and WP6: Involve diverse groups of stakeholders with widely varying
conflicting needs
requirements
Interdependence WP 7: Are high level problems including many component parts or
sub-problems
In addition, in the context of the Professional Competencies
Consequences EP1: Have significant consequences in a range of contexts
Judgement EP2: Require judgement in decision making
CEP Title:Automated Parking Valet
Course / Lab: Signal and System Lab
Introduction This report shows how to construct an automated parking valet system. In this report,
we come to know about tools and techniques in support of path planning, trajectory
generation, and
vehicle control.As Vehicles are Larger in numbers in our Country so due to large
number
of automobiles it is difficult to park a car in limited and time consuming process.
To avoid such a mess we come up with an idea of improving existing
automated
car parking system, which allow cars to park them by it selves and safe the
precious
time of the drivers.
Problem Automatically parking a car that is left in front of a parking lot is a challenging
Statement problem. The vehicle's automated systems are expected to take over control
and steer the vehicle to an available parking spot. Such a function makes use of
multiple on-board sensors.
Objectives To develop an intelligent, user friendly automated car parking system which
reduces the manpower and traffic congestion. To offer safe and secure parking
slots within limited area. Insufficient car park spaces \ lead to traffic congestion
and driver frustration.
Methodology To make our system work we would need the following systems to work with
make our project successful.
Front and side cameras for detecting lane markings, road signs (stop signs, exit
markings, etc.), other vehicles, and pedestrians
Lidar and ultrasound sensors for detecting obstacles and calculating accurate
distance measurements
Ultrasound sensors for obstacle detection
IMU and wheel encoders for dead reckoning
Environment Model: -
Load and display the three map layers. In each layer, dark cells represent occupied
cells, and light cells represent free cells.
mapLayers = loadParkingLotMapLayers;
plotMapLayers(mapLayers)
For sim
Map layer, Stationary Obstacle, Road making, And parked cars
combine the three layers into a single cost map.
costmap = combineMapLayers(mapLayers);
figure
plot (costmap, 'Inflation', 'off')
legend off
costmap. MapExtent % [x, width, y, height] in meters
costmap. CellSize % cell size in meters
ans =
0 75 0 50
ans =
0.5000
Create a vehicle dimensions object for storing the dimensions of the vehicle
vehicleDims = vehicleDimensions;
maxSteeringAngle = 35; % in degrees
Update the VehicleDimensions property of the costmap collision checker
costmap.CollisionChecker.VehicleDimensions = vehicleDims;
Define the starting pose of the vehicle
currentPose = [4 12 0]; % [x, y, theta]
Load the MAT-file containing a route plan that is stored in a table
data = load('routePlan.mat');
routePlan = data.routePlan %#ok<NOPTS>
routePlan =
4×3 table
StartPose EndPose Attributes
______________ ________________ ____________
4 12 0 56 11 0 [1×1 struct]
19 90 [1×1 struct]
56 11 0 70 32 90 [1×1 struct]
39 180 [1×1 struct]
70 19 90 70
70 32 90 53
Vehicle Control and Simulation: -
The reference speeds, together with the smoothed path, comprise a feasible trajectory
that the vehicle can follow. A feedback controller is used to follow this trajectory. The
controller corrects errors in tracking the trajectory that arise from tire slippage and other
sources of noise, such as inaccuracies in localization. In particular, the controller
consists of two components:
• Lateral control: Adjust the steering angle such that the vehicle follows the
reference path.
• Longitudinal control: While following the reference path, maintain the desired
speed by controlling the throttle and the brake.
Create a Helper longitudinal controller object to control the velocity of the
vehicle and specify the sample time.
sampleTime = 0.05;
lonController = HelperLongitudinalController('sample time',
sampleTime);
controlRate = HelperFixedRate(1/sampleTime); % in Hertz
Execute a Complete Plan:-
Now combine all the previous steps in the planning process and run the simulation for
the complete route plan. This process involves incorporating the behavioral planner.
% Set the vehicle pose back to the initial starting point
currentPose = [4 12 0]; % [x, y, theta]
vehicleSim.setVehiclePose(currentPose);
% Reset velocity
currentVel = 0; % meters/second
vehicleSim.setVehicleVelocity(currentVel);
while ~reachedDestination(behavioralPlanner)
% Request next maneuver from behavioral layer
[nextGoal, plannerConfig, speedConfig] =
requestManeuver(behavioralPlanner, ...
currentPose, currentVel);
% Configure the motion planner
configurePlanner(motionPlanner, plannerConfig);
% Plan a reference path using RRT* planner to the next goal pose
refPath = plan(motionPlanner, currentPose, nextGoal);
% Check if the path is valid. If the planner fails to compute a
path,
% or the path is not collision-free because of updates to the map,
the
% system needs to re-plan. This scenario uses a static map, so the
path
% will always be collision-free.
isReplanNeeded = ~checkPathValidity(refPath, costmap);
if isReplanNeeded
warning('Unable to find a valid path. Attempting to re-plan.')
% Request behavioral planner to re-plan
replanNeeded(behavioralPlanner);
continue;
end
% Retrieve transition poses and directions from the planned path
[transitionPoses, directions] = interpolate(refPath);
% Smooth the path
numSmoothPoses = round(refPath.Length / approxSeparation);
[refPoses, directions, cumLengths, curvatures] =
smoothPathSpline(transitionPoses, directions, numSmoothPoses);
% Generate a velocity profile
refVelocities = helperGenerateVelocityProfile(directions,
cumLengths, curvatures, startSpeed, endSpeed, maxSpeed);
% Configure path analyzer
pathAnalyzer.RefPoses = refPoses;
pathAnalyzer.Directions = directions;
pathAnalyzer.VelocityProfile = refVelocities;
% Reset longitudinal controller
reset(lonController);
reachGoal = false;
% Execute control loop
while ~reachGoal
% Find the reference pose on the path and the corresponding
velocity
[refPose, refVel, direction] = pathAnalyzer(currentPose,
currentVel);
% Update driving direction for the simulator
updateDrivingDirection(vehicleSim, direction);
% Compute steering command
steeringAngle = lateralControllerStanley(refPose, currentPose,
currentVel, ...
'Direction', direction, 'Wheelbase',
vehicleDims.Wheelbase);
% Compute acceleration and deceleration commands
lonController.Direction = direction;
[accelCmd, decelCmd] = lonController(refVel, currentVel);
% Simulate the vehicle using the controller outputs
drive(vehicleSim, accelCmd, decelCmd, steeringAngle);
% Check if the vehicle reaches the goal
reachGoal = helperGoalChecker(nextGoal, currentPose,
currentVel, speedConfig.EndSpeed, direction);
% Wait for fixed-rate execution
waitfor(controlRate);
% Get current pose and velocity of the vehicle
currentPose = getVehiclePose(vehicleSim);
currentVel = getVehicleVelocity(vehicleSim);
end
end
% Show vehicle simulation figure
showFigure(vehicleSim);
Parking Maneuver:-
Now that the vehicle is near the parking spot, a specialized parking maneuver is used to
park the vehicle in the final parking spot. This maneuver requires passing through a
narrow corridor flanked by the edges of the parking spot on both ends. Such a
maneuver is typically accompanied with ultrasound sensors or laser scanners
continuously checking for obstacles.
Once the maneuver is found, repeat the previous process to determine a
complete plan: smooth the path, generate a speed profile and follow the trajectory
using the feedback controller.
Smooth the path:-
numSmoothPoses = round(refPath.Length / approxSeparation);
[refPoses, directions, cumLengths, curvatures] =
smoothPathSpline(transitionPoses, directions, numSmoothPoses, 0.5);
% Generate velocity profile
refVelocities = helperGenerateVelocityProfile(directions, cumLengths,
curvatures, currentVel, 0, 2);
pathAnalyzer.RefPoses = refPoses;
pathAnalyzer.Directions = directions;
pathAnalyzer.VelocityProfile = refVelocities;
% Reset longitudinal controller
reset(lonController);
reachGoal = false;
while ~reachGoal
% Get current driving direction
currentDir = getDrivingDirection(vehicleSim);
% Find the reference pose on the path and the corresponding
velocity.
[refPose, refVel, direction] = pathAnalyzer(currentPose,
currentVel);
% If the vehicle changes driving direction, reset vehicle velocity
in
% the simulator and reset longitudinal controller
if currentDir ~= direction
currentVel = 0;
setVehicleVelocity(vehicleSim, currentVel);
reset(lonController);
end
% Update driving direction for the simulator. If the vehicle
changes
% driving direction, reset and return the current vehicle velocity
as zero.
currentVel = updateDrivingDirection(vehicleSim, direction,
currentDir);
% Compute steering command
steeringAngle = lateralControllerStanley(refPose, currentPose,
currentVel, ...
'Direction', direction, 'Wheelbase', vehicleDims.Wheelbase);
% Compute acceleration and deceleration commands
lonController.Direction = direction;
[accelCmd, decelCmd] = lonController(refVel, currentVel);
% Simulate the vehicle using the controller outputs
drive(vehicleSim, accelCmd, decelCmd, steeringAngle);
% Check if the vehicle reaches the goal
reachGoal = helperGoalChecker(parkPose, currentPose, currentVel, 0,
direction);
% Wait for fixed-rate execution
waitfor(controlRate);
% Get current pose and velocity of the vehicle
currentPose = getVehiclePose(vehicleSim);
currentVel = getVehicleVelocity(vehicleSim);
end
% Take a snapshot for the example
closeFigures;
snapnow;
% Delete the simulator
delete(vehicleSim);
Conclusion This example showed how to:
1. Plan a feasible path in a semi-structured environment, such as a parking lot,
using an RRT* path planning algorithm.
2. Smooth the path using splines and generate a speed profile along the
smoothed path.
3. Control the vehicle to follow the reference path at the desired speed.
4. Realize different parking behaviors by using different motion planner settings.
Knowledge Profile Supervisor’s Signature__________________.
Table2: Knowledge profile
SNO Knowledge Check
1 WK1: A systematic, theory-based understanding of the natural sciences
2 applicable to the discipline
WK2: Conceptually-based mathematics, numerical analysis, statistics and
3 formal aspects of computer and information science to support analysis and
4 modelling applicable to the discipline
WK3: A systematic, theory-based formulation of engineering fundamentals
5 required in the engineering discipline
6 WK4: Engineering specialist knowledge that provides theoretical frameworks
7 and bodies of knowledge for the accepted practice areas in the engineering
discipline; much is at the forefront of the discipline.
8 WK5: Knowledge that supports engineering design in a practice area
WK6: Knowledge of engineering practice (technology) in the practice areas in
the engineering discipline
WK7: Comprehension of the role of engineering in society and identified
issues in engineering practice in the discipline: ethics and the professional
responsibility of an engineer to public safety; the impacts of engineering
activity: economic, social, cultural, environmental and sustainability
WK8: Engagement with selected knowledge in the research literature of the
discipline
Supervisor’s Signature__________________.
Range of Complex Engineering Activities:
Complex activities mean (engineering) activities or projects that have some or all of the
following characteristics:
Table3: Complex Engineering Activates
SNO Attributes Check
1 Range of resources (EA1)
2 Level of interactions(EA2)
3 Innovation(EA3)
4 Consequences to society and the environment(EA4)
5 Familiarity(EA5)
Supervisor’s Signature__________________.
Justification of the Project as Complex Engineering Problem Solving:
Constraints:
Table 4: Complex Engineering Problem Attributes
SNO Complex Attributes Check
1 Depth of Knowledge (WP1)
2 Range of Conflicting Requirements (WP2)
3 Depth of Analysis Required(WP3)
4 Familiarity of Issues (WP4)
5 Extent of Applicable Codes(WP5)
6 Extent of Stakeholder involvement and level of conflicting requirements (WP6)
7 Interdependence (WP7)
8 Consequences (EP1)
9 Judgment (EP2)
Supervisor’s Signature__________________.