Skip to content

Commit

Permalink
[HotFix] Fix Ros2 launch file generator, the imports were missed
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-nhg committed Feb 8, 2024
1 parent 4b9f44a commit c8760bd
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ class LaunchFileCompiler_ROS2 {
def compile_toROS2launch(System system) '''
from launch import LaunchDescription
from launch_ros.actions import Node
«IF !getSubsystems(system).empty»from ament_index_python.packages import get_package_share_directory
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource«ENDIF»
«IF !getSubsystems(system).empty»from ament_index_python.packages import get_package_share_directory«ENDIF»
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PythonExpression, PathJoinSubstitution, TextSubstitution

def generate_launch_description():
ld = LaunchDescription()

«FOR component:getNodes(system)»«FOR parameter:component.rosparameters»
«parameter.name»_arg = DeclareLaunchArgument(
parameter.name»", default_value=TextSubstitution(text="«get_param_value(parameter.value,parameter.name)»")
)
ld.add_actionparameter.name»_arg)
«ENDFOR»«ENDFOR»

«FOR component:getNodes(system
Expand Down

0 comments on commit c8760bd

Please sign in to comment.