Aufgrund einer Wartung wird GitLab am 28.09. zwischen 10:00 und 11:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 28.09. between 10:00 and 11:00 am.

Deleted unused test resources

parent 31247ef3
package tests;
import tests.structs.Trajectory;
//import tests.filter.TrajectoryFilter;
import tests.misc.CompareTrajectory;
component Controller{
// port in Q(0:100) cutoffPosition;
// port in Q(0:10) cutoffTime;
//instance TrajectoryFilter<5> filter;
//connect constCutoffPosition.out1 -> filter.cutoffPosition;
//connect constCutoffTime.out1 -> filter.cutoffTime;
//connect filter.trajectoryIn[:] -> filter.trajectoryIn[:];
port in Trajectory trajectoryIn[5];
instance CompareTrajectory compareTrajectory;
connect trajectoryIn[:] -> trajectoryIn[:];
}
\ No newline at end of file
package tests.filter;
import tests.structs.PositionWithDeltaTime;
component PosTimeFilter<N1 m>{
port in Q(0:100) cutoffPosition;
port in Q(0:10) cutoffTime;
port in PositionWithDeltaTime posTimeIn[m];
port out PositionWithDeltaTime posTimeOut[m];
implementation Math{
//TODO: better error value
Q errorValue = 0;
//TODO 1 or 0 based?
for i = 1:1:m
Q compPos = (posTimeIn[i].position.xPosition * posTimeIn[i].position.xPosition) + (posTimeIn[i].position.yPosition * posTimeIn[i].position.yPosition);
if posTimeIn[i].deltaTime > cutoffTime{
posTimeOut[i] = errorValue;
}elseif compPos > cutoffPosition * cutoffPosition{
posTimeOut[i] = errorValue;
}else{
posTimeOut[i] = posTimeIn[i];
}
end
}
}
\ No newline at end of file
package tests.filter;
import tests.structs.Trajectory;
import tests.util.TrajectorySplitter;
import tests.util.TrajectoryAssembler;
component SingleTrajectoryFilter<N1 m = 2>{
port in Q(0:100) cutoffPosition;
port in Q(0:10) cutoffTime;
port in Trajectory trajectoryIn;
port out Trajectory trajectoryOut;
instance TrajectorySplitter<m> splitter;
instance TrajectoryAssembler<m> assembler;
instance PosTimeFilter posTimeFilters[m];
connect cutoffPosition -> timePosFilters[:].cutoffPosition;
connect cutoffTime -> timePosFilters[:].cutoffTime;
connect trajectoryIn -> splitter.trajectoryIn;
connect splitter.positionWithTimeOut[:] -> posTimeFilters[:].posTimeIn;
connect posTimeFilters[:].posTimeOut -> assembler.posTimeIn[:];
connect splitter.objectIdOut -> assembler.objectIdIn;
connect assembler.trajectoryOut -> trajectoryOut;
}
\ No newline at end of file
package tests.filter;
import tests.structs.Trajectory;
component TrajectoryFilter<N1 n = 2>{
port in Q(0:100) cutoffPosition;
port in Q(0:10) cutoffTime;
port in Trajectory trajectoryIn[n];
port out Trajectory trajectoryOut[n];
instance SingleTrajectoryFilter singleFilters[n];
connect trajectoryIn[:] -> singleFilters[:].trajectoryIn;
connect singleFilters[:].trajectoryOut -> trajectoryOut[:];
connect cutoffPosition -> singleFilters[:].cutoffPosition;
connect cutoffTime -> singleFilters[:].cutoffTime;
}
\ No newline at end of file
package tests.misc;
import tests.structs.Trajectory;
//TODO: variable size?
component CompareTrajectory{
port in Trajectory trajectoryIn[4];
port out Z(0:1) stopOut[4];
//TODO: dynamic size?
instance TrajectoryConflict trajectoryConflict[3];
//TODO: autoconnect?
connect trajectoryIn[1] -> trajectoryConflict[1].trajectoryA;
connect trajectoryIn[2] -> trajectoryConflict[1].trajectoryB;
connect trajectoryIn[1] -> trajectoryConflict[2].trajectoryA;
connect trajectoryIn[3] -> trajectoryConflict[2].trajectoryB;
connect trajectoryIn[1] -> trajectoryConflict[3].trajectoryA;
connect trajectoryIn[4] -> trajectoryConflict[3].trajectoryB;
connect trajectoryIn[2] -> trajectoryConflict[4].trajectoryA;
connect trajectoryIn[3] -> trajectoryConflict[4].trajectoryB;
connect trajectoryIn[2] -> trajectoryConflict[5].trajectoryA;
connect trajectoryIn[4] -> trajectoryConflict[5].trajectoryB;
connect trajectoryIn[3] -> trajectoryConflict[6].trajectoryA;
connect trajectoryIn[4] -> trajectoryConflict[6].trajectoryB;
}
\ No newline at end of file
package tests.misc;
import tests.structs.Trajectory;
component TrajectoryConflict{
port in Trajectory trajectoryA;
port in Trajectory trajectoryB;
port out boolean conflict;
implementation Math{
for i = 1:1:5
for j = 1:1:5
Q dX = trajectoryA.positionsWithDeltaTime(i).position.xPosition - trajectoryB.positionsWithDeltaTime[j].position.xPosition;
Q dY = trajectoryA.positionsWithDeltaTime[i].position.yPosition - trajectoryB.positionsWithDeltaTime[j].position.yPosition;
Q posDeltaSquared = dX * dX + dY * dY;
Q timeDelta = abs(trajectoryA.positionsWithTime[i].deltaTime - trajectoryA.positionsWithTime[i].deltaTime);
end
end
}
}
\ No newline at end of file
package tests.structs;
import tests.structs.Position;
component ArrayStructComp{
port in Trajectory trajectoryIn;
// implementation Math{
// PositionWithDeltaTime tmp = trajectoryIn.positionsWithDeltaTime(1);
// }
}
\ No newline at end of file
package tests.structs;
import tests.structs.Position;
component BasicStructComp{
port in Position posIn;
}
\ No newline at end of file
package tests.structs;
import tests.structs.PositionWithDeltaTime;
component NestedStructComp{
port in PositionWithDeltaTime posWithDtIn;
}
\ No newline at end of file
package tests.structs;
struct Position{
Q xPosition;
Q yPosition;
}
package tests.structs;
struct PositionWithDeltaTime{
Q deltaTime;
Position position;
}
package tests.structs;
conforms to de.monticore.lang.monticar.generator.roscpp.RosToEmamTagSchema;
tags Structs{
tag basicStructComp.posIn with RosConnection = {topic = (name1,package/type1), msgField = field1};
tag nestedStructComp.posWithDtIn with RosConnection = {topic = (name2,package/type2), msgField = field2};
tag arrayStructComp.trajectoryIn with RosConnection = {topic = (name3,package/type3), msgField = field3};
}
\ No newline at end of file
package tests.structs;
struct Trajectory{
PositionWithDeltaTime[] positionsWithDeltaTime;
}
package tests.util;
component Constant<T>(T value) {
port
out T out1;
implementation Math{
out1=value;
}
}
\ No newline at end of file
package tests.util;
component Delay<T>(T msg,T defaultMsg,ms delayInMs){
port in T msgIn;
port in ms deltaTime;
port out T msgOut;
//TODO: new msg arrives before old one is send
implementation Math{
static Boolean send = false;
static Z(0:oo) counter = 0;
static T last = defaultMsg;
//reset
if((last == defaultMsg) AND (msgIn != defaultMsg)){
send = false;
counter = 0;
last = msgIn;
}
counter = counter + deltaTime;
if ((counter >= delayInMs) AND (send == false)){
send = true;
msgOut = msgIn;
}else{
msgOut = defaultMsg;
last = defaultMsg;
}
}
}
\ No newline at end of file
package tests.util;
component TrajectoryAssembler<N1 m = 2>{
port in PositionWithDeltaTime posTimeIn[m];
port in Q(0:oo) objectId;
port out Trajectory trajectoryOut;
//implementation Math{
//TODO: ???
//}
}
\ No newline at end of file
package tests.util;
import tests.structs.PositionWithDeltaTime;
import tests.structs.Trajectory;
component TrajectorySplitter<N1 m>{
port in Trajectory trajectoryIn;
port out PositionWithDeltaTime positionWithTimeOut[m];
implementation Math{
//TODO: 1 or 0 based?
for i = 1:1:m
positionWithTimeOut(i) = trajectoryIn.positionsWithDeltaTime(i);
end
}
}
\ 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