diff --git a/AUTHORS b/AUTHORS index 93939d3..e1e9966 100755 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,5 @@ Rafael Pérez Seguí Miguel Fernández Cortizas Pedro Arias Pérez -David Pérez Saura \ No newline at end of file +David Pérez Saura +Javier Melero Deza \ No newline at end of file diff --git a/launch_as2.bash b/launch_as2.bash index 201ff8a..cf62a33 100755 --- a/launch_as2.bash +++ b/launch_as2.bash @@ -72,28 +72,27 @@ done for ns in "${drone_ns[@]}" do - if [[ ${ns} == ${drone_ns[0]} ]]; then - base_launch="true" - else - base_launch="false" - fi - - tmuxinator start -n ${ns} -p utils/session.yml drone_namespace=${ns} gps=${gps} simulation=${simulated} estimator_plugin=${estimator_plugin} & + tmuxinator start -n ${ns} -p tmuxinator/session.yml drone_namespace=${ns} gps=${gps} simulation=${simulated} estimator_plugin=${estimator_plugin} & wait done +if [[ ${estimator_plugin} == "mocap_pose" ]]; then + tmuxinator start -n mocap -p tmuxinator/mocap.yml & + wait +fi + if [[ ${record_rosbag} == "true" ]]; then - tmuxinator start -n rosbag -p utils/rosbag.yml drone_namespace=$(list_to_string "${drone_ns[@]}") & + tmuxinator start -n rosbag -p tmuxinator/rosbag.yml drone_namespace=$(list_to_string "${drone_ns[@]}") & wait fi if [[ ${launch_keyboard_teleop} == "true" ]]; then - tmuxinator start -n keyboard_teleop -p utils/keyboard_teleop.yml simulation=true drone_namespace=$(list_to_string "${drone_ns[@]}") & + tmuxinator start -n keyboard_teleop -p tmuxinator/keyboard_teleop.yml simulation=${simulated} drone_namespace=$(list_to_string "${drone_ns[@]}") & wait fi if [[ ${simulated} == "true" ]]; then - tmuxinator start -n gazebo -p utils/gazebo.yml simulation_config=${simulation_config} & + tmuxinator start -n gazebo -p tmuxinator/gazebo.yml simulation_config=${simulation_config} & wait fi diff --git a/mission.py b/mission.py index cd72d45..52a0133 100755 --- a/mission.py +++ b/mission.py @@ -28,8 +28,10 @@ def drone_run(drone_interface: DroneInterface, simulation=False): ##### ARM OFFBOARD ##### if simulation: + print("Arm") drone_interface.offboard() sleep(sleep_time) + print("Offboard") drone_interface.arm() sleep(sleep_time) diff --git a/real_config/state_estimator_mocap.yaml b/real_config/state_estimator_mocap.yaml index a20dbd7..51393b2 100644 --- a/real_config/state_estimator_mocap.yaml +++ b/real_config/state_estimator_mocap.yaml @@ -1,2 +1,3 @@ /**: ros__parameters: + none: false diff --git a/stop.bash b/stop.bash index 1ce49c9..3ec781e 100755 --- a/stop.bash +++ b/stop.bash @@ -18,8 +18,20 @@ if [[ -n "$TMUX" ]]; then current_session=$(tmux display-message -p '#S') fi -# Kill gazebo -pkill -9 -f "gzclient" < /dev/null +# Send Ctrl+C signal to each window of each session +for session in "${tmux_session_list[@]}"; do + # Check if session exists + if tmux has-session -t "$session" 2>/dev/null; then + # Get the list of windows in the session + windows=($(tmux list-windows -t "$session" -F "#{window_index}")) + # Iterate through each window and send Ctrl+C + for window in "${windows[@]}"; do + # Send Ctrl+C to the window + tmux send-keys -t "$session:$window" C-c + sleep 0.1 # Add a small delay to allow the signal to be processed + done + fi +done # Kill all tmux sessions from the list except for the current one for session in "${tmux_session_list[@]}"; do diff --git a/utils/gazebo.yml b/tmuxinator/gazebo.yml similarity index 100% rename from utils/gazebo.yml rename to tmuxinator/gazebo.yml diff --git a/utils/keyboard_teleop.yml b/tmuxinator/keyboard_teleop.yml similarity index 100% rename from utils/keyboard_teleop.yml rename to tmuxinator/keyboard_teleop.yml diff --git a/utils/mocap.yml b/tmuxinator/mocap.yml similarity index 100% rename from utils/mocap.yml rename to tmuxinator/mocap.yml diff --git a/utils/rosbag.yml b/tmuxinator/rosbag.yml similarity index 100% rename from utils/rosbag.yml rename to tmuxinator/rosbag.yml diff --git a/utils/session.yml b/tmuxinator/session.yml similarity index 100% rename from utils/session.yml rename to tmuxinator/session.yml