Jeff’s Status Report for 04/06/2024

What did I do this week?

This week was focused on working with my teammates to make progress to our interim demo, as well as development focused on setting up the navigation system.

The first thing for the webapp development was to add a new model for the rooms in a building, storing the room’s name, floor, and position on a map (relative to the actual pixel locations on the floor plan map). Then, I added an API endpoint so that users would be able to “search” for a room to go to. With the backend done, I needed to provide the rooms to the front end of the server so the users would be able to select and search for them. To create the connection between the user and the server, I created a form to post the data (offering more security due to having a csrf token). Form submissions by default reload the page, which would interrupt the user experience, so I created a handler that would prevent the page from reloading, validate the form, before sending the form as an AJAX request to the server. The server would be doing further validation to make sure the data is safe before running its algorithms to process the data.

I made a graph of HH A-level, then focused on utilizing the A star algorithm I had written previously. To use it, I needed to write a breadth-first search algorithm to identify the closest portion of the graph to the user (due to the graph featuring only a narrow walkable section in the middle of the hallways). I just needed to call this code in my background endpoint to determine the navigation paths the user should take. The final task at hand was to visualize the paths on the frontend. This was mostly trivial due to previously experimenting with drawing lines on a canvas element.

The overall results seem to be fairly positive. The below video shows a demo of the system working, such that the webserver is running on my local machine and I have a script sending in “dummy data” for the user’s position. Entering a new room using the search bar sends the asynchronous request to the server, which responds with the path the user should take, and is drawn on the user’s map. My local machine takes approximately 150 ms to run the navigation algorithms, which is sufficient (to my surprise/dismay, the EC2 instance runs the algorithm faster than my local machine, despite being the cheapest option AWS offers).

Video Link

 

Is my progress on schedule?

This week I made significant progress on the navigation system; crucially, I added the necessary core functionality for providing directions to users. Hence, my schedule is on track and aligns with what my team planned to do.

Next week’s deliverables:

Next week I would like to augment the application’s user interface to include human-readable user directions to tell the user when they should turn or how far they need to walk. The navigation system, in return, needs to be able to constantly track the user’s progress. It may be worth looking into ways to optimize the graph. For example, I could try scaling the graph down and seeing if there are any significant performance improvements. It is possible my team wants to try offloading some of the localization computation to the server; in this case, I would need to provide more assistance with the server.

Verification and Validation Tests:

My role on the team is primarily working on the user interface and the web application. This subsystem affects several of the tests we must run for verification and validation; particularly, navigation optimality, latency of localization updates, and quality of directions and user experience.

Navigation optimality refers to our navigational algorithm’s capability of generating the most efficient route for our users. Assuming the average walking speed is the same for all hallways, this ends up being the shortest paths between two points. I have already written the A* pathfinding algorithm for navigation and have spent time benchmarking its performance on graphs of buildings as well as verifying the paths it provides are indeed the shortest. In particular, the algorithm runs fairly quickly. It is able to find navigation paths within 100 ms on our webserver. In terms of verifying the algorithm is actually finding a shortest path, a significant amount of testing has been put in. Firstly, it is always able to find the shortest and simplest obvious path between two points. Then, it is capable of finding an optimal path when given multiple paths between targets. Next, it is more than capable of navigating around obstacles in the graph. Then, I have tested the algorithm in larger and more complicated graphs, comparing the result with Dijkstra’s algorithm (which runs slower than A* but is guaranteed to find the shortest path) to make sure both are equivalent, as well as making sure that the resulting path it finds is always less than or equal to a simple breadth first search algorithm.

Another facet of the webserver is low latency between the tag’s communication and the user’s front end. Through testing, this has been shown to take an average of 70 milliseconds to complete updating through our websocket. We want to have a latency between positional changes in real life to be reflected on the application’s user interface within 2000 ms. Hence, this information shows that there is plenty of “delay” that is still allowable from the perspective of the localization system.

Additionally, it typically only takes around 30 milliseconds for the tag to send the data. We initially stated we wished to have a total latency of the localization system and the server updates to take less than 500 ms, so this value gives my partners, who are working on the localization system, approximately 470 ms to work with. Further testing is needed with the RPi to determine the latency of the entire algorithm. With this information, we would be able to determine the maximum update frequency of the device, which we wish to be greater than 2 Hz.

