Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
ros3rag
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
ros3rag
Commits
b281f948
Commit
b281f948
authored
4 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
attribute anchor comments
parent
69f617f7
No related branches found
No related tags found
1 merge request
!1
Multiple scenes, multiple robots and more
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ros3rag.common/src/main/resources/jastadd/types.jadd
+8
-0
8 additions, 0 deletions
ros3rag.common/src/main/resources/jastadd/types.jadd
ros3rag.placeB/src/main/jastadd/WorldModelB.jadd
+15
-2
15 additions, 2 deletions
ros3rag.placeB/src/main/jastadd/WorldModelB.jadd
with
23 additions
and
2 deletions
ros3rag.common/src/main/resources/jastadd/types.jadd
+
8
−
0
View file @
b281f948
...
...
@@ -3,6 +3,7 @@ import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import java.util.*;
aspect Resolving {
//--- resolveObjectOfInterest ---
syn ObjectOfInterest Scene.resolveObjectOfInterest(String name) {
for (DropOffLocation location : getDropOffLocationList()) {
if (location.getName().equals(name)) {
...
...
@@ -16,6 +17,8 @@ aspect Resolving {
}
return null;
}
//--- resolveLogicalObjectOfInterest ---
syn LogicalObjectOfInterest LogicalScene.resolveLogicalObjectOfInterest(String name) {
for (LogicalDropOffLocation location : getLogicalDropOffLocationList()) {
if (location.getName().equals(name)) {
...
...
@@ -32,6 +35,7 @@ aspect Resolving {
}
aspect Computation {
//--- isLocatedAt ---
syn boolean MovableObject.isLocatedAt(DropOffLocation location) {
Orientation orient = location.getOrientation();
Position locationPosition = location.getPosition();
...
...
@@ -70,6 +74,7 @@ aspect Computation {
LT(-halfLocationHeight, rotatedZ) && LT(rotatedZ, halfLocationHeight);
}
//--- getLogicalScene ---
syn LogicalScene Scene.getLogicalScene() {
var result = new LogicalScene();
Map<MovableObject, LogicalMovableObject> objects = new HashMap<>();
...
...
@@ -94,6 +99,7 @@ aspect Computation {
private static final double MovableObject.DELTA = 0.0001;
//--- LT ---
/**
* @return d1 <= d2 (within a DELTA)
*/
...
...
@@ -121,6 +127,7 @@ aspect Navigation {
}
aspect Printing {
//--- prettyPrint ---
syn String JastAddList.prettyPrint() {
return prettyPrint(Object::toString);
}
...
...
@@ -203,6 +210,7 @@ aspect Printing {
}
aspect ConvenienceMethods {
// --- of ---
public static DropOffLocation DropOffLocation.of(String name,
Position position, Orientation orientation, Size size) {
var location = new DropOffLocation();
...
...
This diff is collapsed.
Click to expand it.
ros3rag.placeB/src/main/jastadd/WorldModelB.jadd
+
15
−
2
View file @
b281f948
aspect Computation {
syn nta LogicalDropOffLocation WorldModelB.unspecifiedLocation() = new LogicalDropOffLocation().setName("<unspecified>");
//--- diffScenes ---
syn nta JastAddList<Difference> WorldModelB.diffScenes() {
var result = new JastAddList<Difference>();
if (!hasMyScene() || !hasOtherScene()) {
...
...
@@ -46,6 +48,7 @@ aspect Computation {
return result;
}
//--- diffToOperations ---
syn nta JastAddList<Operation> WorldModelB.diffToOperations() {
var result = new JastAddList<Operation>();
for (Difference difference : diffScenes()) {
...
...
@@ -56,6 +59,7 @@ aspect Computation {
return result;
}
//--- computeOperations ---
syn List<Operation> Difference.computeOperations();
eq DifferenceObjectAtWrongPlace.computeOperations() {
// first, find robots that can reach the locations
...
...
@@ -121,6 +125,7 @@ aspect Computation {
return Collections.emptyList();
}
//--- createPickAndPlace ---
private static Operation DifferenceObjectAtWrongPlace.createPickAndPlace(Robot robot, LogicalMovableObject obj, LogicalDropOffLocation target) {
var result = new PickAndPlace();
result.setRobotToExecute(robot);
...
...
@@ -129,12 +134,12 @@ aspect Computation {
return result;
}
//--- getNextOperation ---
syn Operation WorldModelB.getNextOperation() {
return diffToOperations().getNumChild() > 0 ? diffToOperations().getChild(0) : new ErrorOperation("No operation computed!");
}
// syn List<String> locationIds
//--- canReach ---
syn boolean Robot.canReach(String objectName) {
for (var canReachObj : getCanReachObjectOfInterestWrapper().getCanReachObjectOfInterestList()) {
if (canReachObj.getObjectName().equals(objectName)) {
...
...
@@ -156,6 +161,7 @@ aspect Computation {
//}
aspect AttributeMappings {
//--- toMergedSelection ---
syn de.tudresden.inf.st.ceti.MergedSelection Operation.toMergedSelection();
eq ErrorOperation.toMergedSelection() {
System.err.println(getErrorMessage());
...
...
@@ -168,17 +174,22 @@ aspect AttributeMappings {
throw new RuntimeException("Separate Place operation not supported yet!");
}
eq PickAndPlace.toMergedSelection() = de.tudresden.inf.st.ceti.MergedSelection.newBuilder()
.setIdRobot(getRobotToExecute().getName())
.setIdPick(getObjectToPick().getName())
.setIdPlace(getTargetLocation().getName())
.build();
}
aspect Navigation {
//--- worldModelB ---
inh WorldModelB ASTNode.worldModelB();
eq WorldModelB.getChild().worldModelB() = this;
syn boolean Operation.isErrorOperation() = false;
eq ErrorOperation.isErrorOperation() = true;
}
aspect GlueForShared {
//--- resolveLogicalObjectOfInterest ---
// uncache Difference.resolveLogicalObjectOfInterest
inh LogicalObjectOfInterest Difference.resolveLogicalObjectOfInterest(String name);
eq WorldModelB.diffScenes().resolveLogicalObjectOfInterest(String name) = getMyScene().getLogicalScene().resolveLogicalObjectOfInterest(name);
...
...
@@ -187,6 +198,7 @@ aspect GlueForShared {
}
aspect Printing {
//--- prettyPrint ---
syn String Robot.prettyPrint() = "~Robot " + getName() + "~";
syn String Difference.prettyPrint();
...
...
@@ -212,6 +224,7 @@ aspect Printing {
}
aspect Resolving {
//--- findRobot ---
public Optional<Robot> WorldModelB.findRobot(String name) {
for (Robot robot : getRobotList()) {
if (robot.getName().equals(name)) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment