<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Yafei&apos;s Archive</title><description>Research, Robotics, and Reflections</description><link>https://www.yafei.dev/</link><language>en</language><item><title>Introducing CRESSim-Neo: A GPU-Accelerated Simulation Engine for Surgical Robotics</title><link>https://www.yafei.dev/posts/2026-09-01-introducing-cressim-neo/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-09-01-introducing-cressim-neo/</guid><description>CRESSim-Neo is a GPU-native simulation engine for surgical robotics based on position-based dynamics (PBD) and GPU-resident dataflow.</description><pubDate>Tue, 01 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import ImageWrapper from &apos;../../../../components/misc/MarkdownImageWrapper.astro&apos;;
import ResponsiveImageGrid from &apos;../../../../components/misc/ResponsiveImageGrid.astro&apos;;
import YouTubeVideo from &apos;../../../../components/misc/YouTubeVideo.astro&apos;;
import framework from &apos;./images/framework.png&apos;;
import physicsDemo from &apos;./images/physics-demo.png&apos;;
import sensorOutputs from &apos;./images/sensor-outputs.png&apos;;
import bloodSuction from &apos;./images/blood-suction.png&apos;;
import cdcr from &apos;./images/cdcr.png&apos;;
import thermalCoagulation from &apos;./images/thermal-coagulation.png&apos;;&lt;/p&gt;
&lt;p&gt;High-performance simulation has become a key part of modern robotics. Simulators are not only used for testing control algorithms, but are also increasingly used to generate training data, collect experience for robot learning, and evaluate policies at scale.&lt;/p&gt;
&lt;p&gt;Surgical robotics makes this much harder: A surgical scene may contain rigid instruments, deformable soft tissue, sutures or other strand-like structures, and fluids, all interacting with one another. A useful simulator may also need to support operations that are specific to surgery, such as cutting, cauterization, irrigation and suction.&lt;/p&gt;
&lt;p&gt;This is a very different setting from many common robotics benchmarks, where a rigid-body dynamics solver is often enough to capture most of the relevant physics.&lt;/p&gt;
&lt;p&gt;Existing research has developed sophisticated methods for modeling tissue deformation, suturing, cutting, and other medical interactions. But many of these systems were designed for surgical training (single-scene) rather than large-scale robotics applications.&lt;/p&gt;
&lt;p&gt;At the other end of the spectrum, modern GPU-accelerated robotics simulators (&lt;em&gt;e.g.,&lt;/em&gt; Isaac Sim, SAPIEN, MuJoCo Playground, Genesis World) have made it possible to run large numbers of environments in parallel and connect simulation directly to learning pipelines. These systems work extremely well for locomotion and rigid-body manipulation, but surgical scenes place very different demands on the physics engine.&lt;/p&gt;
&lt;p&gt;This leaves an interesting gap: &lt;strong&gt;we want the physical flexibility of a surgical simulator, but the scalability and workflow of a modern robotics simulator.&lt;/strong&gt; CRESSim-Neo is our attempt to bridge these two worlds.&lt;/p&gt;
&lt;h2&gt;What CRESSim-Neo is&lt;/h2&gt;
&lt;p&gt;CRESSim-Neo is a GPU-accelerated simulation engine designed specifically for surgical robotics, with a unified physics framework for rigid bodies, deformable soft bodies, fluids, and strand-like structures.&lt;/p&gt;
&lt;p&gt;At the core of the simulator is a position-based dynamics (PBD) framework. PBD is particularly attractive for surgical simulation because it provides a relatively unified way to model very different kinds of materials and interactions within the same solver.&lt;/p&gt;
&lt;p&gt;On top of this physics layer, CRESSim-Neo provides a batched rasterization pipeline and GPU-resident simulation workflow, so multiple environments can be simulated efficiently and their outputs can be used directly on the GPU without unnecessary host-device copies, such as for synthetic data generation and robot learning.&lt;/p&gt;
&lt;p&gt;The goal is not simply to reproduce an existing surgical training simulator on the GPU. We want CRESSim-Neo to serve as a general simulation engine on which new surgical robotics environments, sensing modalities, and learning tasks can be built.&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={framework}
alt=&quot;CRESSim-Neo architecture, from user Python and C++ interfaces through the GPU execution pipeline&quot;
caption=&quot;CRESSim-Neo connects Python and C++ interfaces to a GPU-resident runtime for physics, rendering, sensing, and custom task computation.&quot;
/&amp;gt;&lt;/p&gt;
&lt;h2&gt;Why build another simulator for surgical robotics?&lt;/h2&gt;
&lt;p&gt;A natural question is: why build another simulator?&lt;/p&gt;
&lt;p&gt;Modern platforms such as Isaac Sim, Warp, and Newton are increasingly flexible, and in principle many surgery-specific features could be implemented on top of them. But our view is that extensibility alone is not enough.&lt;/p&gt;
&lt;p&gt;Surgical simulation often requires unusual operations and tight coupling between different parts of the system. We may want to change how constraints are solved, how different materials interact, how simulation data is laid out on the GPU, or how a custom surgical operation is inserted into the timestep. In these cases, working within the assumptions of a large general-purpose framework can become a significant engineering burden.&lt;/p&gt;
&lt;p&gt;With CRESSim-Neo, we wanted something simpler: a stack that we can understand and control from top to bottom.&lt;/p&gt;
&lt;p&gt;That means keeping the core architecture relatively small, minimizing unnecessary abstraction layers, and making the important parts of the simulation directly accessible. The goal is for researchers to be able to modify the physics, coupling, sensing, rendering, and execution model when the application demands it (through the available interfaces, or, when necessary, by modifying a comparatively small codebase).&lt;/p&gt;
&lt;p&gt;This philosophy also shapes some of the lower-level design choices. As we wrote in the paper:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Additional considerations include (1) cross-operating-system and cross-GPU support, (2) modern graphics API usage, (3) cross-API shading language portability, and (4) graphics and compute API interoperability.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;These choices are intended to keep the engine portable and to avoid unnecessary dependence on any single graphics or compute stack.&lt;/p&gt;
&lt;h2&gt;What CRESSim-Neo enables&lt;/h2&gt;
&lt;p&gt;CRESSim-Neo is designed to support the kinds of interactions and sensing modalities that make surgical robotics different from general manipulation.&lt;/p&gt;
&lt;p&gt;Current capabilities include deformable tissue simulation, strand simulation and suturing-style interactions, fluid simulation and suction, cauterization, cable constraints for continuum and cable-driven robots, and simulated ultrasound.&lt;/p&gt;
&lt;p&gt;Because these components share the same GPU-resident runtime, they can be combined within the same scene and executed across multiple environments in parallel.&lt;/p&gt;
&lt;p&gt;The same pipeline is intended for robot learning and synthetic data generation. Simulation state, rendered observations, rewards, randomization, and other user-defined computations can remain on the GPU, reducing unnecessary data movement between simulation and learning code.&lt;/p&gt;
&lt;p&gt;The broader goal is to make it easier to build new surgical robotics tasks without first having to engineer a new simulator around each one.&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo
videoSrc=&quot;https://cressim-neo.yafei.dev/latest/_static/CRESSim-Neo-Public.webm&quot;
videoType=&quot;video/webm&quot;
caption=&quot;An overview of CRESSim-Neo&apos;s surgical robotics simulation capabilities.&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={physicsDemo}
alt=&quot;CRESSim-Neo scenes demonstrating rigid bodies, soft bodies, joints, fluids, and suturing&quot;
caption=&quot;Examples from the unified physics pipeline: rigid bodies, deformable bodies, joints, fluids, and suturing.&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;The engine also produces the sensor data needed by robotics pipelines: RGB images, segmentation masks, depth maps, and synthesized ultrasound. These outputs can be consumed on the GPU alongside the simulation state.&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={sensorOutputs}
alt=&quot;CRESSim-Neo RGB, segmentation, depth, and ultrasound sensor outputs&quot;
caption=&quot;Camera RGB, segmentation, depth, and ultrasound outputs generated by CRESSim-Neo.&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;This workflow is demonstrated in a blood-suction task, where the simulated tool, fluid, and tissue evolve together.&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={bloodSuction}
alt=&quot;A suction tool interacting with simulated fluid&quot;
caption=&quot;BloodSuction: a suction tool removes simulated fluid.&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;We also explore surgery-specific interactions, including cable-driven continuum robots and heat-dependent changes in tissue appearance.&lt;/p&gt;
&lt;p&gt;&amp;lt;ResponsiveImageGrid
firstSrc={cdcr}
firstAlt=&quot;A cable-driven continuum robot simulated with spherical joints&quot;
firstCaption=&quot;A cable-driven continuum robot modeled with spherical joints.&quot;
secondSrc={thermalCoagulation}
secondAlt=&quot;Thermal coagulation simulation showing heat-dependent tissue appearance&quot;
secondCaption=&quot;Thermal coagulation with heat-dependent tissue properties and appearance.&quot;
/&amp;gt;&lt;/p&gt;
&lt;h2&gt;Source code and contributing&lt;/h2&gt;
&lt;p&gt;CRESSim-Neo is open source, and we are building it as a research platform rather than a fixed collection of tasks or benchmarks.&lt;/p&gt;
&lt;p&gt;We are still actively developing the project, and there is a lot we want to improve. But we hope CRESSim-Neo can become a useful foundation for researchers working on robot learning, simulation, and autonomy in surgery.&lt;/p&gt;
&lt;p&gt;The code is available here:&lt;/p&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/cressim-neo&quot;}&lt;/p&gt;
&lt;p&gt;For setup guides and API references, see the &lt;a href=&quot;https://cressim-neo.yafei.dev/&quot;&gt;CRESSim-Neo documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We would be excited to see what others build with CRESSim-Neo, and to welcome contributions from the community.&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;p&gt;For the full technical details, please cite &lt;a href=&quot;https://arxiv.org/abs/2608.25192&quot;&gt;the CRESSim-Neo paper&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2026cressim,
  title={CRESSim-Neo: A Batched GPU Simulation Engine for Surgical Robotics and Robot Learning},
  author={Ou, Yafei and Naheen, Ahnaf and Mussin, Tleukhan and Jarales, Hans and Chacko Moncy, Melwin and Tavakoli, Mahdi},
  journal={arXiv preprint arXiv:2608.25192},
  year={2026}
}

