A.K.03/Manual/1_Introduction.ipynb
Nicholas Stănescu ee4d929042 done
2025-11-19 19:57:14 +01:00

309 lines
26 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![book header](pictures/header.png)\n",
"\n",
"[Table of Contents](0_Table_of_Contents.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 1: Introduction\n",
"\n",
"**Contents:**\n",
"* [Project description](#project_description)\n",
"* [Teamwork Division](#teamwork)\n",
"* [Schedule and Deadlines](#schedule-and-deadlines)\n",
"* [Assessment and Report](#assessment-and-reports)\n",
"* [Facilities](#facilities)\n",
"* [Rules and Regulations](#rules-and-regulations)\n",
"* [Educational Objectives](#educational-objectives)\n",
"\n",
"\n",
"Welcome to the EE2L1 IP3 project, “KITT: Autonomous Driving Challenge.” In this 5-EC course project, your team will develop and program an autonomous electric toy car, \"KITT,\" capable of navigating independently from a designated start point to a target location in a field, with you only needing to press the start button.\n",
"KITT is equipped with distance sensors and an audio beacon and communicates with a base station (your computer) via Bluetooth, sending data, receiving commands and control inputs. The field is fitted with five microphones that capture the beacon's signal to facilitate precise localization of the car. \n",
"\n",
"Like in the previous integrated projects, the objective of IP3 is to apply and integrate the EE knowledge you have acquired so far (mostly signals & systems), while we also look forward to telecommunication, system modeling and control. This project heavly relies on Python programming, and you will have to design and implement a system that integrates these aspects.\n",
"\n",
"This manual starts with a description of the overall project. This complex task is split into modules, each contributing to the overall goal. "
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"#project_description_tag"
]
},
"source": [
"## Project Description\n",
"\n",
"The overall goal of the project is to take a standard toy car with added functionality so that it can be remotely operated, can detect obstacles in front of it, and can communicate with a base station (your PC) via Bluetooth. The base station performs calculations such as location estimation (using beacon audio signals recorded by 5 microphones in the field), trajectory tracking, and collision avoidance (optional) as shown in the figure below. You will have to develop these functionalities. You will also have to document the designs in your reports, describe the design choices, and evaluate the test results. Lastly, you will have to present and defend your reports and designs.\n",
"\n",
"<img src=\"pictures/intro_setup.jpg\" alt=\"Illustration of the field and KITT\" width=\"600\" />\n",
"\n",
"To complete this complex project, youll need to build and integrate several key modules that enable KITTs remote connectivity, sensor data processing, localization, and real-time control:\n",
"\n",
"0. Before we can start doing anything, all team members need to set up their programming environment in Python. If you have not done so before, look at chapter 2 and follow the instructions. Besides Python, we also need an Integrated Development Environment (IDE), and some required packages for the project.\n",
"\n",
"1. *Connecting to and controlling KITT*: this module consists of setting up an RF connection to KITT and writing a program that allows you to control KITT and drive it around. The connection is provided by off-the-shelf Bluetooth units, controlled by a microcontroller on the car and an interface on the base station PC. The microcontroller can also generate motor control signals using basic commands from the base station PC.\n",
"\n",
"2. *Reading KITT sensor data* and detecting objects: this module consists of reading and using the data from the anti-collision sensors and the microphones along the field. These distance sensors are a pair of off-the-shelf ultrasonic transmitters/receivers that can detect objects in front of them.\n",
"\n",
" - The maximal range of the detection is about $6$ m.\n",
" - The system is mounted on the car.\n",
" - The system is controlled by the onboard microcontroller and read out via the RF link.\n",
"\n",
"3. *Localization using audio communication* is done by transmitting a repetitive beacon signal from the car. This is an audio signal, and it may be corrupted by interfering signals emitted by other cars present in the field (depending on whether you choose to do this challenge), and by surrounding noise.\n",
"\n",
" - The audio signals from all cars are captured by multiple microphones placed along the field. The analog microphone signals are sampled and made available to you.\n",
" - There are 5 microphones around the field, of which the location is known.\n",
" - The estimation of the location is done in Python by using the microphone data and the TDOA algorithm you developed in the Assignment in Week 1. \n",
" - The location updates should be frequent and accurate enough for the trajectory tracking to function. (Minimal numbers are at least one update per $2$ seconds, with an accuracy better than 30cm.)\n",
"\n",
"4. *Car model: Control and Trajectory tracking* is based on a sufficiently accurate system model of the car, both regarding velocity and steering behavior.\n",
"\n",
" - The state of KITT consists of position, velocity, and orientation (4 parameters).\n",
" - The velocity model is based on differential equations that take the speed settings into account.\n",
" - The steering behavior is based on modeling the trajectory resulting from a steering command.\n",
" - The model of the car should allow you to predict the next state of the car, given the current state and the control input.\n",
"\n",
"5. *System Integration: Navigating KITT and Final Challenges* brings your previously done work together. KITT's starting location and orientation are known, and from this you will have to route KITT to certain points in the field.\n",
"\n",
" - The system you make must be closed loop, control input is from your localization algorithm that uses an audio beacon on top of the car, additionally you may have to use the data from the anti-collision sensors. It is important to note that \"open loop\" solutions will not be accepted. These types of solutions blindly rely on the model and do not take the sensor data and localization estimates into account. \n",
" - The control actions are computed in Python on your base station PC. \n",
" - After the start of the challenge, you are not allowed to touch the base station PC.\n",
" - You have to reach the target within 5 minutes. Ideally, you drive to the target without stopping, and measure your position while driving. In this case, there are many real-time aspects to take into account. In a basic (permitted) solution, you pause the car frequently to measure its position, and then drive another ~50 cm. \n",
" - The main considerations in the design are the proper managing of uncertainties in localization, state updates, and real-time aspects.\n",
"\n",
"Each of these functionalities is specified in its own module.\n",
"\n",
"An overview of the entire system is shown in the system overview figure below. In the control loop, the car model predicts the car position (and its velocity and orientation), and this is used to assist in tracking the state without independent position estimate from the microphones. This block is not absolutely necessary; however, without it, you probably need a pretty good localization system. \n",
"\n",
"The total duration of the project is 8 weeks. Each week, you have two lab sessions; outside of the lab, you must prepare the lab assignments, homework, and report writing. The project is finished with the Final Challenge (demo session, week 9) and the Presentation and Defense (committee interview, week 10).\n",
"\n",
"<img src=\"pictures/projectBD.png\" alt=\"An example architecture of the KITT control system\" width=\"600\" />"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Teamwork\n",
"\n",
"Effective collaboration is essential for the successful completion of this project. Since your team comprises four or, in some cases, five students, we recommend dividing the work into two parallel work packages. Before the midterm, consider forming two subgroups: one group should focus on Modules 1 and 2, while the other works on Modules 3 and 4. Note that both subgroups should read chapter 1 and 2 before starting with their own modules.\n",
"After completing the midterm report, the team will need to integrate all modules, allowing KITT to navigate the field from point A to point B. \n",
"\n",
"### Subgroup 1. Communicating with KITT \n",
"\n",
"Two team members can focus on the communication aspect. This involves establishing a reliable and efficient communication link between the computer (base station) and KITT. Tasks include:\n",
"\n",
"- Implementing communication over Bluetooth.\n",
"- Developing functions to send commands to KITT.\n",
"- Creating modules to read sensor data from KITT.\n",
"- Characterizing the sensors and motions of KITT.\n",
"- Making recordings using the microphones (to be used by subgroup 2).\n",
"\n",
"Communication with KITT is discussed in Modules 1 and 2.\n",
"\n",
"### Subgroup 2. Localization algorithm development\n",
"\n",
"The other two team members can focus on the localization algorithm. This involves processing audio data from the microphones to estimate the location of KITT. Tasks include:\n",
"\n",
"- Developing a channel estimation algorithm for received audio signals. (A basis for this has been designed during the initial Assignments)\n",
"- Implementing Time Difference of Arrival (TDOA) calculations.\n",
"- Using TDOA data locate KITT\n",
"- Handling data synchronization and ensuring accuracy in localization.\n",
"\n",
"This is further explained in Module 3.\n",
"\n",
"### Subgroup (whoever is first)\n",
" - Developing a car model.\n",
"\n",
" This is further explained in Module 4. The goal is to take control inputs and predict the car position ~1 second ahead of time.\n",
"\n",
"### Collaboration\n",
"\n",
"You maximize efficiency and expertise by assigning dedicated team members to each area in parallel. Remember that effective communication within the team is critical. Regular updates, meetings, and shared documentation will help keep everyone on the same page and facilitate successfully integrating the individual components into the autonomous driving system. To better understand what the other group is working on, it is advisable to read the manual on the other modules.\n",
"\n",
"You will find that working in parallel is only possible if you define clear interfaces: e.g., route planning is only possible if it is clear how accurate the localization algorithm works. In turn, the localization algorithm must know time stamps to know how 'old' the microphone data is, and produce a time stamp telling how old the location fix is. As a result, despite each module functioning well independently, integration will present additional challenges. Therefore, rather than spending excessive time refining individual modules, prioritize early integration (even earlier than the midterm report deadline) to address any system-wide issues. \n",
"\n",
"### Kickoff: Getting to know your team\n",
"\n",
"To form a team with new people is not always easy. Lets start with a simple task: filling out and submitting a document together. Please look on Brightspace for the document *ip3_kickoff.docx* (under Content - Week 2 Kickoff). The document asks questions about how you want to collaborate as a team. Submit the document in your Brightspace assignment folder.\n",
"\n",
"You should find ways to brainstorm as a team, find possible approaches to a problem (analyze the problem first!), and keep everyone busy, involved, and synchronized.\n",
"\n",
"One thing to decide is to form two sub-groups: one that will work on localization (Module 3 and 4) and the other to work on the car interface (Modules 1 and 2). After these modules are finished, the mid-term report must be written according to the guidelines in the chapter 'Midterm'.\n",
"\n",
"To further improve on team-working skills, in Week 2 you also will attend an ITAV workshop on _Scrum_. This is a technique originally developed for ICT project management. Rather than a very precise product specification and subsequent lengthy development cycle where the end result might not be what the client wanted, the idea is to have a more flexible design cycle where the product is iteratively refined. At the same time, team members are more involved and carry more responsibility. Thus, Scrum appears to be quite suitable for the way you work in IP3."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Schedule and Deadlines\n",
"\n",
"IP3 has 16 scheduled lab sessions (distributed over 8 weeks). Outside of these sessions, you will have time to prepare and work on the report. In week 9, there is a common session for the final challenge, and in week 10, you will be called for a final presentation followed by a discussion. The total lab time is 56 hours, and preparation/homework time is budgeted at 84 hours, for a total study load of 5 EC.\n",
"\n",
"The table below shows a generic schedule. For the specific dates this year, look in Brightspace! The planning regarding the completion of the modules is flexible, but the deadlines are firm.\n",
"\n",
"Many groups compete for time on the test fields: 4 to 5 groups share the same field. You must reserve time slots on one of these systems using a planner in Brightspace. Come prepared with a measurement/test plan!\n",
"\n",
"| Date | Description |\n",
"|---------|--------------------------------------------------------------------------------------------------|\n",
"| Week 1 | Assignments (audio channel estimation) |\n",
"| Week 2 | Kick-off + getting your IDE setup + ITAV Scrum + Start on modules 1, 2, 3 |\n",
"| Week 3 | Continue modules 1, 2, 3, start on Module 4 |\n",
"| Week 4 | Complete modules 1, 2, 3 |\n",
"| Week 5 | Complete module 4 + ITAV Ethics + **Midterm report deadline** |\n",
"| Week 6 | Module 5 + System integration, prepare for challenge A |\n",
"| Week 7 | Testing challenge A |\n",
"| Week 8 | Complete challenge A, start on challenges B and C; final report writing |\n",
"| Week 9 | **Final challenge + Final report deadline** |\n",
"| Week 10 | Presentation and discussion |"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"## Assessment and reports\n",
"\n",
"### Mid-term assessment and report\n",
"\n",
"As soon as you are ready, please demonstrate the functionality and performance of your communication, localization and car model scripts to your TA. After this, document your work in your mid-term report, detailing your approach, implementation, and test results for Modules 1--4.\n",
"\n",
"#### Modules 1, 2: Communication script assessment\n",
"\n",
"Using your communication script, you are asked to demonstrate that you can control your car using the WASD or arrow keys on the keyboard. You should be able to transmit the beacon signal and record it using the 5 microphones. The detailed requirements are outlined in the chapters on Modules 1 and 2.\n",
"\n",
"#### Module 3: Localization script assessment\n",
"\n",
"Using your localization script, you are asked to demonstrate that you can locate the car from recordings that are given to you. (Integration with your own car is not yet necessary.) Refer to the specifications outlined in the chapter on Module 3 for detailed requirements.\n",
"\n",
"#### Module 4: Car model assessment\n",
"\n",
"In Module 4, you are asked to write a basic car model that captures the dynamics of KITT: its response to driving and steering commands. You do this based on measurements of its behavior, along with simple equations of motion. The goal of this model is to be able to predict the location of KITT after a few seconds of driving. You can also use this model to test your control algorithms later.\n",
"\n",
"You demonstrate your car model by predicting the position of KITT after a short series of commands, and by comparing this to the actual outcome.\n",
"\n",
"#### Mid-term report\n",
"\n",
"You submit a report of approximately 15 pages (plus cover page and appendix) documenting your work until now.\n",
"More details on the structure and contents of this report are in the chapter on the Mid-term report.\n",
"\n",
"### Final Challenge and Report\n",
"\n",
"#### Final Challenge\n",
"\n",
"To conclude the project, your design is tested during the final challenge. The tests will be described briefly here and in more detail in the System Integration chapter.\n",
"\n",
"The final challenge starts at a known location and orientation. At a start signal, you have to drive autonomously to a target. If you complete the task successfully, you may take on more complex tasks, including additional waypoints, obstacles, and other cars. It is required to reach the target with a certain minimal accuracy. Bonus points are obtained by the fastest team for each challenge. During the race, it is not allowed to touch the car.\n",
"\n",
"Speed is not the main requirement in this challenge. You may reach the target faster by driving faster, but navigating becomes more complex, location updates must be computed more quickly, and you have less time to avoid obstacles.\n",
"\n",
"#### Final report\n",
"\n",
"The project outcome is documented in a final report. The report must follow a structured approach, which you have learned in previous projects; the midterm report is a part of it. Use a to-the-point, concise, but complete reporting style. Provide an appendix with all Python code. More details on this report are in the System Integration chapter. Your report is submitted in the corresponding submission folder in Brightspace.\n",
"\n",
"The report without an appendix should be about 30 pages. Within these pages, you must document your design choices, explain your control systems, and report the deliverables of all modules, how you combined these modules, and what problems you ran into and solved them. The focus is on your findings and measurement results and the corresponding conclusions. You are also judged regarding project skills such as planning and teamwork.\n",
"\n",
"#### Final presentation and discussion\n",
"\n",
"In week 10 (consult Brightspace for the exact date), you present and defend your final report before an examination committee. The examiners will ask questions about your design choices and aspects of teamwork. This will be part of your grade.\n",
"\n",
"The presentation lasts at most 10 min. This is rather short: focus on the highlights and special features of the design, and mention the work breakdown and distribution of tasks to team members.\n",
"\n",
"While each team member may not have been directly involved in every aspect of the project, through open communication and collaboration, all team members are expected to have an operating understanding of all parts of the project. During the discussion, detailed questions will be asked to the group. The team member with the best subject knowledge is encouraged to answer. However, less complex questions can be asked to anyone to test their participation in the project. \n",
"\n",
"The examination will last about 30 min. After the examination, you will be asked to fill in a peer review form. Individual grades are differentiated depending on staff observations and the outcome of the peer review.\n",
"\n",
"### Grading\n",
"\n",
"Your grade depends on the following:\n",
"\n",
"- Mid-term report (30\\%);\n",
"- Performance during the final challenge (20\\%);\n",
"- Final report (35\\%);\n",
"- Oral presentation and defense (15\\%).\n",
"\n",
"\n",
"Teamwork is important. Your individual grade may differ depending on staff observations and peer reviews. There is a penalty for submitting the report late.\n",
"\n",
"If your final grade is insufficient, you may have a chance to improve your grade by improving your report.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Facilities\n",
"\n",
"The project is carried out at the Tellegen Hall facilities in A and B teams. Each team has 2 sessions per week. The hall has three testing areas, each shared by 4 teams. We publish a schedule for this on Brightspace. Your testing time is limited, so plan ahead and use it wisely.\n",
"\n",
"The following support is available:\n",
"\n",
"- *Student assistants*; student assistants are your primary help. Each assistant supports up to four teams. Assistants also check attendance and progress.\n",
"- *Instructors*; Practicum coordinators are available at each lab session. The coordinators also grade your reports.\n",
"- *Technical support*; for questions about hardware and implementation issues, you can contact the student assistants and/or the technicians at the facilities.\n",
"\n",
"Visit the Brightspace page of the course for support and contact information.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rules and Regulations\n",
"\n",
"In addition to the rules and regulations of the EEE group on the use of the Tellegen Hall, the following rules and regulations are applicable:\n",
"\n",
"- **You are expected to be present during your scheduled lab sessions.** If you cannot attend for a good reason, contact your assigned TA *before* the lab session. Absence more than two times will not be allowed; you will be removed from the practicum. \n",
"- Preparation for labdays is *mandatory*. This project has an intense pace and limited time; use it wisely. The scheduled homework time is needed.\n",
"- You may not work alone in the lab. A student assistant or staff member must be present.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Educational Objectives\n",
"\n",
"General learning objective: To integrate different technical areas related to electronic systems, signal processing and control. The educational objectives are:\n",
"\n",
"- Increased skills in building and testing electronic systems. Software skills mainly consist of advanced Python programming.\n",
"- Increased skills in measurement techniques, e.g., wireless channel measurements.\n",
"- Application of course material from various courses: linear algebra, signal transformations, digital signal processing. The project also illustrates concepts from telecommunication and control systems which are taught in subsequent courses (EE2T1, EE2S2).\n",
"- Increased academic skills related to project management: **managing an open and complex assignment, planning,** acquiring background literature, **working in teams** (distributing tasks among team members, communicating within and among subgroups), **reporting**, oral presentation.\n",
"\n",
"The main difficulties students have with this project are the complexity of the overall system and planning. You will split up your team into two sub-groups. Each delivers Python code that later has to be integrated and function together. Nobody on the team has complete, detailed knowledge of the entire design. If you dont manage this, then you will fail. Essential parts to make this work are:\n",
"\n",
"- *System Engineering:* At an early stage, agree on an overall structure for your design, partition it into modules, and decide on specifications for the modules. Find the essential aspects that need to be done right. For this system, uncertainty in time and position plays an important role. For example, the car moves while the localization is being computed.\n",
"\n",
"- *Testing:* Each module should have a clearly defined specification, and the Python code should be tested and verified against the specifications before it is integrated into the overall system. You cannot debug the overall system if you are unsure about its parts!\n",
"\n",
"- *Planning:* You will probably find that there is insufficient time in the testing areas: it is available to your team only about 25\\% of the time, and with two sub-groups, you will also compete within your team. Thus, you must plan well on what you want to measure and test during your time slot in the testing area.\n",
"\n",
"- *Modeling:* To avoid waiting for precious testing time, it is advisable to create a (simple or more advanced) software *car model*, such that you are able to test your algorithms on the model. This also allows you to verify in detail the performance of your algorithms. To help you get started, a template framework for such a model will be provided."
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}