j7s-simple/launch/conga_line.launch.py

27 lines
696 B
Python

import launch
import launch_ros.actions
def generate_launch_description():
parrots = []
for i in range(1, 100):
parrots.append(make_parrot(i))
return launch.LaunchDescription(parrots)
def make_parrot(index):
index_before = index - 1
parrot = launch_ros.actions.Node(
package='j7s_simple',
executable='j7s_parrot',
name='j7s_parrot_{}'.format(index),
parameters=[{
"name":"{}".format(index)
}],
remappings=[
("~/parrot_in", "parrot_{}".format(index_before)),
("~/parrot_out", "parrot_{}".format(index))
]
)
return parrot