# Quickstart

bsln version: `0.0.1b40`

SDK source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln`

Page source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln/docs/customer/QUICKSTART.md`

[Read on the web](https://docs.baseline-robotics.com/) | [Markdown](https://docs.baseline-robotics.com/index.md) | [Documentation index](https://docs.baseline-robotics.com/llms.txt)

## 1. Install

Install [uv](https://docs.astral.sh/uv/getting-started/installation/).

```bash
uv tool install bsln
```

## 2. Sign in

Sign in with Google in your browser and approve the code shown in your terminal.

```bash
bsln login
bsln list robot-type
```

Station availability and account permission are separate.

[Request live access](https://docs.baseline-robotics.com/index.md#request-live-access).

## 3. Run a session

Continue after Baseline confirms that your beta account can use **Test my policy** with the bimanual robot and has an assigned task. If you only have access to hosted evaluations in Platform, use the [offline example](https://docs.baseline-robotics.com/guides/your-policy.md#test-offline) here. Read the [station commands and stop behavior](https://docs.baseline-robotics.com/station/commands.md) and keep a second terminal open for the [E-stop command](https://docs.baseline-robotics.com/index.md#emergency-stop). If your workspace bills sessions, [get a quote](https://docs.baseline-robotics.com/api/lifecycle.md#session-billing) before creating one.

```bash
uv init --python 3.12 bsln-quickstart
cd bsln-quickstart
uv add bsln==0.0.1b40
```

Save the example as `quickstart.py`. It turns the left wrist by 0.1 rad and returns it. Confirm the approved robot type with Baseline. Copy the `ses_…` ID printed by the script.

Python session example

```python
import sys
import time

from bsln.sdk import Client

ROBOT_TYPE = "bimanual_arm"
REQUEST_ID = input("Pilot request ID (Enter for standard SDK access): ").strip() or None
WRIST = "left_joint6"  # the left wrist. Unit: rad.
TURN = 0.1  # rad. This is about 6 degrees.

# The server assigns an idle physical station of this robot type.
with (
    Client() as client,
    client.start_session(
        robot_type=ROBOT_TYPE, max_occupied_s=60, request_id=REQUEST_ID
    ) as session,
):
    print("session:", session.id)
    station = session.description
    print("joints:", station["joint_order"])
    print("control rate:", station["control_hz"], "Hz")
    high = next(joint["safe_range"][1] for joint in station["joints"] if joint["name"] == WRIST)
    start = session.get_state()["target"][WRIST]  # the station holds the wrist here now
    turn = TURN if start + TURN <= high else -TURN  # stay inside the safe range

    # 1. Send one target. The station keeps it. The safety supervisor limits the speed.
    session.set_joints({WRIST: start + turn})
    time.sleep(2.0)

    # 2. Return in 2 s, then stream the starting target long enough to retain a recording.
    period = 1.0 / station["control_hz"]
    begin = time.monotonic()
    while (elapsed := time.monotonic() - begin) < 13.0:
        done = min(1.0, elapsed / 2.0)  # 0 at the start, 1 after 2 s
        session.send_targets({WRIST: start + turn * (1.0 - done)})
        time.sleep(period)

    print("wrist now:", round(session.get_joints()[WRIST], 3), "rad")
    session.park()
    usage = session.end()

if usage:  # what the session did, as the server counted it
    print("messages:", usage["messages"], "dropped:", usage["dropped"], "deadman holds:", usage["deadman_holds"])
```


Enter your assigned request ID if you have a one-session grant. It must allow 60 seconds. Request a fresh grant for each separate session.

```bash
uv run python quickstart.py
```

## Watch and stop

Enter the session ID printed by the script when prompted.

```bash
bash -c '
read -r -p "Session ID: " session_id || exit 1
[[ $session_id =~ ^ses_[[:alnum:]_-]+$ ]] || { printf "%s\n" "Enter a valid session ID." >&2; exit 1; }
bsln watch session "$session_id" --no-view
'
```

To end the session normally, run this in a separate terminal:

```bash
bash -c '
read -r -p "Session ID: " session_id || exit 1
[[ $session_id =~ ^ses_[[:alnum:]_-]+$ ]] || { printf "%s\n" "Enter a valid session ID." >&2; exit 1; }
bsln stop session "$session_id"
'
```

The [viewer options](https://docs.baseline-robotics.com/cli/reports-and-data.md#watch-a-session) explain how to open a 3D view.

### Emergency stop

If the robot moves unexpectedly, run this and enter its session ID. If the command cannot reach the station, contact Baseline Robotics immediately.

```bash
bash -c '
read -r -p "Session ID: " session_id || exit 1
[[ $session_id =~ ^ses_[[:alnum:]_-]+$ ]] || { printf "%s\n" "Enter a valid session ID." >&2; exit 1; }
bsln estop "$session_id"
'
```

When the session ends, [get its report and recording](https://docs.baseline-robotics.com/results.md).

## Release status

Use the version shown on this site for offline examples. Keep the client and station configuration approved for your account until Baseline Robotics confirms an upgrade. Beta access and task assignment determine which workflows you can use.

### Request live access

Submit your task and robot setup through the [Platform beta form](https://baseline-robotics.com/beta). Wait for confirmation of SDK session access and an assigned task before opening a real session.

### Python and platform evidence

<a id="command-line-only"></a>
<a id="python-sdk"></a>

<a id="viewer-and-model-environments"></a>
<a id="other-installation-options"></a>
<a id="ros-requirements"></a>

The base client requires Python 3.10 or newer. Quickstart uses CPython 3.12. See [viewer setup](https://docs.baseline-robotics.com/cli/reports-and-data.md#watch-a-session) if you want live 3D playback. The CLI and SDK do not require ROS.

## Recipes

[Explore a recording](https://docs.baseline-robotics.com/recipes/explore-recording.md) · [Autoresearch and weight-space programming](https://docs.baseline-robotics.com/recipes/autoresearch.md)

## Reference

[Command line](https://docs.baseline-robotics.com/cli.md) · [Python SDK](https://docs.baseline-robotics.com/sdk.md) · [HTTP API](https://docs.baseline-robotics.com/api.md)