The final tests revolve around the navigation system. Firstly, it should provide “distance” updates in a timely manner–at least once every two seconds to provide accurate estimates of how far the user should move. Then, we will need to run trials with our clients to garner feedback from them and a quantitative rating out of 5. If the feedback is positive, this would be an indicator that the navigation system is actually providing useful feedback to the users.

Ifeanyi’s Status Report for 03/30/2024

This week I worked primarily on increasing the accuracy of localization, as well as the finishing of the tag device. To increase the accuracy of localization, I wrote a gradient descent-based routine for finding the position of the tag given the anchor distances. This was not only more accurate than the linear-algebra-based trilateration we were using before (since it was not as brittle/much more robust to input measurement error), but also more versatile (since it didn’t take exactly 3 distances as input, but rather, as many anchors as we wanted). The other work I did on increasing localization accuracy was to code up a kind of low pass filter for the distance readings. If a new reading was very far away from the previous readings (based on the maximum speed we estimate a person will be walking), we can mark it as an anomaly and not include it in our tracking. As for my work on the tag device, I fully assembled all parts: Raspberry Pi, battery pack, UWB chip, and accelerometer. I also wrote a script for the Raspberry Pi to estimate its orientation using the gyroscope onboard the accelerometer.

My progress is on track, since I was supposed to program the IMU and complete the tag device this week, which I have done.

Next week, I will program the tag device with the same code as the laptop we are currently using to test, so that we can finally use the tag device in a real test. After that, we should be ready for our interim demo, after which I will continue to work with the rest of the team on improvements to our current tracking system, to make it more responsive and accurate.

Jeff’s Status Report for 03/30/2024

What did I do this week?

This week I worked on testing the A* algorithm, further developing and improving the web application, and worked with my team to test the localization system.

For testing the A* algorithm, I wrote a few scripts to help me construct a simple graph utilizing the png image of a floorplan. From here, I was able to do some performance testing to ensure the algorithm would be able to function on these larger (though simple) graphs. The algorithm was able to execute in around ~10 ms on my machine, which seemed to be a fairly positive result.

I worked on improving the web application. The first thing I worked on was to convert the server from using asynchronous HTML requests to instead using websockets. The main motivation for this was to improve the server’s performance to decrease the number of requests (offsetting more of the load onto a regis server) and decrease the latency between updating the user’s position on the browser. To implement the conversion, I worked on utilizing Django Channels and implemented the code necessary to facilitate communication between the tag and the user. The improvements over using HTML requests were fairly significant. Firstly, websockets seem to result in significantly faster update frequencies–from my testing, it seemed to be an order of 10 times faster. Additionally, the latency from sending the update to being updated on the user’s browser was improved dramatically, at around 5 times faster. With these changes, I also rewrote the script for the tag to send messages to the browser.

I worked on further development of the web application, moving a significant amount of hard-coded values onto the server’s database, as well as improving the user interface. For the floor view, I added a small form floating on top of the page for the user to input their desired destination. Then, I added a “connecting” indicator that shows up whenever the browser is no longer connected to the tag device.

Finally, I helped test the localization system with my team by mapping out the A-level corridor in HH and setting up a floor on the webapplication to view the user’s location.

Is my progress on schedule?

My main goal for this week was to assist my team in improving the accuracy and stability of the localization system. My improvements in the web application’s update frequency directly helped with the responsiveness of our tag’s localization, and I was able to implement the user interface necessary for displaying the user’s position, so I believe I was able to achieve this goal. Altogether, my progress is on track.

Next week’s deliverables:

The midpoint demo is approaching and I believe the localization system is sufficient in providing a stable calculation of the user’s position. My next deliverable is to start working on the localization system. My main goal is to have the webserver be able to take inputs from the user of where they would like to go, run that information through A* algorithm, and generate the paths to display on the browser.

 

Weelie’s Status Report for 3/30/2024

  • What did you personally accomplish this week on the project?

Last week, I worked on refining the localization algorithms to make it more stable and accurate. I upgraded trilateration algorithms into multilateration. I tested the localization algorithms for the system and make sure that it works fine along the A-level corrider of Hamerslage Hall. The video can be found in our team status report.

I worked with Jeff to set up a more stable and faster network connection (websocket) between the tag and the webserver.

