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
|
Returns a flattened version of the configuration of the given item. |
|
Sets the configuration of the given item to the given vector. |
|
Returns a list giving string names for each configuration dimension of given item. |
|
Returns the number of free parameters in the flattened version of the configuration of the given item. |
|
Returns a distance metric for the given configurations a and b of the given item. |
|
Returns a distance metric for the given configurations a and b of the given item. |
Helpers
|
|
|
For compound items returns a list of all component sub-items. |
|
For compound items returns a list of names of all component sub-items. |
- 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.componentNames(*args, **kwargs)
Deprecated in a future version of Klampt. Use component_names instead
- klampt.model.config.getConfig(*args, **kwargs)
Deprecated in a future version of Klampt. Use get_config instead
- klampt.model.config.getConfigNames(*args, **kwargs)
Deprecated in a future version of Klampt. Use get_config_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
- klampt.model.config.setConfig(*args, **kwargs)
Deprecated in a future version of Klampt. Use set_config instead