&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Ghost: 2 Big To Rig - Some Quick Thoughts</title><link>https://www.yafei.dev/posts/2026-08-31-ghost-2-big-to-rig/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-08-31-ghost-2-big-to-rig/</guid><description>Thoughts after watching Ghost: 2 Big To Rig (twice).</description><pubDate>Mon, 31 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;p&gt;I just finished watching &lt;em&gt;Ghost: 2 Big To Rig&lt;/em&gt; and really enjoyed it. I actually went to see it twice.&lt;/p&gt;
&lt;p&gt;Unfortunately, I couldn&apos;t find an IMAX screening in my city 😭&lt;/p&gt;
&lt;p&gt;It is impressive to see just how huge the whole production became. The visuals and sound are amazing (as usual).&lt;/p&gt;
&lt;p&gt;Having seen Ghost in Vancouver earlier this year, it was especially fun seeing the scale of the show again from a completely different perspective (and noticing some details in the performance that I missed during the actual show), as well as seeing everything going on behind the scenes.&lt;/p&gt;
&lt;p&gt;It does feel a little bittersweet knowing Ghost are on hiatus now, but after seeing the scale of everything they have been doing, I can understand why a break is needed.&lt;/p&gt;
&lt;p&gt;I will definitely be revisiting this one after the Blu-ray/DVD release, if there is one (I really hope so 🥺).&lt;/p&gt;
&lt;p&gt;Watch the official clip for “Umbra” here:&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo videoId=&quot;IysK_INTllA&quot; /&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>The Cost of Convenience: Ubuntu, Robotics, and the Loss of Control</title><link>https://www.yafei.dev/posts/2026-08-16-the-cost-of-convenience/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-08-16-the-cost-of-convenience/</guid><description>Over the past several years, I have become increasingly uncomfortable with two related trends: Linux becoming more centralized and opaque in the name of convenience, and robotics researchers becoming increasingly dependent on abstractions they often do not understand underneath.</description><pubDate>Sun, 16 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Over the past several years, I have become increasingly uncomfortable with two related trends: Linux becoming more centralized and opaque in the name of convenience, and robotics researchers becoming increasingly dependent on abstractions they often do not understand underneath. Ubuntu, ROS, Python environments, and containers are all useful technologies. The concern is what happens when useful abstractions become the &lt;strong&gt;only&lt;/strong&gt; layer people know.&lt;/p&gt;
&lt;p&gt;This article is an attempt to connect those trends.&lt;/p&gt;
&lt;h2&gt;Is Ubuntu Becoming Another Windows?&lt;/h2&gt;
&lt;p&gt;Calling Ubuntu &quot;another Windows&quot; is obviously provocative, and taken literally it is wrong. Ubuntu is still built overwhelmingly from free and open-source software. Its source code can be inspected, modified, redistributed, and forked in ways that Windows cannot. The point of the comparison is not licensing. It is the philosophy of the operating system.&lt;/p&gt;
&lt;p&gt;Ubuntu increasingly behaves less like one distribution participating in the Linux ecosystem and more like a vendor-controlled platform.&lt;/p&gt;
&lt;p&gt;Traditional Linux distributions tend to preserve an explicit relationship between the user and the system. The package manager matters. The repository matters. The build recipe matters. The dependency graph matters. If I install a Debian package, I generally understand that I am asking the distribution to integrate that software into the system using Debian&apos;s packaging model. If I use Arch, I can inspect a PKGBUILD and see, often quite directly, how upstream source turns into the files installed on my machine.&lt;/p&gt;
&lt;p&gt;This is not merely aesthetic. It is part of the administrative contract of a Unix-like system: the user should be able to understand what changed, why it changed, and which component is responsible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ubuntu has increasingly moved away from that model.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Snap is the clearest example. The objection to Snap is not simply that it is slower, larger, or technically different from &lt;code&gt;.deb&lt;/code&gt; packaging. The more important issue is that it changes the relationship between the distribution, the software publisher, and the machine owner.
Instead of software primarily being integrated into the distribution, Snap encourages applications to arrive as publisher-prepared bundles distributed through infrastructure closely associated with &lt;strong&gt;Canonical&lt;/strong&gt;.
Dependencies are increasingly hidden inside the application artifact rather than expressed as visible parts of the host system.&lt;/p&gt;
&lt;p&gt;This changes the question from:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;How has this software been integrated into my system?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;to:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Does the application run?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is a very different computing culture.&lt;/p&gt;
&lt;p&gt;The distinction becomes even more troubling when Ubuntu blurs the boundary between APT and Snap. A user typing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt install firefox
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;has a reasonable expectation that they are choosing the Debian packaging model: APT metadata, &lt;code&gt;.deb&lt;/code&gt; packages, distribution-managed dependencies, and software delivered through configured APT repositories.&lt;/p&gt;
&lt;p&gt;Yet Ubuntu has used transitional packages and other integration mechanisms to move applications from traditional packages to Snap. From the user&apos;s perspective, the familiar package-management interface may remain while the underlying distribution mechanism changes.&lt;/p&gt;
&lt;p&gt;One can defend this technically. Canonical can argue that users care about obtaining an application, not about the exact format in which it arrives; maintaining multiple packaging systems is expensive, application publishers want predictable environments, and bundled dependencies can simplify support.&lt;/p&gt;
&lt;p&gt;But that defense reveals the philosophical shift.&lt;/p&gt;
&lt;p&gt;In a &lt;strong&gt;traditional&lt;/strong&gt; Linux model, the delivery mechanism is part of the administrator&apos;s choice.
In a &lt;strong&gt;platform&lt;/strong&gt; model, the user chooses the application and the vendor decides how it should be delivered, which is the philosophy of Windows, macOS, Android, and other vendor-managed operating environments.&lt;/p&gt;
&lt;p&gt;The same tendency appears elsewhere in Ubuntu. Automatic update mechanisms, Canonical-managed services, Ubuntu Pro, extended security maintenance, entitlement checks, telemetry systems, and vendor infrastructure may each have reasonable individual justifications. Security maintenance costs money. Enterprise customers need predictable support. Automatic updates can protect users who would otherwise run vulnerable software indefinitely.&lt;/p&gt;
&lt;p&gt;The concern is not that any one of these features is uniquely malicious. The concern is what they become collectively.&lt;/p&gt;
&lt;p&gt;The operating system increasingly establishes an ongoing relationship between the user&apos;s machine and the company that produced the distribution. The vendor is no longer merely producing packages and publishing releases. It increasingly participates in application delivery, update policy, support entitlement, lifecycle management, and system services after installation.&lt;/p&gt;
&lt;p&gt;For an enterprise customer, this may be exactly what is wanted.&lt;/p&gt;
&lt;p&gt;For a traditional Linux user, it raises a more fundamental question:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why should the company that produced my distribution continue to exercise authority over my machine after I have installed it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This question becomes especially important because Ubuntu&apos;s influence extends far beyond its existing users. Hardware manufacturers support Ubuntu because it has many users. Software vendors test on Ubuntu because customers expect it. Tutorials assume Ubuntu because that is what beginners are likely to run. Research software documents Ubuntu installation because maintaining instructions for ten distributions is expensive.&lt;/p&gt;
&lt;p&gt;Every individual decision is rational.&lt;/p&gt;
&lt;p&gt;Together, they create a network effect.&lt;/p&gt;
&lt;p&gt;More Ubuntu users produce more Ubuntu-specific support. More Ubuntu-specific support makes alternative distributions less convenient. The reduced convenience pushes more users toward Ubuntu. Eventually, software can claim &quot;Linux support&quot; while in practice meaning &quot;we tested this on the currently supported Ubuntu LTS.&quot;&lt;/p&gt;
&lt;p&gt;Ubuntu therefore does not need a formal monopoly to acquire monopoly-like influence.&lt;/p&gt;
&lt;p&gt;Users remain legally free to choose Debian, Arch, Fedora, NixOS, openSUSE, or something else. But freedom in principle may not necessarily be freedom in practice.
If hardware documentation, research software, binary releases, vendor support, and third-party tutorials increasingly assume one distribution, the cost of exercising that freedom rises.&lt;/p&gt;
&lt;p&gt;ROS is a good example. Windows and macOS may be officially supported, but in practical robotics work the surrounding ecosystem--hardware drivers, vendor SDKs, tutorials, simulation tooling, and third-party ROS packages--is often much more strongly oriented toward Linux. Debian itself is only a Tier 3 platform for ROS 2 Lyrical, while Ubuntu 26.04 is Tier 1. RHEL/Fedora provides another Linux path, but with Tier 2 support it does not occupy anything close to Ubuntu’s position within the robotics community. Thus ROS may be formally cross-platform while Ubuntu remains the de facto platform.&lt;/p&gt;
&lt;p&gt;ROS 2 Lyrical &lt;a href=&quot;https://docs.ros.org/en/lyrical/Installation.html&quot;&gt;lists&lt;/a&gt; the following supported platforms even for building from source:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Building from source
--------------------

We support building ROS 2 from source on the following platforms:

* :doc:`Ubuntu Linux 26.04 &amp;lt;Installation/Alternatives/Ubuntu-Development-Setup&amp;gt;`
* :doc:`Ubuntu Linux 26.04 (Pixi) &amp;lt;Installation/Alternatives/Ubuntu-Development-Setup-Pixi&amp;gt;`
* :doc:`Windows 11 &amp;lt;Installation/Alternatives/Windows-Development-Setup&amp;gt;`
* :doc:`RHEL-10/Fedora &amp;lt;Installation/Alternatives/RHEL-Development-Setup&amp;gt;`
* :doc:`macOS &amp;lt;Installation/Alternatives/macOS-Development-Setup&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ubuntu can become effectively mandatory without ever being declared mandatory.&lt;/p&gt;
&lt;p&gt;The desktop itself illustrates the same tendency. Ubuntu Desktop is not a neutral collection of interchangeable components from which users are expected to construct their preferred environment. It presents a curated product: GNOME, Canonical&apos;s modifications, a chosen set of applications, predefined integration, and an intended workflow.&lt;/p&gt;
&lt;p&gt;Of course these components can be replaced. Linux remains Linux. Other Ubuntu flavors exist (&lt;em&gt;e.g.&lt;/em&gt;, &lt;a href=&quot;https://kubuntu.org/&quot;&gt;Kubuntu&lt;/a&gt;), and an experienced user can rebuild large portions of the system.&lt;/p&gt;
&lt;p&gt;But there is an important difference between &lt;strong&gt;something being technically replaceable&lt;/strong&gt; and &lt;strong&gt;a system being designed around replaceability&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Traditional Linux culture often treats composability as a first-class property. A window manager, display manager, shell, package source, service, or desktop environment is a component. The user chooses it because the machine belongs to the user.&lt;/p&gt;
&lt;p&gt;The increasingly product-oriented distribution instead says: this is the experience we have designed; customization occurs around that experience.&lt;/p&gt;
&lt;p&gt;Again, this resembles the direction of mainstream proprietary operating systems far more than it resembles the older Unix ideal.&lt;/p&gt;
&lt;p&gt;None of this makes Ubuntu equivalent to Windows. The distinction in licensing and source availability remains enormous. Nor does it mean Canonical&apos;s engineering decisions are irrational. In many cases Canonical is solving genuine problems created by Linux itself: fragmentation, dependency incompatibility, maintenance burden, security, poor application distribution, and the difficulty of supporting arbitrary combinations of system components.&lt;/p&gt;
&lt;p&gt;That is precisely why the trend deserves criticism.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Centralization rarely arrives by announcing itself as centralization. It arrives as a solution to inconvenience.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A centralized application store is easier for publishers. Bundled applications are easier to test. Automatic updates are easier for users. A single supported distribution is easier for hardware vendors. A preselected desktop is easier to document. A commercial support layer is easier for enterprises to purchase.&lt;/p&gt;
&lt;p&gt;Every step can make sense locally while producing an unhealthy result globally.&lt;/p&gt;
&lt;p&gt;The danger is not that Canonical will suddenly make Ubuntu proprietary. The danger is that Ubuntu becomes so deeply embedded as the default interpretation of &quot;Linux&quot; that the diversity of the wider ecosystem becomes increasingly theoretical, especially in fields such as robotics.&lt;/p&gt;
&lt;p&gt;This is therefore a betrayal of a different Linux tradition: that the operating system should remain legible, composable, decentralized, and ultimately subordinate to the person administering the machine.&lt;/p&gt;
&lt;p&gt;Ubuntu still gives the user freedom.&lt;/p&gt;
&lt;p&gt;The more uncomfortable question is whether it is building an ecosystem in which fewer users understand that freedom, fewer users exercise it, and progressively more infrastructure assumes that they will not.&lt;/p&gt;
&lt;h2&gt;Roboticists Who Don&apos;t Understand Their Computers&lt;/h2&gt;
&lt;p&gt;Robotics makes the problem especially visible: freedom is of limited practical value to users who do not understand the system they are supposedly free to control. Worse, the increasing abstraction and standardization of the ecosystem can reinforce that lack of understanding.&lt;/p&gt;
&lt;p&gt;The easier it becomes to treat Ubuntu, ROS, containers, and package managers as opaque infrastructure, the less incentive there is to understand what happens underneath. In turn, users who lack that understanding become even more dependent on the default platform and its abstractions.&lt;/p&gt;
&lt;p&gt;A surprising number of people working in the field do not have a strong grasp of basic computer systems.&lt;/p&gt;
&lt;p&gt;This is not a claim that roboticists are unintelligent, nor that everyone working on robotics should be a computer scientist. Robotics naturally attracts people from mechanical engineering, electrical engineering, controls, signal processing, computer vision, and many other disciplines. That diversity is one of the field&apos;s strengths.&lt;/p&gt;
&lt;p&gt;The problem is that modern robotics has become, to a large extent, a computing discipline without fully accepting the educational consequences of becoming one.&lt;/p&gt;
&lt;p&gt;In my own experience, I have encountered researchers and engineers who can work on sophisticated robotics problems but do not understand even the basic mechanics of building software: what compilation does, what linking does, why a linker cannot find a symbol, what a shared library is, or what a build system such as CMake is actually doing. This is not about knowing compiler theory or being able to write a linker. The problem is the absence of a basic mental model of how source code becomes a running program.&lt;/p&gt;
&lt;p&gt;The same problem appears in networking, operating systems, permissions, processes, and security. Remote-access services may be exposed casually because getting access to the robot is treated as the objective, while questions about authentication, network boundaries, or who else might be able to reach that service are treated as secondary concerns. Permissions are sometimes bypassed rather than understood. Networking problems are debugged by repeatedly changing settings until something works rather than by reasoning about routes, ports, interfaces, or trust boundaries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;These are not exotic areas of computer science. They are basic properties of the machines on which modern robots depend.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This becomes particularly important because a robot is not simply an algorithm attached to some motors. A modern robot is a networked computer system with actuators attached to it. It may contain multiple computers, cameras, microphones, wireless interfaces, remote-management services, GPUs, embedded controllers, cloud connections, and software from many different vendors. A mistake in an ordinary desktop application may crash the application. A mistake in a robotic system may expose cameras, provide remote control of the machine, or affect something moving in the physical world.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.theverge.com/tech/925696/yarbo-robot-lawn-mower-hack-remote-control-camera-access-mqtt&quot;&gt;The security problems discovered in Yarbo robotic lawnmowers&lt;/a&gt; are an example. Researchers found serious weaknesses involving remote access and privileged credentials. What is striking about such failures is not that they required some obscure cryptographic breakthrough to understand. Yarbo intentionally built remote administrative access, but apparently designed its security model extraordinarily poorly.&lt;/p&gt;
&lt;p&gt;It is tempting to describe such incidents simply as cybersecurity failures, but that may be too narrow. They can also reveal a more fundamental lack of computer systems knowledge--or an organization that failed to ensure such knowledge was present in the design and review process. One does not need to be a professional security researcher to understand that the same root password should not be hard-coded across deployed machines, or that remotely accessible control interfaces require careful authentication and isolation.&lt;/p&gt;
&lt;p&gt;The organizational problem is equally important. In robotics research groups and startups, an engineer may be hired because of expertise in computer vision, controls, mechanical design, or machine learning and then gradually become responsible for software deployment, networking, remote access, build infrastructure, or system administration simply because somebody has to do it. Expertise in one technical area is quietly treated as if it implies competence in all the others.&lt;/p&gt;
&lt;p&gt;It does not.&lt;/p&gt;
&lt;p&gt;Knowing how to train a vision model is not the same thing as knowing how to build a computer system. Knowing control theory does not imply understanding operating-system privileges. Expertise in embedded electronics does not automatically imply competence in network security. These are different bodies of knowledge, and robotics increasingly requires them to interact.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ROS both responds to and reinforces this situation.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ROS is enormously valuable precisely because it hides a great deal of systems complexity. It provides communication abstractions, package conventions, launch mechanisms, tooling, and a common structure that allows researchers to focus on the robotics problem rather than repeatedly rebuilding infrastructure.&lt;/p&gt;
&lt;p&gt;That is good engineering.&lt;/p&gt;
&lt;p&gt;The problem begins when abstraction becomes a substitute for understanding rather than a tool built on top of it. A researcher may learn which ROS command to run without understanding what processes are being created, how packages were built, how libraries are found, how communication occurs between machines, or why changing an environment variable suddenly fixes the system.&lt;/p&gt;
&lt;p&gt;As long as the abstraction works, this can appear perfectly sufficient.&lt;/p&gt;
&lt;p&gt;Robotics, however, is a field in which abstractions leak constantly. Drivers fail. Devices disappear. Networks become unreliable. Libraries conflict. Timing changes. GPUs run out of memory. Processes crash. Permissions prevent access to hardware. A binary built against one library version is deployed onto another machine. A researcher may then wonder why &quot;it stops working&quot; after simply copy-pasting a built binary onto another machine. Suddenly the researcher has crossed the boundary between &quot;using ROS&quot; and &quot;understanding the computer.&quot;&lt;/p&gt;
&lt;p&gt;The problem, therefore, is not abstraction itself. Good abstractions are one of the reasons modern robotics is possible. Nor should every robotics researcher be expected to become an operating-system specialist, a network engineer, and a compiler developer.&lt;/p&gt;
&lt;p&gt;But there has to be a minimum level of systems literacy below the abstraction.&lt;/p&gt;
&lt;p&gt;A person deploying software onto a networked physical machine should understand, at least conceptually, processes, users and privileges, networking, compilation and linking, libraries, dependencies, and basic security boundaries. These are no longer peripheral skills for robotics. They are part of understanding the experimental apparatus itself.&lt;/p&gt;
&lt;p&gt;Yet the incentives of robotics research frequently push in the opposite direction. The researcher is rewarded for the new controller, perception algorithm, planning method, or benchmark result. Time spent understanding a linker problem, improving deployment infrastructure, reviewing remote-access security, or making a build system robust &lt;strong&gt;rarely produces a paper&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The rational response is therefore to learn only enough computing to make the experiment run.&lt;/p&gt;
&lt;p&gt;ROS, Ubuntu, Docker, Python environments, and increasingly sophisticated tooling make this easier than ever. That is useful, but it also means that someone can operate remarkably high in the software stack while having only a vague idea of what is underneath.&lt;/p&gt;
&lt;p&gt;The result is a strange contradiction: robotics is one of the most systems-oriented areas of engineering, yet its research culture can allow people to work on extremely complex systems without requiring them to understand the computers at the center of those systems.&lt;/p&gt;
&lt;p&gt;When everything works, that knowledge can look unnecessary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When it does not, the robot quickly reminds us otherwise.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;When Everything Becomes &lt;code&gt;pip install&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;This pressure to learn only enough computing to make the experiment run has shaped the tooling culture of modern robotics. Python, Conda, prebuilt wheels, containers, and increasingly complete software environments all reduce the amount of systems knowledge required to get from an idea to a working result.&lt;/p&gt;
&lt;p&gt;That is one of their greatest strengths.&lt;/p&gt;
&lt;p&gt;It is also where the next problem begins.&lt;/p&gt;
&lt;p&gt;Python became dominant in robotics research for good reasons. It shortens the distance between an idea and an experiment. But the workflow around it increasingly encourages users to think of software as something that can simply be installed, imported, and executed, while the native libraries, binary interfaces, compiler toolchains, drivers, and runtime dependencies underneath disappear from view.&lt;/p&gt;
&lt;p&gt;A command such as&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pip install torch
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;looks simple, but what it installs is not simply &quot;Python code.&quot; Packages such as PyTorch depend heavily on compiled C/C++ and CUDA components. Current PyTorch binaries may bring their own CUDA runtime libraries rather than relying directly on the system CUDA toolkit.&lt;/p&gt;
&lt;p&gt;This becomes messy as soon as the Python world interacts with software outside it.&lt;/p&gt;
&lt;p&gt;A user may have a Conda environment containing PyTorch and its CUDA runtime while also using C++ code built against the CUDA installation on the host system. Different processes can legitimately use different CUDA runtimes, but problems begin when native extensions, plugins, build environments, or runtime search paths cross those boundaries. Which library gets loaded can then depend on search paths, RPATHs, environment variables, and the order in which libraries are loaded.&lt;/p&gt;
&lt;p&gt;At that point, &quot;which CUDA version am I using?&quot; no longer has an obvious answer.&lt;/p&gt;
&lt;p&gt;The same problem appears when building Python wheels inside Conda environments. A package may compile a native extension and silently discover headers or shared libraries from the host system. The resulting wheel works on the developer&apos;s machine, but it is not really self-contained: it has accidentally acquired dependencies on libraries outside the environment. Later, another version of the same library may appear inside Conda, the environment may be moved to another computer, or the system libraries may change.&lt;/p&gt;
&lt;p&gt;The failure then looks mysterious only because the dependency boundary was never understood in the first place.&lt;/p&gt;
&lt;p&gt;This is one of the strange properties of the modern Python scientific ecosystem: it gives the appearance of being high-level and self-contained while resting on an increasingly complicated collection of native software underneath. Python package managers solve dependencies at the package level, but native software still ultimately lives in the world of compilers, ABIs, shared objects, dynamic loaders, drivers, and operating-system search paths.&lt;/p&gt;
&lt;p&gt;Those worlds do not always align cleanly.&lt;/p&gt;
&lt;p&gt;The problem is made worse by the fact that many users do not know they are crossing that boundary at all. A wheel is experienced as a Python package even when most of the important work is being performed by compiled libraries. A Conda environment is experienced as an isolated environment even when software built inside it has linked against the host. A machine-learning library is experienced as a Python library even when its execution depends on a particular relationship between CUDA userspace libraries and the host NVIDIA driver stack.&lt;/p&gt;
&lt;p&gt;When this becomes difficult enough, the standard answer is increasingly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Just use Docker.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Docker is extremely useful, especially for reproducibility and deployment. In robotics it can make sense to distribute different components as separate images, isolate dependencies, pin versions, and deploy the same software across many machines. I have even seen commercial robots delivered with several Docker containers running different parts of the system, and this is becoming a common architectural pattern.&lt;/p&gt;
&lt;p&gt;But Docker is also increasingly treated as a universal cure for dependency problems that nobody wants to understand.&lt;/p&gt;
&lt;p&gt;A container can make a complicated dependency graph reproducible without making that dependency graph understood.&lt;/p&gt;
&lt;p&gt;The GPU case demonstrates this especially well. A Docker image containing CUDA software is not actually independent of the host GPU stack. The NVIDIA kernel driver still lives on the host, and GPU access from containers depends on additional machinery such as the &lt;a href=&quot;https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.19.1/index.html&quot;&gt;NVIDIA Container Toolkit&lt;/a&gt;. The supposedly self-contained container therefore still relies on a carefully maintained boundary between the host driver, device nodes, container runtime, CUDA userspace libraries, and the application inside the container.&lt;/p&gt;
&lt;p&gt;The abstraction becomes something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;host Linux kernel
    ↓
host NVIDIA driver
    ↓
NVIDIA Container Toolkit
    ↓
container runtime
    ↓
CUDA libraries inside the container
    ↓
PyTorch / TensorRT / ROS
    ↓
robotics application
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When everything works, the user may only see the last line.&lt;/p&gt;
&lt;p&gt;When it stops working, suddenly the difference between the host driver and CUDA runtime matters. So does the container runtime configuration. So do device permissions. So does the way GPU devices are passed into the container.&lt;/p&gt;
&lt;p&gt;And robotics makes the container boundary even less clean.&lt;/p&gt;
&lt;p&gt;A web service can often live comfortably inside a container and communicate through a network socket. A robot frequently needs direct access to cameras, serial devices, USB devices, CAN interfaces, GPUs, shared memory, real-time scheduling, and sometimes host networking. Each requirement punches another hole through the supposedly isolated environment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The closer containerized software gets to physical hardware, the less convincing the idea of the completely self-contained container becomes.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Again, this does not mean containers are bad engineering. Quite the opposite: when the boundaries are deliberately understood and designed, they can be one of the best ways to deploy a complicated robotics system.&lt;/p&gt;
&lt;p&gt;The problem is using them as a substitute for understanding those boundaries.&lt;/p&gt;
&lt;p&gt;There is a recurring pattern:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;native dependencies become difficult
        ↓
use a Python environment

Python and native dependencies become difficult
        ↓
use Conda

Conda and system dependencies become difficult
        ↓
use Docker

Docker and hardware integration become difficult
        ↓
add runtime hooks, device mappings, host networking,
privileges, volumes, and vendor-specific tooling
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The dependency problem has not disappeared. It has moved.&lt;/p&gt;
&lt;p&gt;Meanwhile, the stack has gained another abstraction layer, and the person operating it may understand less of what is happening underneath.&lt;/p&gt;
&lt;p&gt;This is why the Pythonic workflow matters beyond language preference. It reflects a broader change in research culture. The dominant goal is increasingly to make software easy to consume: install the package, activate the environment, start the container, run the launch file.&lt;/p&gt;
&lt;p&gt;That is enormously productive, and research incentives reward it. The researcher wants to test an algorithm, not spend three days understanding ELF symbol resolution or CUDA library loading.&lt;/p&gt;
&lt;p&gt;But there is a cost when this convenience becomes the &lt;strong&gt;only&lt;/strong&gt; model of computing that the researcher knows.&lt;/p&gt;
&lt;p&gt;Python itself is not the problem. Conda is not the problem. Docker is not the problem. ROS is not the problem. Each solves a real and difficult problem.&lt;/p&gt;
&lt;p&gt;The problem appears when each abstraction is used to cover the previous abstraction without anyone maintaining a clear mental model of the complete system.&lt;/p&gt;
&lt;p&gt;At some point, a robotics researcher may be using Python code inside a Conda environment inside a Docker container, calling into C++ and CUDA libraries, communicating through ROS, accessing GPU and hardware devices through runtime-specific mechanisms, on an Ubuntu system whose own software stack they do not fully understand.&lt;/p&gt;
&lt;p&gt;Everything may work.&lt;/p&gt;
&lt;p&gt;But when it does not, the debugging problem is no longer a Python problem, a ROS problem, a Docker problem, or an Ubuntu problem.&lt;/p&gt;
&lt;p&gt;It is a computer-systems problem.&lt;/p&gt;
&lt;p&gt;And that is precisely the knowledge the workflow has made easiest to avoid learning.&lt;/p&gt;
&lt;h2&gt;Conclusion: Convenience, Abstraction, and the Loss of Control&lt;/h2&gt;
&lt;p&gt;None of the technologies discussed here are inherently the problem. Ubuntu, ROS, Python, Conda, and Docker all became popular because they solve real problems and make difficult work easier.&lt;/p&gt;
&lt;p&gt;The problem is what happens when convenience becomes dependence, abstraction becomes opacity, and standardization becomes centralization.&lt;/p&gt;
&lt;p&gt;Ubuntu risks turning “Linux” into a platform defined by one vendor. ROS reinforces that platform because doing otherwise is expensive. Robotics culture often rewards getting the experiment to run more than understanding the system that runs it. Pythonic workflows and containers then make it increasingly possible to operate high in the stack without ever learning what lies underneath.&lt;/p&gt;
&lt;p&gt;Each step is individually rational. Together, they can produce an ecosystem that is easier to use but harder to understand, easier to standardize but harder to escape, and increasingly dependent on abstractions that fewer people are capable of debugging when they fail. Coding agents may accelerate that trend by making it possible to repair systems through language rather than through understanding.&lt;/p&gt;
&lt;p&gt;Perhaps the real question is not whether these tools give us enough freedom.&lt;/p&gt;
&lt;p&gt;It is whether we will still know what that freedom means when the abstractions stop working.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Written by Yafei Ou, assisted by ChatGPT (2026-08-15).&lt;br /&gt;
© 2026 Yafei Ou. All rights reserved.&lt;/p&gt;
</content:encoded></item><item><title>便利的代价：Ubuntu、机器人技术与控制权的丧失</title><link>https://www.yafei.dev/posts/2026-08-16-the-cost-of-convenience/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-08-16-the-cost-of-convenience/</guid><description>过去几年里，我对两个相互关联的趋势越发感到不安：Linux 以便利之名变得越来越集中化和不透明，而机器人研究人员越来越依赖各种抽象，却往往并不理解这些抽象背后的底层原理。</description><pubDate>Sun, 16 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;过去几年里，我对两个相互关联的趋势越发感到不安：Linux 以便利之名变得越来越集中化和不透明，而机器人研究人员越来越依赖各种抽象，却往往并不理解这些抽象背后的底层原理。Ubuntu、ROS、Python 环境和容器都是有用的技术。但令人担忧的是，当有用的抽象成为人们&lt;strong&gt;唯一&lt;/strong&gt;了解的层面时，会发生什么。&lt;/p&gt;
&lt;p&gt;本文试图将这两个趋势联系起来。&lt;/p&gt;
&lt;h2&gt;Ubuntu 正在变成另一个 Windows 吗？&lt;/h2&gt;
&lt;p&gt;称 Ubuntu 为“另一个 Windows”显然是一种挑衅，从字面上看也是错误的。Ubuntu 仍然绝大部分由自由和开源软件构建。其源代码可以被检查、修改、再分发和分叉，这是 Windows 所不能的。然而，这里比较的重点不在于开源许可，而在于操作系统的哲学。&lt;/p&gt;
&lt;p&gt;Ubuntu 越来越不像一个参与 Linux 生态系统的发行版，而更像一个由厂商控制的平台。&lt;/p&gt;
&lt;p&gt;传统的 Linux 发行版倾向于保持用户与系统之间明确的关系。包管理器很重要，软件仓库很重要，构建配方很重要，依赖关系图很重要。如果我安装一个 Debian 包，我大致明白我是在要求发行版使用 Debian 的打包模型将该软件集成到系统中。如果我使用 Arch，我可以查看 PKGBUILD，并且通常能够很直接地看到上游源代码如何变成安装在我机器上的文件。&lt;/p&gt;
&lt;p&gt;这不仅仅是审美问题。它是类 Unix 系统管理契约的一部分：用户应该能够理解什么发生了变化、为什么发生变化，以及哪个组件对此负责。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ubuntu 越来越偏离了这种模式。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Snap 是最明显的例子。对 Snap 的反对并不仅仅在于它更慢、更大，或者技术上与 &lt;code&gt;.deb&lt;/code&gt; 打包不同。更重要的问题是，它改变了发行版、软件发布者和机器所有者之间的关系。&lt;/p&gt;
&lt;p&gt;软件不再是主要由发行版集成，Snap 鼓励应用程序以发布者准备好的捆绑包形式到达，并通过与 &lt;strong&gt;Canonical&lt;/strong&gt; 密切关联的基础设施进行分发。&lt;/p&gt;
&lt;p&gt;依赖项越来越多地隐藏在应用程序工件内部，而不是作为主机系统的可见部分来表达。&lt;/p&gt;
&lt;p&gt;这改变了问题的本质，从：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;这个软件是如何集成到我的系统中的？&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;变成了：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;这个应用程序能运行吗？&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;这是一种截然不同的计算文化（computing culture）。&lt;/p&gt;
&lt;p&gt;当 Ubuntu 模糊了 APT 和 Snap 之间的界限时，这种区别就更加令人不安了。用户输入&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt install firefox
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;时，有一个合理的期望：他们选择的是 Debian 打包模型——APT 元数据、&lt;code&gt;.deb&lt;/code&gt; 包、由发行版管理的依赖项，以及通过配置好的 APT 仓库交付的软件。&lt;/p&gt;
&lt;p&gt;然而，Ubuntu 却使用过渡包和其他集成机制将应用程序从传统包迁移到 Snap。从用户的角度看，熟悉的包管理界面可能保持不变，但底层的分发机制却已经改变。&lt;/p&gt;
&lt;p&gt;人们当然可以从技术上为此辩护。Canonical 可以辩称，用户关心的是获取应用程序，而不是它到达的具体格式；维护多个打包系统成本高昂；应用程序发布者想要可预测的环境；捆绑依赖可以简化支持。&lt;/p&gt;
&lt;p&gt;但这种辩护恰恰揭示了哲学上的转变。&lt;/p&gt;
&lt;p&gt;在&lt;strong&gt;传统的&lt;/strong&gt; Linux 模型中，交付机制是管理员的选择的一部分。&lt;/p&gt;
&lt;p&gt;在&lt;strong&gt;平台&lt;/strong&gt;模型中，用户选择应用程序，而厂商决定它应该如何交付——这正是 Windows、macOS、Android 以及其他由厂商管理的操作环境的哲学。&lt;/p&gt;
&lt;p&gt;同样的趋势也出现在 Ubuntu 的其他方面。自动更新机制、Canonical 管理的服务、Ubuntu Pro、扩展安全维护、授权检查、遥测系统和厂商基础设施，每一项可能都有各自合理的理由。安全维护需要成本。企业客户需要可预测的支持。自动更新可以保护那些本来会无限期运行有漏洞软件的用户。&lt;/p&gt;
&lt;p&gt;令人担忧的不是其中某一项功能本身怀有恶意，而是它们共同构成了什么。&lt;/p&gt;
&lt;p&gt;操作系统越来越多地在用户机器和生产该发行版的公司之间建立一种持续的关系。厂商不再仅仅生产软件包和发布版本。它在安装后越来越多地参与应用程序交付、更新策略、支持授权、生命周期管理和系统服务。&lt;/p&gt;
&lt;p&gt;对于企业客户来说，这可能正是他们想要的。&lt;/p&gt;
&lt;p&gt;对于传统的 Linux 用户来说，这引发了一个更根本的问题：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;为什么生产我的发行版的公司，在我安装之后仍然应该对我的机器行使权力？&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这个问题变得尤为重要，因为 Ubuntu 的影响力远远超出了其现有用户。硬件制造商支持 Ubuntu，因为它有很多用户。软件厂商在 Ubuntu 上测试，因为客户期望如此。教程默认使用 Ubuntu，因为那是初学者最可能运行的系统。研究软件只记录 Ubuntu 的安装步骤，因为为十个发行版维护说明文档成本太高。&lt;/p&gt;
&lt;p&gt;每一个单独的决策都是理性的。&lt;/p&gt;
&lt;p&gt;但它们共同创造了一种网络效应。&lt;/p&gt;
&lt;p&gt;更多的 Ubuntu 用户产生了更多 Ubuntu 专属的支持。更多的 Ubuntu 专属支持使得其他发行版变得更不方便。便利性的降低又推动更多用户转向 Ubuntu。最终，软件可以声称“支持 Linux”，而实际上意思是“我们只在当前受支持的 Ubuntu LTS 上测试过”。&lt;/p&gt;
&lt;p&gt;因此，Ubuntu 不需要形式上的垄断就能获得类似垄断的影响力。&lt;/p&gt;
&lt;p&gt;用户名义上仍然可以自由选择 Debian、Arch、Fedora、NixOS、openSUSE 或其他发行版。但原则上的自由在实践中未必是真正的自由。&lt;/p&gt;
&lt;p&gt;如果硬件文档、研究软件、二进制发布、厂商支持和第三方教程越来越多地默认某一个发行版，那么行使这种自由的成本就会上升。&lt;/p&gt;
&lt;p&gt;ROS 就是一个很好的例子。Windows 和 macOS 可能被官方支持，但在实际的机器人工作中，周边生态系统——硬件驱动、厂商 SDK、教程、仿真工具和第三方 ROS 包——往往更强烈地面向 Linux。Debian 本身在 ROS 2 Lyrical 中只是第三层（Tier 3）平台，而 Ubuntu 26.04 是第一层（Tier 1）。RHEL/Fedora 提供了另一条 Linux 路径，但作为第二层（Tier 2）支持，它在机器人社区中的地位远不能与 Ubuntu 相提并论。因此，ROS 可能在形式上是跨平台的，而 Ubuntu 仍然是事实上的平台。&lt;/p&gt;
&lt;p&gt;甚至对于从源码构建，ROS 2 Lyrical 也只&lt;a href=&quot;https://docs.ros.org/en/lyrical/Installation.html&quot;&gt;列出了&lt;/a&gt;以下受支持的平台：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Building from source
--------------------

We support building ROS 2 from source on the following platforms:

* :doc:`Ubuntu Linux 26.04 &amp;lt;Installation/Alternatives/Ubuntu-Development-Setup&amp;gt;`
* :doc:`Ubuntu Linux 26.04 (Pixi) &amp;lt;Installation/Alternatives/Ubuntu-Development-Setup-Pixi&amp;gt;`
* :doc:`Windows 11 &amp;lt;Installation/Alternatives/Windows-Development-Setup&amp;gt;`
* :doc:`RHEL-10/Fedora &amp;lt;Installation/Alternatives/RHEL-Development-Setup&amp;gt;`
* :doc:`macOS &amp;lt;Installation/Alternatives/macOS-Development-Setup&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ubuntu 可以在从未被宣布为强制的情况下，变得事实上不可或缺。&lt;/p&gt;
&lt;p&gt;桌面环境本身也体现了同样的趋势。Ubuntu 桌面并不是一个中立的、由可互换组件构成的集合，期望用户从中构建自己偏好的环境。它呈现的是一个精心策划的产品：GNOME、Canonical 的修改、一组选定的应用程序、预定义的集成以及预期的工作流程。&lt;/p&gt;
&lt;p&gt;当然，这些组件是可以替换的。Linux 仍然是 Linux。还存在其他 Ubuntu 变体（例如 &lt;a href=&quot;https://kubuntu.org/&quot;&gt;Kubuntu&lt;/a&gt;），有经验的用户可以重建系统的大部分内容。&lt;/p&gt;
&lt;p&gt;但&lt;strong&gt;某样东西在技术上可替换&lt;/strong&gt;与&lt;strong&gt;一个系统围绕可替换性来设计&lt;/strong&gt;之间，存在着重要的区别。&lt;/p&gt;
&lt;p&gt;传统的 Linux 文化往往将可组合性视为一等属性。窗口管理器、显示管理器、shell、软件源、服务或桌面环境都是一个组件。用户选择它，是因为机器属于用户。&lt;/p&gt;
&lt;p&gt;越来越产品化的发行版则说：这是我们设计的体验，定制则需要围绕这个体验进行。&lt;/p&gt;
&lt;p&gt;同样，这更接近主流专有操作系统的方向，而远非更古老的 Unix 理想。&lt;/p&gt;
&lt;p&gt;这些都不能使 Ubuntu 等同于 Windows。许可证和源代码可用性方面的区别仍然是巨大的。这也不意味着 Canonical 的工程决策是非理性的。在许多情况下，Canonical 正在解决 Linux 本身造成的真正问题：碎片化、依赖不兼容、维护负担、安全性、糟糕的应用程序分发，以及支持任意系统组件组合的困难。&lt;/p&gt;
&lt;p&gt;这正是这个趋势值得批评的原因。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;集中化很少以宣布自己是集中化的方式到来。它是以解决不便的方案的形式到来的。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;集中式应用商店对发布者来说更容易。捆绑应用程序更容易测试。自动更新对用户来说更容易。单一受支持的发行版对硬件厂商来说更容易。预选的桌面环境更容易编写文档。商业支持体系对企业来说也更容易购买。&lt;/p&gt;
&lt;p&gt;每一步在局部上都是合理的，但在整体上却产生了一个不健康的结果。&lt;/p&gt;
&lt;p&gt;危险不在于 Canonical 会突然将 Ubuntu 变成专有软件。危险在于 Ubuntu 变得如此深入地嵌入为“Linux”的默认解释，以至于更广泛生态系统的多样性变得越来越理论化，尤其是在机器人等领域。&lt;/p&gt;
&lt;p&gt;因此，这是对另一种 Linux 传统的背叛：操作系统应该保持可读性、可组合性、去中心化，并且最终服从于管理机器的人。&lt;/p&gt;
&lt;p&gt;Ubuntu 仍然给予用户自由。&lt;/p&gt;
&lt;p&gt;但令人不安的问题是，它是否正在构建一个生态系统，在其中更少的用户理解这种自由，更少的用户行使这种自由，而越来越多的基础设施默认他们不会行使这种自由。&lt;/p&gt;
&lt;h2&gt;不懂自己计算机的机器人研究者&lt;/h2&gt;
&lt;p&gt;机器人技术使这个问题尤为明显：对于不理解他们理应能够自由控制的系统的用户来说，自由的实用价值是有限的。更糟糕的是，生态系统日益增加的抽象化和标准化可能加剧这种理解的缺乏。&lt;/p&gt;
&lt;p&gt;将 Ubuntu、ROS、容器和包管理器视为不透明的基础设施越容易，理解底层发生了什么就越没有动力。反过来，缺乏这种理解的用户变得更加依赖默认平台及其抽象。&lt;/p&gt;
&lt;p&gt;令人惊讶的是，在这个领域工作的人中，有相当多的人对基本的计算机系统没有扎实的掌握。&lt;/p&gt;
&lt;p&gt;这并不是说机器人研究者不聪明，也不是说每个从事机器人技术的人都应该是计算机科学家。机器人技术自然地吸引来自机械工程、电气工程、控制、信号处理、计算机视觉和许多其他学科的人。这种多样性是该领域的优势之一。&lt;/p&gt;
&lt;p&gt;问题在于，现代机器人技术在很大程度上已经成为一个计算学科，却没有完全接受成为计算学科所带来的教育后果。&lt;/p&gt;
&lt;p&gt;根据我自己的经验，我遇到过一些研究人员和工程师，他们能够处理复杂的机器人问题，却不理解构建软件的基本机制：编译做什么、链接做什么、为什么链接器找不到符号、什么是共享库，或者像 CMake 这样的构建系统实际上在做什么。这与了解编译器理论或能够编写链接器无关。问题在于缺乏关于源代码如何变成运行程序的基本心智模型。&lt;/p&gt;
&lt;p&gt;同样的问题出现在网络、操作系统、权限、进程和安全领域。远程访问服务可能被随意暴露，因为访问机器人往往被当作最终目标，而关于认证、网络边界或还有谁可能到达该服务的问题则被视为次要问题。权限有时被绕过而不是被理解。网络问题的调试方式是反复更改设置直到某样东西能工作，而不是通过推理路由、端口、接口或信任边界。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;这些并不是计算机科学中的冷门领域。它们是现代机器人所依赖的机器的基本属性。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;这一点尤为重要，因为机器人不仅仅是一个附着在电机上的算法。现代机器人是一台联网的计算机系统，上面附着执行器。它可能包含多台计算机、摄像头、麦克风、无线接口、远程管理服务、GPU、嵌入式控制器、云连接以及来自许多不同厂商的软件。普通桌面应用程序中的错误可能导致应用程序崩溃。机器人系统中的错误可能暴露摄像头、提供机器的远程控制，或影响在物理世界中移动的东西。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.theverge.com/tech/925696/yarbo-robot-lawn-mower-hack-remote-control-camera-access-mqtt&quot;&gt;Yarbo 机器人割草机中发现的安全问题&lt;/a&gt;就是一个例子。研究人员发现了涉及远程访问和特权凭据的严重弱点。这类失败之所以引人注目，并不是因为理解它们需要某种艰深的密码学突破：Yarbo 有意构建了远程管理访问，但显然其安全模型设计得极其糟糕。&lt;/p&gt;
&lt;p&gt;人们很容易将这类事件简单地描述为网络安全失败，但这可能过于狭隘了。它们也可能揭示出更根本的计算机系统知识的缺乏——或者一个未能确保这种知识存在于设计和审查过程中的组织。不需要成为专业安全研究人员也能理解，同一个 root 密码不应该硬编码在所有部署的机器上、可远程访问的控制接口需要仔细的认证和隔离。&lt;/p&gt;
&lt;p&gt;组织层面的问题同样重要。在机器人研究小组和初创公司中，工程师可能因为计算机视觉、控制、机械设计或机器学习方面的专长而被聘用，然后逐渐因为“总得有人来做”而负责软件部署、网络、远程访问、构建基础设施或系统管理。某一技术领域的专长被悄然视为意味着所有其他领域的能力。&lt;/p&gt;
&lt;p&gt;恰恰相反。&lt;/p&gt;
&lt;p&gt;知道如何训练视觉模型与知道如何构建计算机系统不是一回事。懂控制理论并不意味着理解操作系统权限。嵌入式电子方面的专长并不自动意味着网络安全的胜任能力。这些都是不同的知识体系，而机器人技术越来越需要它们相互作用。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ROS 既回应了这种状况，也强化了这种状况。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ROS 非常有价值，正是因为它隐藏了大量的系统复杂性。它提供了通信抽象、包约定、启动机制、工具和通用结构，使研究人员能够专注于机器人问题，而不是反复重建基础设施。&lt;/p&gt;
&lt;p&gt;这是好的工程。&lt;/p&gt;
&lt;p&gt;然而，当抽象成为理解的替代品，而不是建立在其上的工具时，问题就开始了。研究人员可能学会运行哪个 ROS 命令，却不理解正在创建什么进程、包是如何构建的、库是如何找到的、机器之间如何通信，或者为什么更改一个环境变量突然就修复了系统。&lt;/p&gt;
&lt;p&gt;只要抽象正常工作，这看起来完全够用。&lt;/p&gt;
&lt;p&gt;然而，机器人技术是一个抽象层经常失效的领域。驱动失败，设备消失，网络变得不可靠，库冲突，时序变化，GPU 内存耗尽，进程崩溃，权限阻止硬件访问，针对一个库版本构建的二进制文件被部署到另一台机器上——研究人员可能仅仅把构建好的二进制文件复制粘贴到另一台机器上后，就困惑于为什么“它不工作了”。突然间，研究人员跨越了“使用 ROS”和“理解计算机”之间的界限。&lt;/p&gt;
&lt;p&gt;因此，问题不在于抽象本身。好的抽象是现代机器人技术得以可能的原因之一。也不应该期望每个机器人研究人员都成为操作系统专家、网络工程师和编译器开发者。&lt;/p&gt;
&lt;p&gt;但在抽象之下，必须有一个最低限度的系统素养水平。&lt;/p&gt;
&lt;p&gt;一个将软件部署到联网物理机器上的人，至少应该在概念上理解进程、用户和权限、网络、编译和链接、库、依赖关系以及基本的安全边界。这些不再是机器人技术的边缘技能。它们是理解实验装置本身的一部分。&lt;/p&gt;
&lt;p&gt;然而，机器人研究的激励机制往往朝着相反的方向推动。研究人员因新的控制器、感知算法、规划方法或基准测试结果而获得奖励。花时间理解链接器问题、改进部署基础设施、审查远程访问安全性或提升构建系统的鲁棒性，&lt;strong&gt;很少能产出一篇论文&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;因此，理性的反应是只学习足够的计算知识来让实验运行起来。&lt;/p&gt;
&lt;p&gt;ROS、Ubuntu、Docker、Python 环境和日益复杂的工具使这比以往任何时候都更容易。这是有用的，但这也意味着一个人可以在软件栈的相当高的层次上操作，却对下面的东西只有一个模糊的概念。&lt;/p&gt;
&lt;p&gt;结果是一个奇怪的矛盾：机器人技术是最以系统为导向的工程领域之一，但它的研究文化却允许人们在极其复杂的系统上工作，而不要求他们理解位于这些系统核心的计算机。&lt;/p&gt;
&lt;p&gt;当一切正常时，这些知识看起来可能是多余的。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;当出现不正常时，机器人会迅速提醒我们事实并非如此。&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;当一切都变成 &lt;code&gt;pip install&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;这种“只学够让实验跑起来就行”的压力，塑造了现代机器人技术的工具文化。Python、Conda、预编译 wheel、容器以及越来越完整的软件环境，都减少了从想法到可用结果所需的系统知识量。&lt;/p&gt;
&lt;p&gt;这是它们最大的优势之一。&lt;/p&gt;
&lt;p&gt;也是下一个问题的起点。&lt;/p&gt;
&lt;p&gt;Python 在机器人研究中占据主导地位是有充分理由的。它缩短了想法与实验之间的距离。但围绕它的工作流程越来越鼓励用户将软件视为可以简单地安装、导入和执行的东西，而底层的原生库、二进制接口、编译器工具链、驱动程序和运行时依赖则从视野中消失。&lt;/p&gt;
&lt;p&gt;像&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pip install torch
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样的命令看起来很简单，但它安装的不仅仅是“Python 代码”。像 PyTorch 这样的包严重依赖编译过的 C/C++ 和 CUDA 组件。当前的 PyTorch 二进制文件可能自带 CUDA 运行时库，而不是直接依赖系统 CUDA 工具包。&lt;/p&gt;
&lt;p&gt;一旦 Python 世界与其外部的软件交互，这就变得混乱了。&lt;/p&gt;
&lt;p&gt;用户可能有一个包含 PyTorch 及其 CUDA 运行时的 Conda 环境，同时又在使用针对主机系统上 CUDA 安装构建的 C++ 代码。不同的进程可以合法地使用不同的 CUDA 运行时，但当原生扩展、插件、构建环境或运行时搜索路径跨越这些边界时，问题就开始了。哪个库被加载，可能取决于搜索路径、RPATH、环境变量以及库的加载顺序。&lt;/p&gt;
&lt;p&gt;到了这个时候，“我使用的是哪个 CUDA 版本？”就不再有一个显而易见的答案了。&lt;/p&gt;
&lt;p&gt;在 Conda 环境内构建 Python wheel 时也会出现同样的问题。一个包可能编译一个原生扩展，并悄无声息地从主机系统发现头文件或共享库。生成的 wheel 在开发者的机器上能工作，但它实际上并不是完全独立的：它意外地获得了对环境外部库的依赖。后来，另一个版本的同一个库可能出现在 Conda 内部，环境可能被移到另一台计算机上，或者系统库可能发生变化。&lt;/p&gt;
&lt;p&gt;于是，失败之所以看起来神秘，只是因为依赖边界从一开始就未被理解。&lt;/p&gt;
&lt;p&gt;这是现代 Python 科学生态系统的奇怪属性之一：它给人一种高层次的、自包含的表象，但其底层却建立在一个日益复杂的原生软件集合之上。Python 包管理器在包层面上解决依赖问题，但原生软件最终仍然生活在编译器、ABI、共享对象、动态加载器、驱动程序和操作系统搜索路径的世界里。&lt;/p&gt;
&lt;p&gt;这些世界并不总是能干净地对齐。&lt;/p&gt;
&lt;p&gt;更糟糕的是，许多用户根本不知道他们正在跨越那个边界。wheel 被体验为一个 Python 包，即使大部分重要工作是由编译库执行的。Conda 环境被体验为一个隔离的环境，即使在其中构建的软件已经链接到了主机。机器学习库被体验为一个 Python 库，即使它的执行依赖于 CUDA 用户空间库与主机 NVIDIA 驱动栈之间的特定关系。&lt;/p&gt;
&lt;p&gt;当这变得足够困难时，标准答案越来越倾向于：&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;干脆用 Docker 就行了。&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Docker 非常有用，尤其是在可复现性和部署方面。在机器人技术中，将不同组件作为独立镜像分发、隔离依赖、固定版本，并在许多机器上部署相同的软件，是有意义的。我甚至见过商业机器人交付时运行着几个 Docker 容器来承载系统的不同部分，这正在成为一种常见的架构模式。&lt;/p&gt;
&lt;p&gt;但 Docker 也越来越被视为一种万能的解决方案，用来处理没有人愿意去理解的依赖问题。&lt;/p&gt;
&lt;p&gt;容器可以使复杂的依赖图可复现，而不使该依赖图被理解。&lt;/p&gt;
&lt;p&gt;GPU 的情况特别清楚地说明了这一点。包含 CUDA 软件的 Docker 镜像实际上并不独立于主机 GPU 栈。NVIDIA 内核驱动仍然在主机上，容器中的 GPU 访问依赖于额外的机制，如 &lt;a href=&quot;https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.19.1/index.html&quot;&gt;NVIDIA Container Toolkit&lt;/a&gt;。因此，所谓自包含的容器仍然依赖于主机驱动、设备节点、容器运行时、CUDA 用户空间库和容器内应用程序之间精心维护的边界。&lt;/p&gt;
&lt;p&gt;这个抽象大致是这样的：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;主机 Linux 内核
    ↓
