https://interconnected.org/home/2024/02/15/galactic-compass Interconnected A blog by Matt Webb * About * Archive * Work Subscribe for $0 * Email * Feed * (What is a feed?) Unoffice Hours * Book a call * (What is this?) a.k.a. @genmon * X/Twitter * Insta * Threads * Mastodon * LinkedIn Building the AI clock * Back Poem/1 on Kickstarter New app! A compass that points to the centre of the galaxy 18.34, Thursday 15 Feb 2024 Link to this post Hey I made an app! It's a green floating arrow that always points to the middle of the Milky Way. i.e. 26,000 light years towards the supermassive central black hole, Sagittarius A*. You can have it too! Download Galactic Compass from the App Store. BUT: I don't know how to write apps. And yet here we are! Let me explain. [galactic-c] Cultivating a sense of the galactic centre It's remarkably grounding? Once upon a time I trained myself to always know where to look, and the centre of the galaxy moves of course over the day and the year: `So I would end up pointing through the pavement, or down a street, and thinking, huh, that's where it is.' It is a worthwhile super-sense: Eventually then I had this picture of myself, and the Earth, and the solar system, and the centre of the galaxy which had initially been whirling round me, and now it had flipped, I was turning around it. It was wildly situating. I've lost the intuition now, sadly. The above description is from my 2021 writeup which I conclude by saying: In my imagination I see an iPhone app which displays a 3D model, connected to the gyroscope and the compass and the GPS. ... But there are slightly too many things I would need to learn So I couldn't built it. EXCEPT. Now there is ChatGPT. --------------------------------------------------------------------- Developing an app with ChatGPT I can't write Swift (the language used to code iOS apps). But what I am able to do is break up large problems into smaller, expressible problems, and then sequence them. I'll be detailed about this. When I've walking folks through this, they're often interested so it is (perhaps) non-obvious? If you're not interested in the detail, skip to the next section. I started by installing Xcode and setting up a git repo. I know how to do that. (GitHub Copilot doesn't work in Xcode by the way.) To get going, I said to ChatGPT 4 something like: * I'm building an iPhone app using SwiftUI. I have installed Xcode version X. Please walk me through creating a new iOS app with a single screen. The screen should be blank except for a line of text in the middle that says "Hello, World!" Then I followed the instructions. There was lots of interaction like: okay I've done step 1. I'm on step 2 but I can't see the X, or I have the error Y, what should I do? I know, from other coding, that I want to have my build working as early as possible. My next question to ChatGPT was something like: * Now I want to see my development app running on my phone as I work. Please walk me through that. Ok, now I've got a setup which means I can develop and I can test. Now putting together the app itself is not about describing the overall app. I don't want ChatGPT to be overfaced. I worked in steps at this kind of resolution, making sure each step was complete before moving to the next: * Okay now add two tabs at the bottom. The tabs are called Compass and Debug. Each has an icon. The first tab show should the Hello World screen, and the second tab should have the word "Debug" in the middle * We'll work on the Debug screen. Add a section of text rows that simply say A, B, and C. Use standard iOS components. Ok, now add a label at the top. Make the text smaller. Make it capitalised. * Add two rows, latitude and longitude, based on the device location. Add the device heading. * Track the device motion and add rows for pitch, roll, and yaw. Then I found a Swift-compatible library to translate between galactic coordinates and relative coordinates. (Ultimately I need altitude and azimuth, a way of pointing at a position in the sky, based on the current time and location.) I'm using SwiftAA. * I'm using SwiftAA. Please make a new Swift object that takes the current date and device location, and provides the azimuth and altitude of the galactic centre (I looked up the coordinates of the central black hole as a proxy) * Using the new GalacticCenter object, display azimuth and altitude in a new section on the debug screen. I retained the Debug tab in the shipped app so you can see. So that's all the astronomical stuff done. You never want to give ChatGPT big goals where it has to figure out the way on its own. Then both of you will be confused. Intermediate stepping stones and being sure of your boots with each stride, that's the way. Now we build the rotating arrow: * Ok now we're on the Compass screen. Make a SceneKit view with a cube in the middle over the whole screen * (There was a whole lot of back and forth here to fix scrolling issues, ensuring the tabs were tappable, positioning some text over the bottom, and so on.) * Now let's make a green arrow from an extruded rectangle and squashed pyramid. The arrow should point to the top of the screen * Break out the data from the Debug screen into a separate object so both tabs can use it * Assuming the phone is lying flat. Make the arrow point north * Rotate the arrow in 3D in real-time in response to the device orientation so that it always points north * Instead of pointing north, point the arrow at the altitude and azimuth of the galactic centre This now became pretty tricky because I had to learn about how to combine rotations. I barely know anything about quaternions, so there was a bunch to learn here. ChatGPT, being a large language model but lacking embodiment, is awful at 3D maths and reference frames. Finally I... * Asked ChatGPT to walk me through the process of building the app using Xcode Cloud and distributing it on TestFlight * Shared the test app with friends to ask for their help with rotations. Galactic Compass is still pretty janky, to be sure. But it ain't bad for a collaboration between someone who can't build apps and an AI that is barely a year old. --------------------------------------------------------------------- "An app can be a home-cooked meal" Ethan Mollick and a team of social scientists studied a group of management consultants using AI. The headline is that, yes, AI results in better work. The fascinating buried result is that the biggest effect is felt by the bottom-half skilled participants. i.e. if you're sub-skilled then you can use AI to drag you up to median. Now, none of us have just one skill. Like most people, I have a mix. But now I'm a reasonable engineer, an amateur designer, an ok systems thinker, ok at having ideas, and now a midwit everything when it comes to all the actual skilled tasks. And the combination means I can bring ideas to life that simply wouldn't be possible if I had to persuade a designer or engineer buddy to help me out. Being able to bring ideas to life means I can scaffold up to other ideas... and others... Like this galactic compass. Back in 2020, Robin Sloan said that an app can be a home-cooked meal. It's such a memorable perspective, and what we should aspire to from our software. Now I've cooked a meal that anyone with an iPhone can download. Probably only a couple dozen people will want it, but I want it in my pocket, and I want to share it with my friends, and here we are. And I can't even cook! But I know where the centre of the galaxy is, even so. --------------------------------------------------------------------- Galactic Compass links: Download from the App Store. Project page on Acts Not Facts. --------------------------------------------------------------------- If you enjoyed this post, please consider sharing it by email or on social media. Here's the link. Thanks, --Matt. Most recent posts * New app! A compass that points to the centre of the galaxy 15 Feb 2024 (This post) * The startling mundanity of robot cars 7 Feb 2024 * Poem/1: 48 hours on Kickstarter 1 Feb 2024 * Thinking about the emerging landscape of AI hardware products 26 Jan 2024 * Press for Poem/1 25 Jan 2024 * Ok it's happening, my AI clock is happening 23 Jan 2024 * Acts Not Facts #8: clock news, client news, AI, AI, AI, and plans 19 Jan 2024 * What is the fart app for Apple Vision Pro? 16 Jan 2024 * Upcoming travel: SF w/c Mon 5 Feb 11 Jan 2024 * The visual affordances of touchscreen-enabled gloves 10 Jan 2024 * The unimagined orange and new frontiers in management consultancy 5 Jan 2024 * 10 blogs for your newsreader 29 Dec 2023 Continue reading: All in 2023 streak New posts for 203 consecutive weeks (see: blogging tips) New? Start here: Best of 2023 (also 2022, 2021, 2020) Or explore the archives: On this day --------------------------------------------------------------------- Archive * 2024 11 posts * 2023 68 posts * 2022 96 posts * 2021 128 posts * 2020 116 posts * 2019 8 posts * 2018 16 posts * 2017 22 posts * 2016 48 posts * 2015 88 posts * 2014 30 posts * 2013 6 posts * 2012 27 posts * 2011 76 posts * 2010 2 posts * 2009 2 posts * 2008 59 posts * 2007 20 posts --------------------------------------------------------------------- [ ] Search Since February 2000. Copyright (c) 2024 Matt Webb. p.s. my blogroll.