larvaworld.lib.model.agents.larva_offline

Classes

LarvaOffline

Simplified larva agent for offline kinematic simulation.

Module Contents

class larvaworld.lib.model.agents.larva_offline.LarvaOffline(**kwargs: Any)

Bases: larvaworld.lib.model.agents.larva_robot.LarvaRobot

Simplified larva agent for offline kinematic simulation.

Extends LarvaRobot for lightweight simulation without full environment, using minimal physics (orientation tracking, bend angle constraints). Used for rapid trajectory generation and parameter exploration.

Attributes:

fo: Front orientation angle (radians) ro: Rear orientation angle (radians) body_bend: Current body bend angle (radians) dst: Distance traveled in last timestep cum_dst: Cumulative distance traveled

Example:
>>> larva = LarvaOffline(model='explorer', length=0.003)
>>> larva.step()  # Kinematic update without environment
fo
ro
step() None

Perform a single simulation step for the larva agent.

This method updates the agent’s state based on the current model time step. It calculates the linear and angular velocities, updates the agent’s orientation and position, and records the trajectory.