State
The State
object is the response back after calling solve
.
It contains the state of the robot in terms of joint and frames, as well as some diagnostic information regarding proximity
of various shapes
and the center_of_mass
of the robot.
note
For Solver initialization
, only origin
and joints
parameters have to be defined if user decided to provide a State
object to the initial_state
parameter.
Parameter | Type | Optional | Description |
---|---|---|---|
origin | isometry consisted of translation and rotation | no | The transform of the root of the robot. This data is also included in frames |
joints | lookup table of float indexed by a string key | no | A lookup table of the joint values for each movable joint |
frames | lookup table of TransformInfo indexed by string key | can be ignored for Solver initialization | A lookup table of each link’s position in both world and local coordinates |
proximity | list of ProximityInfo | can be ignored for Solver initialization | A vector of data representing pairwise proximity between the robot’s parts and other robot parts and the environment. Each entry contains distance, as well as the closest points between the pair of colliders |
center_of_mass | list of float | can be ignored for Solver initialization | A 3-vector representing the center of mass of the robot in the world frame |
Import
note
There is no need to import for Javascript.
- Python
- Rust
from lively import State
use lively::utils::state::State;
Declaration Example
- Javascript
- Python
- Rust
let state = {origin:{translation:[0,0,0],rotation:[1,0,0,0]},joints:{"panda_joint1":0.0,"panda_joint2":0.0}}
state = State(origin=Transform.identity(),joints={"panda_joint1":0.0,"panda_joint2":0.0})
let iso = Isometry3::from_parts(
Translation3::new(
0.6497281999999998,
-0.24972819999999987,
0.050000000000000044,
),
UnitQuaternion::from_quaternion(Quaternion::new(
0.0,
0.0,
-0.7069999677447771,
0.7072135784958345,
)),
);
let mut joints: HashMap<String, f64> = HashMap::new();
let mut frames: HashMap<String,TransformInfo> = HashMap::new();
let mut proximities = Vec::new();
let mut center_of_mass: Vector3<f64>::new();
let state = State::new(iso, joints, frames, proximities, center_of_mass);