Skip to content

Commit

Permalink
DOCS-2972: Add DoCommand methods for xArms (#3528)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre authored Oct 16, 2024
1 parent 694ec52 commit 1e7666f
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 0 deletions.
60 changes: 60 additions & 0 deletions docs/components/arm/lite6.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,66 @@ See [the frame system service](/services/frame-system/) for more information on

{{< readfile "/static/include/components/test-control/arm-control.md" >}}

### Additional commands

In addition to the [Arm API](/appendix/apis/components/arm/), the `lite6` arm supports some model-specific commands that allow you to set the speed and the acceleration of the arm.
You can invoke these commands by passing the following JSON document to the [`DoCommand()`](/appendix/apis/components/arm/#docommand) method:

```json
{
"set_speed": 45.0,
"set_acceleration": 10.0
}
```

| Key | Type | Description |
| ------------------ | ----- | ---------------------------------------------- |
| `set_speed` | float | Speed in degrees per second. |
| `set_acceleration` | float | Acceleration in degrees per second per second. |

For example:

{{< tabs >}}
{{% tab name="Python" %}}

```python {class="line-numbers linkable-line-numbers"}
command = {
"set_speed": 45.0, # Set speed to 45.0 degrees per second
"set_acceleration": 10.0 # Set acceleration to 10.0 degrees
# per second squared
}
result = await my_arm.do_command(command)
```

{{% /tab %}}
{{% tab name="Go" %}}

```go {class="line-numbers linkable-line-numbers"}
myArm, err := arm.FromRobot(machine, "my_arm")

cmd := map[string]interface{}{
"set_speed": 45.0, // Set speed to 45.0 degrees per second
"set_acceleration": 10.0 // Set acceleration to 10.0 degrees per second squared
}

result, err := myArm.DoCommand(context.Background(), cmd)
```

{{% /tab %}}
{{% tab name="Flutter" %}}

```dart {class="line-numbers linkable-line-numbers"}
const command = {
'set_speed': 45.0, // Set speed to 45.0 degrees per second
'set_acceleration': 10.0 // Set acceleration to 10.0 degrees per second squared
};
var result = myArm.doCommand(command);
```

{{% /tab %}}
{{< /tabs >}}

## Next steps

For more configuration and development info, see:
Expand Down
60 changes: 60 additions & 0 deletions docs/components/arm/xarm6.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,66 @@ See [the frame system Service](/services/frame-system/) for more information on

{{< readfile "/static/include/components/test-control/arm-control.md" >}}

### Additional commands

In addition to the [Arm API](/appendix/apis/components/arm/), the `xArm6` arm supports some model-specific commands that allow you to set the speed and the acceleration of the arm.
You can invoke these commands by passing the following JSON document to the [`DoCommand()`](/appendix/apis/components/arm/#docommand) method:

```json
{
"set_speed": 45.0,
"set_acceleration": 10.0
}
```

| Key | Type | Description |
| ------------------ | ----- | ---------------------------------------------- |
| `set_speed` | float | Speed in degrees per second. |
| `set_acceleration` | float | Acceleration in degrees per second per second. |

For example:

{{< tabs >}}
{{% tab name="Python" %}}

```python {class="line-numbers linkable-line-numbers"}
command = {
"set_speed": 45.0, # Set speed to 45.0 degrees per second
"set_acceleration": 10.0 # Set acceleration to 10.0 degrees
# per second squared
}
result = await my_arm.do_command(command)
```

{{% /tab %}}
{{% tab name="Go" %}}

```go {class="line-numbers linkable-line-numbers"}
myArm, err := arm.FromRobot(machine, "my_arm")

cmd := map[string]interface{}{
"set_speed": 45.0, // Set speed to 45.0 degrees per second
"set_acceleration": 10.0 // Set acceleration to 10.0 degrees per second squared
}

result, err := myArm.DoCommand(context.Background(), cmd)
```

{{% /tab %}}
{{% tab name="Flutter" %}}

```dart {class="line-numbers linkable-line-numbers"}
const command = {
'set_speed': 45.0, // Set speed to 45.0 degrees per second
'set_acceleration': 10.0 // Set acceleration to 10.0 degrees per second squared
};
var result = myArm.doCommand(command);
```

{{% /tab %}}
{{< /tabs >}}

## Next steps

For more configuration and development info, see:
Expand Down
60 changes: 60 additions & 0 deletions docs/components/arm/xarm7.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,66 @@ See [the frame system service](/services/frame-system/) for more information on

{{< readfile "/static/include/components/test-control/arm-control.md" >}}

### Additional commands

In addition to the [Arm API](/appendix/apis/components/arm/), the `xArm7` arm supports some model-specific commands that allow you to set the speed and the acceleration of the arm.
You can invoke these commands by passing the following JSON document to the [`DoCommand()`](/appendix/apis/components/arm/#docommand) method:

```json
{
"set_speed": 45.0,
"set_acceleration": 10.0
}
```

| Key | Type | Description |
| ------------------ | ----- | ---------------------------------------------- |
| `set_speed` | float | Speed in degrees per second. |
| `set_acceleration` | float | Acceleration in degrees per second per second. |

For example:

{{< tabs >}}
{{% tab name="Python" %}}

```python {class="line-numbers linkable-line-numbers"}
command = {
"set_speed": 45.0, # Set speed to 45.0 degrees per second
"set_acceleration": 10.0 # Set acceleration to 10.0 degrees
# per second squared
}
result = await my_arm.do_command(command)
```

{{% /tab %}}
{{% tab name="Go" %}}

```go {class="line-numbers linkable-line-numbers"}
myArm, err := arm.FromRobot(machine, "my_arm")

cmd := map[string]interface{}{
"set_speed": 45.0, // Set speed to 45.0 degrees per second
"set_acceleration": 10.0 // Set acceleration to 10.0 degrees per second squared
}

result, err := myArm.DoCommand(context.Background(), cmd)
```

{{% /tab %}}
{{% tab name="Flutter" %}}

```dart {class="line-numbers linkable-line-numbers"}
const command = {
'set_speed': 45.0, // Set speed to 45.0 degrees per second
'set_acceleration': 10.0 // Set acceleration to 10.0 degrees per second squared
};
var result = myArm.doCommand(command);
```

{{% /tab %}}
{{< /tabs >}}

## Next steps

For more configuration and development info, see:
Expand Down

0 comments on commit 1e7666f

Please sign in to comment.