# Welcome!

## Purpose

Specifically, this code works to simulate an endoscope with a steerable laser fiber within laryngeal models. The code uses the rapidly exploring random trees (RRT) algorithm to move the endoscope and laser fiber to different positions. Files can be run to analyze the reach of the device in both a free space and within a laryngeal model. When simulations are run with a model, the reachable area can be calculated and visualized.

## Quick Start

After cloning the repository to your machine, open src folder and run 'runSimulation'.

{% hint style="warning" %}
You will need to have installed the Deep Learning Toolbox.&#x20;
{% endhint %}

Upon running, three things should occur. Your command window should looks something like this:

```
* Estimation of the reachable workspace *
RRT Runtime: 0.07 minutes 	Total sampled points: 5
* Estimation of the visible surface. Using mcrc algorithm*
Faces Visible: 0 	Percent of Total Faces: 0.00% 
Visible Surface Area: 0.00 mm^2 	Percent of Total Surface Area: 0.00%
```

Additionally, you should also see two windows pop up similar to the following:

{% tabs %}
{% tab title="Animation Window" %}
![Note: Orientation of the model may vary.](https://3922677996-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MBZQmz2daWNXQYWpghx%2F-MBu-iKhRbIWpVVDwCj5%2F-MBu0tCrl3qEQcboRHz7%2Fanimation_window.png?alt=media\&token=5663a9ae-36bd-413b-9603-bada5d5b8fa3)
{% endtab %}

{% tab title="Visibility Figures" %}
![Note: These may be purple if the device reaches close enough to the model.](https://3922677996-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MBZQmz2daWNXQYWpghx%2F-MBu-iKhRbIWpVVDwCj5%2F-MBu0tCl3wswBg6tD1Bs%2Fvisibility_window.png?alt=media\&token=19f70d7e-01d9-47f0-9bdd-2b6f93df19ed)
{% endtab %}
{% endtabs %}

## General Workflow

1. Create the robot using the provided wrist parameters.
2. Run RRT to map the workspace of the robot.
3. Run ray-casting to acquire visibility of the model.
4. Create a video of the exploration.
5. Display figure of visibility.

## Summary of the Folders

Folders are generally separated by functionality.

* anatomical-models: holds the mesh models for the larynx and some test models
* anatomical-models-ear: leftover ear models, unused&#x20;
* testing: functions to determine wrist parameters&#x20;
* src: main code&#x20;
  * figure-generation: display models, video, and figures&#x20;
  * figures: where simulations automatically save the figures generated&#x20;
  * kinematics: classes for the endoscope and wrist along with functions for kinematics&#x20;
  * path-planning: RRT algorithm and helper functions&#x20;
  * simAnalyzer: analyze or rerun functions on previously generated simulations&#x20;
  * tests: old tests for debugging certain functions&#x20;
  * utils: helper functions used throughout the code&#x20;
    * ray-casting: visibility algorithms and helpers&#x20;
    * stlTools: mess with meshes&#x20;
    * visibility: creating and analyzing visibility

## Other Notes

This code was built off a repository where a similar notched wrist explored the inner ear. As a result you may see old terminology and other leftovers from the ear simulations. For example, the model explored is referred to as 'earmodel' in the code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wpi-comet-lab.gitbook.io/hale-bopp-documentation/-MC7XkSzIvo1U7f1XOjm/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
