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

get_config(item)

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

set_config(item, vector)

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

get_config_names(item)

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

num_config_params(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

is_compound(item)

rtype

bool

components(item)

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

component_names(item)

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

klampt.model.config.is_compound(item)[source]
Return type

bool

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.component_names(item)[source]

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

Return type

Union[str, List[str]]

klampt.model.config.num_config_params(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.

Return type

int

klampt.model.config.get_config(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

Return type

Sequence[float]

klampt.model.config.set_config(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

Return type

None

klampt.model.config.get_config_names(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

Return type

List[str]

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.

Return type

float

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.

Return type

Sequence[float]

klampt.model.config.getConfigNames(*args, **kwargs)

Deprecated in a future version of Klampt. Use get_config_names instead

klampt.model.config.getConfig(*args, **kwargs)

Deprecated in a future version of Klampt. Use get_config instead

klampt.model.config.setConfig(*args, **kwargs)

Deprecated in a future version of Klampt. Use set_config instead

klampt.model.config.componentNames(*args, **kwargs)

Deprecated in a future version of Klampt. Use component_names instead

klampt.model.config.isCompound(*args, **kwargs)

Deprecated in a future version of Klampt. Use is_compound instead

klampt.model.config.numConfigParams(*args, **kwargs)

Deprecated in a future version of Klampt. Use num_config_params instead