|
Mujoco KDL Wrapper
0.5.1
MuJoCo + KDL bridge for robot kinematics and dynamics
|
Classes | |
| class | ResetRequested |
| class | Phase |
Functions | |
| kdl.Frame | world_T_base (int arm) |
| kdl.Vector | cube_spot (int arm, xy) |
| mjk.SceneObject | cube_object (str name, kdl.Vector spot) |
| mjk.SceneObject | free_object (name, shape, x, y, half, rgb) |
| mjk.CameraSpec | camera (name, pos, quat, fovy) |
| tuple[mjk.Env, list[mjk.Robot]] | build_env () |
| kdl.JntArray | jnt (values) |
| list[float] | gravity (kdl.ChainDynParam dyn, q_values) |
| list[float] | solve_near_seed (chain, limits, list[float] seed, kdl.Frame target) |
| list[Phase] | pick_place_phases (mjk.Robot robot) |
| list[float] | rnea_torque (robot, rnea, n_segments, q_des) |
| None | measure (env, dict state) |
| bool | run_phase (env, robots, fingers, solvers, Phase phase, dict state) |
| dict | new_metrics () |
| int | main () |
Variables | |
| list | HOME = [0.0, 0.2618, 3.1416, -2.2689, 0.0, 0.9599, 1.5708] |
| float | SURFACE_Z = 0.70 |
| float | CUBE_HS = 0.02 |
| tuple | PICK = (0.40, 0.00) |
| tuple | PLACE = (0.40, 0.24) |
| list | KP = [100.0, 200.0, 100.0, 200.0, 100.0, 200.0, 100.0] |
| list | KD = [20.0, 28.0, 20.0, 28.0, 20.0, 28.0, 20.0] |
| float | GRIPPER_CLOSED = 0.82 |
| float | MAX_PLACE_ERR = 0.005 |
| float | MIN_ELBOW_HEIGHT = 0.45 |
| float | MAX_DISTURB = 0.001 |
| list | BASES = [(-0.70, -0.12, 0.0), (0.70, 0.12, math.pi)] |
| list | PREFIXES = ["", "r2_"] |
| list | FREE_OBJECTS |
| list | CAMERAS |
Two arms facing each other across a table each pick and place a cube with RNEA computed torque; Python counterpart of ex_rnea_pick_place.cpp. Headless it exits 1 unless both cubes are placed, both elbows stay up, the free objects stay put, the arms never touch and RNEA never fails.
| tuple[mjk.Env, list[mjk.Robot]] ex_rnea_pick_place.build_env | ( | ) |
Definition at line 106 of file ex_rnea_pick_place.py.
References camera(), cube_object(), cube_spot(), and free_object().
Referenced by main().
| mjk.CameraSpec ex_rnea_pick_place.camera | ( | name, | |
| pos, | |||
| quat, | |||
| fovy ) |
Definition at line 97 of file ex_rnea_pick_place.py.
Referenced by build_env().
| mjk.SceneObject ex_rnea_pick_place.cube_object | ( | str | name, |
| kdl.Vector | spot ) |
Definition at line 71 of file ex_rnea_pick_place.py.
Referenced by build_env().
| kdl.Vector ex_rnea_pick_place.cube_spot | ( | int | arm, |
| xy ) |
A cube's centre resting on the table at xy in the arm's base frame, in the world frame.
Definition at line 66 of file ex_rnea_pick_place.py.
References world_T_base().
Referenced by build_env(), and main().
| mjk.SceneObject ex_rnea_pick_place.free_object | ( | name, | |
| shape, | |||
| x, | |||
| y, | |||
| half, | |||
| rgb ) |
Definition at line 84 of file ex_rnea_pick_place.py.
Referenced by build_env().
| list[float] ex_rnea_pick_place.gravity | ( | kdl.ChainDynParam | dyn, |
| q_values ) |
| kdl.JntArray ex_rnea_pick_place.jnt | ( | values | ) |
Definition at line 145 of file ex_rnea_pick_place.py.
Referenced by gravity(), rnea_torque(), and solve_near_seed().
| int ex_rnea_pick_place.main | ( | ) |
Definition at line 281 of file ex_rnea_pick_place.py.
References build_env(), cube_spot(), gravity(), main(), new_metrics(), pick_place_phases(), and run_phase().
Referenced by main().
| None ex_rnea_pick_place.measure | ( | env, | |
| dict | state ) |
What a viewer sees: the elbows, the free objects and any arm-to-arm contact.
Definition at line 234 of file ex_rnea_pick_place.py.
Referenced by run_phase().
| dict ex_rnea_pick_place.new_metrics | ( | ) |
Definition at line 277 of file ex_rnea_pick_place.py.
Referenced by main().
| list[Phase] ex_rnea_pick_place.pick_place_phases | ( | mjk.Robot | robot | ) |
Joint waypoints in the arm's base frame, so they serve every arm placed like this one.
Definition at line 189 of file ex_rnea_pick_place.py.
References solve_near_seed().
Referenced by main().
| list[float] ex_rnea_pick_place.rnea_torque | ( | robot, | |
| rnea, | |||
| n_segments, | |||
| q_des ) |
| bool ex_rnea_pick_place.run_phase | ( | env, | |
| robots, | |||
| fingers, | |||
| solvers, | |||
| Phase | phase, | ||
| dict | state ) |
One update() per step for both arms: it reads the state and applies the previous cycle's command.
Definition at line 249 of file ex_rnea_pick_place.py.
References measure(), and rnea_torque().
Referenced by main().
| list[float] ex_rnea_pick_place.solve_near_seed | ( | chain, | |
| limits, | |||
| list[float] | seed, | ||
| kdl.Frame | target ) |
Damped-least-squares IK stepped from seed, so the answer stays on the seed's branch.
Definition at line 158 of file ex_rnea_pick_place.py.
References jnt().
Referenced by pick_place_phases().
| kdl.Frame ex_rnea_pick_place.world_T_base | ( | int | arm | ) |
Definition at line 61 of file ex_rnea_pick_place.py.
Referenced by cube_spot().
| list ex_rnea_pick_place.BASES = [(-0.70, -0.12, 0.0), (0.70, 0.12, math.pi)] |
Definition at line 31 of file ex_rnea_pick_place.py.
| list ex_rnea_pick_place.CAMERAS |
Definition at line 41 of file ex_rnea_pick_place.py.
| float ex_rnea_pick_place.CUBE_HS = 0.02 |
Definition at line 19 of file ex_rnea_pick_place.py.
| list ex_rnea_pick_place.FREE_OBJECTS |
Definition at line 33 of file ex_rnea_pick_place.py.
| float ex_rnea_pick_place.GRIPPER_CLOSED = 0.82 |
Definition at line 25 of file ex_rnea_pick_place.py.
| list ex_rnea_pick_place.HOME = [0.0, 0.2618, 3.1416, -2.2689, 0.0, 0.9599, 1.5708] |
Definition at line 17 of file ex_rnea_pick_place.py.
| list ex_rnea_pick_place.KD = [20.0, 28.0, 20.0, 28.0, 20.0, 28.0, 20.0] |
Definition at line 24 of file ex_rnea_pick_place.py.
| list ex_rnea_pick_place.KP = [100.0, 200.0, 100.0, 200.0, 100.0, 200.0, 100.0] |
Definition at line 23 of file ex_rnea_pick_place.py.
| float ex_rnea_pick_place.MAX_DISTURB = 0.001 |
Definition at line 28 of file ex_rnea_pick_place.py.
| float ex_rnea_pick_place.MAX_PLACE_ERR = 0.005 |
Definition at line 26 of file ex_rnea_pick_place.py.
| float ex_rnea_pick_place.MIN_ELBOW_HEIGHT = 0.45 |
Definition at line 27 of file ex_rnea_pick_place.py.
| tuple ex_rnea_pick_place.PICK = (0.40, 0.00) |
Definition at line 20 of file ex_rnea_pick_place.py.
| tuple ex_rnea_pick_place.PLACE = (0.40, 0.24) |
Definition at line 21 of file ex_rnea_pick_place.py.
| list ex_rnea_pick_place.PREFIXES = ["", "r2_"] |
Definition at line 32 of file ex_rnea_pick_place.py.
| float ex_rnea_pick_place.SURFACE_Z = 0.70 |
Definition at line 18 of file ex_rnea_pick_place.py.