Simulation Parameters

Parameters of the simulation, including physics parameters (eg. friction, gravity) and visualization parameters (eg. render mode, render FPS), are defined in the Parameters class. This class, however, does not include parameters that are specific to the NeuroMechFly model itself (eg. which body segments are included in collision tracking; where the model is spawned at the beginning of the simulation).

class flygym.mujoco.Parameters

Parameters of the MuJoCo simulation.

Attributes:
timestepfloat

Simulation timestep in seconds, by default 0.0001.

joint_stiffnessfloat

Stiffness of actuated joints, by default 0.05.

joint_dampingfloat

Damping coefficient of actuated joints, by default 0.06.

actuator_kpfloat

Position gain of the actuators, by default 18.0.

tarsus_stiffnessfloat

Stiffness of the passive, compliant tarsus joints, by default 2.2.

tarsus_dampingfloat

Damping coefficient of the passive, compliant tarsus joints, by default 0.126.

frictionfloat

Sliding, torsional, and rolling friction coefficients, by default (1, 0.005, 0.0001)

gravityTuple[float, float, float]

Gravity in (x, y, z) axes, by default (0., 0., -9.81e3). Note that the gravity is -9.81 * 1000 due to the scaling of the model.

contact_solref: Tuple[float, float]

MuJoCo contact reference parameters (see MuJoCo documentation for details). By default (9.99e-01, 9.999e-01, 1.0e-03, 5.0e-01, 2.0e+00). Under the default configuration, contacts are very stiff. This is to avoid penetration of the leg tips into the ground when leg adhesion is enabled. The user might want to decrease the stiffness if the stability becomes an issue.

contact_solimp: Tuple[float, float, float, float, float]

MuJoCo contact reference parameters (see MuJoCo docs for details). By default (9.99e-01, 9.999e-01, 1.0e-03, 5.0e-01, 2.0e+00). Under the default configuration, contacts are very stiff. This is to avoid penetration of the leg tips into the ground when leg adhesion is enabled. The user might want to decrease the stiffness if the stability becomes an issue.

enable_olfactionbool

Whether to enable olfaction, by default False.

enable_visionbool

Whether to enable vision, by default False.

render_raw_visionbool

If enable_vision is True, whether to render the raw vision (raw pixel values before binning by ommatidia), by default False.

render_modestr

The rendering mode. Can be “saved” or “headless”, by default “saved”.

render_window_sizeTuple[int, int]

Size of the rendered images in pixels, by default (640, 480).

render_playspeedfloat

Play speed of the rendered video, by default 0.2.

render_fpsint

FPS of the rendered video when played at render_playspeed, by default 30.

render_camerastr

The camera that will be used for rendering, by default “Animat/camera_left”.

render_timestamp_textbool

If True, text indicating the current simulation time will be added to the rendered video.

render_playspeed_textbool

If True, text indicating the play speed will be added to the rendered video.

vision_refresh_rateint

The rate at which the vision sensor is updated, in Hz, by default 500.

enable_adhesionbool

Whether to enable adhesion. By default False.

draw_adhesionbool

Whether to signal that adhesion is on by changing the color of the concerned leg. By default False.

adhesion_forcefloat

The magnitude of the adhesion force. By default 20.

draw_sensor_markersbool

If True, colored spheres will be added to the model to indicate the positions of the cameras (for vision) and odor sensors. By default False.

draw_contactsbool

If True, arrows will be drawn to indicate contact forces between the legs and the ground. By default Fasle.

decompose_contactsbool

If True, the arrows visualizing contact forces will be decomposed into x-y-z components. By default True.

force_arrow_scalingfloat

Scaling factor determining the length of arrows visualizing contact forces. By default 1.0.

tip_lengthfloat

Size of the arrows indicating the contact forces in pixels. By default 10.

contact_thresholdfloat

The threshold for contact detection in mN (forces below this magnitude will be ignored). By default 0.1.

draw_gravtiybool

If True, an arrow will be drawn indicating the direction of gravity. This is useful during climbing simulations. By default False.

gravity_arrow_scalingfloat

Scaling factor determining the size of the arrow indicating gravity. By default 0.0001.

align_camera_with_gravitybool

If True, the camera will be rotated such that gravity points down. This is usful during climbing simulations. By default False.

camera_follows_fly_orientation: bool

If True, the camera will be rotated so that it aligns with the fly’s orientation. By default False.