diff --git a/conf/airframes/examples/ardrone2_gazebo_cyberzoo.xml b/conf/airframes/examples/ardrone2_gazebo_cyberzoo.xml new file mode 100644 index 0000000000..4f48760e60 --- /dev/null +++ b/conf/airframes/examples/ardrone2_gazebo_cyberzoo.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + +
+ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + +
+ +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + +
+
diff --git a/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml b/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml index 0e0a302f07..b7652ca0c4 100644 --- a/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml +++ b/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml @@ -45,9 +45,9 @@ - + - + @@ -105,6 +105,16 @@ + +
+ + + + + + +
+
diff --git a/conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml b/conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml index fd720ca313..f235b05ac0 100644 --- a/conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml +++ b/conf/flight_plans/tudelft/course2017_avoid_orange_cyberzoo.xml @@ -39,10 +39,10 @@ - nav_block) && !(nav_block >= IndexOfBlock('Land here')) && - (autopilot_in_flight() == true) )" deroute="Standby"/> + (autopilot_in_flight() == true) )" deroute="Standby"/--> 3.5) && !(IndexOfBlock('Holding point') > nav_block) && !(nav_block >= IndexOfBlock('Land here')) && - (autopilot_in_flight == true) )" deroute="Land here"/> + (autopilot_in_flight() == true) )" deroute="Land here"/> + + + + + cv_colorfilter.xml
@@ -14,7 +20,7 @@
- + diff --git a/conf/simulator/gazebo/models/cyberzoo/cyberzoo.sdf b/conf/simulator/gazebo/models/cyberzoo/cyberzoo.sdf new file mode 100644 index 0000000000..68f135d0e0 --- /dev/null +++ b/conf/simulator/gazebo/models/cyberzoo/cyberzoo.sdf @@ -0,0 +1,103 @@ + + + + true + 0 0 0 0 0 0 + + + 0 0 0.01 0 0 0 + + + + 10 10 0.02 + + + + 0 0 0 1 + 0.2 0.8 0.2 1 + 0.2 0.2 0.2 1 + 0 0 0 0 + + + + + + 10 10 0.02 + + + + + + + 0 5 5 0 0 0 + + + + 10 0.2 10 + + + + 0 0 0 1 + 0.2 0.2 0.2 1 + 0 0 0 1 + 0 0 0 0 + + + + + + 10 0.2 10 + + + + + + + 5 0 5 0 0 0 + + + + 0.2 10 10 + + + + 0 0 0 1 + 0.2 0.2 0.2 1 + 0 0 0 1 + 0 0 0 0 + + + + + + 0.2 10 10 + + + + + + + 0 -5 6.25 0 0 0 + + + + 10 0.2 7.5 + + + + 0 0 0 1 + 0.2 0.2 0.2 1 + 0 0 0 1 + 0 0 0 0 + + + + + + 10 0.2 7.5 + + + + + + \ No newline at end of file diff --git a/conf/simulator/gazebo/models/cyberzoo/model.config b/conf/simulator/gazebo/models/cyberzoo/model.config new file mode 100644 index 0000000000..8272959314 --- /dev/null +++ b/conf/simulator/gazebo/models/cyberzoo/model.config @@ -0,0 +1,15 @@ + + + Cyberzoo + 1.0 + cyberzoo.sdf + + + Tom van Dijk + tomvand@users.noreply.github.com + + + + Cyberzoo coarse model + + \ No newline at end of file diff --git a/conf/simulator/gazebo/models/orange_pole/model.config b/conf/simulator/gazebo/models/orange_pole/model.config new file mode 100644 index 0000000000..de9b5b1c4a --- /dev/null +++ b/conf/simulator/gazebo/models/orange_pole/model.config @@ -0,0 +1,15 @@ + + + Orange Pole + 1.0 + orange_pole.sdf + + + Tom van Dijk + tomvand@users.noreply.github.com + + + + Orange pole as used in the TU Delft Cyberzoo. + + \ No newline at end of file diff --git a/conf/simulator/gazebo/models/orange_pole/orange_pole.sdf b/conf/simulator/gazebo/models/orange_pole/orange_pole.sdf new file mode 100644 index 0000000000..f81f240046 --- /dev/null +++ b/conf/simulator/gazebo/models/orange_pole/orange_pole.sdf @@ -0,0 +1,43 @@ + + + + 0 0 1.0 0 0 0 + true + + + 1.0 + + + 0.083 + 0.0 + 0.0 + 0.083 + 0.0 + 0.083 + + + + + + 0.3 + 2.0 + + + + + + + 0.2 + 2.0 + + + + 1 0.55 0 1 + 1 0.55 0 1 + 0.1 0.1 0.1 1 + 0 0 0 0 + + + + + \ No newline at end of file diff --git a/conf/simulator/gazebo/world/ardrone_cyberzoo.world b/conf/simulator/gazebo/world/ardrone_cyberzoo.world new file mode 100644 index 0000000000..4412027765 --- /dev/null +++ b/conf/simulator/gazebo/world/ardrone_cyberzoo.world @@ -0,0 +1,1588 @@ + + + + 0.001 + 0 + + + quick + 1 + + + + + 0.4 0.4 0.4 1 + 0.7 0.7 0.7 1 + 1 + + + 0 + 0 0 10 0 -0 0 + 0.8 0.8 0.8 1 + 0.1 0.1 0.1 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.5 -1 + + + EARTH_WGS84 + 51.990634 + 4.376789 + 0 + 150 + + + + model://ardrone + + + + 1 + + + + + 0 0 1 + 100 100 + + + + + + 100 + 50 + + + + + + + + + + + 10 + + + 0 + + + 0 0 1 + 100 100 + + + + + + + 0 + 0 + 0 + + + 0 0 -9.8 + 6e-06 2.3e-05 -4.2e-05 + + + + + + 1 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + 0.6 + 0.6 + + + + + + + + + + + 10 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + 0 + 0 + 0 + + -4.32267 -5.41265 0 0 -0 0 + + + 1 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + 0.6 + 0.6 + + + + + + + + + + + 10 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + 0 + 0 + 0 + + -2.76277 -5.40361 0 0 -0 0 + + + 1 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + 0.6 + 0.6 + + + + + + + + + + + 10 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + 0 + 0 + 0 + + -1.22632 -5.39461 0 0 -0 0 + + + 1 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + 0.6 + 0.6 + + + + + + + + + + + 10 + + + 0 0 1 0 -0 0 + + + 1.5 0.8 0.03 + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + 0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 -0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + 10 + + + + + + + + + + + + + + + -0.68 0.38 0.5 0 -0 0 + + + 0.02 + 1 + + + + + + + 0 + 0 + 0 + + 0.369055 -5.38977 0 0 -0 0 + + + 2.13254 -5.18591 0.15 0 -0 0 + + + 2 + + 0.0416667 + 0 + 0 + 0.0566667 + 0 + 0.0683333 + + + + + + 0.5 0.4 0.3 + + + + + + 1 + 1 + + + + + + + + 1e+07 + 1 + 0.001 + 0.1 + + + + + 10 + + + 0 0 -0.15 0 -0 0 + + + model://cardboard_box/meshes/cardboard_box.dae + 1 1 1 + + + + 0 + 0 + 0 + + + + 1 + + 0 0 0.01 0 -0 0 + + + + model://powerplant/meshes/powerplant.dae + 1 1 1 + + + 10 + + + + + + + + + + + + + + + + + model://powerplant/meshes/powerplant.dae + 1 1 1 + + + + 0 + 0 + 0 + + 14.4159 -38.034 0 0 -0 0 + + + -3.60609 4.59513 1 0 -0 0 + 1 + + + 1 + + 0.083 + 0 + 0 + 0.083 + 0 + 0.083 + + + + + + 0.3 + 2 + + + 10 + + + + + + + + + + + + + + + + + 0.2 + 2 + + + + 1 0.55 0 1 + 1 0.55 0 1 + 0.1 0.1 0.1 1 + 0 0 0 0 + + + 0 + 0 + 0 + + + + -0.897962 4.54077 1 0 -0 0 + 1 + + + 1 + + 0.083 + 0 + 0 + 0.083 + 0 + 0.083 + + + + + + 0.3 + 2 + + + 10 + + + + + + + + + + + + + + + + + 0.2 + 2 + + + + 1 0.55 0 1 + 1 0.55 0 1 + 0.1 0.1 0.1 1 + 0 0 0 0 + + + 0 + 0 + 0 + + + + 4.41201 -2.15118 1 0 -0 0 + 1 + + + 1 + + 0.083 + 0 + 0 + 0.083 + 0 + 0.083 + + + + + + 0.3 + 2 + + + 10 + + + + + + + + + + + + + + + + + 0.2 + 2 + + + + 1 0.55 0 1 + 1 0.55 0 1 + 0.1 0.1 0.1 1 + 0 0 0 0 + + + 0 + 0 + 0 + + + + 4.42776 -0.974296 1 0 -0 0 + 1 + + + 1 + + 0.083 + 0 + 0 + 0.083 + 0 + 0.083 + + + + + + 0.3 + 2 + + + 10 + + + + + + + + + + + + + + + + + 0.2 + 2 + + + + 1 0.55 0 1 + 1 0.55 0 1 + 0.1 0.1 0.1 1 + 0 0 0 0 + + + 0 + 0 + 0 + + + + 726 684000000 + 51 907058416 + 1496417116 584893201 + 51038 + + 2.13254 -5.19434 0.160037 0.056408 -0 1e-06 + 1 1 1 + + 2.13254 -5.19434 0.160037 0.056408 -0 1e-06 + 0 0 0 0 -0 0 + -0 -0 0 0 -0 0 + -0 -0 0 0 -0 0 + + + + -0.184743 -0.031412 0 0 -0 0 + 1 1 1 + + 4.81526 -0.031412 5 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -0.184743 -0.031412 0.01 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -0.184743 4.96859 5 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + -0.184743 -5.03141 6.25 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + 0 0 0 0 -0 0 + 1 1 1 + + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -3.60609 4.59513 1 0 -0 0 + 1 1 1 + + -3.60609 4.59513 1 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -0.897962 4.54077 1 0 -0 0 + 1 1 1 + + -0.897962 4.54077 1 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + 4.41201 -2.15118 1 0 -0 0 + 1 1 1 + + 4.41201 -2.15118 1 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + 4.42776 -0.974296 1 0 -0 0 + 1 1 1 + + 4.42776 -0.974296 1 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -1.68422 -6.28019 -0 1e-06 -1e-06 -3.05305 + 1 1 1 + + -1.68422 -6.28019 -0 1e-06 -1e-06 -3.05305 + 0 0 0 0 -0 0 + 1.53004 1.29309 -1.41088 -1.33828 1.56536 -0.047231 + 122.403 103.447 -112.87 0 -0 0 + + + + 1.4897 -16.402 0 0 -0 0 + 1 1 1 + + 1.4897 -16.402 0.01 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -4.32267 -5.41265 0 0 -0 0 + 1 1 1 + + -4.32267 -5.41265 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -2.76277 -5.40361 0 0 -0 0 + 1 1 1 + + -2.76277 -5.40361 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + -1.22632 -5.39461 0 0 -0 0 + 1 1 1 + + -1.22632 -5.39461 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + 0.369055 -5.38977 0 0 -0 0 + 1 1 1 + + 0.369055 -5.38977 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + 0 0 0 0 -0 0 + + + + 0 0 10 0 -0 0 + + + + + -29.7009 22.0773 26.2883 0 0.803643 -0.984605 + orbit + perspective + + + + 1 + -0.184743 -0.031412 0 0 -0 0 + + 0 0 0.01 0 -0 0 + + + + 10 10 0.02 + + + + 0 0 0 1 + 0.2 0.8 0.2 1 + 0.2 0.2 0.2 1 + 0 0 0 0 + + + + + + 10 10 0.02 + + + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + 0 5 5 0 -0 0 + + + + 10 0.2 10 + + + + 0 0 0 1 + 0.2 0.2 0.2 1 + 0 0 0 1 + 0 0 0 0 + + + + + + 10 0.2 10 + + + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + 5 0 5 0 -0 0 + + + + 0.2 10 10 + + + + 0 0 0 1 + 0.2 0.2 0.2 1 + 0 0 0 1 + 0 0 0 0 + + + + + + 0.2 10 10 + + + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + 0 -5 6.25 0 -0 0 + + + + 10 0.2 7.5 + + + + 0 0 0 1 + 0.2 0.2 0.2 1 + 0 0 0 1 + 0 0 0 0 + + + + + + 10 0.2 7.5 + + + 10 + + + + + + + + + + + + + + 0 + 0 + 0 + + + + + + 0 -0.1 0.95 0 -0 0 + 80 + + 24.88 + 0 + 0 + 25.73 + 0 + 2.48 + + + + 0 -0.1 0.01 0 -0 0 + + + 0.5 0.35 0.02 + + + 10 + + + + + + + + + + + + + + + 0 0 0.02 0.04 -0 0 + + + model://person_standing/meshes/standing.dae + 1 1 1 + + + 10 + + + + + + + + + + + + + + + 0 0 0.02 0.04 -0 0 + + + model://person_standing/meshes/standing.dae + 1 1 1 + + + + 0 + 0 + 0 + + -1.68422 -6.28019 0 0 -0 0 + + + diff --git a/conf/userconf/tudelft/conf.xml b/conf/userconf/tudelft/conf.xml index 94f29e42fd..c2db10209b 100644 --- a/conf/userconf/tudelft/conf.xml +++ b/conf/userconf/tudelft/conf.xml @@ -429,6 +429,17 @@ settings_modules="modules/ahrs_int_cmpl_quat.xml modules/stabilization_int_quat.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml modules/radio_control_superbitrf_rc.xml modules/gps_ubx_ucenter.xml" gui_color="green" /> + + diff --git a/conf/userconf/tudelft/course2017_control_panel.xml b/conf/userconf/tudelft/course2017_control_panel.xml index 666d1cbcdd..596431901b 100644 --- a/conf/userconf/tudelft/course2017_control_panel.xml +++ b/conf/userconf/tudelft/course2017_control_panel.xml @@ -20,6 +20,7 @@ +
diff --git a/sw/airborne/modules/computer_vision/lib/vision/image.c b/sw/airborne/modules/computer_vision/lib/vision/image.c index 4b5151994a..98b5db5763 100644 --- a/sw/airborne/modules/computer_vision/lib/vision/image.c +++ b/sw/airborne/modules/computer_vision/lib/vision/image.c @@ -620,7 +620,7 @@ void image_gradient_pixel(struct image_t *img, struct point_t *loc, int method, uint8_t add_ind = pixel_width - 1; // check if all pixels will fall in the image: - if(loc->x >= 1 && loc->x < img->w-1 && loc->y >= 1 && loc->y < img->h - 1) { + if(loc->x >= 1 && (loc->x + 1) < img->w && loc->y >= 1 && (loc->y + 1) < img->h ) { if(method == 0) { // ************* diff --git a/sw/airborne/modules/orange_avoider/orange_avoider.c b/sw/airborne/modules/orange_avoider/orange_avoider.c index 00f84d4d0b..6cfdc60549 100644 --- a/sw/airborne/modules/orange_avoider/orange_avoider.c +++ b/sw/airborne/modules/orange_avoider/orange_avoider.c @@ -14,6 +14,7 @@ #include "modules/computer_vision/colorfilter.h" #include "firmwares/rotorcraft/navigation.h" #include "generated/flight_plan.h" +#include "generated/airframe.h" #include "state.h" #include #include @@ -30,6 +31,31 @@ #define VERBOSE_PRINT(...) #endif +#ifndef ORANGE_AVOIDER_LUM_MIN +#define ORANGE_AVOIDER_LUM_MIN 41 +#endif + +#ifndef ORANGE_AVOIDER_LUM_MAX +#define ORANGE_AVOIDER_LUM_MAX 183 +#endif + +#ifndef ORANGE_AVOIDER_CB_MIN +#define ORANGE_AVOIDER_CB_MIN 53 +#endif + +#ifndef ORANGE_AVOIDER_CB_MAX +#define ORANGE_AVOIDER_CB_MAX 121 +#endif + +#ifndef ORANGE_AVOIDER_CR_MIN +#define ORANGE_AVOIDER_CR_MIN 134 +#endif + +#ifndef ORANGE_AVOIDER_CR_MAX +#define ORANGE_AVOIDER_CR_MAX 249 +#endif + + uint8_t safeToGoForwards = false; int tresholdColorCount = 0.05 * 124800; // 520 x 240 = 124.800 total pixels float incrementForAvoidance; @@ -42,12 +68,12 @@ float maxDistance = 2.25; void orange_avoider_init() { // Initialise the variables of the colorfilter to accept orange - color_lum_min = 20; - color_lum_max = 255; - color_cb_min = 75; - color_cb_max = 145; - color_cr_min = 167; - color_cr_max = 255; + color_lum_min = ORANGE_AVOIDER_LUM_MIN; + color_lum_max = ORANGE_AVOIDER_LUM_MAX; + color_cb_min = ORANGE_AVOIDER_CB_MIN; + color_cb_max = ORANGE_AVOIDER_CB_MAX; + color_cr_min = ORANGE_AVOIDER_CR_MIN; + color_cr_max = ORANGE_AVOIDER_CR_MAX; // Initialise random values srand(time(NULL)); chooseRandomIncrementAvoidance();