import { waitForState } from './util'

export async function moveToJoints({ client }, { joints }) {
  const { j1, j2, j3, j4, j5, j6 } = joints

  await client.jointMoveTo([j1, j2, j3, j4, j5, j6])

  await waitForState(client, status => !status.isBusy)

  return true
}
