Mujoco KDL Wrapper  0.5.1
MuJoCo + KDL bridge for robot kinematics and dynamics
Loading...
Searching...
No Matches
ex_table_pick_place Namespace Reference

Classes

class  ResetRequested
class  Phase

Functions

tuple[mjk.Env, 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)
dict new_metrics ()
float push_scale (float t_rel)
None measure_push (env, robot, dict state, q_ref, cube, float t_rel, force)
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 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 = [10.0, 20.0, 10.0, 20.0, 10.0, 20.0, 10.0]
float GRIPPER_CLOSED = 0.82
list CUBE_START = [PICK[0], PICK[1], SURFACE_Z + CUBE_HS]
float MAX_PLACE_ERR = 0.005
str PUSH_BODY = "bracelet_link"
str PUSH_PHASE = "PLACE_ABOVE"
float PUSH_FORCE = 20.0
 PUSH_DIR = kdl.Vector(1.0, 0.0, 0.0)
 PUSH_ON
 PUSH_OFF
 PUSH_RAMP
float SETTLE = 0.5
float MIN_DEFLECTION = 0.010
tuple DEFLECTION_RATIO = (0.85, 1.15)
float MAX_RESIDUAL = 0.004
float MAX_CUBE_SLIP = 0.010
float MIN_ELBOW_HEIGHT = 0.45

Detailed Description

Table pick-place with joint impedance, pushed while carrying the cube; Python counterpart
of ex_table_pick_place.cpp. Headless it exits 1 unless the cube is placed, the push deflection
matches J K^-1 J^T F, the arm springs back, the cube stays in hand and the elbow stays up.

Function Documentation

◆ build_env()

tuple[mjk.Env, mjk.Robot] ex_table_pick_place.build_env ( )

Definition at line 55 of file ex_table_pick_place.py.

Referenced by main().

◆ gravity()

list[float] ex_table_pick_place.gravity ( kdl.ChainDynParam dyn,
q_values )

Definition at line 99 of file ex_table_pick_place.py.

References jnt().

Referenced by main(), and run_phase().

◆ jnt()

kdl.JntArray ex_table_pick_place.jnt ( values)

Definition at line 92 of file ex_table_pick_place.py.

Referenced by gravity(), measure_push(), and solve_near_seed().

◆ main()

int ex_table_pick_place.main ( )

Definition at line 253 of file ex_table_pick_place.py.

References build_env(), gravity(), main(), new_metrics(), pick_place_phases(), and run_phase().

Referenced by main().

◆ measure_push()

None ex_table_pick_place.measure_push ( env,
robot,
dict state,
q_ref,
cube,
float t_rel,
force )
Deflection against the reference of the same cycle, and what the stiffness predicts.

Definition at line 184 of file ex_table_pick_place.py.

References jnt().

Referenced by run_phase().

◆ new_metrics()

dict ex_table_pick_place.new_metrics ( )

Definition at line 167 of file ex_table_pick_place.py.

Referenced by main().

◆ pick_place_phases()

list[Phase] ex_table_pick_place.pick_place_phases ( mjk.Robot robot)

Definition at line 136 of file ex_table_pick_place.py.

References solve_near_seed().

Referenced by main().

◆ push_scale()

float ex_table_pick_place.push_scale ( float t_rel)

Definition at line 178 of file ex_table_pick_place.py.

Referenced by run_phase().

◆ run_phase()

bool ex_table_pick_place.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 216 of file ex_table_pick_place.py.

References gravity(), measure_push(), and push_scale().

Referenced by main().

◆ solve_near_seed()

list[float] ex_table_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 105 of file ex_table_pick_place.py.

References jnt().

Referenced by pick_place_phases().

Variable Documentation

◆ CUBE_HS

float ex_table_pick_place.CUBE_HS = 0.02

Definition at line 18 of file ex_table_pick_place.py.

◆ CUBE_START

list ex_table_pick_place.CUBE_START = [PICK[0], PICK[1], SURFACE_Z + CUBE_HS]

Definition at line 24 of file ex_table_pick_place.py.

◆ DEFLECTION_RATIO

tuple ex_table_pick_place.DEFLECTION_RATIO = (0.85, 1.15)

Definition at line 35 of file ex_table_pick_place.py.

◆ GRIPPER_CLOSED

float ex_table_pick_place.GRIPPER_CLOSED = 0.82

Definition at line 23 of file ex_table_pick_place.py.

◆ HOME

list ex_table_pick_place.HOME = [0.0, 0.2618, 3.1416, -2.2689, 0.0, 0.9599, 1.5708]

Definition at line 16 of file ex_table_pick_place.py.

◆ KD

list ex_table_pick_place.KD = [10.0, 20.0, 10.0, 20.0, 10.0, 20.0, 10.0]

Definition at line 22 of file ex_table_pick_place.py.

◆ KP

list ex_table_pick_place.KP = [100.0, 200.0, 100.0, 200.0, 100.0, 200.0, 100.0]

Definition at line 21 of file ex_table_pick_place.py.

◆ MAX_CUBE_SLIP

float ex_table_pick_place.MAX_CUBE_SLIP = 0.010

Definition at line 37 of file ex_table_pick_place.py.

◆ MAX_PLACE_ERR

float ex_table_pick_place.MAX_PLACE_ERR = 0.005

Definition at line 25 of file ex_table_pick_place.py.

◆ MAX_RESIDUAL

float ex_table_pick_place.MAX_RESIDUAL = 0.004

Definition at line 36 of file ex_table_pick_place.py.

◆ MIN_DEFLECTION

float ex_table_pick_place.MIN_DEFLECTION = 0.010

Definition at line 34 of file ex_table_pick_place.py.

◆ MIN_ELBOW_HEIGHT

float ex_table_pick_place.MIN_ELBOW_HEIGHT = 0.45

Definition at line 38 of file ex_table_pick_place.py.

◆ PICK

tuple ex_table_pick_place.PICK = (0.40, 0.00)

Definition at line 19 of file ex_table_pick_place.py.

◆ PLACE

tuple ex_table_pick_place.PLACE = (0.40, 0.24)

Definition at line 20 of file ex_table_pick_place.py.

◆ PUSH_BODY

str ex_table_pick_place.PUSH_BODY = "bracelet_link"

Definition at line 27 of file ex_table_pick_place.py.

◆ PUSH_DIR

ex_table_pick_place.PUSH_DIR = kdl.Vector(1.0, 0.0, 0.0)

Definition at line 30 of file ex_table_pick_place.py.

◆ PUSH_FORCE

float ex_table_pick_place.PUSH_FORCE = 20.0

Definition at line 29 of file ex_table_pick_place.py.

◆ PUSH_OFF

ex_table_pick_place.PUSH_OFF

Definition at line 31 of file ex_table_pick_place.py.

◆ PUSH_ON

ex_table_pick_place.PUSH_ON

Definition at line 31 of file ex_table_pick_place.py.

◆ PUSH_PHASE

str ex_table_pick_place.PUSH_PHASE = "PLACE_ABOVE"

Definition at line 28 of file ex_table_pick_place.py.

◆ PUSH_RAMP

ex_table_pick_place.PUSH_RAMP

Definition at line 31 of file ex_table_pick_place.py.

◆ SETTLE

float ex_table_pick_place.SETTLE = 0.5

Definition at line 32 of file ex_table_pick_place.py.

◆ SURFACE_Z

float ex_table_pick_place.SURFACE_Z = 0.70

Definition at line 17 of file ex_table_pick_place.py.