← Back

Stylet

A ROS 2 simulation of LiDAR-guided robotic needle insertion, from target localization to force-monitored insertion.

Personal project — medical robotics
Independent initiative, solo
ROS 2C++Precision robotics3D perceptionMotion planningTesting & validation

Context

Stylet simulates the image-guided percutaneous insertion used in biopsy or tumour ablation: locate a target, approach it with a robotic arm, then insert a needle while monitoring the sensed force to detect any deviation from the planned path. The constraint I set myself: the planner receivesno ground-truth pose. The target is only known through a point cloud captured by distance sensors, exactly as a real system would have to recover it.

Architecture

The pipeline is split into independent building blocks, from locating the target to the final gesture:

1

Perception

2

Planning

3

Force-monitored insertion

  • Perception — fusion of several distance sensors to reconstruct the target's surface and determine its exact position, with no information given in advance.
  • Planning — computing the approach path, then driving the insertion while monitoring the sensed force to detect any deviation.
  • Actuation — a robotic arm paired with a custom insertion actuator, designed specifically for this gesture.
  • Interface — a custom control panel for picking the entry point and tracking the procedure live.

A realistic simulation environment with a full 3D model of the arm and actuator, and automated tests on every code change.

Reliability & validation

Rather than presenting a single successful run, I set up a repeated test protocol to check that the pipeline holds up over many trials, not just once.

50 / 50successful localization trials, single attempt
245 mmmaximum insertion depth tested
< 2.5 mmapproach error measured across all trials
< 1.6 mminsertion error measured across all trials

Engineering philosophy

Beyond the code, three principles guided the project's most important decisions:

Robustness through redundancy, not one-off fixes. Locating a target from a point cloud can, in rare cases, get the orientation wrong — a bit like mixing up the front and back of a symmetric object. Rather than correcting the error after the fact, I have the algorithm test several starting hypotheses and keep only the most consistent one.

Fix the cause, not the symptom. My first approach for inserting the needle followed a direct path, which caused collisions in certain configurations. Rather than working around each case one by one, I redesigned the mechanical part responsible to eliminate that whole class of error at the root.

Diagnose before fixing. An intermittent, hard-to-reproduce crash appeared during integration testing, caused by poorly managed concurrent access between two parts of the program. Rather than working around it with an automatic restart, I took the time to pin down its exact cause before fixing the problem at the root.

Current status

Environment setup, modelling, perception and planning are complete, with an end-to-end demo launchable from a single command. The following phases (simulated tissue haptic feedback, a moving target to simulate respiration) are planned but not yet built.