puma / ik.h

#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
);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.