Source

puma / ik.h

Full commit
#pragma once

/** Combine the DH parameters for FK/IK and limits/scaling for drive */
typedef struct {
	double d;
	double a;
	double scale; // rads to counter ticks
	double angle; // offset from "0" in the DH map
	double coupled; // amount this axis is cross coupled to the previous
	int min;
	int max;
} joint_cfg_t;

extern int
ik_first(
	const joint_cfg_t * const joints,
	double * const theta, // output commands
	const double * const xyz, // desired position (in mm)
	const int right, // right arm = +1, left arm = -1
	const int above // elbow above arm = +1, below arm = -1
);


extern int
ik_wrist(
	const joint_cfg_t * const joints,
	double * const theta, // input(0-2)/output(3-5) commands
	const double * const xyz, // desired position (in mm)
	const double * const a, // desired approach vector
	const double * const s, // desired sliding vector (for hand opening)
	const double * const n, // desired normal vector
	const int wrist // wrist up = +1, wrist down = -1
);