Please see <https://jastadd.pages.st.inf.tu-dresden.de/ragconnect/use_cases.html#mpm4cps-paper-codename-ros2rag> for more information.
# Terms/Concepts
\ No newline at end of file
-**Definition type**: they define when to read from and write to mqtt, when to update tokens, and when to call or invalidate attributes. there will be a small DSL to define those
-**Connection**: on instance/AST-level, an mqtt-topic can be associated to a source or target of a definition
-**Transformation**: a method or attribute modeling a math. function y = f(x)
-**Operator**: the atomar building blocks of a transformation, e.g., projection of an object, or a boolean operator
# Ros2Rag Really Generating
Sources:
- UpdateDefinition `read Joint.CurrentPosition using ParseLinkState, LinkStateToIntPosition ;`
- DependencyDefinition `RobotArm._AppropriateSpeed canDependOn Joint.CurrentPosition as dependency1 ;`
- MappingDefinition
```
ParseLinkState maps byte[] bytes to panda.Linkstate.PandaLinkState {:
public ${Source.getJavaTypeUse().generateAbstractGrammar(sb)} ${sourceParent.getName()}.get${Source.getName()}() {
return get${internalTokenName()};
}
// refine name of TokenComponent when writing out abstract grammar
refine BackendAbstractGrammar public void TokenComponent.generateAbstractGrammar(StringBuilder sb) {
// TODO, check if TokenComponent is in Source of a dependency definition
// if yes, then somehow change getName() to return internalTokenName()
// if not, return refined()
}
```
Things to pay attention to:
-`JavaTypeUse().generateAbstractGrammar(sb)` adds the type to a given StringBuilder
Open questions:
- What is the best way to replace/change the Source-TokenComponent
- Replacing the TokenComponent in the original Program is probably not a good idea, because there may be references to the original TokenComponent, which then has no parent (and this may lead to NullPointerExceptions etc.)
- Setting a new name in the original TokenComponent defeats the purpose, because other definitions would use the internal token instead of the created virtual getter and setter
- Refining just `TokenComponent.generateAbstractGrammar` from the aspect `BackendAbstractGrammar` seems fine, but may lead to duplicate code
Warnings/Errors to check for:
- There must **not** be a write update definition for the source token
- This would create conflicting setter
- [name=rs] [time=May 6th, 2020] This could actually be wrong, as write definition do not create a setter
- There **must be** a write update definition for the target token
- Otherwise there are missing update and write methods used in the virtual setter