Commit 2ab2f0a9 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Model: Cleanup

parent b733b06a
package ba;
import ba.intersection.IntersectionController;
import ba.util.RelToAbsTrajectory;
import ba.util.CommQuality;
import ba.vehicle.VelocityController;
import ba.collision.CollisionDetection;
import ba.struct.Rectangle;
//component System<N1 n = 2,N1 x = 1,N1 m = 5,N1 m1 = 4,N1 m2 = 10>{
component System{
ports
//Intersection ports
ports in Q(0s : 10s) cutoffTimeIn,
in B isActiveIn,
in Q^{3,5} absTrajectory[2];
in Q(0s : 10s) cutoffTimeIn,
in B isActiveIn,
in Q^{3,5} absTrajectory[2],
//Collision detection ports
ports in Rectangle hullsIn[2],
out B collisionOut;
in Rectangle hullsIn[2],
out B collisionOut,
//Vehicle ports
ports in Q(0m/s^2 : 100m/s^2) maxAccel[2],
in Q(0m/s : 60m/s) maxVel[2],
in Q(0s : 10s) deltaTime[2],
in Q(0s : 60s) holdTime[2],
in B resetVel[2],
in B slowDown[2],
out Q(0m/s : 60m/s) curVel[2];
in Q(0m/s^2 : 100m/s^2) maxAccel[2],
in Q(0m/s : 60m/s) maxVel[2],
in Q(0s : 10s) deltaTime[2],
in Q(0s : 60s) holdTime[2],
in B resetVel[2],
in B slowDown[2],
out Q(0m/s : 60m/s) curVel[2];
instance IntersectionController intersectionController;
instance CollisionDetection collisionDetection;
instance CommQuality<B> stopCommQuality[2];
instance VelocityController(3.0) velocityController[2];
//Intersection
connect cutoffTimeIn -> intersectionController.cutoffTime;
connect isActiveIn -> intersectionController.isActive;
......
......@@ -4,7 +4,6 @@ import ba.util.SingleSetCompareRectangle;
import ba.struct.Rectangle;
component CollisionDetection<N1 n = 2,N1 x = 1>{
//component CollisionDetection{
ports in Rectangle hulls[n],
out B collision;
......
......@@ -2,15 +2,14 @@ package ba.intersection;
import ba.util.SingleSetCompareMatrix;
//TODO: x = (n-1)n/2
//TODO: m1 = m - 1, m2 = m1(m1+1)/2
//component IntersectionController<N1 n = 2,N1 x = 1,N1 m = 5,N1 m1 = 4,N1 m2 = 10>{
component IntersectionController{
ports in Q^{3,5} trajectoryIn[2],
component IntersectionController<N1 n = 2,N1 x = 1,N1 m = 5,N1 m1 = 4,N1 m2 = 10>{
ports in Q^{3,5} trajectoryIn[n],
in Q(0m : 10m) cutoffTime,
in B isActive,
out B stop[2];
out B stop[n];
instance SingleSetCompareMatrix<3,5,2,1> singleSetCompare;
instance TrajectoryCollision<5,4,10> trajectoryCollision[1];
instance TrajectoryCollision<5,4,10> trajectoryCollision[x];
instance CollisionToStop<2,1,5> collisionToStop;
connect trajectoryIn[:] -> singleSetCompare.setIn[:];
......
package ba.util;
//TODO: remove once EMAM2Cpp can handle matrix generics
//Dummy component. Behaviour is implemented in ROS. The Ports are only used to define the incoming and outgoing topics
component CommQualityMatrix<N1 rows = 3,N1 cols = 3>{
port in Q^{rows,cols} commIn,
out Q^{rows,cols} commOut;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment