LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.envs.blimp.model Namespace Reference

Classes

class  BlimpLinear
 
class  BlimpParams
 

Functions

str mjcf (BlimpParams p=BlimpParams(), float arena=2.5, float ceiling=3.0)
 
mujoco.MjModel load_blimp_model (BlimpParams p=BlimpParams())
 
np.ndarray allocation (BlimpParams p=BlimpParams())
 
np.ndarray motor_command (np.ndarray u, BlimpParams p=BlimpParams())
 
np.ndarray buoyancy_wrench (mujoco.MjData data, mujoco.MjModel model, BlimpParams p=BlimpParams())
 
BlimpLinear blimp_linear (BlimpParams p=BlimpParams())
 
DiscreteLinearModel blimp_fsyn (float dt, BlimpParams p=BlimpParams())
 
np.ndarray state_from_mujoco (np.ndarray qpos, np.ndarray qvel, float z_ref=0.0)
 

Variables

str F_SIM_VERSION = "blimp-mjcf-v1"
 
str F_SYN_VERSION = "blimp-fsyn-nahs-lin-v1"
 

Detailed Description

MuJoCo blimp ``f_sim`` matched to the NAHS ``BlimpSim`` model, and its ``f_syn``.

Parameters are those that drive the NAHS experiments (`gtmab_model/utilities.py`, see
``docs/blimp_model.md``): Fossen 6-DOF model about the centre of buoyancy (CB) with the
centre of gravity (CG) ``r_gb = 0.05 m`` below it, neutral buoyancy, added mass at the CB,
linear damping at the CB, thrust applied at the gondola ``d_vt = 0.295 m`` below the CB.

MuJoCo realisation (world ENU, z up; body frame x forward, z up):

* free joint whose origin is the CB; body inertial at ``(0, 0, -r_gb)`` with ``m_RB`` and the
  CG inertia ``I``;
* added mass ``(m_Ax, m_Ay, m_Az)`` as **armature** of the three translational dofs (they act
  at the joint origin = CB and carry no gravity, as in Fossen's ``M_A``). The free joint's
  translational dofs are world-frame, so this equals the body-frame added mass up to the
  small roll/pitch angles (``m_Ax = m_Ay`` makes it exact under yaw);
* linear damping ``D_v`` / ``D_omega`` as dof damping (translational at the CB, rotational in
  the body frame); MuJoCo's own fluid model is disabled;
* buoyancy ``m_RB g`` upward at the CB, applied every step through ``xfrc_applied``
  (:func:`buoyancy_wrench`), which MuJoCo applies at the CoM, hence the added torque;
* six thrusters on the gondola (four lateral, two vertical) as site actuators; the
  generalised input ``u = (f_x, f_y, f_z, tau_z)`` (body frame, at the gondola) is mapped to
  them by :func:`allocation`.

``f_syn`` (:func:`blimp_fsyn`) is the NAHS linearisation about hover with zero yaw, restricted
to its four decoupled blocks ``(v_x, p_x)``, ``(v_y, p_y)``, ``(v_z, p_z)``, ``(omega_z, psi)``
(roll/pitch are driven by the lateral forces but feed back into nothing in that model and are
unconstrained, as in NAHS); ZOH-discretised at the planning step.

Function Documentation

◆ allocation()

np.ndarray rl_stl.envs.blimp.model.allocation ( BlimpParams   p = BlimpParams())
``u = M f`` with ``u = (f_x, f_y, f_z, tau_z)`` (body, at the gondola) and motor thrusts ``f``.

Lateral pairs: t1/t2 push along +x at y = +-a (tau_z = -a f1 + a f2), t3/t4 along +y at
x = +-a (tau_z = a f3 - a f4); t5/t6 push along +z.

◆ blimp_fsyn()

DiscreteLinearModel rl_stl.envs.blimp.model.blimp_fsyn ( float  dt,
BlimpParams   p = BlimpParams() 
)
8-state ``f_syn``: ``x = (p_x, p_y, p_z, psi, v_x, v_y, v_z, omega_z)``, ``u = (f_x, f_y, f_z, tau_z)``.

Positions in the world frame relative to the arena centre (``p_z`` = height); exact ZOH.

◆ blimp_linear()

BlimpLinear rl_stl.envs.blimp.model.blimp_linear ( BlimpParams   p = BlimpParams())

◆ buoyancy_wrench()

np.ndarray rl_stl.envs.blimp.model.buoyancy_wrench ( mujoco.MjData  data,
mujoco.MjModel  model,
BlimpParams   p = BlimpParams() 
)
``xfrc_applied`` row (force, torque about the CoM) of buoyancy ``m_RB g`` at the CB.

◆ load_blimp_model()

mujoco.MjModel rl_stl.envs.blimp.model.load_blimp_model ( BlimpParams   p = BlimpParams())

◆ mjcf()

str rl_stl.envs.blimp.model.mjcf ( BlimpParams   p = BlimpParams(),
float   arena = 2.5,
float   ceiling = 3.0 
)

◆ motor_command()

np.ndarray rl_stl.envs.blimp.model.motor_command ( np.ndarray  u,
BlimpParams   p = BlimpParams() 
)
Minimum-norm motor thrusts for the generalised input (clipped to the motor ranges).

◆ state_from_mujoco()

np.ndarray rl_stl.envs.blimp.model.state_from_mujoco ( np.ndarray  qpos,
np.ndarray  qvel,
float   z_ref = 0.0 
)
``f_syn`` state of the CB from MuJoCo ``qpos/qvel`` (yaw from the quaternion).

Velocities: world-frame CB velocity (``f_syn`` inputs ``f_x, f_y`` are world-frame horizontal
forces; the tracker rotates them into the body frame), yaw rate = body z rate (MuJoCo free
joint angular velocity is body-frame).

Variable Documentation

◆ F_SIM_VERSION

str rl_stl.envs.blimp.model.F_SIM_VERSION = "blimp-mjcf-v1"

◆ F_SYN_VERSION

str rl_stl.envs.blimp.model.F_SYN_VERSION = "blimp-fsyn-nahs-lin-v1"