Skip to content

Commit

Permalink
run stuff on multithreaded executor
Browse files Browse the repository at this point in the history
  • Loading branch information
EricPedley committed Jun 26, 2024
1 parent 6f51a12 commit 5d03a42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/demo_commander_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import mavros_msgs.srv
import rclpy
import rclpy.node
from rclpy.executors import MultiThreadedExecutor
import argparse
from threading import Thread
import sys
Expand All @@ -29,7 +30,10 @@

node = CommanderNode(args)

spinner = Thread(target = rclpy.spin, args = (node,))
executor = MultiThreadedExecutor()
executor.add_node(node)

spinner = Thread(target = executor.spin)
spinner.start()

node.execute_mission_loop()
Expand Down

0 comments on commit 5d03a42

Please sign in to comment.