Closes #1313 Current if spin_unitl_future_complete is called inside a nodes callback it removes the node from the executor This results in any subsiquent waitables to never be checked by the node s...
defspin_once_until_future_complete(self,future:Future,timeout_sec:float=None)->None: 323+ """ 324+ Wait for and execute a single callback. 325+ 326+ This should behave in the same way as :meth:`spin_once`. 327+ If needed by the implementation, it should awake other threads waiting...
示例1 classMinimalActionClient(Node):def__init__(self):super().__init__('minimal_action_client')self._action_client=ActionClient(self,Fibonacci,'fibonacci')defcancel_done(self,future):cancel_response=future.result()iflen(cancel_response.goals_canceling)>0:self.get_logger().info('Goal success...
File"/home/myLocalSuperUser/ros/Issue/NodeClient.py", line 75,in<module>loop.run_until_complete(main()) File"/home/myLocalSuperUser/ros/Issue/NodeClient.py", line 67,inmainexecutor.spin() File"/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 294,inspinself....
()node=rclpy.create_node("test_wait")executor=rclpy.get_global_executor()executor.add_node(node)task=executor.create_task(test_1)executor.spin_until_future_complete(task)asserttask.result()task=executor.create_task(test_2,executor)executor.spin_until_future_complete(task)asserttask.result()rclpy...
spin_until_future_complete(task) node.get_logger().info("Testing complete!") except KeyboardInterrupt: pass node.destroy_node() executor.shutdown() Now there is pretty much no examples of create_task being used like this so I have been experimenting and reading a bit of the rclpy code. ...
What happens here is afterrclpy.spin_until_future_completecompleted,self.nodeis removed from the executor. That said,modify_collision_checkingfunction can be completed as you mentioned, but no more executable entity cannot be taken or executed in this executor anymore since the node has been remove...