public SmartQuadrupedController(QuadrupedIkDriver driver) { _driver = driver ?? throw new ArgumentNullException(nameof(driver)); _driver.Setup(); _lastWrittenPosition = _driver.ReadCurrentLegPositions(); Task.Run(MainControllerLoop).ConfigureAwait(false); }
public void DetachDriver() { if (!_engineTask.IsCompleted) { throw new InvalidOperationException("Engine has to be stopped before detaching the driver"); } Driver = null; }
public InterpolationGaitEngine(QuadrupedIkDriver driver) : base(driver) { Driver.Setup(); _lastWrittenPosition = Driver.ReadCurrentLegPositions(); if (_moves.TryDequeue(out var deqeueuedLegPosition)) { _nextMove = deqeueuedLegPosition; } StartEngine(); }
public FunctionalGaitEngine(QuadrupedIkDriver driver) : base(driver) { Driver.Setup(); var currentPosition = driver.ReadCurrentLegPositions(); float average = (currentPosition.LeftFront.Z + currentPosition.RightFront.Z + currentPosition.LeftRear.Z + currentPosition.RightRear.Z) / 4; if (average > -9) { Driver.MoveLegsSynced(RelaxedStance.Transform(new Vector3(0, 0, -LegHeight))); Thread.Sleep(1000); } _lastWrittenPosition = RelaxedStance; Driver.MoveLegsSynced(_lastWrittenPosition); StartEngine(); }
protected QuadrupedGaitEngine(QuadrupedIkDriver driver) { Driver = driver ?? throw new ArgumentNullException(nameof(driver)); }