主机 NVIDIA 驱动
    ↓
NVIDIA Container Toolkit
    ↓
容器运行时
    ↓
容器内的 CUDA 库
    ↓
PyTorch / TensorRT / ROS
    ↓
机器人应用程序
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;当一切正常时，用户可能只看到最后一行。&lt;/p&gt;
&lt;p&gt;当它停止工作时，主机驱动和 CUDA 运行时之间的区别突然就重要了。容器运行时配置也很重要。设备权限也很重要。GPU 设备传入容器的方式也很重要。&lt;/p&gt;
&lt;p&gt;而机器人技术使容器边界变得更加不干净。&lt;/p&gt;
&lt;p&gt;Web 服务通常可以舒适地运行在容器内，通过网络套接字通信。机器人则经常需要直接访问摄像头、串行设备、USB 设备、CAN 接口、GPU、共享内存、实时调度，有时还需要主机网络。每一项需求都在所谓隔离的环境上又打了一个洞。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;容器化软件越接近物理硬件，完全自包含容器的想法就越不可信。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;同样，这并不意味着容器是糟糕的工程。恰恰相反：当边界被有意识地理解和设计时，它们可以成为部署复杂机器人系统的最佳方式之一。&lt;/p&gt;
&lt;p&gt;问题在于将它们用作理解这些边界的替代品。&lt;/p&gt;
&lt;p&gt;有一个反复出现的模式：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;原生依赖变得困难
        ↓
