klampt.model.config module

A uniform interface for getting/setting configurations of arbitrary objects. A configuration is a flattened list of floats describing the physical pose of an object.

Supported objects include world entities, mathematical objects, and IK goals. You can also set a configuration of a set of objects, or a world, in which case the configuration is the concatenation of the configurations of each object.

Supported objects include:

  • WorldModel

  • RobotModel

  • RigidObjectModel

  • point

  • rotation

  • rigid transform

  • coordinates module objects

  • IKObjective

  • lists containing multiple objects (including nested lists)

Notably, used in the klampt.vis.visualization.setItemConfig(), klampt.vis.visualization.getItemConfig(), and klampt.vis.visualization.animate() methods. Also used in Cartesian interpolation in the cartesian_trajectory module.

Module summary

API

getConfig(item)

Returns a flattened version of the configuration of the given item.

setConfig(item, vector)

Sets the configuration of the given item to the given vector.

getConfigNames(item)

Returns a list giving string names for each configuration dimension of given item.

numConfigParams(item)

Returns the number of free parameters in the flattened version of the configuration of the given item.

distance(item, a, b)

Returns a distance metric for the given configurations a and b of the given item.

interpolate(item, a, b, u)

Returns a distance metric for the given configurations a and b of the given item.

Helpers

isCompound(item)

components(item)

For compound items returns a list of all component sub-items.

componentNames(item)

For compound items returns a list of names of all component sub-items.

klampt.model.config.componentNames(item)[source]

For compound items returns a list of names of all component sub-items. For non-compound items, returns a singular name.

klampt.model.config.components(item)[source]

For compound items returns a list of all component sub-items. For non-compound items, returns a singular item.

klampt.model.config.distance(item, a, b)[source]

Returns a distance metric for the given configurations a and b of the given item. If possible this is a geodesic distance.

klampt.model.config.getConfig(item)[source]

Returns a flattened version of the configuration of the given item. Nearly all Klamp’t objects are recognized, including RobotModel’s, RigidObjectModel’s, WorldModel’s, IKObjectives, and all variable types in the coordinates module.

TODO: ContactPoint

klampt.model.config.getConfigNames(item)[source]

Returns a list giving string names for each configuration dimension of given item. Nearly all Klamp’t objects are recognized, including RobotModel’s, RigidObjectModel’s, WorldModel’s, IKObjectives, and all variable types in the coordinates module.

TODO: ContactPoint

klampt.model.config.interpolate(item, a, b, u)[source]

Returns a distance metric for the given configurations a and b of the given item. If possible this is a geodesic distance.

klampt.model.config.isCompound(item)[source]
klampt.model.config.numConfigParams(item)[source]

Returns the number of free parameters in the flattened version of the configuration of the given item. Nearly all Klamp’t objects are recognized, including RobotModel’s, RigidObjectModel’s, WorldModel’s, IKObjectives, and all variable types in the coordinates module.

klampt.model.config.setConfig(item, vector)[source]

Sets the configuration of the given item to the given vector. Nearly all Klamp’t objects are recognized, including RobotModel’s, RigidObjectModel’s, WorldModel’s, IKObjectives, and all variable types in the coordinates module.

TODO: ContactPoint