ORL Surgical Planner (ROS 2 Jazzy, WSL)
This cheat‑sheet shows EXACT commands to run in each terminal, plus how to
force the overlay if ROS2 can’t find the package (note: the package name is
ear_planner, sometimes confused with path_planner).
────────────────────────────────────────────────────────────────────────────── 0) COMMON (run at the START of EVERY terminal) ────────────────────────────────────────────────────────────────────────────── source /opt/ros/jazzy/setup.bash source ~/orlsurg/ros2_ws/install/local_setup.bash export RMW_FASTRTPS_USE_SHM=0 # recommended under WSL cd ~/orlsurg/ros2_ws
ros2 pkg list | grep ^ear_ || echo "(!) Overlay not loaded" ros2 pkg prefix ear_planner || echo "(!) ear_planner not visible"
──────────────────────────────────────────────────────────────────────────────
- TERMINAL 1 — Launch all nodes ────────────────────────────────────────────────────────────────────────────── SDF=$(realpath data/mri_processed/sdf_mm.nii.gz) MASK=$(realpath data/mri_processed/canal_mask.nii.gz) ros2 launch ear_planner planning_demo.launch.py sdf_path:=$SDF mask_path:=$MASK
────────────────────────────────────────────────────────────────────────────── 2) TERMINAL 2 — Generate data, then send a planning goal ──────────────────────────────────────────────────────────────────────────────
python3 ../tools/synthetic_ear.py --out data/mri_raw/synth.nii.gz
ros2 service call /segment_ear ear_msgs/srv/SegmentEar
"{mri_path: '$(realpath data/mri_raw/synth.nii.gz)'}"
ros2 service call /compute_centerline ear_msgs/srv/Centerline
"{mask_path: '$(realpath data/mri_processed/canal_mask.nii.gz)'}"
cat > goal.yaml <<'YAML' entry: header: {frame_id: mri} pose: {position: {x: -20.0, y: 0.0, z: 0.0}} target: header: {frame_id: mri} pose: {position: {x: 20.0, y: 0.0, z: 0.0}} tool_diam_mm: 1.5 safety_margin_mm: 0.5 YAML
ros2 action send_goal --feedback /plan_path ear_msgs/action/PlanPath "$(cat goal.yaml)"
ros2 topic echo /planned_path --once
ros2 param get /planner sdf_path ros2 param get /planner mask_path
────────────────────────────────────────────────────────────────────────────── 3) TERMINAL 3 — RViz2 visualization ────────────────────────────────────────────────────────────────────────────── rviz2
────────────────────────────────────────────────────────────────────────────── If ROS 2 can’t find the package (force the overlay) ──────────────────────────────────────────────────────────────────────────────
source /opt/ros/jazzy/setup.bash source ~/orlsurg/ros2_ws/install/local_setup.bash export AMENT_PREFIX_PATH=$PWD/install:$AMENT_PREFIX_PATH export CMAKE_PREFIX_PATH=$PWD/install:$CMAKE_PREFIX_PATH
ros2 pkg prefix ear_planner
────────────────────────────────────────────────────────────────────────────── Full rebuild (if the workspace was moved or things look stale) ────────────────────────────────────────────────────────────────────────────── cd ~/orlsurg/ros2_ws source /opt/ros/jazzy/setup.bash rm -rf build/ install/ log/ colcon build --symlink-install --merge-install source install/local_setup.bash
chmod +x src/ear_segmentation/ear_segmentation/segment_node.py
src/ear_centerline/ear_centerline/centerline_node.py
src/ear_planner/ear_planner/planner_action_server.py