# Record and Replay Teleoperated Trajectories
In this section, we go through a simple example of recording proprioceptive states of the robot arm and replay the trajectory.
## Record a trajectory through teleoperation
Under `deoxys_control/deoxys`, run:
```shell
python examples/collect_low_dim_states_with_spacemouse.py
```
Then you can control the robot through a [teleoperation device](./using_teleoperation_devices.html). When you finish recording, press reset button of the spacemouse. The terminal will ask you if you want to save the teleopeated trajectory so far. Confirm and the trajectory will be saved in a `hdf5` file under `/tmp/deoxys_demo_data/` by default, and the exact path will be printed for future reference.
### Replay the recorded trajectory
After the previous step, run:
```shell
python examples/replay_low_dim_demonstration_trajectory.py --dataset SAVED_HDF5_FILE
```
Then the robot will be reset to the first configuration of the trajectory, and run the whole action sequence that is recorded in `SAVED_HDF5_FILE`. Here is a video of the full procedure of recording robot actions through teleoperation and replay the trajectory.
## Record a trajectory through kinesthetic teaching
If you want to record the trajectory through kinesthetic teaching, you can run the script above with additional arguments:
```shell
python examples/collect_low_dim_states_with_spacemouse.py --controller-type JOINT_IMPEDANCE --controller-cfg compliant-joint-impedance-controller.yml
```
Here is a video of the full procedure of recording kinesthetic teaching and replay the trajectory.