Files
paparazzi/conf/modules/wedgebug.xml
Ralph R. Schmidt d047a9bb81 StereoWedgeBug (#2555)
* First comit of clean branch

* Added new drone airframe files (xml and model folder) for gazebo

* Renamed sdf file for bebop drone with stereo cams

* Added custom configuration and control panel files
 On branch stereoCamerasNewDrone
 Changes to be committed:
	new file:   conf/userconf/tudelft/ralphthesis2020_conf.xml
	new file:   conf/userconf/tudelft/ralphthesis2020_control_panel.xml

* Added new files necessary for a new bebop model with stereo vision
On branch stereoCamerasNewDrone
Changes to be committed:
	new file:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	new file:   conf/flight_plans/tudelft/ralphthesis2020_stereo_cyberzoo.xml
	modified:   conf/simulator/gazebo/airframes/bebop_w_stereo_cams.xml
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/model.config
	modified:   conf/userconf/tudelft/ralphthesis2020_conf.xml

* Replaced cameras on bebop (front + down) with a stereo setup

On branch stereoCamerasNewDrone
Changes to be committed:
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf

* Solved low resolution in left camera

On branch stereoCamerasNewDrone
Changes to be committed:
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf

* Created new module "wedgebu" and added it to the airframe "bebop_ralphthesis2020_stereo.xml"
Also, used "make" to create tool for creating modules
On branch wedgeBug
Your branch is up to date with 'origin/wedgeBug'.
Changes to be committed:
	modified:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	new file:   conf/modules/wedgebug.xml
	modified:   conf/userconf/tudelft/ralphthesis2020_conf.xml
	new file:   sw/airborne/modules/wedgebug/wedgebug.c
	new file:   sw/airborne/modules/wedgebug/wedgebug.h
	new file:   sw/tools/create_module/create_module_ui.py
	new file:   sw/tools/create_module/datalink_ui.py
	new file:   sw/tools/create_module/event_ui.py
	modified:   sw/tools/create_module/files_create.py
	new file:   sw/tools/create_module/init_ui.py
	new file:   sw/tools/create_module/periodic_ui.py

* Added functions to copy images from left and right camera to global variables
On branch wedgeBug
Your branch is ahead of 'origin/wedgeBug' by 1 commit.
 Changes to be committed:
	modified:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	modified:   conf/modules/wedgebug.xml
	modified:   conf/simulator/gazebo/models/bebop_w_stereo_cams/bebop_w_stereo_cams.sdf
	modified:   sw/airborne/modules/wedgebug/wedgebug.c

* Added function to compare individual pixels of  images types (image_t)

* Tried to figure out why the C++ Mat object of the left gray pixels looks different to the left image

* A rough implementation and proof of the copy function (note: copy buf entries by incrementing pointer)
Changes to be committed:
	deleted:    Color_Image.jpg
	modified:   conf/airframes/tudelft/bebop_ralphthesis2020_stereo.xml
	deleted:    merged_stereo_image.jpg
	modified:   sw/airborne/modules/wedgebug/wedgebug.c
	modified:   sw/airborne/modules/wedgebug/wedgebug.h
	modified:   sw/airborne/modules/wedgebug/wedgebug_opencv.cpp
	modified:   sw/airborne/modules/wedgebug/wedgebug_opencv.h

* Finalized 1) image merging function for YY image and 2) function for saving gray images using openCV

* Created C++ function to create and return disparity image. Also changed gazebo world.

* 1) Added FPS like controlls for drone, using Xbox controller. 2) Added cropping image functionality of block matching function.

* SBM can take 16 bit images now, save function uses an image_t struct and a new type called "IMAGE_OPENCV_DISP" was added, specifically for OpenCV disparity images.

* Added openCV dependent openin and closing functions

* Added 1) openCV dependent dilation and sobel operation functions, 2) 3d point structure to image.h 3) Loop in wedebug.c for findin edge point closest to target.

* Added functions to convert world coordinates to camera coordinates (turned out to be a wrong implementation. Next commit will be the correct implementation)

* Added functions to convert world to agent to camera coordinates (and vice versa)

* Cleaned up coordinate conversion functions

* 1. Created new world for drone testing, 2. Created new waytpoints for drone testing, 4. Created state machine template in module 5. Debugged the "SBM_OCV" function 6. Filled in the state for "Initial position", "Move to start", "Start position" and  "Goal reached" 7. Started to fill in the state "Move to goal" 8. Created function to get median distance of object in front ("median_disparity_to_point") 9. Created function to determine angle between drone and goal point ("heading_towards_waypoin") 10. Cleaned up code, removed non-essential variables (especially images) and added new variables.

