Creative Collaboration with AI: Designing and Coding Motion Capture Systems with ChatGPT

Continuing from my earlier noodlings with AI and Raspberry Pi for frugal design, I spent the Christmas break delving deeper into my motion capture project. One of the major milestones between family shindigs and country walks was building out the triangulation code that merged the motion data from four sensors into a single position in space. What began as a straightforward proof of concept evolved into a desktop Mac app able to visualise the motion data, update settings remotely, and record the data to a file.

This project evolved way beyond my initial expectations thanks to the collaboration with a large language chatbot, in this case ChatGPT. It played a crucial role in helping me quickly prototype a basic version of the app, which I then enhanced with additional functionality. One of the most transformative features I integrated was the ability to update device settings over Bluetooth. Previously, making changes like updating Wi-Fi details, port numbers, or device IDs required directly connecting each Raspberry Pi Pico device to a computer and modifying raw code manually in Thonny; a python development environment. This new remote update capability streamlined the process of setting up and running the sensor array, making the system much more user-friendly.

Simulating data for four sensors to test WiFi bandwidth capabilities.

Using a large language model as part of the design and development process provided fascinating insights into both the potential and the limitations of AI-assisted programming. At times, progress felt astonishingly quick, with coding breakthroughs and new feature ideas emerging faster than anticipated. However, there were moments when technical roadblocks left me looping through the same recommendations from the AI, unable to resolve an issue.

A great example of this was trying to build out Wi-Fi connectivity for all four sensors. I was trying to set up sockets which would allow all four wireless sensors to send data to the desktop app, however ChatGPT confused the use of four independent IP addresses with four independent communication ports. For some reason the AI completely misunderstood the basic network functionality until I realised what the problem was. I eventually cottoned on to this, explained the confusion to ChatGPT, and then we were off to the races again, fixing the issue and making fast progress. This was an easy fix, however in some circumstances, when the code had become more complex than I initially understood, it was hard for me to identify what the problems were.

Four sensors successfully sending data over WiFi and triangulated into a single point on a virtual canvas, running as a desktop Mac app.

Without a deeper understanding of the underlying processes, it was challenging for me to pinpoint the problem and fix it, or in many cases, have ChatGPT fix the issue by instructing it what to do. Sometimes it was very much a “you don’t know what you don’t know” situation. Ironically, these moments of frustration turned into some of the most valuable learning experiences. They forced me to step back and explore alternative options, often diving into example code and documentation to understand the broader context of the problem. By reviewing how various functions interacted and how the code was structured, I not only found solutions but also significantly improved my Python and Swift programming skills, which were non existent before that start of this little project.

I now have a strong foundational understanding of both languages, as well as Apple’s Xcode application and the Thonny IDE. The iterative process of proposing alternative approaches to the AI, testing the results, and refining code proved incredibly effective. This is the fastest I have ever been able to adopt a new programming language, and I’ve also learnt a great deal about how to navigate LLM chat systems, avoid dead ends, and work collaboratively to unlock better results.

The four prototype sensors, all soldered up into discrete packages, ready for cases.

This back and forth conversation really highlighted the potential benefits, and tricky pitfalls of AI collaboration. While the AI accelerated development and provided useful starting points, the process of debugging, rethinking, and learning, added depth to my understanding and enriched the overall experience. The result for me was not just a functional motion capture proof of concept, but also a stronger foundational understanding of the programming involved. I have continued to develop the prototype, adding additional features, and using it as inspiration for a new project with a much grander scope, which I look forward to sharing more about soon.