Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Manual robot control interfaces.

- Dual-mode operation (Cartesian & Joint space)
- Real-time velocity control
- Multiple coordinate systems support
- Multiple coordinate systems support (Robot base or Tool)

**Individual Jogging Controls**

Expand Down
95 changes: 95 additions & 0 deletions docs/JoggerConnection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
## JoggerConnection

Jogging in a robotics context generally refers to the manual movement of the robot via direct human input. The Wandelbots platform provides websocket-based jogging methods which can be used to build similar jogging interfaces to those found on teach pendants.

```ts
import { NovaClient, JoggerConnection } from "@wandelbots/nova-js/v2"

const nova = new NovaClient({ instanceUrl: "nova-instance-url" })
const jogger = await JoggerConnection.open(nova, `some-motion-group-id`) // or to set options
// const jogger = await JoggerConnection.open(nova, `some-motion-group-id`), options)
```

The jogger's mode is set to "off" first. You'll need to set it to "jogging" or "trajectory" to be able to
send movement commands

```ts
// Set jogger to "jogging" mode and sends InitializeJoggingRequest to API
await jogger.setJoggingMode("jogging")

// You can update options ater initializing like this:
await jogger.setOptions({
tcp: "Flange", // TCP id
timeout: 3000 // How long the promise should wait when server does not respond to init request
orientation: "tool",
})

// For planned motions, use "trajectory" mode
await jogger.setJoggingMode("trajectory")
await jogger.rotateTCP({...}) // Error: Continuous jogging websocket not connected; ...
await jogger.runIncrementalCartesianMotion({...}) // Plan and run trajectory
```

### Stopping the jogger

For safety purposes, let's first consider how to stop the jogger. Calling stop will stop all motion types regardless of mode:

```ts
await jogger.stop()
```

As a failsafe, the server will also stop any jogging motions when it detects the relevant websocket has been closed. This means that if e.g. the network connection drops out or the browser tab is closed in the middle of a motion, it will stop automatically.

However, you should never totally rely on any software being able to stop the robot: always have the hardware emergency stop button within reach just in case!

### Jogging: Rotating a joint `rotateJoints`

This example starts joint 0 of the robot rotating in a positive direction at 1 radian per second:

```ts
await jogger.rotateJoints({
joint: 0,
direction: "+",
velocityRadsPerSec: 1,
})
```

### Jogging: Moving a TCP `translateTCP`

This example starts moving a TCP in a positive direction along the X axis of the specified coordinate system, at a velocity of 10 millimeters per second:

```ts
await jogger.translateTCP({
axis: "x",
direction: "+",
velocityMmPerSec: 10,
})
```

### Jogging: Rotating a TCP `rotateTCP`

This example starts rotating the TCP in a positive direction around the X axis of the specified coordinate system, at a velocity of 1 radians per second:

```ts
await jogger.rotateTCP({
axis: "x",
direction: "+",
velocityRadsPerSec: 1,
})
```

### Trajectory: Plan and run incremental motion `runIncrementalCartesianMotion`

```ts
await jogger.runIncrementalCartesianMotion({...})
```

### Post-jogging cleanup

When you are done with a jogger, make sure to call dispose:

```ts
await jogger.dispose()
```

This will close any open websockets and ensure things are left in a good state.
18 changes: 18 additions & 0 deletions docs/MotionGroup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Connect to a motion group

The library provides an easy to use way to access properties of a motion group.

```ts
import { NovaClient, ConnectedMotionGroup } from "@wandelbots/nova-js/v2"

const nova = new NovaClient({ instanceUrl: "nova-instance-url" })
const activeRobot = await ConnectedMotionGroup.connect(nova, "motion-group-id")
```

This connected motion group opens a websocket and listens to changes of the current joints and the TCP pose. You can read out those values by using the `rapidlyChangingMotionState` of the object. Along other properties it also provides the current `safetySetup` and `tcps`.

```ts
const newJoints = activeRobot.rapidlyChangingMotionState.joint_position
```

**Api V2 change:** Please not that joints are now directly accessible in `rapidlyChangingMotionState.joint_position`, previously there were nested in `.rapidlyChangingMotionState.state.joint_position.joints`.
4 changes: 2 additions & 2 deletions docs/RobotCard.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The `RobotCard` component is a responsive card that displays a 3D robot with sta

```tsx
import { RobotCard } from "@wandelbots/wandelbots-js-react-components"
import { useConnectedMotionGroup } from "@wandelbots/nova-js"
import { useConnectedMotionGroup } from "@wandelbots/nova-js/v1"

function RobotDashboard() {
const connectedMotionGroup = useConnectedMotionGroup("0@ur5e")
Expand Down Expand Up @@ -146,7 +146,7 @@ Add these to your translation files:
The component works with Nova.js ConnectedMotionGroup:

```tsx
import { useConnectedMotionGroup } from "@wandelbots/nova-js"
import { useConnectedMotionGroup } from "@wandelbots/nova-js/v1"

function ConnectedRobotCard({ motionGroupId }) {
const connectedMotionGroup = useConnectedMotionGroup(motionGroupId)
Expand Down
126 changes: 99 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@types/react": "^19.1.8",
"@types/three": "^0.174.0",
"@vitejs/plugin-react": "^4.3.4",
"@wandelbots/nova-js": "^2.1.0",
"@wandelbots/nova-js": "3.3.1",
"add": "^2.0.6",
"eslint-plugin-storybook": "^10.0.1",
"glob": "^11.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/3d-viewport/CoordinateSystemTransform.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CoordinateSystem } from "@wandelbots/nova-api/v1"
import type { CoordinateSystem } from "@wandelbots/nova-js/v1"
import type { ReactNode } from "react"
import { Quaternion, Vector3 } from "three"

Expand Down
3 changes: 1 addition & 2 deletions src/components/3d-viewport/SafetyZonesRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type ThreeElements } from "@react-three/fiber"
import type { Geometry } from "@wandelbots/nova-api/v1"
import type { SafetySetupSafetyZone } from "@wandelbots/nova-js/v1"
import type { Geometry, SafetySetupSafetyZone } from "@wandelbots/nova-js/v1"
import * as THREE from "three"
import { ConvexGeometry } from "three-stdlib"

Expand Down
2 changes: 1 addition & 1 deletion src/components/3d-viewport/collider/ColliderCollection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ThreeElements } from "@react-three/fiber"
import type { Collider } from "@wandelbots/nova-api/v1"
import type { Collider } from "@wandelbots/nova-js/v1"
import ColliderElement from "./ColliderElement"

export type MeshChildrenProvider = (
Expand Down
Loading