I helped Ifeani setting up environments for running localization algorithms on Raspberry Pi.

Github Repo: https://github.com/weelieguo/18500-dw1001

  • Is your progress on schedule or behind?

Based on the schedule, I should still work on the localization part and prepare for the interim demo. It should meet my schedule.

  • What deliverables do you hope to complete in the next week?

Next week, I will work on running the localization system on the Raspberry Pi, and also integrate IMU orientations (what Ifeani did this week) with the localization system. Also, I will try to test the localization system in a larger scale and make sure that the tag can detect at least three anchors all the time in a large space.

Ifeanyi’s Status Report for 03/23/2024

This week I worked on both localization and mapping. More specifically, I ordered more materials for the anchors, such as Li-Po batteries as well as a Li-Po battery charger. I worked with Weelie to develop a debugging program that would take in the positions of anchors and use those as well as an incoming serial stream of the distances to the anchors to estimate the position of the tag. However, the current localization scheme is slow to update (around 2Hz), and rather inaccurate (fluctuates about an area larger than 1m^2). To remedy this, I am currently working on a gradient descent-based method of solving for the user’s position that I hope will be more robust. I also got started on mapping software for floor plans, that allows me to mark what areas of a floor are walkable space and what areas are not (such as walls, rooms, etc). When completed, this will plug into the A* algorithm to route the user around places they cannot traverse.

As with regards to the schedule, I am currently still on track. This next week is supposed to be the week where I finish the tag device by adding and programming the accelerometer. It is also the week I am supposed to map out at least a single hallway for tracking with the system.

In this coming week, I hope to program the accelerometer (something I have written the code for but have not yet wired up), assemble the finished tag device, test out the new localization method, and map out a hallway. To assist in this mapping effort, I also ordered a tape measure which also functions as a laser ranging device, which is arriving in this coming week.

Weelie’s Status Report for 3/23/2024

  • What did you personally accomplish this week on the project?

Last week, I worked on the interfacing between the dwm1001 tag with the laptop. And used python script to read the serial outputs from dwm1001 and perform trilateration algorithm to get the estimated position of the current location. Then I worked with Jeff to transfer the location data from the location machine to webserver. At last, we successfully made them as a whole system. The tag could get the distances of anchors, perform trilateration algorithm, and then transfer the data to the webserver and show the current location on a graph. I also used averaged position to make the measurements more accurate and stable.

Github Repo: https://github.com/weelieguo/18500-dw1001

  • Is your progress on schedule or behind?

Based on the schedule, I should still work on the localization part. It should meet my schedule.

  • What deliverables do you hope to complete in the next week?

Next week, I will work on optimize the trilateration algorithm to make it more accurate, and also preparing for interiem demo.

Jeff’ Status Report for 03/23/2024

What did I do this week?

This week I worked on the web application, assisted testing the localization system from inside of a room, and worked on developing an A* pathfinding algorithm for the navigation system.

For the webapp development, I deployed a debug version of the Django application onto an AWS EC2 instance to provide the graphical user interface platform for the rest of my team to test the navigation system on the tag device. I tested the user interfaces to make sure they would actually be able to display properly on a real mobile device. Additionally, I was skeptical of the possible performance offered by the webserver due to the high volume of AJAX requests sent by both the browser and the tag, so I decided to benchmark the average delay from creating data (with an estimated latency of 100 milliseconds) to the latency of displaying the update on the browser. My results seemed positive: it took less than 0.55 seconds on average for the entire update latency, which is much less than the 2.0 seconds we noted in our Design Report.

I spent some time working with the team to test the DWM1001’s, finding that a tag was able to connect to at least 5 anchors, as well as some preliminary testing of localization with the webapp displaying the user’s position.

Finally, I focused on implementing the A* pathfinding algorithm for the route planning with our indoor navigation system. I briefly discussed with Ifeanyi how to construct a graph necessary for representing a floorplan of a building so that he can create a graph this weekend to test the algorithm. I created a basic heuristic function to estimate distances between given coordinates, utilizing just the straight-line distance, though this has room for improvement in the future to consider obstacles or walls.  Then I implemented the rest of the algorithm, which involved iteratively exploring neighboring nodes and using a priority queue to use coordinates with the lowest cost. I was able to do a brief amount of testing to verify its behavior, though further testing is necessary.

Is my progress on schedule?

My goal this week was to finish setting up the webapp as a way to demo showing the user’s location, and I believe I was able to accomplish this goal to a satisfactory degree. Additionally, I was also able to work on implementing an A* pathfinding algorithm, which was my secondary goal. Hence, my progress is on track.

Next week’s deliverables:

The midpoint demo is approaching, so my main goal for the next week is to continue assisting my team in improving the accuracy and stability of the localization system.

I would like to test using websockets as the connection between the device and the webserver. It is possible this can result in a “smoother” connection between the client and server. Although my testing reveals the average latency of update from the tag to the user’s browser appears sufficient, there were occasional “drops” in updating, where updates were delayed by a second or two. Using websockets could improve this, as well as improve the server’s capability for handling more users.

Finally, it would be good to test the A* algorithm with Ifeanyi’s graph.

Team Status Report for 03/23/2024

Significant Risks

The most significant risk we currently face is that we have finally gotten our localization system with at least 3 anchors up and running, and yet, we are seeing less than desirable results with regards to localization frequency (not quite < 2 Hz)  and position accuracy (the tag’s distance measurements seem to have variance of up to +/- 0.75 meters). To improve the latency, we are implementing various optimization strategies such as running a thread in the background to process the data, and are already seeing slight speedup. For position accuracy, we are currently tinkering with slightly different methods of calculating the position using the 3 distances. We are also implementing smoothing that averages at least the last 3 measurements. We might also see accuracy gains if we use more anchors.

Changes to System Design

We were able to successfully set up a webserver and send localization updates to the webserver. Because of this, there was no need to make any updates to the system design. 

Schedule

This week we were able to further test the localization system. We were able to have the tag find the positions of at least five anchors simultaneously, and we also found that the maximum distance we could communicate between a tag and an anchor appeared to be approximately 35 meters, which is above the 25 meter benchmark we were aiming for in our Design Report. 

Next week is the runup to our midpoint demo; hence, we would like to continue improving our localization accuracy, augment our user orientation using the IMU data, and continue making improvements to the throughput between our webserver and the client by testing websockets. 

An updated schedule with our current progress can be found here.

Ifeanyi’s Status Report for 03/16/2024

This week, I did some preliminary work on the user tag device. I ordered a battery pack to power the Raspberry Pi. I unboxed and set up the Raspberry Pi, installing the OS and setting up its networking features. Furthermore, I started working on the interfacing of the Raspberry Pi with the accelerometer module. The accelerometer module came with through-holes rather than pins, so I had to solder header pins onto it that can connect with the GPIO. I am currently still working on getting it to be readable from Python scripts on the Raspberry Pi so that we can get rotation from it to estimate which way the user is facing.

https://www.raspberrypi.com/documentation/computers/getting-started.html

https://makersportal.com/blog/2019/11/11/raspberry-pi-python-accelerometer-gyroscope-magnetometer

I am currently still on track with my current progress, as this week was dedicated to setting up the hardware for the tag device, which is slowly coming together.

In the coming week, I plan on finishing the tag device hardware-wise. That is, I want the RPi, battery, case, accelerometer, and DWM module all put together and talking to each other as well as the phone. This way, all that will be left is for each of us to write the software that goes on each of those parts (with me being in charge of the RPi, Weelie the DWM, and Jeff the phone).

Weelie’s Status Report for 3/16/2024

  • What did you personally accomplish this week on the project?

Last week, I mainly worked on the communications between a tag and multiple anchors. Now the tag and the anchors can be configured in the same network. The tag could simultaneous receive signals from multiple anchors and know the anchors’ ids (mac address) and get the distances from the tag to the anchors. The tag will then output the information of all anchors it received by printing information out with UART. The video can be found in our team status report and our slack channel. I also pushed the code in the git repository.

Github Repo: https://github.com/weelieguo/18500-dw1001

  • Is your progress on schedule or behind?

Based on the schedule, I should still implement the trilateration algorithms this week. Now I finished the distances measuring and the trilateration algorithms themselves. It should be on schedule.

  • What deliverables do you hope to complete in the next week?

Next week, since we already have distance measuring and trilateration algorithms implemented. I will try to connect the Raspberry Pi 4 to the tag to read the uart output and parse the distances and positions to use trilateration algorithm. Then we will send the information to the frontend server to see if our localization works for a single room.