< Summary

Class:ApnController
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Controller/ApnController.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:20
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:2
Method coverage:0% (0 of 2)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ApnController(...)0%2100%
PlanImpl(...)0%2100%

File(s)

/github/workspace/Assets/Scripts/Controller/ApnController.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4// The augmented proportional navigation controller applies augmented proportional navigation to
 5// steer the agent towards its target.
 6public class ApnController : PnController {
 07  public ApnController(Agent agent, float navigationGain) : base(agent, navigationGain) {}
 8
 09  protected override Vector3 PlanImpl(in Transformation relativeTransformation) {
 010    Vector3 pnAccelerationInput = base.PlanImpl(relativeTransformation);
 11
 12    // Add a feedforward term proportional to the target's acceleration.
 013    Vector3 targetAcceleration = relativeTransformation.acceleration.cartesian;
 014    Vector3 normalTargetAcceleration =
 15        Vector3.ProjectOnPlane(targetAcceleration, _agent.transform.forward);
 016    Vector3 accelerationInput =
 17        pnAccelerationInput + _navigationGain / 2 * normalTargetAcceleration;
 018    return accelerationInput;
 019  }
 20}