Overview

MiRo's Kinematic Chain is described on the Geometry page. A library is provided for manipulating a model of this kinematic chain.

Instantiation

To instantiate a parametrised kinematic chain model fitted to the MiRo robot, use the kc_interf module, which acts as a MiRo-specific interface to the kc library.

The instantiated model is as specified in MiRo's Kinematic Chain. It has the degrees of freedom (DOFs): POSE, TILT, LIFT, YAW, and PITCH. It has the frames: WORLD, FOOT, BODY, NECK, GIMBAL, HEAD.

Example

Here, we create a model of MiRo's kinematic chain in variable kc.

import miro2 as miro ... kc = miro.lib.kc_interf.kc_miro()

Constants

Frame constants

Frames are specified with one of the frame constants.

LINK_WORLD
The world frame.
LINK_FOOT
MiRo's footprint (roughly, the projection of BODY onto the z=0 plane in WORLD). Related to WORLD by a translation in the plane, specified by POSE.
LINK_BODY
MiRo's body.
LINK_NECK
Internal frame.
LINK_GIMBAL
Internal frame.
LINK_HEAD
MiRo's head.

Example

Here, we transform a position from WORLD into HEAD using a kc model, specifying the input and output frames using frame constants.

import miro2 as miro ... xyz_HEAD = kc.changeFrameAbs(miro.constants.LINK_WORLD, miro.constants.LINK_HEAD, xyz_WORLD)

Functions

kc.zeroPose()
Reset the DOF POSE [x, y, theta] to all-zero.
kc.getPose()
Return the DOF POSE as an array [x, y, theta].
At R210921 and earlier, this function returns the data as a tuple ([x, y], theta).
kc.setPose(pose)
Set the DOF POSE as an array pose = [x, y, theta].
kc.getConfig()
Get the remaining DOFs as an array [TILT, LIFT, YAW, PITCH].
kc.setConfig(config)
Set the remaining DOFs as an array config = [TILT, LIFT, YAW, PITCH]. No checking is performed, so the model can be configured in a way that is not physically realisable. TILT should always be set to miro.constants.TILT_RAD_CALIB.
kc.getState()
Get pose and config as one list [pose, config].
kc.getStateInit()
Return result of getState() called immediately after instantiation, for later reference.
kc.getPoseInit(), getConfigInit()
Return just pose or config as for getStateInit().
kc.changeFrameAbs(inFrame, outFrame, pos)
Transform the passed position pos from the frame inFrame to the frame outFrame. Both frame arguments should be frame constants.
kc.changeFrameRel(inFrame, outFrame, dir)
Transform the passed direction dir from the frame inFrame to the frame outFrame. Both frame arguments should be frame constants.

Example

See client_map and example_kc on the Examples page for more in-depth examples of usage.