File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
formant_ros2_adapter/scripts Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
import rclpy
2
+ import time
2
3
3
4
from formant .sdk .agent .v1 import Client
4
5
5
6
from ros2_adapter import ROS2Adapter
7
+ from utils .logger import get_logger
8
+
9
+
10
+ FCLIENT_WAIT = 2
6
11
7
12
8
13
if __name__ == "__main__" :
14
+ logger = get_logger ()
9
15
rclpy .init ()
10
16
node = rclpy .create_node (
11
17
"formant_ros2_adapter" ,
12
18
allow_undeclared_parameters = True ,
13
19
automatically_declare_parameters_from_overrides = True ,
14
20
)
15
- fclient = Client (ignore_throttled = True , ignore_unavailable = True )
21
+ logger .info ("Creating Formant agent client" )
22
+ # To do: a cleaner solution would have ignore_unavailable=True and
23
+ # something implemented in the client to avoid a race condition
24
+ fclient = Client (ignore_throttled = True )
25
+ logger .info ("Waiting %s seconds for Formant agent client" % FCLIENT_WAIT )
16
26
ROS2Adapter (fclient , node )
17
27
try :
18
28
while rclpy .ok ():
You can’t perform that action at this time.
0 commit comments