* Converted edge detection algorithm into a function and cleaned code more. Also created more global variables.

* Added draft approach for "EDGE_DETECTION"

* Quick save

* First draft of code. The robot can evade a board in its way and reach the goal. Also  increase periodic loop speed to 15 hz to counter the fast turning of the drone

* Included code for measuring metrics and displaying them. Also, cleaned the code some more.

* Cleaned code, added comments to describe code and variables and got rid of bug in function calculating heading direction.

* Removed bug in POSITION_EDGE state, where a new holding point was not set, after an obstacle was encountered. Also added various shapes (with birck texture) for testing.

* Added more shapes for experiment and added settings to change in GCS

* Changed camera settings to mimic those of Mathies et al. 2014. The drone can now avoid the standard metal board and the brick wall (type 2 2 x 2 meters)!

* Implemented state machine for control modes.

* Simplified code

* Cleaned code

* Added a  flag to detect changes in the navigation mode used

* Merged background processes under the condition that the state machine is running in certain state

* Debugged time measurement of total time (metric 1)

* Cleaned code

* MAde debug options state number independent (i.e. they have been renamed to include the name of the state and not the number)

* Remove states: POSITION_INITIAL, MOVE_TO_START and POSITION_START from finite state machine. Also all associate variables have been removed.

* Changed "NUMER_OF_STATES" to "NUMBER_OF_STATES". Also increased "max_obstacle_confidence" from 3 to 5, to avoid fake obstacle detection.

* Added metric measurement when in direct flight.

* Added aluminum bar as object for goal marker and creted button for drone to move to start position and another button for drone to start the experiment. In the current example the drone goes around a 2x2 meter wall.

* Added saving flag and functions for report (in c and cpp file)

* Added median kernel dimensions as options in settings

* Made unused waypoints invisible in the GCS

* Added two more objects for investigation (with a larger hole for the drone to fly through). Also fine tuned the code.

* Commit before change of depth image.

* Added 16 bit background processes for greater precision. Also change some funciton in C++ file to better handle 16bit images

* Using depht works, but its not fine tuned and code is messy.

* Ibligatory commit so that I can checkout a different branch.

* Added depth image on which edge detection is now based on (used to be based on disparity). It works relatively ok with all shapes investigated.

* A save after the experiments for the first repor thave been finalized.

* After demonstration

* Added code to toggle between p2DWedgeBug and p3DWedgeBug.

* Removed original files that were created during the previous merge process.

* Added background processes that works with a 16 bit disparity image (i.e. more precise distance measurement)

* Made finite state machine more readable. Also refined find_best_edge coordinates2 function. Additionally, added function to got from image place coordinates to camera coordinate using depth as input. Lastly, depth is now measured in cm when considerring the thresholds.

* Successfully integrated edge search over depth image instead of disparity image (tested in direct control mode only). Next step is to implement this for the guided mode.

* Addressed bug: The baseline used by the drone model was not the same as in the c file. This has been changed such that the baseline in the drone model now resembles the one in the c file.
By addressing this bug of the Bug algorithm the drone can now judge distances accurately. This in turn results in the drone being able to accurately avoid the wall (2mxm) obstacle.

* Changed flight plan to start experiment atuomatically.

* Just a checkpoint

* Added tree models.

* Removed non used objects from world file.

* Reverted back to opencv_bebop

* Reverted back to original files for push to master

* Added new shapes for experimentation

* Deleted blacklisted

* Cleaned code before push

* Added missing varibales and added declarations.

* Run style bash script and renamed image enum name (IMAGE_INT16)

* Corrected typos and delted unused control panel config file.
2020-07-17 18:53:28 +02:00

81 lines
4.2 KiB
XML

