---
title: MuJoCoMove-v1
description: Move the TCP in a specified direction using the MuJoCo backend.
---

# MuJoCoMove-v1

Move the robot's end-effector in a cardinal direction by a fixed distance.

## Overview

| Property | Value |
|----------|-------|
| Environment ID | `MuJoCoMove-v1` |
| Backend | MuJoCo |
| Max episode steps | 256 |
| Config class | `MoveConfig` (extends `EnvironmentConfig`) |
| Task description | "Move the end-effector \{direction\} by \{distance:.2f\} m." |

## Configuration

`MoveConfig` extends `EnvironmentConfig` with the following fields:

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `direction` | `Literal["up", "down", "left", "right", "forward", "backward"]` | "up" | Direction of movement |
| `target_distance` | `float` | 0.10 | Distance to move in meters |
| `success_threshold` | `float` | 0.01 | Shortfall tolerance (m) on the directional displacement. |

## Observation Space

Default observation is a 16-dimensional vector (configurable via the `observations` parameter on `MoveConfig`):

| Component | Class | Dimensions | Description |
|-----------|-------|------------|-------------|
| Joint positions | `JointPositions` | 6 | Current angle of each robot joint |
| End-effector pose | `EndEffectorPose` | 7 | TCP position and orientation |
| Target offset | `TargetOffset` | 3 | Vector from the TCP to the goal position |

## Objects

No objects are present. The goal position is computed at episode start from the initial TCP position offset by `direction * target_distance`. On the Warp backend (`WarpMove-v1`) the target is captured from the pre-settle TCP, so it is identical across `reset()` and same-step autoreset; with `reset_settle_frames > 0` the first observed TCP-to-target distance can therefore differ slightly from `target_distance`.

## Success Condition

Succeeds when the TCP has traveled at least `target_distance` along the move direction (within `success_threshold`), regardless of perpendicular drift.

## Example

```python
import gymnasium as gym
import so101_nexus.mujoco

from so101_nexus.config import MoveConfig

env = gym.make(
    "MuJoCoMove-v1",
    render_mode="human",
    config=MoveConfig(direction="up", target_distance=0.10),
)

obs, info = env.reset()
for _ in range(256):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        obs, info = env.reset()

env.close()
```

## Train a policy

Train a PPO policy for this task on the GPU-parallel Warp backend (`WarpMove-v1`) in Colab:

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/johnsutor/so101-nexus/blob/main/examples/ppo_warp_colab.ipynb)

Set `ENV_ID = "WarpMove-v1"` in the notebook's environment cell. See [Training with PPO](/docs/training/ppo) for the local CLI workflow.
