diff --git a/conf/airframes/tudelft/ardrone2_orangeavoid_course2017_gazebo.xml b/conf/airframes/tudelft/ardrone2_orangeavoid_course2017_gazebo.xml deleted file mode 100644 index a1e6fc6f0b..0000000000 --- a/conf/airframes/tudelft/ardrone2_orangeavoid_course2017_gazebo.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - -
- - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - -
- -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
- -
- - - - - - - -
- -
- - - -
- - -
- - - - -
- -
- - - - - -
-
diff --git a/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml b/conf/airframes/tudelft/bebop_course2018_orangeavoid.xml similarity index 97% rename from conf/airframes/tudelft/bebop_orangeavoid_course2017.xml rename to conf/airframes/tudelft/bebop_course2018_orangeavoid.xml index 20d6ece207..ef04b0a450 100644 --- a/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml +++ b/conf/airframes/tudelft/bebop_course2018_orangeavoid.xml @@ -1,7 +1,7 @@ - Vision Course TUDelft V2017 + Vision Course TUDelft V2018 @@ -41,9 +41,7 @@ - - - + @@ -72,8 +70,7 @@ - - + @@ -183,10 +180,10 @@
- - - - + + + + diff --git a/conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml b/conf/flight_plans/tudelft/course2018_orangeavoid_cyberzoo.xml similarity index 96% rename from conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml rename to conf/flight_plans/tudelft/course2018_orangeavoid_cyberzoo.xml index 5b668e437f..2cb57617c7 100644 --- a/conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml +++ b/conf/flight_plans/tudelft/course2018_orangeavoid_cyberzoo.xml @@ -1,6 +1,6 @@ - +
#include "subsystems/datalink/datalink.h" #include "subsystems/electrical.h" @@ -8,7 +8,7 @@ #include "subsystems/ahrs.h" // Note: use 'git submodule update --init -- sw/ext/tudelft_gazebo_models/' - // to download the required models. + // to download the required models. #define NPS_GAZEBO_WORLD "cyberzoo_orange_poles.world"
@@ -48,7 +48,7 @@ !(nav_block >= IndexOfBlock('Land here')) && (autopilot_in_flight() == true) )" deroute="Standby"/--> - 5) && !(IndexOfBlock('Holding point') > nav_block) && !(nav_block >= IndexOfBlock('Land here')) && (autopilot_in_flight() == true) )" deroute="Land here"/> diff --git a/conf/simulator/gazebo/airframes/bebop.xml b/conf/simulator/gazebo/airframes/bebop.xml index 926e5dc2f1..9ec25a7765 100644 --- a/conf/simulator/gazebo/airframes/bebop.xml +++ b/conf/simulator/gazebo/airframes/bebop.xml @@ -8,6 +8,7 @@ +
diff --git a/conf/simulator/gazebo/models/bebop/bebop.sdf b/conf/simulator/gazebo/models/bebop/bebop.sdf index ce6c6838d7..0d4d0e71f3 100644 --- a/conf/simulator/gazebo/models/bebop/bebop.sdf +++ b/conf/simulator/gazebo/models/bebop/bebop.sdf @@ -9,7 +9,7 @@ - 0.38905 + 0.536 0.000906 0.001242 @@ -34,6 +34,10 @@ 0.15 0.05 0.05 + + 0.82 0.07 0.07 1 + 0.82 0.07 0.07 1 + @@ -65,8 +69,8 @@ - 0.25 0.85 0.95 1 - 0.25 0.85 0.95 1 + 0.82 0.07 0.07 1 + 0.82 0.07 0.07 1 @@ -129,8 +133,8 @@ - 0.25 0.85 0.95 1 - 0.25 0.85 0.95 1 + 0.82 0.07 0.07 1 + 0.82 0.07 0.07 1 @@ -192,11 +196,11 @@ 15.0 - 4608 + 3746 3288 R8G8B8 - 3.69 + 3.00 equisolid_angle true diff --git a/conf/userconf/tudelft/course2017_conf.xml b/conf/userconf/tudelft/course2017_conf.xml deleted file mode 100644 index 6f0b002d98..0000000000 --- a/conf/userconf/tudelft/course2017_conf.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/conf/userconf/tudelft/course2018_conf.xml b/conf/userconf/tudelft/course2018_conf.xml new file mode 100644 index 0000000000..b10a8f34aa --- /dev/null +++ b/conf/userconf/tudelft/course2018_conf.xml @@ -0,0 +1,14 @@ + + + diff --git a/conf/userconf/tudelft/course2017_control_panel.xml b/conf/userconf/tudelft/course2018_control_panel.xml similarity index 54% rename from conf/userconf/tudelft/course2017_control_panel.xml rename to conf/userconf/tudelft/course2018_control_panel.xml index 712ac1dde2..59eb0ee5e1 100644 --- a/conf/userconf/tudelft/course2017_control_panel.xml +++ b/conf/userconf/tudelft/course2018_control_panel.xml @@ -4,8 +4,15 @@ - - + + + + + + + + + @@ -23,7 +30,56 @@
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34,31 +90,11 @@ + - - - + + - - - - - - - - - - - - - - - - - - - -
diff --git a/sw/ground_segment/python/distance_counter/dist.py b/sw/ground_segment/python/distance_counter/dist.py new file mode 100755 index 0000000000..487d2ce8c5 --- /dev/null +++ b/sw/ground_segment/python/distance_counter/dist.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# +# Copyright (C) 2016 TUDelft +# +# This file is part of paparazzi. +# +# paparazzi is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# paparazzi is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with paparazzi. If not, see . +# + +import wx +import sys +import argparse +import distance_counter + +parser = argparse.ArgumentParser(description='Capture PAYLOAD messages over the IVY bus and forward to a remote application.', epilog='payload.py is part of the paparazzi-uav project.') +settings = parser.parse_args() + +print(settings) + +class DistanceFrame(wx.App): + def OnInit(self): + self.main = distance_counter.DistanceCounterFrame(settings) + self.main.Show() + self.SetTopWindow(self.main) + return True + +def main(): + application = DistanceFrame(0) + application.MainLoop() + +if __name__ == '__main__': + main() diff --git a/sw/ground_segment/python/distance_counter/distance_counter.py b/sw/ground_segment/python/distance_counter/distance_counter.py new file mode 100644 index 0000000000..206689b60c --- /dev/null +++ b/sw/ground_segment/python/distance_counter/distance_counter.py @@ -0,0 +1,124 @@ +# +# Copyright (C) 2016 TUDelft +# +# This file is part of paparazzi. +# +# paparazzi is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# paparazzi is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with paparazzi. If not, see . +# + +import wx +import sys +import os +import threading +import socket +import array +from cStringIO import StringIO +import wx +import array +import Image +import math + + +PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../..'))) + +sys.path.append(PPRZ_SRC + "/sw/ext/pprzlink/lib/v1.0/python") + +from pprzlink.ivy import IvyMessagesInterface + +WIDTH = 300 + + + +class DistanceCounterFrame(wx.Frame): + + def message_recv(self, ac_id, msg): + if msg.name == "INS": + + self.msg_count = self.msg_count + 1 + + newx = float(msg.get_field(0)) / 256.0 + newy = float(msg.get_field(1)) / 256.0 + + moved = ((newx - self.ins_msg_x) ** 2 + (newy - self.ins_msg_y) ** 2) + if self.init == 0: + self.init = 1 + else: + self.distance = self.distance + math.sqrt(moved) + + self.ins_msg_x = newx + self.ins_msg_y = newy + self.ins_msg_z = msg.get_field(2) + + + # graphical update + wx.CallAfter(self.update) + + def update(self): + self.Refresh() + + def OnSize(self, event): + self.w = event.GetSize()[0] + self.h = event.GetSize()[1] + self.Refresh() + + def OnPaint(self, e): + # Paint Area + dc = wx.PaintDC(self) + brush = wx.Brush("white") + dc.SetBackground(brush) + dc.Clear() + + # Background + dc.SetBrush(wx.Brush(wx.Colour(0,0,0), wx.TRANSPARENT)) + font = wx.Font(11, wx.DEFAULT, wx.NORMAL, wx.NORMAL) + dc.SetFont(font) + dc.DrawText("INS Packets:" + str(self.msg_count),2,2) + dc.DrawText("Data: " + str(self.ins_msg_x) + ", " + str(self.ins_msg_y) + ", " + str(self.ins_msg_z) + ".",2,22) + dc.DrawText("Distance: " + str(round(float(self.distance)/1.0,2)) + " m",2,22+20) + + + + def __init__(self, _settings): + + # Command line arguments + self.settings = _settings + + # Statistics + self.data = { 'packets': 0, 'bytes': 0} + + self.w = WIDTH + self.h = WIDTH + + # Frame + wx.Frame.__init__(self, id=-1, parent=None, name=u'Distance Counter', + size=wx.Size(self.w, self.h), title=u'Distance Counter') + + self.Bind(wx.EVT_PAINT, self.OnPaint) + self.Bind(wx.EVT_SIZE, self.OnSize) + self.Bind(wx.EVT_CLOSE, self.OnClose) + + # IVY + self.interface = IvyMessagesInterface("DistanceCounter") + self.interface.subscribe(self.message_recv) + + self.msg_count = 0 + self.distance = 0 + self.ins_msg_x = 0 + self.ins_msg_y = 0 + self.ins_msg_z = 0 + self.init = 0 + + def OnClose(self, event): + self.interface.shutdown() + self.Destroy()