Shubham - 712295014 - Assignment 06 Parallel Parking System

You might also like

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

Name – Ghugarkar Pratik Vijay

Shubham Patil MIS No. 712295014


712295007
Assignment 6 – Parallel Parking System

Using parallel parking system, measure the distance between two vehicles parked on
street.

A parallel parking system is a feature commonly found in modern automobiles that assists
drivers in parking their vehicles parallel to the curb. It uses a combination of sensors,
cameras, and automated controls to guide the vehicle into a parking space.

Here's a general overview of how a parallel parking system typically works:

Activation: The driver activates the parallel parking system, usually by pressing a button or
engaging a specific mode on the vehicle's control panel.

Sensors and Cameras: The system utilizes sensors and cameras located around the vehicle to
gather information about the surrounding environment. These sensors can include
ultrasonic sensors, radar, or even cameras mounted on the side mirrors or rear bumper.

Scanning: The system scans the available parking spaces adjacent to the road, typically using
the sensors and cameras mentioned earlier. It assesses the size and distance of the parking
spaces to determine if they are suitable for parking.
Positioning: Once a suitable parking space is identified, the system prompts the driver to
stop the vehicle and align it properly. The driver is usually instructed to position the vehicle
parallel to the cars in front and behind the intended parking space.

Automated Steering: With the vehicle in position, the driver releases control of the steering
wheel. The parallel parking system takes over and steers the vehicle into the parking space.
It uses the gathered sensor data and algorithms to calculate the necessary steering inputs to
execute the parking maneuver.

Monitoring: Throughout the parking process, the system continues to monitor the
surroundings, making adjustments as needed to ensure the vehicle is properly aligned and
centered within the parking space.

Finalizing: Once the vehicle is parked, the system may provide visual or audible feedback to
inform the driver of the successful completion of the maneuver. Some systems may also
engage the parking brake automatically.

It's important to note that the specific capabilities and features of parallel parking systems
can vary among different vehicle models and manufacturers. Some advanced systems may
even offer additional functionalities like autonomous parking, where the driver can initiate
the parking maneuver from outside the vehicle.

Always consult your vehicle's user manual or contact the manufacturer for detailed
instructions on how to use the parallel parking system in your specific vehicle model.

Coding
def parallel_parking():
# Measure distances to the vehicles in front and behind
front_distance = measure_distance_front_sensor()
rear_distance = measure_distance_rear_sensor()

# Calculate the required distance to leave between the two vehicles


target_distance = calculate_target_distance(front_distance, rear_distance)
# Begin the parking maneuver
start_parking()

# Loop until the vehicle reaches the desired position


while not is_parked_correctly(target_distance):
# Measure the current distance to the vehicles
current_front_distance = measure_distance_front_sensor()
current_rear_distance = measure_distance_rear_sensor()

# Adjust steering based on the distance measurements


steer = calculate_steering(current_front_distance, current_rear_distance,
target_distance)
apply_steering(steer)

# Parking is complete
stop_parking()

Implementing code for a parallel parking system between two vehicles can be quite
complex, as it involves various components such as sensor data processing, vehicle control,
and collision detection. The code will also depend on the specific hardware and sensors
available in the vehicle.
This example assumes the availability of sensors to detect distances and a mechanism for
controlling the vehicle's steering.

Automatic Parking
Distance Measuring between two vehicles
def measure_distance_between_vehicles():

# Activate distance measurement sensors

activate_sensors()

# Measure distance to the vehicle in front

front_distance = measure_front_distance()

# Measure distance to the vehicle behind

rear_distance = measure_rear_distance()

# Deactivate distance measurement sensors

deactivate_sensors()

# Calculate the distance between the two vehicles

distance_between_vehicles = front_distance + rear_distance

# Return the measured distance

return distance_between_vehicles
Conclusion
To measure the distance between two vehicles parked on a street, you would need to have
access to sensors capable of measuring distances, such as ultrasonic sensors or LiDAR.
Keep in mind that the actual implementation may vary depending on the specific hardware
and sensors you are using. You would need to refer to the documentation or APIs provided
by the sensor manufacturer to understand how to activate, measure, and deactivate
distances using the specific sensors you have.
It's also important to note that measuring distances accurately can be challenging due to
potential obstacles, variations in sensor accuracy, and other environmental factors.
Calibration and error handling may be necessary to ensure reliable distance measurements.

You might also like