larvaworld.lib.model.modules.locomotor

Classes

Locomotor

Locomotor module orchestrating agent movement control.

Module Contents

class larvaworld.lib.model.modules.locomotor.Locomotor(conf: Any, dt: float = 0.1, **kwargs: Any)

Bases: larvaworld.lib.param.NestedConf

Locomotor module orchestrating agent movement control.

Coordinates multiple behavioral modules (crawler, turner, feeder, intermitter) to produce realistic larva locomotion patterns with peristaltic crawling, turning, feeding, and run/pause transitions.

Attributes:

interference: Crawl-bend coupling module (attenuates turning during crawling) intermitter: Behavioral intermittency module (controls run/pause/feed states) feeder: Feeding behavior module (head-sweeping motions) turner: Body-bending module (directional changes) crawler: Peristaltic crawling module (forward locomotion) dt: Simulation time step (seconds)

Args:
conf: Locomotor configuration dict with module configs:
  • ‘crawler’: Crawler module config (or None)

  • ‘turner’: Turner module config (or None)

  • ‘feeder’: Feeder module config (or None)

  • ‘intermitter’: Intermitter module config (or None)

  • ‘interference’: Interference module config (or None)

dt: Simulation time step in seconds (default: 0.1) **kwargs: Additional keyword arguments passed to parent class

Returns:

Tuple of (linear_velocity, angular_velocity, feed_flag) from step()

Example:
>>> locomotor = Locomotor(conf=loco_conf, dt=0.1)
>>> lin_vel, ang_vel, feeding = locomotor.step(A_in=0.5, length=2.0, on_food=False)
interference
intermitter
feeder
turner
crawler
dt: float = 0.1
on_new_pause() None
on_new_run() None
on_new_feed() None
step_intermitter(**kwargs: Any) None
property stride_completed: bool
property feed_motion: bool
step(A_in: float = 0, length: float = 1, on_food: bool = False) tuple[float, float, bool]