moveToJointPositions method

  1. @override
Future<void> moveToJointPositions(
  1. List<double> positions, {
  2. Map<String, dynamic>? extra,
})
override

Move each joint on the arm to the corresponding position specified in positions.

// Create a list of joint angles for each arm joint
List<double> targetPositions = [180, 90, 15.75, 30, 90, 0];

// Move the arm joints to those angles
await myArm.moveToJointPositions(targetPositions);

For more information, see Arm component.

Implementation

@override
Future<void> moveToJointPositions(List<double> positions, {Map<String, dynamic>? extra}) async {
  final request = MoveToJointPositionsRequest()
    ..name = name
    ..positions = (JointPositions()..values.addAll(positions))
    ..extra = extra?.toStruct() ?? Struct();
  await client.moveToJointPositions(request);
}