Skip to content

Commit

Permalink
Updated launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Juancams committed Jan 25, 2024
1 parent d1d625e commit 3501174
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@

def generate_launch_description():

names = ['scan', 'chatter', 'image']
topics = ['/scan', '/chatter', '/image']
types = ['sensor_msgs::msg::LaserScan', 'std_msgs::msg::String', 'sensor_msgs::msg::Image']
names = ['scan_raw', 'nav_vel']
topics = ['/scan_raw', '/nav_vel']
msgs = ['sensor_msgs::msg::LaserScan', 'geometry_msgs::msg::Twist']
node_types = ['Consumer', 'Consumer']
ns = ''

composable_nodes = []
for topic, topic_type, name in zip(topics, types, names):
for topic, msg, name, type in zip(topics, msgs, names, node_types):
composable_node = ComposableNode(
package='coresense_instrumentation_driver',
plugin='coresense_instrumentation_driver::InstrumentationLifecycleNode<'
+ topic_type + '>',
plugin='coresense_instrumentation_driver::Instrumentation' + type + '<'
+ msg + '>',
name=name + '_node',
namespace='coresense',
parameters=[{'topic': topic, 'topic_type': topic_type}],
namespace=ns,
parameters=[{'topic': topic, 'topic_type': msg}],
)
composable_nodes.append(composable_node)

container = ComposableNodeContainer(
name='coresense_container',
namespace='coresense',
namespace=ns,
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=composable_nodes,
Expand Down

0 comments on commit 3501174

Please sign in to comment.