From 0a37e57049f1cd2cedd5089868108915bf664167 Mon Sep 17 00:00:00 2001 From: knmcguire Date: Mon, 20 Nov 2023 13:55:41 +0100 Subject: [PATCH] fixed error messaging --- crazyflie/scripts/crazyflie_server.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/crazyflie/scripts/crazyflie_server.py b/crazyflie/scripts/crazyflie_server.py index a47c9c896..138dc6bf8 100755 --- a/crazyflie/scripts/crazyflie_server.py +++ b/crazyflie/scripts/crazyflie_server.py @@ -802,22 +802,22 @@ def _upload_trajectory_callback(self, request, response, uri="all"): id = request.trajectory_id offset = request.piece_offset - size = request.pieces.size() + lenght = len(request.pieces) total_duration = 0 - self.get_logger().info("upload_trajectory(id=%d,offset=%d, size=%d)"% ( + self.get_logger().info("upload_trajectory(id=%d,offset=%d, lenght=%d)"% ( id, offset, - size, + lenght, )) trajectory = [] - for i in range(size): + for i in range(lenght): piece = request.pieces[i] - px = piece.poly_x - py = piece.poly_y - pz = piece.poly_z - pyaw = piece.poly_yaw - duration = request.duration.sec + px = Poly4D.Poly(piece.poly_x) + py = Poly4D.Poly(piece.poly_y) + pz = Poly4D.Poly(piece.poly_z) + pyaw = Poly4D.Poly(piece.poly_yaw) + duration = piece.duration.sec trajectory.append(Poly4D(duration, px, py, pz, pyaw )) total_duration = total_duration + duration @@ -864,9 +864,9 @@ def _start_trajectory_callback(self, request, response, uri="all"): )) if uri == "all": for link_uri in self.uris: - self.swarm._cfs[link_uri].cf.commander.start_trajectory(id, ts, rel, rev, gm) + self.swarm._cfs[link_uri].cf.high_level_commander.start_trajectory(id, ts, rel, rev, gm) else: - self.swarm._cfs[uri].cf.commander.start_trajectory(id, ts, rel, rev, gm) + self.swarm._cfs[uri].cf.high_level_commander.start_trajectory(id, ts, rel, rev, gm) return response