# Motion constraints reference

You can constrain the motion of your machine using the motion service’s built-in constraint options.
Constraints are passed as arguments to the [`Move`](https://docs.viam.com/reference/apis/services/motion/#move) method.

The following constraints are available:

- [Linear constraint](https://docs.viam.com/reference/services/motion/constraints/#linear-constraint)
- [Orientation constraint](https://docs.viam.com/reference/services/motion/constraints/#orientation-constraint)
- [Next steps](https://docs.viam.com/reference/services/motion/constraints/#next-steps)

## Linear constraint

The linear constraint (`{"motion_profile": "linear"}`) forces the path taken by `component_name` to follow an exact linear path from the start to the goal.
If the start and goal orientations are different, the orientation along the path will follow the quaternion [Slerp (Spherical Linear Interpolation)](https://en.wikipedia.org/wiki/Slerp) of the orientation from start to goal.
This has the following sub-options:

| Parameter Name                | Type   | Default | Description                                                                                           |
| ------------------------------ | ------ | ------- | ----------------------------------------------------------------------------------------------------- |
| line_tolerance_mm             | float  | 0.1     | Max linear deviation from straight-line between start and goal, in mm.                               |
| orientation_tolerance_degs     | float  | 2.0     | Allowable deviation from Slerp between start/goal orientations, in degrees.                           |

**Example usage**:

- [Python](https://docs.viam.com/reference/services/motion/constraints/#tabset-referenceservicesmotionconstraints-1-0)
- [Go](https://docs.viam.com/reference/services/motion/constraints/#tabset-referenceservicesmotionconstraints-1-1)

```python

```

You can find more information in the [Python SDK Docs](https://python.viam.dev/autoapi/viam/gen/service/motion/v1/motion_pb2/index.html#viam.gen.service.motion.v1.motion_pb2.Constraints).

```go

```

You can find more information in the [Go SDK Docs](https://pkg.go.dev/go.viam.com/api/service/motion/v1#Constraints).

## Orientation constraint

The orientation constraint (`{"motion_profile": "orientation"}`) places a restriction on the orientation change during a motion, such that the orientation during the motion does not deviate from the [Slerp](https://en.wikipedia.org/wiki/Slerp) between start and goal by more than a set amount.
This is similar to the “orient_tolerance” option in the linear profile, but without any path restrictions.
If set to zero, a movement with identical starting and ending orientations will hold that orientation throughout the movement.

| Parameter Name                | Type   | Default | Description                                                                                           |
| ------------------------------ | ------ | ------- | ----------------------------------------------------------------------------------------------------- |
| orientation_tolerance_degs     | float  | 2.0     | Allowable deviation from Slerp between start/goal orientations, in degrees.                           |

**Example usage**:

- [Python](https://docs.viam.com/reference/services/motion/constraints/#tabset-referenceservicesmotionconstraints-2-0)
- [Go](https://docs.viam.com/reference/services/motion/constraints/#tabset-referenceservicesmotionconstraints-2-1)

```python

```

```go

```

You can find more information in the [Go SDK Docs](https://pkg.go.dev/go.viam.com/api/service/motion/v1#Constraints).

## Next steps

Constraints are used in the following tutorials:

[Claw Game](https://docs.viam.com/tutorials/projects/claw-game/)\
Create your own version of the famous arcade claw machine using a robotic arm and a claw grabber.

[Add motion constraints](https://docs.viam.com/tutorials/services/constrain-motion/)\
Use constraints and transforms with the motion service.
