KeepDirection.emam 743 Bytes
Newer Older
Jean-Marc Ronck's avatar
Jean-Marc Ronck committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package de.rwth.armin.modeling.autopilot.motion;

import de.rwth.armin.modeling.autopilot.common.SignedAngleBetween;

component KeepDirection {
  port
    in  Q                               currentDirectionX,
    in  Q                               currentDirectionY,
    in  Q                               desiredDirectionX,
    in  Q                               desiredDirectionY,

    out Q                               steeringAngle;

  instance SignedAngleBetween           sab;

  connect currentDirectionX     ->      sab.v1x;
  connect currentDirectionY     ->      sab.v1y;
  connect desiredDirectionX     ->      sab.v2x;
  connect desiredDirectionY     ->      sab.v2y;
  connect sab.angle             ->      steeringAngle;
}