# Ghost teaching

> Teach robot positions by moving a ghost object of the tool in Isaac Sim. Learn how to move the robot to a ghost object, choose its joint configuration, and let the robot follow.

Video: [/video/omniservice/ghost\_teaching/ghost\_teaching\_intro.webm](/video/omniservice/ghost_teaching/ghost_teaching_intro.webm)

Ghost teaching is a feature that allows you to teach a robot by moving a ghost object in a simulation environment.
The ghost object is a virtual representation of the robot's end effector and can be moved around in the simulation environment.
The robot of a virtual controller moves to the pose of the ghost object.

## Prerequisites

You need to complete 3 steps to use ghost teaching with Wandelbots NOVA in NVIDIA Isaac Sim:

1. [Set up a scene](/simulation/quickstart)
2. Add a robot and tool to the scene.\
   Ensure the [Tool API](/simulation/build-scene/open-usd-types#tool-api) is applied and configured, otherwise the connected motion group will not be found.
3. Connect the robot to a [virtual controller](/simulation/installation#create-a-virtual-controller-for-a-robot-in-the-scene).\
   → The connect step configures the robot prim with the [Motion group API](/simulation/build-scene/open-usd-types#motion-group-api).
   If the robot prim is not configured the backend will fail to find a reference flange prim for the tool TCP position.

## Use ghost teaching

Right-click the tool prim and select `Create` → `Wandelbots NOVA` → `Ghost Object` to create a ghost object.
To turn existing prims into ghost objects, see [convert poses to ghost objects](/simulation/build-scene/scene-from-nova#convert-poses-to-ghost-objects).

Ghost objects will receive the [Ghost Object API](/simulation/build-scene/open-usd-types#ghost-object-api) which contains
the reference TCP for creation as source.

## Move the motion group

Move the robot to a ghost object with the `Ghost Teaching Tool Bar` below the viewport.

![Screenshot of the Ghost Teaching Tool Bar with motion group, TCP, ghost object, joint configuration, and Move to](/assets/nova/omniservice/ghost_teaching/ghost-teaching-tool-bar.webp)

### Tool bar

The tool bar opens when you select a ghost object.
From left to right it shows the motion group, the TCP, and the ghost object.
Then follow the joint configuration, `Move to`, `Follow`, and the settings.

> **Info:** If the tool bar does not open, select `Tools` → `Wandelbots NOVA` → `Ghost Teaching Tool Bar`.
> If it shows `Not connected`, connect the motion group with `Open connector`.

### Move to a ghost object

> **Info:** `Move to` and `Follow` set the joints of the virtual controller. They need a [virtual controller](/simulation/installation#create-a-virtual-controller-for-a-robot-in-the-scene) and do not work with a physical controller.

1. Select the ghost object in the viewport or the stage tree.
2. Optional: Select the TCP and the joint configuration in the tool bar.
3. Press and hold `Move to` until the robot reaches the ghost object.\
   → The simulation starts and the robot moves to the ghost object.

Releasing `Move to` stops the robot at its current position.

Video: [/video/omniservice/ghost\_teaching/ghost-teaching-move-to.webm](/video/omniservice/ghost_teaching/ghost-teaching-move-to.webm)

### Choose the joint configuration

The joint configuration list shows every solution Wandelbots NOVA finds for the ghost object, for example `1 Front Down NoFlip`.
The closest one to the current robot position comes first.

Select a joint configuration to use it for `Move to`.
The ghost object stores the choice as its preferred joint values and kinematic configuration.
The tool bar hides the list for the motion command `Line`, which keeps the current configuration.

### Follow a ghost object

> **Warning:** The robot moves to the ghost object as soon as you enable `Follow`, before you touch the ghost object.

1. Click the `Follow` button next to `Move to`.\
   → The robot moves to the ghost object right away.
2. Move the ghost object.\
   → The robot follows it to every new position.
3. Click `Follow` again to stop.

Video: [/video/omniservice/ghost\_teaching/ghost-teaching-follow.webm](/video/omniservice/ghost_teaching/ghost-teaching-follow.webm)

## Change the tool bar settings

Click the settings button at the right end of the tool bar.

- `Velocity` and `Acceleration`: Limit the TCP motion of `Move to`.
- `Motion command`: Choose `Joint P2P`, `Cartesian P2P`, or `Line`.
- `Stay open`: Keep the tool bar open when no ghost object is selected.
- `Open with ghost object`: Open the tool bar when you select a ghost object.
- `Select in scene`: Select the ghost object in the stage when you pick it in the tool bar.
- `Visible`, `Mesh color`, `Max joint configs`: Change the [viewport overlay](#viewport-overlay).

![Screenshot of the Ghost Teaching Settings with velocity, motion command, tool bar, and overlay options](/assets/nova/omniservice/ghost_teaching/ghost-teaching-settings.webp)

## TCP management

Create TCPs from the context menu of a [TCP prim](/simulation/build-scene/open-usd-types#tcp-prim) or of a ghost object.
See [sync tool data with Wandelbots NOVA](/simulation/build-scene/scene-from-nova#sync-tool-data-with-wandelbots-nova).

## Viewport overlay

Enabled by default, the viewport overlay displays all available joint configurations for the selected ghost object.
It displays the motion group colliders provided by Wandelbots NOVA and usually takes a few seconds until all mesh data is loaded upon selection.

If no joint configuration is available, no meshes will be displayed.

Video: [/video/omniservice/ghost\_teaching/ghost\_teaching\_overlay.webm](/video/omniservice/ghost_teaching/ghost_teaching_overlay.webm)

If the contrast is barely visible, change the color and opacity of the overlay in the [tool bar settings](#change-the-tool-bar-settings).
