Skip to content

Commit 104f6d8

Browse files
doumdimamaheuxMariamFdil
authored
Fix delays (#98)
* Build the user interface at build time. * Reduce the sleep duration * Adding delays when launching nodes. * add more delays --------- Co-authored-by: Marc-Antoine Maheux <Marc-Antoine.Maheux@USherbrooke.ca> Co-authored-by: MariamFdil <fdil.mariam@gmail.com>
1 parent c1fe399 commit 104f6d8

27 files changed

+174
-53
lines changed

ros/demos/connect4/launch/connect4.launch

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
<remap from="pose/filter_state" to="nearest_face_following/filter_state"/>
7373
</node>
7474

75-
<include file="$(find t_top)/launch/behaviors/led_animations.launch"/>
75+
<include file="$(find t_top)/launch/behaviors/led_animations.launch">
76+
<arg name="led_animations_behavior_delay" value="0.0"/>
77+
</include>
7678

7779
<!-- WebRTC -->
7880
<include file="$(find t_top)/launch/behaviors/opentera.launch">

ros/t_top/launch/behaviors.launch

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88
<arg name="open_browser" default="true"/>
99
<arg name="fullscreen_face" default="false"/>
1010

11+
<!-- Delays -->
12+
<arg name="dance_behavior_delay"/>
13+
<arg name="explore_behavior_delay"/>
14+
<arg name="face_behavior_delay"/>
15+
<arg name="face_following_behavior_delay"/>
16+
<arg name="gesture_behavior_delay"/>
17+
<arg name="led_animations_behavior_delay"/>
18+
<arg name="led_emotions_behavior_delay"/>
19+
<arg name="sound_following_behavior_delay"/>
20+
<arg name="sound_object_person_following_behavior_delay"/>
21+
<arg name="sound_player_behavior_delay"/>
22+
<arg name="talk_behavior_delay"/>
23+
<arg name="too_close_reaction_behavior_delay"/>
24+
1125
<!-- Telepresence -->
1226
<!-- See opentera-webrtc-ros -->
1327

@@ -16,53 +30,71 @@
1630
<include file="$(find t_top)/launch/behaviors/face.launch">
1731
<arg name="open_browser" value="$(arg open_browser)"/>
1832
<arg name="fullscreen" value="$(arg fullscreen_face)"/>
33+
<arg name="face_behavior_delay" value="$(arg face_behavior_delay)"/>
34+
</include>
35+
36+
<include file="$(find t_top)/launch/behaviors/led_emotions.launch">
37+
<arg name="led_emotions_behavior_delay" value="$(arg led_emotions_behavior_delay)"/>
1938
</include>
20-
<include file="$(find t_top)/launch/behaviors/led_emotions.launch"/>
2139

2240
<!-- Led Animation -->
23-
<include file="$(find t_top)/launch/behaviors/led_animations.launch"/>
41+
<include file="$(find t_top)/launch/behaviors/led_animations.launch">
42+
<arg name="led_animations_behavior_delay" value="$(arg led_animations_behavior_delay)"/>
43+
</include>
2444

2545
<!-- Talk -->
2646
<include file="$(find t_top)/launch/behaviors/talk.launch">
2747
<arg name="language" value="$(arg language)"/>
2848
<arg name="gender" value="$(arg gender)"/>
2949
<arg name="voice_generator_type" value="$(arg voice_generator_type)"/>
3050
<arg name="speaking_rate" value="$(arg speaking_rate)"/>
51+
<arg name="talk_behavior_delay" value="$(arg talk_behavior_delay)"/>
3152
</include>
3253

3354
<!-- Gesture -->
3455
<include file="$(find t_top)/launch/behaviors/gesture.launch">
3556
<arg name="simulation" value="$(arg simulation)"/>
57+
<arg name="gesture_behavior_delay" value="$(arg gesture_behavior_delay)"/>
3658
</include>
3759

3860
<!-- Sound Following -->
3961
<include file="$(find t_top)/launch/behaviors/sound_following.launch">
4062
<arg name="simulation" value="$(arg simulation)"/>
63+
<arg name="sound_following_behavior_delay" value="$(arg sound_following_behavior_delay)"/>
4164
</include>
4265

4366
<!-- Face Following -->
4467
<include file="$(find t_top)/launch/behaviors/face_following.launch">
4568
<arg name="simulation" value="$(arg simulation)"/>
69+
<arg name="face_following_behavior_delay" value="$(arg face_following_behavior_delay)"/>
4670
</include>
4771

4872
<!-- Sound Object Person Following -->
4973
<include file="$(find t_top)/launch/behaviors/sound_object_person_following.launch">
5074
<arg name="simulation" value="$(arg simulation)"/>
5175
<arg name="camera_2d_wide_enabled" value="$(arg camera_2d_wide_enabled)"/>
76+
<arg name="sound_object_person_following_behavior_delay" value="$(arg sound_object_person_following_behavior_delay)"/>
5277
</include>
5378

5479
<!-- Dance -->
55-
<include file="$(find t_top)/launch/behaviors/dance.launch"/>
80+
<include file="$(find t_top)/launch/behaviors/dance.launch">
81+
<arg name="dance_behavior_delay" value="$(arg dance_behavior_delay)"/>
82+
</include>
5683

5784
<!-- Explore -->
5885
<include file="$(find t_top)/launch/behaviors/explore.launch">
5986
<arg name="simulation" value="$(arg simulation)"/>
87+
<arg name="explore_behavior_delay" value="$(arg explore_behavior_delay)"/>
6088
</include>
6189

6290
<!-- Too Near Reaction -->
63-
<include file="$(find t_top)/launch/behaviors/too_close_reaction.launch"/>
91+
<include file="$(find t_top)/launch/behaviors/too_close_reaction.launch">
92+
<arg name="too_close_reaction_behavior_delay" value="$(arg too_close_reaction_behavior_delay)"/>
93+
</include>
6494

6595
<!-- Sound Player -->
66-
<include file="$(find t_top)/launch/behaviors/sound_player.launch"/>
96+
<include file="$(find t_top)/launch/behaviors/sound_player.launch">
97+
<arg name="sound_player_behavior_delay" value="$(arg sound_player_behavior_delay)"/>
98+
</include>
6799

68100
</launch>

ros/t_top/launch/behaviors/dance.launch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<launch>
2+
<arg name="dance_behavior_delay"/>
23

3-
<node pkg="dance" type="head_dance_node.py" name="head_dance_node">
4+
<node pkg="dance" type="head_dance_node.py" name="head_dance_node" launch-prefix="bash -c 'sleep $(arg dance_behavior_delay); $0 $@' ">
45
<param name="movement_file" value="$(find dance)/head_movements.json"/>
56

67
<remap from="pose/filter_state" to="head_dance/filter_state"/>
78
<remap from="bpm" to="dance/bpm"/>
89
<remap from="beat" to="dance/beat"/>
910
</node>
1011

11-
<node pkg="dance" type="torso_dance_node.py" name="torso_dance_node">
12+
<node pkg="dance" type="torso_dance_node.py" name="torso_dance_node" launch-prefix="bash -c 'sleep $(arg dance_behavior_delay); $0 $@' ">
1213
<param name="movement_file" value="$(find dance)/torso_movements.json"/>
1314

1415
<remap from="pose/filter_state" to="torso_dance/filter_state"/>
1516
<remap from="bpm" to="dance/bpm"/>
1617
<remap from="beat" to="dance/beat"/>
1718
</node>
1819

19-
<node pkg="dance" type="led_dance_node.py" name="led_dance_node">
20+
<node pkg="dance" type="led_dance_node.py" name="led_dance_node" launch-prefix="bash -c 'sleep $(arg dance_behavior_delay); $0 $@' ">
2021
<param name="led_colors_file" value="$(find dance)/led_colors.json"/>
2122

2223
<remap from="set_led_colors/filter_state" to="led_dance/filter_state"/>

ros/t_top/launch/behaviors/explore.launch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<launch>
22
<arg name="simulation"/>
3+
<arg name="explore_behavior_delay"/>
34

4-
<node pkg="explore" type="explore_node.py" name="explore_node">
5+
<node pkg="explore" type="explore_node.py" name="explore_node" launch-prefix="bash -c 'sleep $(arg explore_behavior_delay); $0 $@' ">
56
<param name="simulation" value="$(arg simulation)"/>
67
<param name="explore_frequency" value="0.00833333333"/>
78
<param name="torso_speed_rad_sec" value="0.5"/>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<launch>
22
<arg name="open_browser" default="true"/>
33
<arg name="fullscreen" default="false"/>
4+
<arg name="face_behavior_delay"/>
45

5-
<node pkg="user_interface" type="web.sh" name="user_interface" args="$(arg open_browser) $(arg fullscreen)"/>
6+
<node pkg="user_interface" type="web.sh" name="user_interface" args="$(arg open_browser) $(arg fullscreen)" launch-prefix="bash -c 'sleep $(arg face_behavior_delay); $0 $@' "/>
67

78
</launch>

ros/t_top/launch/behaviors/face_following.launch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<launch>
22
<arg name="simulation"/>
3+
<arg name="face_following_behavior_delay"/>
34

4-
<node pkg="face_following" type="nearest_face_following_node.py" name="nearest_face_following_node">
5+
<node pkg="face_following" type="nearest_face_following_node.py" name="nearest_face_following_node" launch-prefix="bash -c 'sleep $(arg face_following_behavior_delay); $0 $@' ">
56
<param name="simulation" value="$(arg simulation)"/>
67
<param name="control_frequency" value="30"/>
78
<param name="torso_control_alpha" value="0.2"/>
@@ -16,7 +17,7 @@
1617
<remap from="pose/filter_state" to="nearest_face_following/filter_state"/>
1718
</node>
1819

19-
<node pkg="face_following" type="specific_face_following_node.py" name="specific_face_following_node">
20+
<node pkg="face_following" type="specific_face_following_node.py" name="specific_face_following_node" launch-prefix="bash -c 'sleep $(arg face_following_behavior_delay); $0 $@' ">
2021
<param name="simulation" value="$(arg simulation)"/>
2122
<param name="control_frequency" value="30"/>
2223
<param name="torso_control_alpha" value="0.2"/>

ros/t_top/launch/behaviors/gesture.launch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<launch>
22
<arg name="simulation"/>
3+
<arg name="gesture_behavior_delay"/>
34

4-
<node pkg="gesture" type="gesture_node.py" name="gesture_node">
5+
<node pkg="gesture" type="gesture_node.py" name="gesture_node" launch-prefix="bash -c 'sleep $(arg gesture_behavior_delay); $0 $@' ">
56
<param name="simulation" value="$(arg simulation)"/>
67

78
<remap from="pose/filter_state" to="gesture/filter_state"/>

ros/t_top/launch/behaviors/led_animations.launch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<launch>
2+
<arg name="led_animations_behavior_delay"/>
23

3-
<node pkg="led_animations" type="led_animations_node.py" name="led_animations_node">
4+
<node pkg="led_animations" type="led_animations_node.py" name="led_animations_node" launch-prefix="bash -c 'sleep $(arg led_animations_behavior_delay); $0 $@' ">
45
<remap from="set_led_colors/filter_state" to="led_animations/filter_state"/>
56
</node>
67

ros/t_top/launch/behaviors/led_emotions.launch

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<launch>
22

3-
<node pkg="led_emotions" type="led_emotions_node.py" name="led_emotions_node">
3+
<arg name="led_emotions_behavior_delay"/>
4+
5+
<node pkg="led_emotions" type="led_emotions_node.py" name="led_emotions_node" launch-prefix="bash -c 'sleep $(arg led_emotions_behavior_delay); $0 $@' ">
46
<param name="led_patterns_file" value="$(find led_emotions)/led_patterns.json"/>
57

68
<remap from="set_led_colors/filter_state" to="led_emotions/filter_state"/>

ros/t_top/launch/behaviors/sound_following.launch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<launch>
22
<arg name="simulation"/>
33
<arg name="min_activity" default="0.1"/>
4+
<arg name="sound_following_behavior_delay"/>
45

5-
<node pkg="sound_following" type="sound_following_node.py" name="sound_following_node">
6+
<node pkg="sound_following" type="sound_following_node.py" name="sound_following_node" launch-prefix="bash -c 'sleep $(arg sound_following_behavior_delay); $0 $@' ">
67
<param name="simulation" value="$(arg simulation)"/>
78
<param name="control_frequency" value="30"/>
89
<param name="torso_control_alpha" value="0.2"/>

0 commit comments

Comments
 (0)