Skip to content

Commit 23db4ac

Browse files
committed
Fixed an bug in head angle
1 parent e5f8545 commit 23db4ac

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

amadeusgpt/analysis_objects/relationship.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def calc_angle_in_egocentric_animal(mouse_cs_inv, p):
7171
p_in_mouse[:, 1], p_in_mouse[:, 0]
7272
) # relative angle between the object and the mouse body axis
7373
theta = np.rad2deg(theta % (2 * np.pi))
74+
7475
return theta
7576

7677

@@ -91,6 +92,7 @@ def get_name(self):
9192
return self.__name__
9293

9394
def query_relationship(self, query_name: str) -> ndarray:
95+
9496
ret = self.data[query_name]
9597
return ret
9698

@@ -239,7 +241,7 @@ def _animal_animal_relationship(
239241
mouse_cs_inv[valid] = np.linalg.inv(mouse_cs[valid])
240242
head_cs_inv.append(mouse_cs_inv)
241243
head_angles = calc_angle_in_egocentric_animal(
242-
head_cs_inv, sender_animal.get_center()
244+
head_cs_inv, receiver_animal.get_center()
243245
)
244246

245247
relative_velocity = (
@@ -261,7 +263,7 @@ def _animal_animal_relationship(
261263

262264
if head_angles is not None:
263265
ret["relative_head_angle"] = head_angles
264-
# print ('head angle', head_angles)
266+
265267
if angles is not None:
266268
ret["relative_angle"] = angles
267269
if orientation is not None:

amadeusgpt/managers/event_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ def get_animals_animals_events(
320320
_comparison = comparison_operator + "".join(
321321
query.split(comparison_operator)[1:]
322322
)
323+
323324
events = self.get_events_from_relationship(
324325
relationship, _query, _comparison, smooth_window_size
325326
)

amadeusgpt/programs/sandbox.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,9 @@ def render_temp_message(query, sandbox):
543543
from amadeusgpt.analysis_objects.object import ROIObject
544544
from amadeusgpt.main import create_amadeus
545545

546-
config = Config("amadeusgpt/configs/Horse_template.yaml")
546+
config = Config("amadeusgpt/configs/mabe_template.yaml")
547+
547548
amadeus = create_amadeus(config)
548549
sandbox = amadeus.sandbox
549-
analysis = sandbox.exec_namespace["behavior_analysis"]
550-
analysis.add_roi_object = ""
551550

552-
res = sandbox.step("plot the trajectory of the bodypart body_mouth")
551+
render_temp_message('random', sandbox)

0 commit comments

Comments
 (0)