Commit 68f78782 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Move struct_msgs package check to viewmodel creation, enable find_package(struct_msgs) for ros2

parent 6837cb3f
Pipeline #118144 failed with stages
in 50 seconds
......@@ -69,7 +69,7 @@ public class GeneratorRosCpp {
private List<FileContent> generateRosAdapter(EMAComponentInstanceSymbol component) {
List<FileContent> res = new ArrayList<>();
if (TagHelper.rosConnectionsValid(component)) {
if (TagHelper.rosConnectionsValid(component, ros2Mode)) {
List<EMAPortSymbol> rosPorts = component.getPortInstanceList().stream()
.filter(EMAPortSymbol::isRosPort)
.collect(Collectors.toList());
......@@ -122,6 +122,8 @@ public class GeneratorRosCpp {
.map(RosConnectionSymbol::getTopicType)
.map(Optional::get)
.map(n -> n.split("/")[0])
//dont add struct_msgs if we are in ros1 mode
.filter(s -> ros2Mode || !s.equals("struct_msgs"))
.forEach(allPackages::add);
allPackages.forEach(model::addPackage);
......
......@@ -4,9 +4,7 @@ set (CMAKE_CXX_STANDARD 14)
set (AMENT_CMAKE_UNINSTALL_TARGET FALSE)
<#list model.getPackages() as pack>
<#if pack != "struct_msgs">
find_package(${pack} REQUIRED)
</#if>
</#list>
add_library(${model.name} ${model.name}.cpp)
......
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