Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file added music/Radetzky March.mp3
Binary file not shown.
Binary file added music/The Blue Danube - Op. 314.mp3
Binary file not shown.
7 changes: 7 additions & 0 deletions music/eine_kleine_nachtmusik.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CC BY-NC-ND 3.0 DEED

https://creativecommons.org/licenses/by-nc-nd/3.0/

Performance by A Far Cry

https://musopen.org/music/28074-serenade-no-13-a-little-night-music-eine-kleine-nachtmusik-k-525/
7 changes: 7 additions & 0 deletions music/radetzky_march.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Public Domain (US Government Work)

https://creativecommons.org/publicdomain/mark/1.0/

Recording by "The President's Own" United States Marine Band, from Sound Off!, recorded May 18–21, 1992 at Center for the Arts, George Mason University; conducted by John R. Bourgeois

https://www.marineband.marines.mil/Portals/175/Docs/Audio/Educational_Series/sound_off/radetzky_march.mp3
7 changes: 7 additions & 0 deletions music/the_blue_danube.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CC BY-NC 4.0

https://creativecommons.org/licenses/by-nc/4.0/

Live concert recording by: Das Orchester Tsumugi / Takashi Inoue (Recorded on 10/Mar. 2024, Fukuoka Symphony Hall, Japan) / Source: IMSLP

https://www.classicals.de/strauss-2-blue-danube
277 changes: 143 additions & 134 deletions pixi.lock

Large diffs are not rendered by default.

31 changes: 13 additions & 18 deletions swarm_gpt/core/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,7 @@ def deploy(self, drone_ids: list[int] | None = None) -> bool:
...

if not self.music_manager.verify_libvlc():
logger.error(
"VLC/libvlc is not available. Install VLC (see README) before deploying."
)
logger.error("VLC/libvlc is not available. Install VLC (see README) before deploying.")
return False

swarm = DroneSwarm(self.choreographer.drones, lighthouse=self.settings["lighthouse"])
Expand All @@ -340,14 +338,20 @@ def deploy(self, drone_ids: list[int] | None = None) -> bool:
logger.warning(
f"Drone {uri} is too far from the expected initial position. pos={obs['pos']}, exp={d['pos']}"
)
landing_pos = obs["pos"]
landing_pos = obs["pos"] if self.settings["land_on_docks"] else d["pos"]
# TODO fix hard coded yaw
init_pos_dict[uri] = np.array([*init_pos, 0.0])
final_pos_dict[uri] = np.array([*landing_pos + np.array([0.0, 0.0, 0.8]), 0.0])
landing_pos_dict[uri] = np.array([*landing_pos - np.array([0.0, 0.0, 0.2]), 0.0])
choreography_dict[uri] = self.splines[i]
color_top[uri] = {0.0: colors_array[i]}
color_bot[uri] = {0.0: colors_array[i]}
color_top[uri] = {
0.0: colors_array[i],
self.waypoints["time"][0, -1] - 0.1: np.zeros(4),
}
color_bot[uri] = {
0.0: colors_array[i],
self.waypoints["time"][0, -1] - 0.1: np.zeros(4),
}

try:
if not correct_positions:
Expand Down Expand Up @@ -376,19 +380,10 @@ def deploy(self, drone_ids: list[int] | None = None) -> bool:
color_top=color_top,
color_bot=color_bot,
)
swarm.apply_colors(None, None) # Turn off colors after choreography
swarm.goto(final_pos_dict, duration=1.0) # Transition from ideal point to hover pos
swarm.setpoint(final_pos_dict, duration=10.0) # Hovering
for i, d in enumerate(self.choreographer.drones.values()):
uri = d["uri"]
print(swarm.get_obs(uri)["pos"])
print(landing_pos_dict[uri])
swarm.goto(final_pos_dict, duration=2.0) # Transition from ideal point to hover pos
if self.settings["land_on_docks"]:
swarm.goto(final_pos_dict, duration=5.0) # Hovering
swarm.goto(landing_pos_dict, duration=1.5) # Landing
# swarm.land(0.0, duration=1.0)
for i, d in enumerate(self.choreographer.drones.values()):
uri = d["uri"]
print(swarm.get_obs(uri)["pos"])
print(landing_pos_dict[uri])
finally:
swarm.close()
self.music_manager.song = original_song
Expand Down
Loading
Loading