[ROS2] Can I launch nodes using yaml file?
If yes, what is the format and key words of yaml file? Could somebody give an example? Thank you.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
If yes, what is the format and key words of yaml file? Could somebody give an example? Thank you.
Here is a discussion on this.
Below is my implementation for your reference:
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
import launch_ros.actions
def generate_launch_description():
default_yaml = os.path.join(get_package_share_directory('my_package'), 'param',
'param.yaml')
return LaunchDescription([
launch_ros.actions.Node(
package='my_package', node_executable='my_executable',
arguments=['-config', default_yaml],
output='screen'),
])
I'm not sure this is an answer to the question of the OP: he appears to be asking whether it'd be possible to launch nodes merely using a .yaml
file. The linked issue and the code snippet appear to show how to pass parameters to a node. Those would seem to be two different things.
Asked: 2019-08-19 22:23:25 -0500
Seen: 358 times
Last updated: Aug 20 '19
esp32 microros Component Linker Error
ROS in arm/v7, Docker, and Limited Storage Robot
Update odometry based on pose estimate
rviz2 does not display an urdf file
/odom topic doesn't work on ROS2
subscription callback types ROS1 vs. ROS2
ament_export_dependencies(Boost) not working?
Should there be a DefaultQoS or default constructor for QoS?