Skip to content

Commit

Permalink
fix spaces and launch file generator test
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-nhg committed Dec 3, 2020
1 parent ed5aa11 commit 45a2967
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0"?>
<launch>
<param name="param1" value="hello"/>
<rosparam param="list">[1,2,a]</rosparam>
<rosparam param="list">[1,3]</rosparam>
<rosparam>
first_element:8
third_element:dsd
</rosparam>
<param name="param1" value="hello"/>
<rosparam param="list">[1,2,a]</rosparam>
<rosparam param="list">[1,3]</rosparam>
<rosparam>
first_element:8
third_element:dsd
</rosparam>

<node pkg="test_pkg" type="test_node" name="test_node" cwd="node" respawn="false" output="screen">
</node>
<node pkg="test_pkg" type="test_node" name="test_node" cwd="node" respawn="false" output="screen">
</node>

<node pkg="test_pkg" type="test_node" name="test_node2" ns="test2" cwd="node" respawn="false" output="screen">
</node>
<node pkg="test_pkg" type="test_node" name="test_node2" ns="test2" cwd="node" respawn="false" output="screen">
</node>

<node pkg="test_pkg" type="test_node" name="test_nodea" cwd="node" respawn="false" output="screen">
</node>
<node pkg="test_pkg" type="test_node" name="test_nodea" cwd="node" respawn="false" output="screen">
</node>

</launch>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,27 @@ class LaunchFileCompiler {
def compile_tolaunch(RosSystem system) '''«init_comp()»
<?xml version="1.0"?>
<launch>
«FOR ROSParameter:system.parameter»«IF ROSParameter.type.toString.contains("ParameterStructType")»
<rosparam>
«IF ROSParameter.value!==null»«FOR ParamMember:ROSParameter.value.eContents»
«FOR ROSParameter:system.parameter»
«IF ROSParameter.type.toString.contains("ParameterStructType")»
<rosparam>
«IF ROSParameter.value!==null»
«FOR ParamMember:ROSParameter.value.eContents»
«getParamName(ParamMember.eContents.get(0).toString)»:«compile_param_value(convertParamValue(ParamMember.eContents.get(0).eContents.get(0)))»
«ENDFOR»«ELSE»
«FOR ParamMember:ROSParameter.eContents.get(0).eContents»«IF !(ParamMember.eContents.get(0).eContents.empty)»
«getParamName(ParamMember.toString)»:«compile_param_value(convertParamValue(ParamMember.eContents.get(0).eContents.get(0)))»«ENDIF»
«ENDFOR»«ENDIF»
</rosparam>
«ELSEIF ROSParameter.type.toString.contains("ParameterListType") || ROSParameter.type.toString.contains("ParameterArrayType")»
<rosparam param="list">«IF ROSParameter.value!==null»«compile_param_value(ROSParameter.value)»«ENDIF»</rosparam>
«ELSE» <param name="«ROSParameter.name»" value="«compile_param_value(ROSParameter.value)»"/>
«ENDIF»
«ENDFOR»
«ENDFOR»
«ELSE»
«FOR ParamMember:ROSParameter.eContents.get(0).eContents»
«IF !(ParamMember.eContents.get(0).eContents.empty)»
«getParamName(ParamMember.toString)»:«compile_param_value(convertParamValue(ParamMember.eContents.get(0).eContents.get(0)))»
«ENDIF»
«ENDFOR»
«ENDIF»
</rosparam>
«ELSEIF ROSParameter.type.toString.contains("ParameterListType") || ROSParameter.type.toString.contains("ParameterArrayType")»
<rosparam param="list">«IF ROSParameter.value!==null»«compile_param_value(ROSParameter.value)»«ENDIF»</rosparam>
«ELSE»
<param name="«ROSParameter.name»" value="«compile_param_value(ROSParameter.value)»"/>
«ENDIF»
«ENDFOR»
«FOR component:system.rosComponent»
«FOR rosPublisher:component.rospublisher»
«IF component.hasNS»
Expand Down

0 comments on commit 45a2967

Please sign in to comment.