|
Mujoco KDL Wrapper
0.5.1
MuJoCo + KDL bridge for robot kinematics and dynamics
|
Classes | |
| class | Phase |
| class | ResetRequested |
Functions | |
| mjk.AttachmentSpec | gripper_attachment (str gripper_path) |
| mjk.AttachmentSpec | bottle_attachment (str bottle_path) |
| mjk.SceneObject | table_object (str table_path) |
| mjk.SceneObject | receiver_object (str receiver_path) |
| mjk.SceneObject | ball_object (int index) |
| tuple[mjk.Env, mjk.Robot] | build_env () |
| kdl.JntArray | jnt (list[float] values) |
| list[float] | as_list (kdl.JntArray q) |
| float | clamp (float value, float low, float high) |
| tuple[kdl.JntArray, kdl.JntArray] | joint_limit_arrays (mjk.Robot robot) |
| dict[str, list[float]] | build_waypoints (mjk.Env env, mjk.Robot robot) |
| list[float] | gravity (kdl.ChainDynParam dyn, q_values) |
| None | pd_gravity (mjk.Robot robot, kdl.ChainDynParam dyn, list[float] target) |
| float | max_abs_joint_err (mjk.Robot robot, list[float] target) |
| list[float] | lerp (list[float] start, list[float] target, float alpha) |
| None | place_balls_in_bottle (mjk.Env env, mjk.Robot robot) |
| tuple[int, list[float]] | balls_in_receiver (mjk.Env env) |
| bool | run_phase (env, robot, fingers, dyn, Phase phase, dict state) |
| int | main () |
Variables | |
| list | HOME = [0.0, 0.2618, 3.1416, -2.2689, 0.0, 0.9599, 1.5708] |
| float | TABLE_Z = 0.70 |
| float | ROBOT_BACK_X = -0.26 |
| float | JUG_X = 0.30 |
| float | JUG_Y = 0.14 |
| float | RETREAT_X = JUG_X - 0.08 |
| float | RETREAT_Y = JUG_Y - 0.08 |
| float | JUG_RADIUS = 0.028 |
| float | JUG_HEIGHT = 0.084 |
| float | BALL_RADIUS = 0.007 |
| int | NUM_BALLS = 36 |
| float | POUR_TILT_RAD = 1.95 |
| float | TILT_OUTLET_Z = TABLE_Z + 0.18 |
| float | GRIPPER_CLOSED = 0.82 |
| int | MIN_IN_RECEIVER = 24 |
| int | IK_TOL = 3e-3 |
| list | KP = [120.0, 220.0, 120.0, 220.0, 110.0, 190.0, 90.0] |
| list | KD = [12.0, 22.0, 12.0, 22.0, 11.0, 18.0, 9.0] |
Pour balls into a tabletop receiver; Python counterpart of src/examples/ex_table_pour.cpp. Headless, it exits 1 if fewer than MIN_IN_RECEIVER balls land in the receiver; --record [out.mp4] also writes a 1080p MP4 through VideoRecorder (EGL + ffmpeg).
| list[float] ex_table_pour.as_list | ( | kdl.JntArray | q | ) |
Definition at line 132 of file ex_table_pour.py.
Referenced by build_waypoints().
| mjk.SceneObject ex_table_pour.ball_object | ( | int | index | ) |
Definition at line 84 of file ex_table_pour.py.
Referenced by build_env().
| tuple[int, list[float]] ex_table_pour.balls_in_receiver | ( | mjk.Env | env | ) |
Definition at line 259 of file ex_table_pour.py.
Referenced by main().
| mjk.AttachmentSpec ex_table_pour.bottle_attachment | ( | str | bottle_path | ) |
Definition at line 59 of file ex_table_pour.py.
Referenced by build_env().
| tuple[mjk.Env, mjk.Robot] ex_table_pour.build_env | ( | ) |
Definition at line 97 of file ex_table_pour.py.
References ball_object(), bottle_attachment(), gripper_attachment(), receiver_object(), and table_object().
Referenced by main().
| dict[str, list[float]] ex_table_pour.build_waypoints | ( | mjk.Env | env, |
| mjk.Robot | robot ) |
Definition at line 151 of file ex_table_pour.py.
References as_list(), jnt(), and joint_limit_arrays().
Referenced by main().
| float ex_table_pour.clamp | ( | float | value, |
| float | low, | ||
| float | high ) |
Definition at line 136 of file ex_table_pour.py.
Referenced by run_phase().
| list[float] ex_table_pour.gravity | ( | kdl.ChainDynParam | dyn, |
| q_values ) |
Definition at line 223 of file ex_table_pour.py.
References jnt().
Referenced by main(), and pd_gravity().
| mjk.AttachmentSpec ex_table_pour.gripper_attachment | ( | str | gripper_path | ) |
Definition at line 51 of file ex_table_pour.py.
Referenced by build_env().
| kdl.JntArray ex_table_pour.jnt | ( | list[float] | values | ) |
Definition at line 125 of file ex_table_pour.py.
Referenced by build_waypoints(), and gravity().
| tuple[kdl.JntArray, kdl.JntArray] ex_table_pour.joint_limit_arrays | ( | mjk.Robot | robot | ) |
Definition at line 140 of file ex_table_pour.py.
Referenced by build_waypoints().
| list[float] ex_table_pour.lerp | ( | list[float] | start, |
| list[float] | target, | ||
| float | alpha ) |
Definition at line 241 of file ex_table_pour.py.
Referenced by run_phase().
| int ex_table_pour.main | ( | ) |
Definition at line 304 of file ex_table_pour.py.
References balls_in_receiver(), build_env(), build_waypoints(), gravity(), main(), place_balls_in_bottle(), and run_phase().
Referenced by main().
| float ex_table_pour.max_abs_joint_err | ( | mjk.Robot | robot, |
| list[float] | target ) |
Definition at line 237 of file ex_table_pour.py.
Referenced by run_phase().
| None ex_table_pour.pd_gravity | ( | mjk.Robot | robot, |
| kdl.ChainDynParam | dyn, | ||
| list[float] | target ) |
| None ex_table_pour.place_balls_in_bottle | ( | mjk.Env | env, |
| mjk.Robot | robot ) |
Definition at line 245 of file ex_table_pour.py.
Referenced by main().
| mjk.SceneObject ex_table_pour.receiver_object | ( | str | receiver_path | ) |
Definition at line 76 of file ex_table_pour.py.
Referenced by build_env().
| bool ex_table_pour.run_phase | ( | env, | |
| robot, | |||
| fingers, | |||
| dyn, | |||
| Phase | phase, | ||
| dict | state ) |
One update() per step: it reads the state and applies the previous cycle's command.
Definition at line 275 of file ex_table_pour.py.
References clamp(), lerp(), max_abs_joint_err(), and pd_gravity().
Referenced by main().
| mjk.SceneObject ex_table_pour.table_object | ( | str | table_path | ) |
Definition at line 67 of file ex_table_pour.py.
Referenced by build_env().
| float ex_table_pour.BALL_RADIUS = 0.007 |
Definition at line 26 of file ex_table_pour.py.
| float ex_table_pour.GRIPPER_CLOSED = 0.82 |
Definition at line 30 of file ex_table_pour.py.
| list ex_table_pour.HOME = [0.0, 0.2618, 3.1416, -2.2689, 0.0, 0.9599, 1.5708] |
Definition at line 17 of file ex_table_pour.py.
| int ex_table_pour.IK_TOL = 3e-3 |
Definition at line 32 of file ex_table_pour.py.
| float ex_table_pour.JUG_HEIGHT = 0.084 |
Definition at line 25 of file ex_table_pour.py.
| float ex_table_pour.JUG_RADIUS = 0.028 |
Definition at line 24 of file ex_table_pour.py.
| float ex_table_pour.JUG_X = 0.30 |
Definition at line 20 of file ex_table_pour.py.
| float ex_table_pour.JUG_Y = 0.14 |
Definition at line 21 of file ex_table_pour.py.
| list ex_table_pour.KD = [12.0, 22.0, 12.0, 22.0, 11.0, 18.0, 9.0] |
Definition at line 34 of file ex_table_pour.py.
| list ex_table_pour.KP = [120.0, 220.0, 120.0, 220.0, 110.0, 190.0, 90.0] |
Definition at line 33 of file ex_table_pour.py.
| int ex_table_pour.MIN_IN_RECEIVER = 24 |
Definition at line 31 of file ex_table_pour.py.
| int ex_table_pour.NUM_BALLS = 36 |
Definition at line 27 of file ex_table_pour.py.
| float ex_table_pour.POUR_TILT_RAD = 1.95 |
Definition at line 28 of file ex_table_pour.py.
| float ex_table_pour.RETREAT_X = JUG_X - 0.08 |
Definition at line 22 of file ex_table_pour.py.
| float ex_table_pour.RETREAT_Y = JUG_Y - 0.08 |
Definition at line 23 of file ex_table_pour.py.
| float ex_table_pour.ROBOT_BACK_X = -0.26 |
Definition at line 19 of file ex_table_pour.py.
| float ex_table_pour.TABLE_Z = 0.70 |
Definition at line 18 of file ex_table_pour.py.
| float ex_table_pour.TILT_OUTLET_Z = TABLE_Z + 0.18 |
Definition at line 29 of file ex_table_pour.py.