Skip to main content

pamoja_two_link_arm_joints_for

Function pamoja_two_link_arm_joints_for 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_two_link_arm_joints_for( arm: PamojaTwoLinkArm, x: f32, y: f32, elbow: PamojaElbow, out_joints: *mut PamojaJoints, ) -> bool
Expand description

Finds the joint angles that put a two-link arm’s hand at a point.

§Arguments

  • arm - the arm.
  • x - the target’s x coordinate.
  • y - the target’s y coordinate.
  • elbow - which way the elbow bends.
  • out_joints - where to write the angles.

§Returns

true with the angles written to out_joints, or false for a target out of reach, an arm with a link of no length, or a coordinate that is not a finite number.

§Safety

out_joints must point to a writable PamojaJoints, or be null.