使用 Python 环境

Python 和原生依赖变得困难
        ↓
使用 Conda

Conda 和系统依赖变得困难
        ↓
使用 Docker

Docker 和硬件集成变得困难
        ↓
添加运行时钩子、设备映射、主机网络、
特权、卷和厂商特定工具
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;依赖问题并没有消失。它只是转移了。&lt;/p&gt;
&lt;p&gt;与此同时，栈上又增加了一层抽象，而操作它的人可能对其底层发生的事情了解得更少了。&lt;/p&gt;
&lt;p&gt;这正是 Python 化工作流程值得关注的原因，不仅仅是语言偏好的问题。它反映了研究文化中更广泛的变革。主导目标越来越倾向于让软件易于消费：安装包，激活环境，启动容器，运行 launch 文件。&lt;/p&gt;
&lt;p&gt;这极具生产力，研究激励机制也奖励这种做法。研究人员想要测试算法，而不是花三天时间理解 ELF 符号解析或 CUDA 库加载。&lt;/p&gt;
&lt;p&gt;但当这种便利成为研究人员所知道的&lt;strong&gt;唯一&lt;/strong&gt;计算模型时，代价就出现了。&lt;/p&gt;
&lt;p&gt;Python 本身不是问题。Conda 不是问题。Docker 不是问题。ROS 不是问题。每一个都解决了一个真实而困难的问题。&lt;/p&gt;
&lt;p&gt;但当每一个抽象被用来掩盖前一个抽象，而没有人对完整系统保持清晰的心智模型时，问题就出现了。&lt;/p&gt;
&lt;p&gt;在某个时刻，机器人研究人员可能正在使用 Docker 容器内 Conda 环境中的 Python 代码，调用 C++ 和 CUDA 库，通过 ROS 通信，通过运行时特定机制访问 GPU 和硬件设备，运行在他们自己并不完全理解的 Ubuntu 系统之上。&lt;/p&gt;
&lt;p&gt;一切可能都能工作。&lt;/p&gt;
&lt;p&gt;但当它不工作时，调试问题就不再是 Python 问题、ROS 问题、Docker 问题或 Ubuntu 问题了。&lt;/p&gt;
&lt;p&gt;它是一个计算机系统问题。&lt;/p&gt;
&lt;p&gt;而这恰恰是这种工作流程最容易让人避免学习的知识。&lt;/p&gt;
&lt;h2&gt;结论：便利、抽象与控制权的丧失&lt;/h2&gt;
&lt;p&gt;本文讨论的技术本身都不是问题所在。Ubuntu、ROS、Python、Conda 和 Docker 之所以流行，是因为它们解决了真实的问题，使困难的工作变得更容易。&lt;/p&gt;
&lt;p&gt;问题在于当便利变成依赖、抽象变成不透明、标准化变成集中化时会发生什么。&lt;/p&gt;
&lt;p&gt;Ubuntu 有把“Linux”变成一个由单一厂商定义的平台的风险。ROS 强化了这个平台，因为不这样做成本太高。机器人文化往往更奖励让实验运行起来，而不是理解运行实验的系统。Python 化的工作流程和容器则使人们越来越有可能在栈的高层操作，而不必学习底层的任何东西。&lt;/p&gt;
&lt;p&gt;每一步在个体上都是理性的。但它们共同产生了一个更容易使用却更难理解的生态系统，更容易标准化却更难摆脱，并且越来越依赖那些出故障后很少有人能调试的抽象。编码智能体（coding agent）可能通过使人们能够借助语言而非理解来修复系统，从而加速这一趋势。&lt;/p&gt;
&lt;p&gt;也许真正的问题不在于这些工具是否给了我们足够的自由。&lt;/p&gt;
&lt;p&gt;而在于当抽象停止工作时，我们是否还知道那种自由意味着什么。&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;本文由欧亚非撰写，ChatGPT 辅助完成（2026-08-15）。原文以英文撰写，并由 DeepSeek 辅助翻译（2026-08-16）；最终审阅与润色由欧亚非完成。&lt;br /&gt;
© 2026 Yafei Ou。保留所有权利。&lt;/p&gt;
</content:encoded></item><item><title>Introducing CRESSim-Ultrasound</title><link>https://www.yafei.dev/posts/2026-08-15-cressim-ultrasound/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-08-15-cressim-ultrasound/</guid><description>A CUDA-only ultrasound simulation library, with a C API and deformation-aware scatterer tracking.</description><pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import ResponsiveImageGrid from &quot;../../../../components/misc/ResponsiveImageGrid.astro&quot;;
import ImageUltrasoundRestTissue from &quot;./ultrasound-rest-tissue.png&quot;;
import ImageUltrasoundDeformedTissue from &quot;./ultrasound-deformed-tissue.png&quot;;&lt;/p&gt;
&lt;p&gt;CRESSim-Ultrasound is a CUDA-only ultrasound simulation library. It is a lightweight reimplementation of &lt;a href=&quot;https://github.com/sigurdstorve/OpenBCSim&quot;&gt;OpenBCSim&lt;/a&gt; designed for GPU-based ultrasound simulation and can be easily integrated into robotics and simulation workflows.&lt;/p&gt;
&lt;p&gt;The source code is available on GitHub:&lt;/p&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/CRESSim-Ultrasound&quot;}&lt;/p&gt;
&lt;h2&gt;What it provides&lt;/h2&gt;
&lt;p&gt;The library exposes a C API for constructing scan sequences, configuring a Gaussian excitation signal and beam profile, binding scatterers, and running the simulation. Its main compute interface keeps scatterers, scanlines, and RF output buffers on the GPU, avoiding unnecessary CPU-GPU transfers.&lt;/p&gt;
&lt;p&gt;For applications in which the probe pose changes frequently, scanlines can be supplied from a device-resident buffer instead of rebuilding and uploading a CPU-side scan sequence. The simulator also supports CUDA streams and an external CUDA completion semaphore, which makes it practical to compose with other GPU workloads (such as Vulkan).&lt;/p&gt;
&lt;h2&gt;Deformation-aware scatterers&lt;/h2&gt;
&lt;p&gt;One useful extension is the deformation tracker. It generates dense ultrasound scatterers from sparse input points, records their initial configuration, and updates the scatterers as those input points move. This provides a direct path for coupling the ultrasound image formation pipeline to a deformable-tissue simulator (such as when using the material point method) while keeping the update on the GPU.&lt;/p&gt;
&lt;p&gt;&amp;lt;ResponsiveImageGrid
firstSrc={ImageUltrasoundRestTissue.src}
firstAlt=&quot;Simulated ultrasound scan of undeformed tissue&quot;
firstCaption=&quot;Ultrasound simulation with the probe over tissue in its rest configuration&quot;
secondSrc={ImageUltrasoundDeformedTissue.src}
secondAlt=&quot;Simulated ultrasound scan of deformed tissue&quot;
secondCaption=&quot;Ultrasound simulation after the tissue has deformed&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;The current implementation uses a Gaussian beam profile. It is not yet a feature-complete replacement for OpenBCSim; in particular, lookup-table beam-profile support is not implemented.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Written by Yafei Ou, assisted by ChatGPT (2026-08-15).&lt;br /&gt;
© 2026 Yafei Ou. All rights reserved.&lt;/p&gt;
</content:encoded></item><item><title>CRESSim-Ultrasound：基于 CUDA 的轻量级超声仿真库</title><link>https://www.yafei.dev/posts/2026-08-15-cressim-ultrasound/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-08-15-cressim-ultrasound/</guid><description>一个基于 CUDA 实现的超声仿真库，提供 C API 和支持形变的散射体跟踪。</description><pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import ResponsiveImageGrid from &quot;../../../../components/misc/ResponsiveImageGrid.astro&quot;;
import ImageUltrasoundRestTissue from &quot;./ultrasound-rest-tissue.png&quot;;
import ImageUltrasoundDeformedTissue from &quot;./ultrasound-deformed-tissue.png&quot;;&lt;/p&gt;
&lt;p&gt;CRESSim-Ultrasound 是一个基于 CUDA 实现的超声仿真库。它是 &lt;a href=&quot;https://github.com/sigurdstorve/OpenBCSim&quot;&gt;OpenBCSim&lt;/a&gt; 的轻量级重新实现，面向 GPU 超声仿真，并且可以方便地集成到机器人和仿真工作流中。&lt;/p&gt;
&lt;p&gt;源代码已在 GitHub 开源：&lt;/p&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/CRESSim-Ultrasound&quot;}&lt;/p&gt;
&lt;h2&gt;主要功能&lt;/h2&gt;
&lt;p&gt;该库提供 C 语言应用程序接口（C API），用于构建扫描序列、配置高斯激励信号和高斯声束轮廓、绑定散射体，以及运行仿真。其主要计算接口将散射体、扫描线和射频（RF）输出缓冲区保留在 GPU 上，从而避免不必要的主机端（CPU）与 GPU 之间的数据传输。&lt;/p&gt;
&lt;p&gt;对于探头位姿频繁变化的应用，扫描线可直接由设备端缓冲区提供，无需重新构建并上传主机端的扫描序列。模拟器还支持 CUDA 流和用于完成通知的外部 CUDA 信号量，因此可与其他 GPU 工作负载（如 Vulkan）组合使用。&lt;/p&gt;
&lt;h2&gt;支持形变的散射体&lt;/h2&gt;
&lt;p&gt;一个实用的扩展功能是形变跟踪器。它可以根据稀疏输入点生成稠密的超声散射体，记录散射体的参考构形，并在输入点移动时更新散射体位置。这为超声成像流程与可形变组织模拟器（例如基于物质点法的模拟器）在 GPU 上直接耦合提供了途径。&lt;/p&gt;
&lt;p&gt;&amp;lt;ResponsiveImageGrid
firstSrc={ImageUltrasoundRestTissue.src}
firstAlt=&quot;未形变组织的模拟超声扫描&quot;
firstCaption=&quot;组织处于参考构形时，探头上方的超声仿真&quot;
secondSrc={ImageUltrasoundDeformedTissue.src}
secondAlt=&quot;形变组织的模拟超声扫描&quot;
secondCaption=&quot;组织形变后的超声仿真&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;当前的代码实现使用高斯声束轮廓。它尚不是 OpenBCSim 的完整替代品；尤其是尚未实现基于查找表（LUT）的声束轮廓支持。&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;作者：欧亚非与 ChatGPT（2026-08-15）。原文以英文撰写，并在 ChatGPT 的协助下翻译；最终审阅与润色由欧亚非完成。&lt;br /&gt;
© 2026 欧亚非。保留所有权利。&lt;/p&gt;
</content:encoded></item><item><title>Simulation of Surgical Suturing Using Position-Based Dynamics and the Material Point Method for Robot Reinforcement Learning</title><link>https://www.yafei.dev/posts/pub-mussin2026suturing/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-mussin2026suturing/</guid><description>By Tleukhan Mussin, Yafei Ou, Mahdi Tavakoli. IEEE RAS/EMBS 11th International Conference on Biomedical Robotics and Biomechatronics (BioRob), 2026.</description><pubDate>Wed, 29 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Simulation of Surgical Suturing Using Position-Based Dynamics and the Material Point Method for Robot Reinforcement Learning&lt;/strong&gt;&lt;br /&gt;
Tleukhan Mussin, Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;IEEE RAS/EMBS 11th International Conference on Biomedical Robotics and Biomechatronics (BioRob)&lt;/em&gt;, 2026&lt;/p&gt;
&lt;p&gt;arXiv: &lt;a href=&quot;https://arxiv.org/abs/2607.27494&quot;&gt;https://arxiv.org/abs/2607.27494&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Recent advances in robotics research have created a strong demand for high-performance simulators. Surgical robotics simulation faces unique challenges due to the need to model diverse objects, such as rigid instruments, soft tissue, and fluids. While many studies simulate sutures or soft tissue independently, only a few have considered the complete soft-tissue suturing scenario, including the contact between sutures and deformable tissue during suture insertion. Building on previous work, this paper presents a novel suturing simulation environment using sutures modelled by position-based dynamics (PBD) and soft bodies modelled by the material point method (MPM) while considering two-way contact with frictional and drag forces. We introduce a contact coupling method between the PBD suture and the MPM soft tissue, enabling visually plausible suture-tissue interactions. The simulator is optimized for GPU execution with parallel scenes using multiple CUDA streams, and we present a Reinforcement Learning (RL) environment for autonomous suturing sub-tasks, including needle insertion, driving, and extraction. Using ML-Agents, RL agents trained in the simulator show stable learning and achieve 80% and 68% success rates in needle insertion and extraction, respectively, under the strictest distance threshold.&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@misc{mussin2026simulation,
  title={Simulation of Surgical Suturing Using Position-Based Dynamics and the Material Point Method for Robot Reinforcement Learning},
  author={Mussin, Tleukhan and Ou, Yafei and Tavakoli, Mahdi},
  year={2026},
  eprint={2607.27494},
  archivePrefix={arXiv},
  primaryClass={cs.RO},
  url={https://arxiv.org/abs/2607.27494}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>A Quick Hack for Texturing a 3D Model</title><link>https://www.yafei.dev/posts/2026-03-16-a-quick-hack-for-texturing/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-03-16-a-quick-hack-for-texturing/</guid><description>Quick experiment generating textures for a RealSense D435i 3D model.</description><pubDate>Mon, 16 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import ImageWrapper from &quot;../../../../components/misc/MarkdownImageWrapper.astro&quot;;
import ImageRealSenseGenerated from &quot;./realsense-generated.png&quot;;
import ImageRealSense from &quot;./realsense-d435i.png&quot;;
import ImageRealSense2 from &quot;./realsense-d435i-2.png&quot;;&lt;/p&gt;
&lt;p&gt;Although the CAD model (SolidWorks) for the RealSense D435i camera is available in the official documentation, I could not find a textured 3D model suitable for simulation or rendering.&lt;/p&gt;
&lt;p&gt;So I tried a quick workaround: generating views of each side of the camera using images of the device found online, with the help of Nano Banana Pro.&lt;/p&gt;
&lt;p&gt;See one of the generated views below:&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={ImageRealSenseGenerated.src}
alt=&quot;Generated bottom view of RealSense D435i&quot;
caption=&quot;Generated bottom view of RealSense D435i using Nano Banana Pro&quot;
class=&quot;w-full h-full&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;These generated views can then be used as textures during UV unwrapping (e.g., using Project from View). By simply aligning the vertices with the image, the model can quickly obtain a usable texture.&lt;/p&gt;
&lt;p&gt;This is far from perfect, but given the minimal cost (except for the Google One subscription fee), the results are surprisingly usable.&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={ImageRealSense.src}
alt=&quot;Shaded RealSense D435i model in Blender&quot;
caption=&quot;Shaded RealSense D435i model in Blender&quot;
class=&quot;w-full h-full&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={ImageRealSense2.src}
alt=&quot;Shaded RealSense D435i model in Blender&quot;
caption=&quot;Shaded RealSense D435i model in Blender&quot;
class=&quot;w-full h-full&quot;
/&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Written by Yafei Ou and reviewed for grammar and conceptual accuracy by ChatGPT (2026-03-16).&lt;br /&gt;
© 2026 Yafei Ou. All rights reserved.&lt;/p&gt;
</content:encoded></item><item><title>一个快速为 3D 模型添加纹理的小技巧</title><link>https://www.yafei.dev/posts/2026-03-16-a-quick-hack-for-texturing/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2026-03-16-a-quick-hack-for-texturing/</guid><description>为 RealSense D435i 3D 模型快速生成纹理。</description><pubDate>Mon, 16 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import ImageWrapper from &quot;../../../../components/misc/MarkdownImageWrapper.astro&quot;;
import ImageRealSenseGenerated from &quot;./realsense-generated.png&quot;;
import ImageRealSense from &quot;./realsense-d435i-2.png&quot;;
import ImageRealSense2 from &quot;./realsense-d435i.png&quot;;&lt;/p&gt;
&lt;p&gt;尽管在官方文档中可以找到 RealSense D435i 相机的 CAD 模型（SolidWorks），但是我没找到能够用于仿真或渲染的带纹理三维模型。&lt;/p&gt;
&lt;p&gt;因此，我尝试了一个简单的变通方法：借助 Nano Banana Pro，利用网上找到的设备图片生成相机各个侧面的视图。&lt;/p&gt;
&lt;p&gt;下面是生成视图中的一个示例：&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={ImageRealSenseGenerated.src}
alt=&quot;Generated bottom view of RealSense D435i&quot;
caption=&quot;Nano Banana Pro 生成的 RealSense D435i 底部视图&quot;
class=&quot;w-full h-full&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;这些生成的视图可以在进行 UV 展开时用作纹理（例如使用“从视图投影”）。只需要将模型的顶点与图像对齐，就可以快速为模型赋予一个可用的纹理。&lt;/p&gt;
&lt;p&gt;虽说远非完美，但考虑到几乎不费什么成本（除了 Google One 订阅费），已经相当实用。&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={ImageRealSense.src}
alt=&quot;Shaded RealSense D435i model in Blender&quot;
caption=&quot;Blender 中带材质的 RealSense D435i 模型&quot;
class=&quot;w-full h-full&quot;
/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ImageWrapper
src={ImageRealSense2.src}
alt=&quot;Shaded RealSense D435i model in Blender&quot;
caption=&quot;Blender 中带材质的 RealSense D435i 模型&quot;
class=&quot;w-full h-full&quot;
/&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;作者：欧亚非；语法与概念准确性由 ChatGPT 审校。原文以英文撰写，并在 ChatGPT 的协助下翻译；最终审阅与润色由欧亚非完成。&lt;br /&gt;
© 2026 欧亚非。保留所有权利。&lt;/p&gt;
</content:encoded></item><item><title>CRESSim–MPM: A Material Point Method Library for Surgical Soft Body Simulation with Cutting and Suturing</title><link>https://www.yafei.dev/posts/pub-ou2025cressim/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2025cressim/</guid><description>By Yafei Ou, Mahdi Tavakoli. 2025 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2025.</description><pubDate>Sun, 19 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;CRESSim-MPM: A Material Point Method Library for Surgical Soft Body Simulation with Cutting and Suturing&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;2025 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;IEEE Xplore: &lt;a href=&quot;https://ieeexplore.ieee.org/document/11247388&quot;&gt;https://ieeexplore.ieee.org/document/11247388&lt;/a&gt;&lt;br /&gt;
arXiv: &lt;a href=&quot;https://arxiv.org/abs/2502.18437&quot;&gt;https://arxiv.org/abs/2502.18437&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;A number of recent studies have focused on developing surgical simulation platforms to train machine learning (ML) agents or models with synthetic data for surgical assistance. While existing platforms excel at tasks such as rigid body manipulation and soft body deformation, they struggle to simulate more complex soft body behaviors like cutting and suturing. A key challenge lies in modeling soft body fracture and splitting using the finite-element method (FEM), which is the predominant approach in current platforms. Additionally, the two-way suture needle/thread contact inside a soft body is further complicated when using FEM. In this work, we use the material point method (MPM) for such challenging simulations and propose new rigid geometries and soft-rigid contact methods specifically designed for them. We introduce CRESSim-MPM, a GPU-accelerated MPM library that integrates multiple MPM solvers and incorporates surgical geometries for cutting and suturing, serving as a specialized physics engine for surgical applications. It is further integrated into Unity, requiring minimal modifications to existing projects for soft body simulation. We demonstrate the simulator&apos;s capabilities in real-time simulation of cutting and suturing on soft tissue and provide an initial performance evaluation of different MPM solvers when simulating varying numbers of particles.&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo videoId=&quot;IwEsBQ508YU&quot; /&amp;gt;&lt;/p&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;h3&gt;CUDA/C++ library&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/cressim-mpm&quot;}&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2025cressim,
  title={CRESSim-MPM: A Material Point Method Library for Surgical Soft Body Simulation with Cutting and Suturing},
  author={Ou, Yafei and Tavakoli, Mahdi},
  journal={arXiv preprint arXiv:2502.18437},
  year={2025}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Learning Autonomous Surgical Irrigation and Suction with the da Vinci Research Kit Using Reinforcement Learning</title><link>https://www.yafei.dev/posts/pub-ou2024learning/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2024learning/</guid><description>By Yafei Ou, Mahdi Tavakoli. IEEE Transactions on Automation Science and Engineering, 2025.</description><pubDate>Wed, 04 Jun 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Learning Autonomous Surgical Irrigation and Suction with the da Vinci Research Kit Using Reinforcement Learning&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;IEEE Transactions on Automation Science and Engineering&lt;/em&gt;, vol. 22, pp. 16753-16767, 2025&lt;/p&gt;
&lt;p&gt;IEEE Xplore: &lt;a href=&quot;https://ieeexplore.ieee.org/abstract/document/11023631&quot;&gt;https://ieeexplore.ieee.org/abstract/document/11023631&lt;/a&gt;&lt;br /&gt;
arXiv: &lt;a href=&quot;https://arxiv.org/abs/2411.14622&quot;&gt;https://arxiv.org/abs/2411.14622&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;The irrigation-suction process is a common procedure to rinse and clean up the surgical field in minimally invasive surgery (MIS). In this process, surgeons first irrigate liquid, typically saline, into the surgical scene for rinsing and diluting the contaminant, and then suction the liquid out of the surgical field. While recent advances have shown promising results in the application of reinforcement learning (RL) for automating surgical subtasks, fewer studies have explored the automation of fluid-related tasks. In this work, we explore the automation of both steps in the irrigation-suction procedure and train two vision-based RL agents to complete irrigation and suction autonomously. To achieve this, a platform is developed for creating simulated surgical robot learning environments and for training agents, and two simulated learning environments are built for irrigation and suction with visually plausible fluid rendering capabilities. With techniques such as domain randomization (DR) and carefully designed reward functions, two agents are trained in the simulator and transferred to the real world. Individual evaluations of both agents show satisfactory real-world results. With an initial amount of around 5 grams of contaminants, the irrigation agent ultimately achieved an average of 2.21 grams remaining after a manual suction. As a comparison, fully manual operation by a human results in 1.90 grams remaining. The suction agent achieved 2.64 and 2.24 grams of liquid remaining across two trial groups with more than 20 and 30 grams of initial liquid in the container. Fully autonomous irrigation-suction trials reduce the contaminant in the container from around 5 grams to an average of 2.42 grams, although yielding a higher total weight remaining (4.40) due to residual liquid not suctioned. Further information about the project is available at &lt;a href=&quot;https://tbs-ualberta.github.io/CRESSim/&quot;&gt;this https URL&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo videoId=&quot;yvgTuXm1IwQ&quot; /&amp;gt;&lt;/p&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;h3&gt;CRESSim (Unity Project)&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;tbs-ualberta/cressim&quot;}&lt;/p&gt;
&lt;h3&gt;PhysX 5 for Unity&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/physx5-for-unity&quot;}&lt;/p&gt;
&lt;h3&gt;PhysX 5 for Unity Native Plugin (C++)&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/physx5-native-plugin&quot;}&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2025learning,
  title={Learning autonomous surgical irrigation and suction with the da vinci research kit using reinforcement learning},
  author={Ou, Yafei and Tavakoli, Mahdi},
  journal={IEEE Transactions on Automation Science and Engineering},
  year={2025},
  volume={22},
  pages={16753-16767},
  publisher={IEEE}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Thoughts on Modern C++</title><link>https://www.yafei.dev/posts/2025-05-17-thoughts-cpp/</link><guid isPermaLink="true">https://www.yafei.dev/posts/2025-05-17-thoughts-cpp/</guid><description>Some thoughts on C++ based on my own experience.</description><pubDate>Sat, 17 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Modern C++ is undeniably powerful.
But, as with any programming language, it is also often hated by many.
And there are certainly reasons.&lt;/p&gt;
&lt;h2&gt;The Legacy&lt;/h2&gt;
&lt;p&gt;I have been using C++ for around a year for some projects, but without formal training or specific tutorials.
I really started learning it by reading Nvidia&apos;s PhysX codebase, which I found very well-organized and performance-driven.
PhysX has been used by many games--as well as game engines like Unity.
On the other hand, the codebase is far from being &quot;modern&quot; from many C++ users&apos; view.
STL is not even used--no smart pointers, no &lt;code&gt;std::vector&lt;/code&gt;, all implemented within PhysX in an old fashioned way.&lt;/p&gt;
&lt;p&gt;It is not difficult to make some guesses as to the reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PhysX was initially developed around 20 years ago when the standard hadn&apos;t even introduced the modern features;&lt;/li&gt;
&lt;li&gt;PhysX really wants to squeeze that last bit of performance, especially on low-end devices;&lt;/li&gt;
&lt;li&gt;PhysX should support those devices that your regular program won&apos;t run on, &lt;em&gt;e.g.&lt;/em&gt; Nintendo Switch (NS). I don&apos;t even know how much of the standard Nintendo has implemented for the NS, as it is completely proprietary.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I am not sure how each of these points has contributed to this design, and there are likely other factors influencing PhysX’s architecture.
But here&apos;s the practical question: &lt;strong&gt;should we always use modern C++ features when starting a new project now?&lt;/strong&gt;
I do not have the answer myself, but since I learned C++ by reading PhysX&apos;s codebase, I have stayed away from many modern features.&lt;/p&gt;
&lt;h2&gt;The Confusing Standard&lt;/h2&gt;
&lt;p&gt;I do like many of the modern additions and changes to the C++ standard, which simplify and unify many aspects.
Still, the standard’s wording sometimes leaves even experienced users confused.
I once blamed my own skill level until I read &lt;a href=&quot;https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1839r7.html&quot;&gt;P1839R7&lt;/a&gt; and realized ambiguities (and possibly defects) in the standard are a common headache.
Below is quoted from the paper:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void print_hex(int n) {
    unsigned char* a = (unsigned char*)(&amp;amp;n);
    for (int i = 0; i &amp;lt; sizeof(int); ++i)
        printf(&quot;%02x &quot;, a[i]);
}

