Commit 3d380601 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Merge branch 'dev-LB' into 'master'

Fix field naviagation bug

See merge request !13
parents 813ffcc8 0776d56d
Pipeline #158713 passed with stages
in 2 minutes and 1 second
......@@ -9,7 +9,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-roscpp-generator</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......
......@@ -20,28 +20,6 @@ public abstract class RosInterface {
public RosMsg getRosMsg() {
String packageName = Arrays.stream(getTopicType().split("/")).findFirst().get();
RosMsg res = GeneratorRosMsg.getRosType(packageName, this.getPort().getTypeReference(), false);
if(rosConnectionSymbol.getMsgField().isPresent()){
String msgField = rosConnectionSymbol.getMsgField().get();
String[] parts = msgField.split("\\.");
String path = "";
for(String p : parts){
path += (path.length() == 0 ? "." : "") + p;
boolean found = false;
for(RosField field : res.getFields()){
if (field.getType() instanceof RosMsg)
if (field.getName().equals(msgField)) {
res = (RosMsg) field.getType();
found = true;
}else{
Log.error("Found field " + path + ", but it has a primitive type instead of a message type!");
}
}
if(!found){
Log.error("Can not find field " + path + "!");
}
}
}
return res;
}
......
Supports Markdown
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