Yuxuan’s Status Report for 03/11/2023

This week I’ve been mostly working on creating a demo on Bluetooth communication and writing part of the design review document. The package initially used for Bluetooth communication is Pybluez. However, the package is not stable on Mac OS. I tried to install and import the bluetooth package and it already says it’s missing other packages. After installing the missing packages, it then says it cannot find the method inside the package. I’ve looked at many issue threads related to it on the repo and still cannot fix the bug. I believe that the code is importing packages that have conflicting versions that require manual fixes on the code after installation.  I’ve also tried a well-maintained package called Bleak but it’s mostly acting as a Bluetooth client and it provides little documentation for creating a Bluetooth server.
An alternative way to establish communication between two devices is using a TCP connection via a socket. I’ve tested the round-trip communication time between Mac running as an echo server and iPhone running as client but the result is not optimal. Sometimes the round trip time is more than 200ms which won’t meet our design requirements. The TCP solution and USB serial connection should be put as our backup plan in case the Bluetooth connection solution fails.

The work is mostly on schedule. I’m going to focus on installing the Bluetooth packages on a Windows PC once it’s available next week. Once the Windows PC is received, I will also try to test the Xbox emulator package and codes that read data from the game. If all the packages can be successfully installed and tested, the latter implementation for the game controller can be much smoother.

Yuxuan’s Weekly Status Report for 02/25/2023

This week I’m mostly looking into the details of how the program on the PC side can simultaneously handle data from the Pi client via Bluetooth and interact with the game. I’ve thought about using multithreading as I read into the tutorial, but I realized that multithreading is unnecessary since we only have one client and one server, so only a single connection is needed. A feasible way of implementing the program is by binding a socket to a port where the program can read game data. In addition, another socket will be created and bind another port for Bluetooth communication. Then, all the communication and actions can be done in a while loop. The initial file structure is created and some skeleton codes on the PC side are pushed to this repository on GitHub.
One block I realize is that the PYXinput Xbox emulator is used for windows only but I’m using a Mac for development. Also, only a powerful game laptop can power the BeamNG game for further testing. Therefore, I need to look for a way to borrow a game laptop next week.

The progress is mostly on schedule. The priority for next week is obtaining a gaming laptop. Both of my teammates use Windows and are pro gamers so I will ask them about this issue. Meanwhile, I’m planning to implement the program mentioned above on the PC side.

To fill in the gap for team members, I can talk with Xiao about the exact functionalities of the buttons and hardware so we can have a better understanding of what signals will be read and interpreted by the program. I can also talk with Qiaoan and assist him with tuning the gyro sensor by writing program that reads the outputs.

 

Yuxuan’s Status Report for 02/18/2023

This week I’ve been designing software systems that allow Raspberry Pi and Windows PC to communicate game data. I’ve created a diagram as shown below showing how and what kind of data is flowed between different hardware and software as well as devices. 

The diagram uses blocks to identify major software components I need to implement in order to achieve communication between two devices. For each component, I identified certain libraries that can be used to accomplish the task in a document called Module Details in our shared folder on Google drive. It contains links to the library repo, discussions, and video demos.

I’m currently mostly on schedule as we are finalizing our designs this week.

Next week I’m planning to try implementing the process of retrieving data from the game using the Outgauge protocol as well as emulating the Xbox controller using the PYXInput library to establish a basic interaction with the game using codes.

The courses covered in this process are 18-213 and 18-349. Both involve creating software systems transmitting data from one device to the other via different protocols.

Team Status Report for 02/11/2023

The most important risk now is not certain whether a task can be finished or not by each team member since everything is pretty abstract now. We are actively communicating ideas in our chat group and after each class, following the Gantt chart we created during the proposal.

After the proposal presentation, we realized certain things our team lacked. In our design, we agreed to include more details including diagrams and hardware specifications in our presentations. We also realized that our solution approach section in the presentation should be more related to how the entire system is structured rather than solutions to a few technical challenges. In the use case explanations, we realized that we focused too much on an engineer’s perspective rather than a real user’s perspective. In the next discussion on creating design presentations, we are going to modify our use case requirements.

We also need to figure out how those components we mentioned there will interact with each other, speficially, what kind of data should be transmitted from one part to another part, and what should each part act in different scenarios.  The team is discussing a flow chart to clarify this and we think we will present a flow chart for design presentation.

Since the team is still working on the initial design, we don’t have much update available. We believe our progress are on schedule and no update is needed.

Yuxuan’s Status Report for 02/11/2023

This week I’ve been mostly exploring the software design ideas related to how the game should interact with the controllers. I looked into the API which is developed by the game BeamNG.drive on this repo. The examples and features are mostly related to setting up a car driving environment by using the library function calls to set up a simulator on a PC.  For example, the user can specify the car brand to be Honda and the location to be west coast by calling related APIs This is quite different from what we initially thought since we are designing a program that sends input data to a PC.

Then, the focus is shifted towards firmware on hardware that can read inputs from hardware and send the data to the PC. The game itself should interpret the control data sent by the controller.  I found this repo which is a firmware that can act as a game controller using Raspberry Pi Pico and send data via USB.  I’m planning to dive into code and explore their design ideas in order to gain a better idea of how hardware and game interact via firmware for my following research. Currently, I’m on schedule.