LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.envs.skydio_x2.tracker Namespace Reference

Classes

class  TrackerConfig
 
class  TrackerParams
 

Functions

TrackerParams make_tracker_params (float mass, float gravity, TrackerConfig cfg=TrackerConfig())
 
jnp.ndarray tracker_action (jnp.ndarray quat, jnp.ndarray p_com, jnp.ndarray v_com, jnp.ndarray p_ref, jnp.ndarray v_ref, jnp.ndarray a_ref, TrackerParams tp, CTBRParams cp)
 

Detailed Description

Outer-loop tracker: ``f_syn`` reference (p, v, a) -> normalized CTBR action.

This lets synthesized plans and learned policies drive MuJoCo through the *same*
action interface (:mod:`rl_stl.envs.skydio_x2.ctbr`)::

    a_cmd  = a_ref + Kp (p_ref - p) + Kd (v_ref - v)               (world, COM)
    f_des  = m (a_cmd + g e_z), horizontal part limited to tilt_max
    T      = f_des . z_body                                         (projected thrust)
    z_des  = f_des / |f_des|
    w_tilt = K_att_xy * R^T (z_body x z_des)                        (reduced attitude, body frame)
    w_yaw  = K_att_z * wrap(yaw_ref - yaw) * R^T e_z                (heading, lower priority)
    action = command_to_normalized(T, w_tilt + w_yaw)

The tilt and heading errors are decoupled on purpose: the full SO(3) error
``1/2 vee(R_des^T R - R^T R_des)`` loses its yaw component and flips the sign of the
tilt correction near a 180 deg heading error, which diverged from random-yaw resets.

Pure ``jax.numpy``; single sample (vmap for batches).

Function Documentation

◆ make_tracker_params()

TrackerParams rl_stl.envs.skydio_x2.tracker.make_tracker_params ( float  mass,
float  gravity,
TrackerConfig   cfg = TrackerConfig() 
)

◆ tracker_action()

jnp.ndarray rl_stl.envs.skydio_x2.tracker.tracker_action ( jnp.ndarray  quat,
jnp.ndarray  p_com,
jnp.ndarray  v_com,
jnp.ndarray  p_ref,
jnp.ndarray  v_ref,
jnp.ndarray  a_ref,
TrackerParams  tp,
CTBRParams  cp 
)