int main() {
    print_hex(123456);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;In C, this is a valid program. On a little-endian machine where &lt;code&gt;sizeof(int) == 4&lt;/code&gt;, this will print &lt;code&gt;40 e2 01 00&lt;/code&gt;. In C++, this is widely assumed to be valid as well, and this functionality is widely used in existing code bases (think of binary file formats, hex viewers, and many other low-level use cases).&lt;/p&gt;
&lt;p&gt;However, surprisingly, in C++ this code has undefined behaviour under the current specification. In fact, it is impossible in C++ to directly access the object representation of an object (i.e. to read its underlying bytes), even for built-in types such as int. Instead, we would have to use memcpy to copy the bytes into a separate array of &lt;code&gt;unsigned char&lt;/code&gt;, and access them from there. However, this workaround only works for trivially copyable types. It also directly violates one of the fundamental principles of C++: to leave no room for a lower-level language.&lt;/p&gt;
&lt;p&gt;The goal of this paper is to provide the necessary wording fixes to make accessing object representations such as in the code above defined behaviour. Existing compilers already assume that this should be valid. The goal of the paper is therefore to not require any changes to existing compilers or existing code, but to legalise existing code that already works in practice and was always intended to be valid.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Practically, compiler implementations and their documentation are the de facto standard, rather than the formal C++ standard.
One example is &lt;a href=&quot;https://stackoverflow.com/questions/11373203/accessing-inactive-union-member-and-undefined-behavior&quot;&gt;&lt;code&gt;union&lt;/code&gt; type punning&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;cstdint&amp;gt;

union Pun {
    std::uint32_t i;
    float         f;
};

int main() {
    Pun u;
    u.i = 0x3F800000;      // Bit pattern for 1.0f in IEEE-754
    std::cout &amp;lt;&amp;lt; u.f      // Reads the float interpretation
              &amp;lt;&amp;lt; std::endl;
    return 0;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The use case is well-defined by the C standard, but is UB in C++.
The C++ standard does not define the behavior (likely deliberately) and leaves more freedom for compilers&apos; implementation.
Practically I don&apos;t see any compiler that does not support this.
But it is very confusing to look up and be certain.
GCC states this explicitly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The practice of reading from a different union member than the one most recently written to (called “type-punning”) is common. Even with &lt;code&gt;-fstrict-aliasing&lt;/code&gt;, type-punning is allowed, provided the memory is accessed through the union type. So, the code above works as expected. See Structures, Unions, Enumerations, and Bit-Fields.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;However, I can&apos;t find any information about MSVC&apos;s treatment on this case, although it is obviously supported.&lt;/p&gt;
&lt;p&gt;The ambiguity on the wording of the standard, either by design or by oversight, makes it almost a common practice to wait for at least 5 years before a standard can be used until things stabilize.
There seems to be no hope for improvements in the situation.&lt;/p&gt;
&lt;h2&gt;How About CUDA?&lt;/h2&gt;
&lt;p&gt;CUDA&apos;s rise for GPGPU, and especially with recent hype in machine learning, has attracted another unique group of C++ users.
NVCC&apos;s implementation of C++ is very unique, as the code is compiled for the GPU device instead of the CPU.
This adds an additional layer of confusion.&lt;/p&gt;
&lt;p&gt;One example is pointer casting.
Using this for type punning is UB that violates the strict aliasing rule (although at least MSVC shouldn&apos;t have trouble with this).
It is usually more proper to use &lt;code&gt;union&lt;/code&gt; or &lt;code&gt;memcpy&lt;/code&gt; to achieve this (although &lt;code&gt;union&lt;/code&gt; doesn&apos;t seem portable as per the standard), but Nvidia&apos;s &lt;a href=&quot;https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#atomic-functions&quot;&gt;official documentation&lt;/a&gt; implies that at least this will definitely work for their GPUs.
Below is taken from the documentation:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#if __CUDA_ARCH__ &amp;lt; 600
__device__ double atomicAdd(double* address, double val)
{
    unsigned long long int* address_as_ull =
                              (unsigned long long int*)address;
    unsigned long long int old = *address_as_ull, assumed;

    do {
        assumed = old;
        old = atomicCAS(address_as_ull, assumed,
                        __double_as_longlong(val +
                               __longlong_as_double(assumed)));

    // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN)
    } while (assumed != old);

    return __longlong_as_double(old);
}
#endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Casting from a &lt;code&gt;double*&lt;/code&gt; to a &lt;code&gt;unsigned long long int*&lt;/code&gt; and dereferencing it is obviously UB.
But this code snippet suggests that it should be well-defined, at least for device code.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;My experience with developing a cross-platform C++/CUDA project has been painful, and the aspects mentioned above have been lingering in my mind since the beginning.&lt;/p&gt;
&lt;p&gt;There has not been a practical alternative to C++ at least for CUDA programming (or even broadly, most GPGPU programming).
I guess the only way is to live with it, live with a confusing standard, and live with UBs in my code.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Written by Yafei Ou and reviewed for grammar and conceptual accuracy by ChatGPT (o4-mini-high).&lt;br /&gt;
© 2025 Yafei Ou. All rights reserved.&lt;/p&gt;
</content:encoded></item><item><title>Autonomous Soft-Tissue Needle Steering Using Reinforcement Learning Guided by Human Input</title><link>https://www.yafei.dev/posts/pub-ou2024autonomous-2/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2024autonomous-2/</guid><description>By Yafei Ou, Mahdi Tavakoli. Journal of Medical Robotics Research, 2024.</description><pubDate>Tue, 24 Dec 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Autonomous Soft-Tissue Needle Steering Using Reinforcement Learning Guided by Human Input&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;Journal of Medical Robotics Research&lt;/em&gt;, vol. 09, no. 03n04, 2024.&lt;/p&gt;
&lt;p&gt;Link: &lt;a href=&quot;https://www.worldscientific.com/doi/abs/10.1142/S2424905X24400105&quot;&gt;https://www.worldscientific.com/doi/abs/10.1142/S2424905X24400105&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Soft-tissue needle steering, where a deformable needle is inserted into the tissue to guide its tip to a desired position, is a common minimally invasive surgery (MIS) procedure. The diverse types of needles and complex tissue dynamics limit the use of existing approaches that utilize models of the needle and the tissue for automating the task. In this work, we employ a data-driven approach using deep reinforcement learning (DRL) to achieve autonomous needle steering by viewing it as a multi-goal reinforcement learning problem. Human interventions are incorporated during training to accelerate learning and reduce catastrophic failures. Generative adversarial imitation learning (GAIL) is combined with regular DRL by utilizing a hindsight relabeling scheme for human interventions to encourage the agent to imitate human behavior. To emulate the sim-to-real process, an agent is first trained in a simplistic simulation environment for needle steering and then transferred to a sophisticated one considered as the real world with fine-tuning (sim-to-sim). Experimental results show that with human interventions, the proposed method outperforms the other compared DRL approaches and can achieve good performance with only 2,000 training steps in the complex simulation environment, achieving an average return comparable to that of a 55,000-step agent trained from scratch.&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2024autonomous,
  title={Autonomous Soft-Tissue Needle Steering Using Reinforcement Learning Guided by Human Input},
  author={Ou, Yafei and Tavakoli, Mahdi},
  journal={Journal of Medical Robotics Research},
  volume={9},
  number={03n04},
  pages={2440010},
  year={2024},
  publisher={World Scientific}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Autonomous Blood Suction for Robot-Assisted Surgery: A Sim-to-Real Reinforcement Learning Approach</title><link>https://www.yafei.dev/posts/pub-ou2024autonomous/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2024autonomous/</guid><description>By Yafei Ou, Abed Soleymani, Xingyu Li, Mahdi Tavakoli. IEEE Robotics and Automation Letters, 2024.</description><pubDate>Mon, 01 Jul 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Autonomous Blood Suction for Robot-Assisted Surgery: A Sim-to-Real Reinforcement Learning Approach&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Abed Soleymani, Xingyu Li, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;IEEE Robotics and Automation Letters&lt;/em&gt;, vol. 9, no. 8, pp. 7246-7253, Aug. 2024&lt;/p&gt;
&lt;p&gt;IEEE Xplore: &lt;a href=&quot;https://ieeexplore.ieee.org/abstract/document/10578312&quot;&gt;https://ieeexplore.ieee.org/abstract/document/10578312&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Recent applications of deep reinforcement learning (DRL) in surgical autonomy have shown promising results in automating various surgical sub-tasks. While most of these studies consider the rigid and soft body dynamics in the surgery such as tissue deformation, only a few have investigated the situation where fluid is present. However, the presence of fluids, particularly blood, is common in surgeries, and interacting with them adds additional challenges to task automation. In this work, we investigate the use of DRL in automating blood suction, a common surgical sub-task where blood is removed from the surgical field. We build a blood suction simulation environment based on position-based fluids (PBF), train an agent with domain-randomized environment parameters through curriculum learning, and obtain a generalizable policy that can be applied to various shapes of tissue and types of liquid. Real-world experiments show that the agent can perform autonomous suction in different tissue models with different amounts and types of liquid, and only one of the 50 trials resulted in more than 3 ml of blood remaining.&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo videoId=&quot;u75v2EOT38Q&quot; /&amp;gt;&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2024autonomous,
  title={Autonomous Blood Suction for Robot-Assisted Surgery: A Sim-to-Real Reinforcement Learning Approach},
  author={Ou, Yafei and Soleymani, Abed and Li, Xingyu and Tavakoli, Mahdi},
  journal={IEEE Robotics and Automation Letters},
  year={2024},
  publisher={IEEE}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>A Realistic Surgical Simulator for Non-Rigid and Contact-Rich Manipulation in Surgeries with the da Vinci Research Kit</title><link>https://www.yafei.dev/posts/pub-ou2024realistic/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2024realistic/</guid><description>By Yafei Ou, Sadra Zargarzadeh, Paniz Sedighi, Mahdi Tavakoli. 21st International Conference on Ubiquitous Robots (UR), 2024</description><pubDate>Mon, 08 Apr 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;A Realistic Surgical Simulator for Non-Rigid and Contact-Rich Manipulation in Surgeries with the da Vinci Research Kit&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Sadra Zargarzadeh, Paniz Sedighi, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;2024 21st International Conference on Ubiquitous Robots (UR)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;IEEE Xplore: &lt;a href=&quot;https://ieeexplore.ieee.org/document/10597513&quot;&gt;https://ieeexplore.ieee.org/document/10597513&lt;/a&gt;&lt;br /&gt;
arXiv: &lt;a href=&quot;https://arxiv.org/abs/2404.05888&quot;&gt;https://arxiv.org/abs/2404.05888&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Realistic real-time surgical simulators play an increasingly important role in surgical robotics research, such as surgical robot learning and automation, and surgical skills assessment. Although there are a number of existing surgical simulators for research, they generally lack the ability to simulate the diverse types of objects and contact-rich manipulation tasks typically present in surgeries, such as tissue cutting and blood suction. In this work, we introduce CRESSim, a realistic surgical simulator based on PhysX 5 for the da Vinci Research Kit (dVRK) that enables simulating various contact-rich surgical tasks involving different surgical instruments, soft tissue, and body fluids. The real-world dVRK console and the master tool manipulator (MTM) robots are incorporated into the system to allow for teleoperation through virtual reality (VR). To showcase the advantages and potentials of the simulator, we present three examples of surgical tasks, including tissue grasping and deformation, blood suction, and tissue cutting. These tasks are performed using the simulated surgical instruments, including the large needle driver, suction irrigator, and curved scissor, through VR-based teleoperation.&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo videoId=&quot;GIBHPmgqJcs&quot; /&amp;gt;&lt;/p&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;h3&gt;CRESSim (Unity Project)&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;tbs-ualberta/cressim&quot;}&lt;/p&gt;
&lt;h3&gt;PhysX 5 for Unity&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/physx5-for-unity&quot;}&lt;/p&gt;
&lt;h3&gt;PhysX 5 for Unity Native Plugin (C++)&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;yafei-ou/physx5-native-plugin&quot;}&lt;/p&gt;
&lt;h3&gt;Citation&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;@inproceedings{ou2024realistic,
  title={A Realistic Surgical Simulator for Non-Rigid and Contact-Rich Manipulation in Surgeries with the da Vinci Research Kit}, 
  author={Ou, Yafei and Zargarzadeh, Sadra and Sedighi, Paniz and Tavakoli, Mahdi},
  booktitle={2024 21st International Conference on Ubiquitous Robots (UR)}, 
  year={2024},
  pages={64-70}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Towards Safe and Efficient Reinforcement Learning for Surgical Robots Using Real-Time Human Supervision and Demonstration</title><link>https://www.yafei.dev/posts/pub-ou2023towards/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2023towards/</guid><description>By Yafei Ou, Mahdi Tavakoli. 2023 International Symposium on Medical Robotics (ISMR), 2023.</description><pubDate>Wed, 19 Apr 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Towards Safe and Efficient Reinforcement Learning for Surgical Robots Using Real-Time Human Supervision and Demonstration&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;2023 International Symposium on Medical Robotics (ISMR)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;IEEE Xplore: &lt;a href=&quot;https://ieeexplore.ieee.org/abstract/document/10130214&quot;&gt;https://ieeexplore.ieee.org/abstract/document/10130214&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Recent research in surgical robotics has focused on increasing the level of autonomy in order to reduce the workload of surgeons. While deep reinforcement learning (DRL) has shown promising results in automating some surgical subtasks, due to its demand for a large number of random explorations, safety and learning efficiency remain the primary challenges when applying it to surgical robot learning. In this work, we present a DRL framework with real-time human supervision during the training process for surgical robot learning to avoid significant failures and speed up training. A novel training methodology based on the combination of DRL and generative adversarial imitation learning (GAIL) is proposed to further improve learning efficiency by imitating human behaviors. The proposed method is validated using two simulated environments, where human intervention is performed via teleoperation. Results show that our method outperforms baseline algorithms and can achieve safe and efficient learning.&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@inproceedings{ou2023towards,
  title={Towards safe and efficient reinforcement learning for surgical robots using real-time human supervision and demonstration},
  author={Ou, Yafei and Tavakoli, Mahdi},
  booktitle={2023 International Symposium on Medical Robotics (ISMR)},
  pages={1--7},
  year={2023},
  organization={IEEE}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Robot Learning Incorporating Human Interventions in the Real World for Autonomous Surgical Endoscopic Camera Control</title><link>https://www.yafei.dev/posts/pub-ou2023robot/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2023robot/</guid><description>By Yafei Ou, Mahdi Tavakoli. Journal of Medical Robotics Research, 2023.</description><pubDate>Fri, 10 Mar 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Robot Learning Incorporating Human Interventions in the Real World for Autonomous Surgical Endoscopic Camera Control&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;Journal of Medical Robotics Research&lt;/em&gt;, vol. 08, no. 03n04, p. 2340004, 2023.&lt;/p&gt;
&lt;p&gt;Link: &lt;a href=&quot;https://www.worldscientific.com/doi/abs/10.1142/S2424905X23400044&quot;&gt;https://www.worldscientific.com/doi/abs/10.1142/S2424905X23400044&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Recent studies in surgical robotics have focused on automating common surgical subtasks such as grasping and manipulation using deep reinforcement learning (DRL). In this work, we consider surgical endoscopic camera control for object tracking e.g. using the endoscopic camera manipulator (ECM) from the da Vinci Research Kit (dVRK) (Intuitive Inc., Sunnyvale, CA, USA) as a typical surgical robot learning task. A DRL policy for controlling the robot joint space movements is first trained in a simulation environment and then continues the learning in the real world. To speed up training and avoid significant failures (in this case, losing view of the object), human interventions are incorporated into the training process and regular DRL is combined with generative adversarial imitation learning (GAIL) to encourage imitating human behaviors. Experiments show that an average reward of 159.8 can be achieved within 1000 steps compared to only 121.8 without human interventions, and the view of the moving object is lost only twice during the training process out of 3 trials. These results show that human interventions can improve learning speed and significantly reduce failures during the training process.&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2023robot,
  title={Robot learning incorporating human interventions in the real world for autonomous surgical endoscopic camera control},
  author={Ou, Yafei and Zargarzadeh, Sadra and Tavakoli, Mahdi},
  journal={Journal of Medical Robotics Research},
  volume={8},
  number={03n04},
  pages={2340004},
  year={2023},
  publisher={World Scientific}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Sim-to-Real Surgical Robot Learning and Autonomous Planning for Internal Tissue Points Manipulation Using Reinforcement Learning</title><link>https://www.yafei.dev/posts/pub-ou2023sim/</link><guid isPermaLink="true">https://www.yafei.dev/posts/pub-ou2023sim/</guid><description>By Yafei Ou, Mahdi Tavakoli. IEEE Robotics and Automation Letters, 2023.</description><pubDate>Fri, 10 Mar 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import YouTubeVideo from &apos;../../../components/misc/YouTubeVideo.astro&apos;;&lt;/p&gt;
&lt;h2&gt;Full Article&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Sim-to-Real Surgical Robot Learning and Autonomous Planning for Internal Tissue Points Manipulation Using Reinforcement Learning&lt;/strong&gt;&lt;br /&gt;
Yafei Ou, Mahdi Tavakoli&lt;br /&gt;
&lt;em&gt;IEEE Robotics and Automation Letters&lt;/em&gt;, vol. 8, no. 5, pp. 2502-2509, May 2023&lt;/p&gt;
&lt;p&gt;IEEE Xplore: &lt;a href=&quot;https://ieeexplore.ieee.org/abstract/document/10065553&quot;&gt;https://ieeexplore.ieee.org/abstract/document/10065553&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Abstract&lt;/h2&gt;
&lt;p&gt;Indirect simultaneous positioning (ISP), where internal tissue points are placed at desired locations indirectly through the manipulation of boundary points, is a type of subtask frequently performed in robotic surgeries. Although challenging due to complex tissue dynamics, automating the task can potentially reduce the workload of surgeons. This letter presents a sim-to-real framework for learning to automate the task without interacting with a real environment, and for planning preoperatively to find the grasping points that minimize local tissue deformation. A control policy is learned using deep reinforcement learning (DRL) in the FEM-based simulation environment and transferred to real-world situation. Grasping points are planned in the simulator by utilizing the trained policy using Bayesian optimization (BO). Inconsistent simulation performance is overcome by formulating the problem as a state augmented Markov decision process (MDP). Experimental results show that the learned policy places the internal tissue points accurately, and that the planned grasping points yield small tissue deformation among the trials. The proposed learning and planning scheme is able to automate internal tissue point manipulation in surgeries and has the potential to be generalized to complex surgical scenarios.&lt;/p&gt;
&lt;p&gt;&amp;lt;YouTubeVideo videoId=&quot;PKHARy8CbuQ&quot; /&amp;gt;&lt;/p&gt;
&lt;h2&gt;Citation&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;@article{ou2024autonomous,
  title={Autonomous Soft-Tissue Needle Steering Using Reinforcement Learning Guided by Human Input},
  author={Ou, Yafei and Tavakoli, Mahdi},
  journal={Journal of Medical Robotics Research},
  volume={9},
  number={03n04},
  pages={2440010},
  year={2024},
  publisher={World Scientific}
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Site Changelog</title><link>https://www.yafei.dev/posts/site-changelog/</link><guid isPermaLink="true">https://www.yafei.dev/posts/site-changelog/</guid><description>Changelog of this site.</description><pubDate>Sat, 01 Jan 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The changelog of the site.
The published date is set to be old enough so that this post will always appear at the bottom.&lt;/p&gt;
&lt;h2&gt;2026-08-15&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Migrated to Astro 7&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2026-01-22&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Added astrojs/mdx and use MDX for most of the posts&lt;/li&gt;
&lt;li&gt;Added some other publications&lt;/li&gt;
&lt;li&gt;Increased cover image height&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2025-05-18&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fixed an issue due to some characters in path (in tags)&lt;/li&gt;
&lt;li&gt;Added the 404 page from Fuwari&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2025-05-17&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Migrated to Fuwari&lt;/li&gt;
&lt;li&gt;Added publications and CV pages&lt;/li&gt;
&lt;li&gt;Added posts on publications&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2024-09-07&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Updated the CV page and the PDF version.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2024-08-31&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Updated the CV page and the PDF version.&lt;/li&gt;
&lt;li&gt;Changed the website title to &quot;Yafei&apos;s Archive&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;2024-07-28&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Added CV page&lt;/li&gt;
&lt;li&gt;Removed redundant pages&lt;/li&gt;
&lt;li&gt;Added Publications page (only one paper has been added)&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item></channel></rss>