Esempio n. 1
0
 def push_empty_gradients(self, executor: Executor) -> None:
     """Push empty neural net gradients TO server ROS node."""
     request = Gradients.Request()
     request.id = self._worker_id
     self._future_gradients = self._cli['gradients'].call_async(request)
     rclpy.spin_until_future_complete(self, self._future_gradients,
                                      executor)
Esempio n. 2
0
 def push_gradients(self, executor: Executor, network: str) -> None:
     """Push neural net gradients TO server ROS node."""
     request = self._policy.transfer_gradients(Gradients.Request(), network)
     request.id = self._worker_id
     request.name = network
     self._future_gradients[network] = self._cli['gradients'].call_async(
         request)
     rclpy.spin_until_future_complete(self, self._future_gradients[network],
                                      executor)