Skip to content

Commit

Permalink
why did unittest tell the github action it passed when fig8 failed ?
Browse files Browse the repository at this point in the history
  • Loading branch information
julienthevenoz committed Feb 2, 2024
1 parent 2519bc5 commit 17d68d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/systemtests_sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
export PYTHONPATH="${PYTHONPATH}:/home/github/actions-runner/_work/crazyswarm2/crazyswarm2/crazyflie-firmware/build/"
export ROS_LOCALHOST_ONLY=1
export ROS_DOMAIN_ID=99
python3 src/crazyswarm2/systemtests/test_flights.py --sim
python3 src/crazyswarm2/systemtests/test_flights.py --sim -v #-v is verbose argument of unittest
- name: Upload files
id: step7
Expand Down
15 changes: 2 additions & 13 deletions systemtests/plotter_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def __init__(self, sim_backend = False):
if self.SIM : #It allows to temporally adjust the ideal and real trajectories on the graph. Could this be implemented in a better (not hardcoded) way ?
self.DELAY_CONST_FIG8 = -0.18 #for an unknown reason, the delay constant with the sim_backend is different
self.ALTITUDE_CONST_FIG8 = 1 #this is the altitude given for the takeoff in figure8.py. I should find a better solution than a symbolic constant ?
# self.ALTITUDE_CONST_MULTITRAJ = 0 #takeoff altitude for traj0 in multi_trajectory.py
# self.X_OFFSET_CONST_MULTITRAJ = 0 #offest on the x axis between ideal and real trajectory. Reason: ideal trajectory (traj0.csv) starts with offset of 0.3m and CrazyflieServer.startTrajectory() is relative to start position


def file_guard(self, pdf_path):
msg = None
if os.path.exists(pdf_path):
Expand Down Expand Up @@ -101,15 +99,6 @@ def read_csv_and_set_arrays(self, ideal_csvfile, rosbag_csvfile):

self.ideal_traj_x[i], self.ideal_traj_y[i], self.ideal_traj_z[i]= pos[0], pos[1], pos[2]

# #special cases
# if self.test_name == "fig8":
# # self.ideal_traj_z[i] = self.ALTITUDE_CONST_FIG8 #special case: in fig8 no altitude is given in the trajectory polynomials (idealcsv) but is fixed as the takeoff altitude in figure8.py
# pass
# elif self.test_name == "m_t":
# self.ideal_traj_z[i] = pos[2] + self.ALTITUDE_CONST_MULTITRAJ #for multi_trajectory the altitude given in the trajectory polynomials is added to the fixed takeoff altitude specified in multi_trajectory.py
# self.ideal_traj_x[i] = pos[0] + self.X_OFFSET_CONST_MULTITRAJ #the x-axis is offset by 0.3 m because ideal start position not being (0,0,0)


self.euclidian_dist[i] = np.linalg.norm([self.ideal_traj_x[i]-self.bag_x[i],
self.ideal_traj_y[i]-self.bag_y[i], self.ideal_traj_z[i]-self.bag_z[i]])
if self.euclidian_dist[i] > self.EPSILON:
Expand Down Expand Up @@ -172,7 +161,7 @@ def adjust_arrays(self):



assert False or (takeoff_index != None) and (landing_index != None), "Plotter : couldn't find drone takeoff or landing"
assert (takeoff_index != None) and (landing_index != None), "Plotter : couldn't find drone takeoff or landing"


####get rid of datapoints before takeoff and after landing in bag_times, bag_x, bag_y, bag_y
Expand Down
2 changes: 1 addition & 1 deletion systemtests/test_flights.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_multi_trajectory(self):
self.test_file = "multi_trajectory_traj0_ideal.csv"
self.record_start_and_clean("multi_trajectory", 80)
test_passed = self.translate_plot_and_check("multi_trajectory")
assert test_passed, "multitrajectory test failed : deviation larger than epsilon"
test_passed, "multitrajectory test failed : deviation larger than epsilon"



Expand Down

0 comments on commit 17d68d2

Please sign in to comment.