klampt.model.config module

A uniform interface for determining configurations of arbitrary objects. These objects can be a world entity, a mathematical object, or an IK goal.

A configuration is a flattened list of floats describing the physical layout of the object.

Most notably, used in the klampt.vis.visualization.setItemConfig(), klampt.vis.visualization.getItemConfig(), and klampt.vis.visualization.animate() methods.

Supported objects include

  • WorldModel
  • RobotModel
  • RigidObjectModel
  • point
  • rotation
  • rigid transform
  • coordinates module objects
  • IKObjective
  • lists containing multiple objects (including nested lists)
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