# Running the Robot Controller

Code to start the camera stream publisher and robot controller. The code is useful for [Record3d](https://record3d.app)-based camera streaming, but can be adapted for other use cases.

## Getting Started

1. Clone repository onto your Hello Robot Stretch:

   ```bash
   git clone https://github.com/notmahi/dobb-e.git
   cd dobb-e/robot-server
   ```
2. Install required packages **on your root pip env** (where `hello_robot` package is installed):

   ```bash
   pip install -r requirements.txt
   ```

## Running

1. If you just turned on the robot, perform joint calibration on your Stretch by running the following in terminal:

   ```bash
   stretch_robot_home.py
   ```

   this only needs to be run once every time the robot is booted up.
2. In a separate terminal window, Run `roscore` on your Stretch within the conda/mamba environment `home_robot` on your Stretch

   ```bash
   mamba activate home_robot
   roscore
   ```
3. [Attach and set up iPhone on robot](/hardware/attach-camera-to-robot.md).
4. Change current working directory to this repository’s root folder (`cd ../robot-server`).
5. Run in terminal (not within the `conda` environment, but in the root pip environment):

   ```bash
   python3 start_server.py
   ```


---

# 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://docs.dobb-e.com/software/running-the-robot-server.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.