<!DOCTYPE module SYSTEM "module.dtd">
<module name="wedgebug" dir="wedgebug">
<doc>
<description> An integration of the WegdeBug algorithm (Laubach 1999) for path finding, for drones with stereo vision. </description>
<define name="WEDGEBUG_CAMERA_RIGHT" value="front_camera|bottom_camera" description="Video device to use"/>
<define name="WEDGEBUG_CAMERA_LEFT" value="front_camera|bottom_camera" description="Video device to use"/>
</doc>
<settings>
<dl_settings>
<dl_settings name="W-Disparity">
<dl_setting var="SE_opening_OCV" min="5" step="1" max = "401" shortname="SE_op"/>
<dl_setting var="SE_closing_OCV" min="5" step="1" max = "401" shortname="SE_clo"/>
<dl_setting var="SE_dilation_OCV_1" min="5" step="1" max = "401" shortname="SE_dil_1"/>
<dl_setting var="SE_dilation_OCV_2" min="5" step="1" max = "101" shortname="SE_dil_2"/>
<dl_setting var="SE_erosion_OCV" min="5" step="1" max = "101" shortname="SE_ero"/>
<dl_setting var="K_median_w" min="1" step="1" max = "321" shortname="K_med_w"/>
<dl_setting var="K_median_h" min="1" step="1" max = "321" shortname="K_med_h"/>
<dl_setting var="threshold_median_depth" min="0" step="1" max = "10000" shortname="thr_obs_depth"/>
<dl_setting var="threshold_depth_of_edges" min="0" step="1" max = "10000" shortname="thr_edge_depth"/>
<dl_setting var="threshold_edge_magnitude" min="0" step="50" max = "50000" shortname="thr_edge_mag"/>
<dl_setting var="threshold_distance_to_goal" min="0.00" step="0.05" max = "1.00" shortname="thr_goal_dist"/>
<dl_setting var="threshold_distance_to_angle" min="0.0" step="0.1" max = "3.1" shortname="thr_angle_dist"/>
<dl_setting var="max_obstacle_confidence" min="0" step="1" max = "50" shortname="conf_obs"/>
<dl_setting var="max_free_path_confidence " min="0" step="1" max = "50" shortname="conf_free"/>
<dl_setting var="max_position_confidence" min="0" step="1" max = "50" shortname="conf_pos"/>
<dl_setting var="max_heading_confidence" min="0" step="1" max = "50" shortname="conf_head"/>
<dl_setting var="max_edge_found_micro_confidence" min="0" step="1" max = "50" shortname="conf_edge_mi"/>
<dl_setting var="max_edge_found_macro_confidence" min="0" step="1" max = "50" shortname="conf_edge_mac"/>
<dl_setting var="max_no_edge_found_confidence" min="0" step="1" max = "50" shortname="conf_no_edge"/>
<dl_setting var="heat_map_type" min="0" step="1" max = "11" shortname="heatmap"/>
<dl_setting var="save_images_flag" min="0" step="1" max="1" shortname="Save Images">
<strip_button name="Start image capture" icon="dcstart.png" value="1" group="cv"/>
<strip_button name="Stop image capture" icon="dcstop.png" value="0" group="cv"/>
</dl_setting>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="wedgebug.h"/>
</header>
<init fun="wedgebug_init()"/>
<periodic fun="wedgebug_periodic()" freq="7"/> <!-- originally 4 -->
<makefile target="ap|nps">
<file name="wedgebug.c"/>
<file name="wedgebug_opencv.cpp"/>
<flag name="CXXFLAGS" value="I$(PAPARAZZI_SRC)/sw/ext/opencv_bebop/install_pc/include"/> <!-- needed to include headers -->
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/lib"/>
<flag name="LDFLAGS" value="lopencv_world"/>
<flag name="LDFLAGS" value="L$(PAPARAZZI_HOME)/sw/ext/opencv_bebop/install_pc/share/OpenCV/3rdparty/lib"/>
<flag name="LDFLAGS" value="llibprotobuf"/>
<flag name="LDFLAGS" value="lquirc"/>
<flag name="LDFLAGS" value="L/usr/lib/x86_64-linux-gnu"/>
<flag name="LDFLAGS" value="ljpeg"/>
<flag name="LDFLAGS" value="lpng"/>
<flag name="LDFLAGS" value="ltiff"/>
<flag name="LDFLAGS" value="L/usr/lib/x86_64-linux-gnu/hdf5/serial"/>
<flag name="LDFLAGS" value="lhdf5"/>
<flag name="LDFLAGS" value="lpthread"/>
<flag name="LDFLAGS" value="lsz"/>
<flag name="LDFLAGS" value="lz"/>
<flag name="LDFLAGS" value="ldl"/>
<flag name="LDFLAGS" value="lm"/>
<flag name="LDFLAGS" value="lfreetype"/>
<flag name="LDFLAGS" value="lharfbuzz"/>
<flag name="LDFLAGS" value="lrt"/>
</makefile>
</module>