Latest / CyberSecurity Summary / Learning Robotics Using Python
Transcript
- 0:00Speaker 1: You know when you look at an old school wind
- 0:02Speaker 1: up toy, like one of those little tin cars, there's
- 0:06Speaker 1: this illusion of intelligence. You wind the key, you set
- 0:09Speaker 1: it down on the floor, and it just zips across
- 0:12Speaker 1: the room. It looks, I don't know, purposeful, right.
- 0:14Speaker 2: It has a trajectory. It's interacting with the physical world
- 0:18Speaker 2: in a very literal sense, just moving its mass from
- 0:20Speaker 2: point A to point B.
- 0:21Speaker 1: But it's completely blind. Oh, it's just releasing potential energy
- 0:26Speaker 1: from a spring on a fixed mechanical path. Yeah, I mean,
- 0:29Speaker 1: somebody drops a shoe in front of it. It just
- 0:31Speaker 1: crashes into the leather and spins its little wheels until
- 0:35Speaker 1: the spring dies.
- 0:35Speaker 2: Yeah, it has absolutely no idea the shoe is there.
- 0:38Speaker 2: It's not making choices exactly. Well, it's more than just blind, really,
- 0:42Speaker 2: it's completely agnostic to reality. It's a machine, sure, but
- 0:46Speaker 2: it lacks any mechanism to perceive its environment or alter
- 0:50Speaker 2: its behavior based on what it finds.
- 0:52Speaker 1: And crossing that massive evolutionary gap from a blind wind
- 0:55Speaker 1: up toy to a machine that can actually perceive that shoe, stop,
- 1:00Speaker 1: think and navigate around it. That takes an incredible amount
- 1:02Speaker 1: of engineering.
- 1:03Speaker 2: An unbelievable amount yeah.
- 1:04Speaker 1: Yeah, today we are exploring exactly how to make that leap.
- 1:09Speaker 1: Welcome to the deep dive where we are going under
- 1:11Speaker 1: the hood of Lent and Joseph's manual Learning Robotics using Python.
- 1:16Speaker 2: It's such a great source to dive into.
- 1:18Speaker 1: We're going to see what it actually takes to build
- 1:21Speaker 1: a differential drive service robot, specifically a robotic waiter.
- 1:26Speaker 2: And it's a brilliant journey for you to follow along
- 1:28Speaker 2: with because it forces you to synthesize disciplines. You can't
- 1:31Speaker 2: just be a programmer, and you can't just be a mechanic.
- 1:34Speaker 2: You have to bridge the physical world and the digital world.
- 1:37Speaker 1: Okay, let's unpack this because before we can even think
- 1:40Speaker 1: about building our robotic waiter, we really need to define
- 1:44Speaker 1: what separates a tree robot from just, you know, a
- 1:48Speaker 1: complex machine. You really do, and honestly, we have to
- 1:51Speaker 1: fight through a century of science fiction myths to get
- 1:53Speaker 1: to a working definition.
- 1:54Speaker 2: Oh absolutely. Even the origin of the word itself sets
- 1:58Speaker 2: up this expectation that engineers have been wrestling with ever since.
- 2:01Speaker 2: I mean, the term robot didn't originate in an MIT laboratory.
- 2:05Speaker 2: It was coined in a theater in nineteen twenty a
- 2:08Speaker 2: check writer named Carol Kappek wrote a play called ru Are.
- 2:12Speaker 1: Which stands for Rossum's Universal Robots right exactly.
- 2:15Speaker 2: He was trying to come up with a term for
- 2:17Speaker 2: artificial human workers, and his brother Joseph actually suggested robode,
- 2:21Speaker 2: which carries a.
- 2:22Speaker 1: Very specific cultural weight, doesn't it very much?
- 2:25Speaker 2: So it stems from the word robota in Czech and Slovak,
- 2:29Speaker 2: which translates to work or more accurately surf labor or
- 2:34Speaker 2: hard drudgery.
- 2:35Speaker 1: Wow.
- 2:36Speaker 2: So right from its birth, the concept implies a machine
- 2:39Speaker 2: designed to take on the heavy, undesirable lifting for humanity.
- 2:43Speaker 1: Though I mean spoiler alert for a play from the
- 2:46Speaker 1: nineteen twenties, those robotic serfs eventually revolt and wipe out humanity.
- 2:50Speaker 2: A narrative trope that has completely dominated our perception of
- 2:54Speaker 2: robotics ever since. But you know, if we strip away
- 2:57Speaker 2: the Hollywood dramatization and look for a functional, modern defy definition,
- 3:00Speaker 2: roboticists like Maji Jamataric offer a much clearer lens.
- 3:04Speaker 1: Okay, what's her tick?
- 3:05Speaker 2: She defines a robot as an autonomous system existing in
- 3:07Speaker 2: the physical world, able to sense its environment and act
- 3:10Speaker 2: on it to.
- 3:11Speaker 1: Achieve goals, which fundamentally disqualifies my washing machine.
- 3:14Speaker 2: Yes it does.
- 3:15Speaker 1: My washing machine doesn't sense anything. It just runs a
- 3:17Speaker 1: pre programmed timer, much like the tin wind up toy. Yeah,
- 3:21Speaker 1: but I was thinking about this definition, and it also
- 3:24Speaker 1: seems to disqualify something incredibly smart, like my email spam filter.
- 3:29Speaker 2: Ah, that's an interesting point.
- 3:30Speaker 1: Right, because a spam filter learns, it adapts, it acts
- 3:35Speaker 1: autonomously to keep junk out of my inbox. Yeah, but
- 3:38Speaker 1: it doesn't live in the physical world. The data is
- 3:40Speaker 1: just perfectly spoon fed to it in a stable digital environment. Right.
- 3:44Speaker 1: Is the sheer chaos of a messy physical bedroom what
- 3:48Speaker 1: makes building a true robot so uniquely difficult.
- 3:51Speaker 2: That is the absolute core of the challenge. A spam
- 3:53Speaker 2: filter never has to worry about a sudden gust of wind,
- 3:57Speaker 2: or the floor being slippery, or a dog running by
- 4:00Speaker 2: exactly or the lighting in the room changing and blinding
- 4:02Speaker 2: its camera. The physical world is wildly unpredictable. The friction
- 4:06Speaker 2: on a carpet is different from the friction on hardwood.
- 4:09Speaker 2: Sensing that unpredictable chaos, making sense of it, and then
- 4:13Speaker 2: physically exerting force upon it, that continuous loop is what
- 4:16Speaker 2: separates true robotics from pure software engineering.
- 4:20Speaker 1: So if a true robot must sense an act in
- 4:23Speaker 1: this chaotic physical space, how do we build a brain
- 4:27Speaker 1: that can process all that messy sensory information and decide
- 4:31Speaker 1: what to do well.
- 4:31Speaker 2: This brings us to the fundamental anatomy of a robot.
- 4:34Speaker 2: You have the physical body. You have sensors which measure
- 4:37Speaker 2: the environment to create what we call a digital state.
- 4:40Speaker 2: You have effectors or the motors and arms that do
- 4:42Speaker 2: the actual moving and sitting between the sensors and the effectors,
- 4:47Speaker 2: you have the controllers.
- 4:48Speaker 1: The brain, precisely the brain.
- 4:50Speaker 2: And giving a machine a brain that could handle physical
- 4:53Speaker 2: chaos really started around nineteen sixty six with a robot
- 4:57Speaker 2: developed at the Stanford Research Institute famously named Shaky. Shaky, Yeah, Shaky.
- 5:02Speaker 2: It was a milestone because it didn't just execute a
- 5:05Speaker 2: list of hard coded commands. It could actually reason. How So,
- 5:08Speaker 2: if you gave Shakey a high level command, it could
- 5:11Speaker 2: break that complex goal down into smaller, solvable intermediate steps.
- 5:15Speaker 2: I mean, trying to get Shaky to navigate around literal
- 5:18Speaker 2: blocks in a room actually led researchers to invent the
- 5:21Speaker 2: a star search algorithm.
- 5:22Speaker 1: Wait, really, the same pathfinding tool used in computer science today,
- 5:26Speaker 1: the very same.
- 5:26Speaker 2: It's foundational. But Shaky got its name for a reason.
- 5:31Speaker 2: It was incredibly slow and jerky.
- 5:34Speaker 1: Oh, because it had to think so much.
- 5:35Speaker 2: Yes, it would move a tiny bit, stop, think for
- 5:39Speaker 2: a very long time, and then move a tiny bit more.
- 5:42Speaker 2: Trying to plan every single movement perfectly just isn't practical.
- 5:46Speaker 1: No, especially in a dynamic environment with people walking.
- 5:49Speaker 2: Around exactly, And that tension led to the development of
- 5:53Speaker 2: different control paradigms. You have the hierarchical or deliberative paradigm,
- 5:57Speaker 2: which is what Shakey used.
- 5:58Speaker 1: Okay, what does that look like.
- 6:00Speaker 2: The sequence is sense the world, plan a route, then act.
- 6:03Speaker 2: It's very intelligent, but computing that plan takes critical time.
- 6:07Speaker 2: On the opposite end, you have the reactive paradigm. This
- 6:10Speaker 2: is simply sense then act. There is no planning, just
- 6:13Speaker 2: immediate response.
- 6:15Speaker 1: Let me see if I have this right, because I
- 6:16Speaker 1: was trying to map this onto human biology all reading. Sure,
- 6:19Speaker 1: if I accidentally brush my hand against a hont stove,
- 6:22Speaker 1: I don't stop sense the temperature, formulate a spatial plan
- 6:27Speaker 1: to move my arm, and then execute the movement.
- 6:29Speaker 2: No, you'd burn your hand.
- 6:31Speaker 1: Right, My spinal cord just bypasses my brain entirely and
- 6:35Speaker 1: yanks my hand back in a fraction of a second.
- 6:38Speaker 1: Is reactive control. Basically a digital reflex.
- 6:41Speaker 2: A spinal reflex is a phenomenal way to picture it, actually,
- 6:44Speaker 2: but with one major caveat A robot's reflex is completely programmable.
- 6:50Speaker 2: And if we connect this to the bigger picture of
- 6:52Speaker 2: the robotic waiter we are trying to build from the
- 6:54Speaker 2: source material, you quickly realize you can't rely purely on
- 6:58Speaker 2: one paradigm.
- 6:59Speaker 1: You need accommodate.
- 7:00Speaker 2: You need a hybrid model.
- 7:01Speaker 1: Yes, because it has to be smart enough to find
- 7:03Speaker 1: the table, but fast enough not to run over a customer.
- 7:06Speaker 2: Exactly that. The robot needs a hierarchical deliberative plan to
- 7:11Speaker 2: note that payble four is across the dining room, to
- 7:14Speaker 2: map an efficient path around the stationary booths, and to
- 7:16Speaker 2: calculate an arrival time. But if a patron suddenly steps
- 7:20Speaker 2: backward out of their chair holding a tray of drinks,
- 7:23Speaker 2: the robot does not have three seconds to sit there
- 7:25Speaker 2: and recalculate a new global map.
- 7:27Speaker 1: It would crash.
- 7:28Speaker 2: It needs that reactive reflex to slam on the brakes
- 7:30Speaker 2: of the millisecond it's light ar detects a sudden obstacle.
- 7:34Speaker 2: The hybrid model layers these systems, a slow smart planner
- 7:38Speaker 2: running in the background and a fast reactive safety system
- 7:41Speaker 2: running in the foreground.
- 7:42Speaker 1: All right, so we understand this hybrid brain. But a
- 7:45Speaker 1: brain needs a physical vessel to carry the soup. If
- 7:49Speaker 1: we are actually engineering this robotic waiter, how do we
- 7:52Speaker 1: design the physical machine from scratch?
- 7:55Speaker 2: Well, you start by defining your hard constraints. Engineering is
- 7:58Speaker 2: all about solving specific problems. For this project, the robot
- 8:02Speaker 2: needs to carry food, so the text specifies a payload
- 8:05Speaker 2: capacity of up to five kilograms.
- 8:07Speaker 1: Okay.
- 8:08Speaker 2: It needs to travel at roughly a human walking base
- 8:10Speaker 2: to not be disruptive, which means a target speed between
- 8:13Speaker 2: er point twenty five and one meter per second.
- 8:15Speaker 1: That makes sense.
- 8:16Speaker 2: It also needs more than three centimeters of ground clearance
- 8:19Speaker 2: to get over doorway thresholds without getting stuck. And crucially,
- 8:23Speaker 2: it needs to be relatively low cost.
- 8:25Speaker 1: And the mechanical solution the book walks us through is
- 8:28Speaker 1: a differential drive system. Yes, it's modeled after the turtlebot architecture.
- 8:32Speaker 1: If you picture it, it looks kind of like a
- 8:34Speaker 1: three tiered wedding cake made of metal plates, a base plate,
- 8:38Speaker 1: a middle plate, and a top plate. That's a good visual,
- 8:41Speaker 1: But the drive system is what caught my eye. It
- 8:44Speaker 1: only has two powered wheels on the left and right sides,
- 8:47Speaker 1: and then these unpowered castor wheels like you'd find on
- 8:51Speaker 1: the bottom of an office chair on the front and back,
- 8:53Speaker 1: just to keep it from tipping over.
- 8:55Speaker 2: Differential drive is brilliant in its simplicity. By independently controlling
- 8:59Speaker 2: just the yeat and direction of those two side wheels,
- 9:02Speaker 2: you can steer the robot.
- 9:03Speaker 1: Effortlessly without needing a heavy, complex steering rack like a
- 9:06Speaker 1: car uses.
- 9:07Speaker 2: Exactly, well, you can't just slap any motors onto those
- 9:10Speaker 2: wheels and call it a day. You have to calculate
- 9:12Speaker 2: the physics.
- 9:13Speaker 1: Right, because if you guess wrong, the robot either moves
- 9:16Speaker 1: at its nail's pace or it completely stalls out when
- 9:19Speaker 1: you put a bowl of soup on it.
- 9:20Speaker 2: Exactly, you are managing the tension between speed and torque.
- 9:24Speaker 2: The text walks through the calculations. If you want this
- 9:27Speaker 2: robot to travel at a modest point three to five
- 9:29Speaker 2: meters per second, and you are using wheels with a
- 9:31Speaker 2: nine centimeter diameter, to maintain that ground clearance.
- 9:35Speaker 1: Okay, right.
- 9:35Speaker 2: In the math, the geometry dictates the wheels must spin
- 9:38Speaker 2: at roughly seventy four revelations per minute. The author standardizes
- 9:42Speaker 2: this by selecting an off the shelf eighty rpm motor.
- 9:45Speaker 1: But speed is only half the battle. Torque is the muscle,
- 9:49Speaker 1: right right.
- 9:50Speaker 2: Torque is the twisting force required to overcome inertia and friction.
- 9:54Speaker 2: Think about pushing a heavy box across a room. The
- 9:57Speaker 2: hardest part is always that initial show to get it
- 10:00Speaker 2: to budge from a dead stop.
- 10:01Speaker 1: Yeah, once it's sliding, it's easier.
- 10:03Speaker 2: Our robotic waiter. The chassis plus that five kilogram payload
- 10:07Speaker 2: weighs about fifteen kilograms total. That weight is pressing down on.
- 10:10Speaker 1: The floor, and the floor has friction, a lot of it.
- 10:14Speaker 2: If you factor in a friction coefficient of zero point
- 10:16Speaker 2: six for a standard indoor surface, the math reveals that
- 10:19Speaker 2: the motors need to generate ten point three to two
- 10:21Speaker 2: kilogram centimeters of torque just to break that static friction
- 10:25Speaker 2: and get the robot moving.
- 10:26Speaker 1: Wow.
- 10:27Speaker 2: If you buy a motor with only five kilogram centimeters
- 10:30Speaker 2: of tork, it won't matter how fast it can spin.
- 10:32Speaker 2: The wheels will just hum, heat up, and stall.
- 10:35Speaker 1: That transition from abstract code to high school physics is wild.
- 10:40Speaker 1: You have to literally calculate the friction of the floor,
- 10:43Speaker 1: and once that math is locked in, you have to
- 10:45Speaker 1: design the parts.
- 10:46Speaker 2: Yes, the actual model.
- 10:47Speaker 1: He also uses libricad for the two D bluefrints and
- 10:51Speaker 1: Blender for the three D models. But here's where I
- 10:54Speaker 1: got really confused reading the source. Oh, when it's time
- 10:58Speaker 1: to build the three D model in Blender, the author
- 11:00Speaker 1: doesn't use the mouse. They don't drag and drop shapes.
- 11:04Speaker 1: They open Blenders, Python API, the boopy module and write
- 11:08Speaker 1: lines of Python code just to generate a three D cylinder.
- 11:11Speaker 2: Ah.
- 11:12Speaker 1: Yes, Why would someone write a script to draw a
- 11:15Speaker 1: shape when they could literally just click and drag the
- 11:17Speaker 1: mounts and be done in three seconds.
- 11:19Speaker 2: I know it feels entirely counterintuitive until you consider the
- 11:22Speaker 2: reality of iterative engineering. When you drag a mouse to
- 11:25Speaker 2: draw a cylinder, you are introducing human imperfection. You might
- 11:28Speaker 2: be off by a fraction of a millimeter, right, But
- 11:31Speaker 2: more importantly, a hand drawn shape is static. Programmatic modeling
- 11:35Speaker 2: allows you to completely parameterize your dimensions.
- 11:38Speaker 1: Meaning you link the shape to the.
- 11:39Speaker 2: Math exactly Imagine you build the robot and you realize
- 11:43Speaker 2: your waiter actually needs to carry ten kilograms of food
- 11:46Speaker 2: instead of five. The physics change.
- 11:48Speaker 1: You need bigger motors.
- 11:49Speaker 2: Which require bigger mounts, which means the base plate needs
- 11:52Speaker 2: to be wider. If you drew it by hand, you
- 11:54Speaker 2: have to manually resize the chassis, reposition the wheel axes,
- 11:58Speaker 2: and check every clearance by I.
- 12:01Speaker 1: That sounds like a nightmare.
- 12:02Speaker 2: It is, But if you used Python, you simply open
- 12:05Speaker 2: your script, change the variable payload weight to.
- 12:07Speaker 1: Ten, and run the code and it does it all
- 12:10Speaker 1: for you.
- 12:10Speaker 2: The math automatically recalculates, resizes the cylinder, shifts the wheel mounts,
- 12:15Speaker 2: and spits out a flawless, updated three D model. Plus
- 12:19Speaker 2: the script can automatically export the STL files needed for
- 12:22Speaker 2: simulation without any graphical artifacts. You aren't drawing a picture,
- 12:27Speaker 2: you are engineering a responsive system.
- 12:29Speaker 1: Okay. I love that the code itself becomes the ultimate
- 12:32Speaker 1: precision tool. So now we have our three D model,
- 12:34Speaker 1: perfectly generated by Python, sitting on as differential drive wheels, right.
- 12:38Speaker 1: But to make it actually navigate a virtual restaurant, we
- 12:41Speaker 1: run into the physics of driving, and this introduces kinematics.
- 12:44Speaker 2: Yes. Kinematics is the study of motion, the mathematics of
- 12:49Speaker 2: how things move without worrying about the underlying forces like
- 12:53Speaker 2: mass or friction that we.
- 12:54Speaker 1: Just discussed, so just the geometry of it.
- 12:56Speaker 2: Basically, for our robot, we have to look at its
- 12:59Speaker 2: degrees of freedom or its pose on a flat restaurant floor.
- 13:03Speaker 2: The robot operates in a standard X and y coordinate
- 13:06Speaker 2: system like a graph, but it also has a heading
- 13:10Speaker 2: the direction it's facing, which is represented by the Greek
- 13:13Speaker 2: letter theta, So its pose is always defined by x,
- 13:16Speaker 2: y and theta.
- 13:18Speaker 1: But because it uses that two wheel differential drive, it
- 13:21Speaker 1: has a major movement limitation. The source calls it a
- 13:25Speaker 1: non holonomic constraint, a very intimidating term which sounds like
- 13:28Speaker 1: a terrifying math term, but it just basically just what
- 13:31Speaker 1: I deal with when I try to parallel park my car.
- 13:33Speaker 2: Actually, yes, because my.
- 13:35Speaker 1: Car can't just slide sideways into a spot. I have
- 13:37Speaker 1: to roll forward or backward based on where the wheels
- 13:40Speaker 1: are pointing. I have to do this whole geometric dance
- 13:42Speaker 1: of turning, reversing, and straightening out just to move a
- 13:46Speaker 1: few feet to the left. Face does our robotic waiter
- 13:49Speaker 1: have the same problem, like, if table four is directly
- 13:51Speaker 1: to its left, can it just strafe sideways?
- 13:54Speaker 2: It absolutely cannot, and your parallel parking frustration is the
- 13:58Speaker 2: exact manifestation of a non Holow constraint. The robot cannot
- 14:02Speaker 2: change its position on the x or y axis without
- 14:04Speaker 2: first changing its data it's heading wow. To reach of
- 14:07Speaker 2: that table to its left, it must execute a specific
- 14:10Speaker 2: foundational algorithm for inverse kinematics vrot vahead v rot.
- 14:16Speaker 1: Rotate, drive ahead, rotate again correct.
- 14:18Speaker 2: It rotates in place to face the target coordinates. It
- 14:21Speaker 2: drives ahead in a straight line to reach them, and
- 14:23Speaker 2: then it rotates a second time to face the final
- 14:26Speaker 2: desired orientation, say, facing the customer to deliver the plate.
- 14:30Speaker 1: Got it.
- 14:30Speaker 2: What's fascinating here is the geometry of how it turns.
- 14:34Speaker 2: Because the two wheels are fixed on a single horizontal axis,
- 14:37Speaker 2: anytime the left wheel and right wheels spin at different speeds,
- 14:40Speaker 2: the robot naturally sweeps through an arc.
- 14:42Speaker 1: Okay, I can picture that it.
- 14:43Speaker 2: Rotates around a specific invisible pivot point located somewhere along
- 14:47Speaker 2: that extended axis line. This is called the instantaneous center
- 14:50Speaker 2: of curvature, or ICC.
- 14:52Speaker 1: And the math is constantly crunching the wheel speeds to
- 14:55Speaker 1: figure out where that invisible pivot.
- 14:56Speaker 2: Point is continually forward. Kinematics is the mes asking, given
- 15:01Speaker 2: the current speed of my left wheel and right wheel,
- 15:04Speaker 2: where will my X y and theta be in five seconds?
- 15:08Speaker 2: In Verse, kinematics asks the much harder question, I need
- 15:12Speaker 2: to be at this specific X y and theta Exactly
- 15:16Speaker 2: how fast should I spin my left wheel versus my
- 15:18Speaker 2: right wheel to make my ICC carve the perfect arc
- 15:21Speaker 2: to get there?
- 15:22Speaker 1: But wait to calculate any of that, the robot needs
- 15:25Speaker 1: to know exactly how far its wheels have actually turned
- 15:28Speaker 1: in the real world. It doesn't have GPS indoors, how
- 15:30Speaker 1: does it know it drove two meters and not one ah.
- 15:33Speaker 2: It relies on wheel adometry. Attached to the motors are
- 15:36Speaker 2: sensors called wheel encoders encoders Okay. The text explains that
- 15:40Speaker 2: these encoders output binary signals microscopic digital clicks or steps
- 15:44Speaker 2: as the physical wheel rotates. If you know exactly how
- 15:47Speaker 2: far the wheel travels in one tiny step, you just
- 15:50Speaker 2: count the steps.
- 15:50Speaker 1: And multiply, so it's basically counting its own footsteps in
- 15:53Speaker 1: the dark.
- 15:53Speaker 2: Yes, if you think of the cameras and light oars
- 15:56Speaker 2: as the robot's eyes. The wheel encoders are its inner ear.
- 16:00Speaker 2: They provide proprioception. They give the robot a constant mathematical
- 16:05Speaker 2: awareness of its own body moving through space, feeding real
- 16:09Speaker 2: numbers back into those kinematics equations.
- 16:11Speaker 1: Oh yeah, so we've got the Python three D model.
- 16:13Speaker 1: We have the torque calculations that we have the complex
- 16:16Speaker 1: kinematics and encoders all.
- 16:18Speaker 2: Figured out everything we need.
- 16:19Speaker 1: But before we spend a single dollar ordering real motors
- 16:22Speaker 1: or cutting metal plates, the book has us take all
- 16:26Speaker 1: this logic and plug it into the matrix the simulation.
- 16:30Speaker 2: Which is the most crucial step in modern robotics. Simulation
- 16:33Speaker 2: gives you a sandbox to test your real production ready
- 16:36Speaker 2: coming on virtual hardware. It's low cost and more importantly,
- 16:40Speaker 2: zero physical.
- 16:41Speaker 1: Risk, no broken parts.
- 16:42Speaker 2: Exactly. If your inverse kinematics math is inverted and your
- 16:46Speaker 2: virtual robot accelerates to maximum speed and drive straight into
- 16:48Speaker 2: a virtual wall, you don't have a pile of broken
- 16:51Speaker 2: metal and a fired engineer. You just hit reset on
- 16:53Speaker 2: the simulation.
- 16:54Speaker 1: Here's where it gets really interesting for me. The tools
- 16:57Speaker 1: used for this are gazebo and ros because zebo makes sense.
- 17:01Speaker 1: It's the three D physics simulator. It renders the restaurant,
- 17:04Speaker 1: the tables, and calculates the virtual gravity. But ROS, the
- 17:07Speaker 1: robot operating system, is what actually runs the brain, although
- 17:11Speaker 1: the text makes a point to say it isn't actually
- 17:13Speaker 1: an operating system like Windows or Linux. It's a meta
- 17:17Speaker 1: operating system and a distributed framework.
- 17:20Speaker 2: That's a vital distinction ROS. It's on top of a
- 17:22Speaker 2: traditional operating system. At its core, ROS is a communication framework.
- 17:28Speaker 2: A modern robot runs dozens of separate executable programs simultaneously,
- 17:33Speaker 2: one for vision, one for driving, one for mapping. ROS
- 17:36Speaker 2: calls these individual programs nodes nodes. Yes, you have a
- 17:40Speaker 2: central directory called the ROS master that keeps track of
- 17:43Speaker 2: what nodes are running. But the actual data sharing happens
- 17:45Speaker 2: through a brilliant published and subscribe model using data streams
- 17:49Speaker 2: called topics.
- 17:50Speaker 1: So this publish and subscribe thing, I'm trying to wrap
- 17:52Speaker 1: my head around it. If a wheel encoder has new
- 17:54Speaker 1: odometry data, does it just shout it out? Is it
- 17:57Speaker 1: sort of like a social media feed where a node
- 18:00Speaker 1: tweets its speed to a topic and hope someone else
- 18:03Speaker 1: is reading it.
- 18:04Speaker 2: That is an incredibly useful way to conceptualize it. The
- 18:07Speaker 2: wheel encoder node publishes its data to a topic named,
- 18:12Speaker 2: for example, slash odometry. It has absolutely no idea who
- 18:16Speaker 2: is reading it, or if anyone who is reading it
- 18:18Speaker 2: at all.
- 18:18Speaker 1: Oh wow.
- 18:19Speaker 2: Conversely, your motor control node needs to know how fast
- 18:22Speaker 2: the robot is moving, so it subscribes to the slash
- 18:26Speaker 2: o doomitory topic. It essentially follows.
- 18:28Speaker 1: That feed, just waiting for updates. Yeah.
- 18:30Speaker 2: Whenever new data appears on the topic, the motor node
- 18:32Speaker 2: reads it and adjusts the power. The two nodes never
- 18:36Speaker 2: speak directly to each other. They just interact with the feed.
- 18:38Speaker 1: They don't even need to know the other one exists exactly.
- 18:40Speaker 2: And this decoupled architecture is what makes ros so powerful.
- 18:44Speaker 2: Because the nodes are completely independent, they don't even need
- 18:47Speaker 2: to be written in the same programming language. Wait really, Yeah,
- 18:51Speaker 2: your wheel encoder node could be a simple Python script
- 18:54Speaker 2: running on a tiny Raspberry Pie strapped to the robot's base. Meanwhile,
- 18:59Speaker 2: your complex path planning node could be a heavy performance
- 19:02Speaker 2: intensive C plus plus program running on a massive server
- 19:05Speaker 2: in the restaurant's back office, communicating over Wi Fi. It's
- 19:09Speaker 2: a decentralized peer to peer.
- 19:11Speaker 1: Network, which means you can easily borrow code from other people.
- 19:14Speaker 2: Right, that's the real magic code reuse. A university team
- 19:18Speaker 2: in Tokyo might write a brilliant, highly optimized node for
- 19:22Speaker 2: avoiding dynamic obstacles. Because their node just subscribes to standard
- 19:26Speaker 2: laser scan topics and publishes to standard velocity topics. You
- 19:30Speaker 2: can download their open source code and drop it straight into.
- 19:33Speaker 1: Your waiter robot and it just works.
- 19:34Speaker 2: As long as the topic names match, it works instantly.
- 19:37Speaker 1: It's an entire collaborative ecosystem operating under the hood. So
- 19:41Speaker 1: what does this all mean for you listening? Let's recap
- 19:43Speaker 1: the journey.
- 19:44Speaker 2: Let's do it.
- 19:45Speaker 1: We started with a nineteen twenties play about artificial surf labor.
- 19:49Speaker 1: We defined what a robot actually is, a machine that
- 19:52Speaker 1: must sense an act in the physical world. We gave
- 19:55Speaker 1: it a hybrid control system that can deliberatively plan a
- 19:59Speaker 1: route while reflexively hitting the brakes.
- 20:02Speaker 2: A digital spinal cord.
- 20:03Speaker 1: Yes, we calculated the physical torque needed to move a
- 20:06Speaker 1: tray of food, parameterized a three D model using Python scripts,
- 20:10Speaker 1: and solve the parallel parking geometry of non holonomic kinematics,
- 20:15Speaker 1: and Finally, we plug all those independent nodes into the
- 20:18Speaker 1: ros published and subscribe matrix to simulate a working waiter.
- 20:22Speaker 2: It is a remarkable synthesis. You are stacking mechanical physics,
- 20:25Speaker 2: computer science, and geometry to create something that ultimately feels
- 20:29Speaker 2: almost alive.
- 20:30Speaker 1: And the practical takeaway here is that the next time
- 20:32Speaker 1: you see a food delivery robot rolling down the sidewalk,
- 20:35Speaker 1: or even just watch your roombow vacuuming your hallway, you
- 20:37Speaker 1: won't just see a plastic shell roaming around.
- 20:39Speaker 2: Now you'll see the matrix.
- 20:41Speaker 1: You will be able to visualize the hidden architecture, the
- 20:44Speaker 1: kinematics constantly calculating instantaneous pivot points, the invisible nodes tweeting
- 20:49Speaker 1: data back and forth, and the hybrid brain fighting to
- 20:52Speaker 1: survive the chaos of the physical world.
- 20:54Speaker 2: It profoundly changes how you view the machines around you.
- 20:58Speaker 2: But to leave you with a final thought to mull over.
- 21:01Speaker 2: Earlier we touched on the history of robotics, which the
- 21:03Speaker 2: source text outlines, and you can't discuss that history without
- 21:06Speaker 2: mentioning Isaac Asimov's famous three laws of robotics. Asimov's first
- 21:11Speaker 2: law states that a robot may not injure a human being.
- 21:14Speaker 2: It's an ethical philosophical mandate designed to keep us safe.
- 21:18Speaker 1: Right. But from everything we've just discussed, there is no
- 21:21Speaker 1: philosophy module in Python precisely.
- 21:24Speaker 2: And this raises an important question for the future of engineering.
- 21:27Speaker 2: In the reality of ros, everything is just nodes, topics,
- 21:30Speaker 2: wheel encoders, and coordinate geometry. How do you map a
- 21:34Speaker 2: human value onto a publish and subscribe network When our
- 21:38Speaker 2: simulated waiter is calculating its instantaneous center of curvature to
- 21:42Speaker 2: avoid a table, At what point does a mathematical threshold
- 21:45Speaker 2: cross over into a moral decision. We know how to
- 21:48Speaker 2: program a machine to understand rpm and torque, but how
- 21:51Speaker 2: do we eventually program it to understand us.
- 21:53Speaker 1: Math crossing into morality a massive question to leave off on.
- 21:57Speaker 1: From blind wind up toys crashing into shoes to ysical
- 22:00Speaker 1: machines calculating the geometry of human safety, we'll leave you
- 22:03Speaker 1: upon to that one. Thanks for joining us on this
- 22:05Speaker 1: deep dive.