mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
fix-imu_default_settings
14 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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.
|
||
|
|
0391b4df26 |
[nps][bebop] update gazebo sim camera (#2383)
This pull request updates the Bebop camera simulation in order to work with the new defines and settings from #2364. It also includes a number of small fixes by @kirkscheper . The new setup renders the entire camera sensor, which allows the crop and zoom settings to be changed at runtime just as on the real drone. The resolution of the simulated sensor can be reduced for better runtime performance. ---- * update gazebo sim camera * WIP Revert Bebop SDF cam hfov to 3.0, TODO update to full sensor size * WIP mt9f002.c remove OUTPUT_SCALER comment * WIP FIX image.c casting problem vectors.pos is now cast to float to prevent unwanted implicit casting to uint. I did not change the point_t types as I do not have time to test this, but this would be a good idea for a later pull request. * WIP lucas_kanade.c comment keep_bad_points * WIP opticflow_module.c replace memcpy with assignment for readability * WIP nps_fdm_gazebo fix mt9f117 check for bottom_cam instead of front_cam * WIP nps_fdm_gazebo do not set env_texture_size The current size (2048) is probably large enough for all realistic ZOOM settings. * WIP ERROR nps_fdm_gazebo fix camera, corrupt image in gazebo :/ * WIP ERROR zoom is not tuneable at runtime :/ * WIP fixed sensor resolution in gazebo Since the zoom should be adjustable at runtime, the zoom factor will need to be implemented in the image sampling routine, it cannot be set beforehand in the bebop model. * WIP include mt9f002.c and mt9v117.c in NPS Added simple wrapper files to prevent overwriting the video_thread_nps.c ones. * WIP enable runtime zoom and offset changes for mt9f002 in NPS! Zoom and offset settings can now be adjusted at runtime just like on the real drone. The mt9f002.c code handles the bounds checking etc. * WIP take out string comparison in read_image * WIP ignore GCC errors that do not appear in compilation for ARM Might be better to actually fix these errors, but I am not familiar with that part of the code. * WIP remove todo file * FIX ardrone2_gazebo build error linking error was caused by undefined reference to mt9f002 struct (which is not used in the ardrone). Removing the NPS MT9F002 define means that this struct is always linked, even though it may not be used. To fix, I added an empty `__attribute__((weak))` struct that prevents these linking errors, but could cause unexpected behavior when a Bebop model or other model with mt9f002 camera is used without the bebop_cam module. * FIX naming conflict after merge * FIX Allow arbitrary simulated sensor sizes for runtime improvement The FDM can now handle arbitrary sizes for the camera sensor. This allows the sensor size to be reduced from the real-world 4608x3288 to a lower resolution to reduce rendering times, at the cost of lower-resolution images. The downscaling of the sensor is controlled using the `NPS_MT9F002_SENSOR_RES_DIVIDER` define. * Update Bebop 2 gazebo models for new front- and bottom cam code |
||
|
|
2430b31f0f | [gazebo] add ROS support and sonar sensor (#2399) | ||
|
|
58cbb73d68 |
Gazebo model of the 2018 dronerace track (#2335)
* New Gazebo Models for ADR2018 * Add gazebo simulation session to controlpanel |
||
|
|
c0741e01ab |
MAVLab course 2018 (#2268)
* Merge cyberzoo model (squashed) Squashed commit of the following: commit |
||
|
|
c870e27ac5 |
[gazebo] Cyberzoo model (#2230)
* First steps towards detailed cyberzoo model. Got transparency working. * Fix ambient lighting of cyberzoo_solid * Import improved model * Fix optitrack cameras * Fix lighting colors * Fix optitrack camera color * Add orange pole and traffic mat objects * Fix orange_pole2 smoothing errors * Fix cyberzoo origin * Add first draft of cyberzoo surroundings * Add updated cyberzoo surroundings and outside walls * Minor fixes to surroundings * Create cyberzoo world To-do: set origin coordinates and rotate environment * Set world coordinates and rotation, fix naming conflict * Add cyberzoo world with orange poles for orange_avoider * Remove old cyberzoo model, fix dependencies * Add daylight in windows on outer walls * Separate cyberzoo model into layers Makes it easier to hide parts of the model in the GUI. * Add cyberzoo surroundings to main model in separate layers * Restore cyberzoo floor collision box * Add cyberzoo props * Minor tweaks to models * Compress textures Reduced texture dimensions. Size of model folder is now approx. 20 MB instead of 60+ MB. * Remove origin marker from worlds * Move CyberZoo models to submodule - All new models are moved to the tudelft/gazebo_models repository, which is included as a submodule in sw/ext/tudelft_gazebo_models/ - Changed vehicle and world SDF loading to use URI's, these can be used with multiple search paths - Added gzclient_launcher.sh script that sets up environment variables before launching gzclient. This prevents errors if the user forgets to add the paths to .bashrc. Added as a tool to control_panel_example.xml |
||
|
|
ff8c58a190 |
[gazebo] Simulate Bebop1 camera (#2225)
* First attempt at bebop fisheye camera * Try setting raw camera output size during initialization, does not work SetImageSize() is ignored and SetEnvTextureSize() causes an exception. Currently the camera output is too large for real-time operation. * FIX apply MT9F002_OUTPUT_SCALER to gazebo front camera * Add MT9F002 camera cropping to fdm_gazebo * Apply MT9F002_TARGET_FPS to bebop front cam in gazebo * Set up bottom camera for bebop model * Minor fixes and cleanup * Fix MT9F002 partially applied to all cameras * Remove sensors_params_bebop, introduce NPS_SIMULATE_MT9F002 Reduces duplicate code for sensor parameters, and follows the same pattern as NPS_SIMULATE_LASER_RANGE_ARRAY. Also does not require the sensor params to be changed in every bebop airframe. |
||
|
|
cfabb51eed |
[gazebo] Add actuator dynamics and bebop model (#2219)
* Add gazebo model for Parrot Bebop 1 * Add first-order high pass filter * First implementation of actuator dynamics and spinup torque Flies ok with PID control Does not fly ok with INDI, the required G1 R is 0.159 instead of 0.0022 (estimated by flying in adaptive mode). The other parameters are close to those specified in the airframe file. * FIX incorrect yaw behavior Fixed two bugs: 1. gazebo_actuators.torques was set to NPS_ACTUATOR_THRUSTS 2. spinup torque direction is now also controlled by motor mixing * Clean up debug code and file logger * Clean up gazebo example airframes * Minor cleanup * FIX warnings about missing initializer in fdm_gazebo * Update documentation * Remove modules section, move to firmware * Minor fixes to fdm_gazebo and high_pass_filter * Move actuator dynamics to included airframe files Should prevent duplicate actuator defines spread accross all airframe files. * Fix FILTER_ROLL_RATE in bebop2_indi airframe Moved to firmware targets so it will be disabled in gazebo. Is this actually working in jsbsim?? * Update documentation * Fix newlines * Minor fixes in nps_fdm_gazebo.cpp * Re-enable filter roll rate Caution: causes oscillations around roll axis in gazebo * Disable roll filter and cleanup |
||
|
|
6fafcaaae9 |
Gazebo in tudelft conf, with orange avoid example (#2149)
* Gazebo Cyberzoo and OrangeAvoid in tudelft conf, Simulate when no RC, call gzclient as tool * [orange_avoider] color setting * docs+remove modules section |
||
|
|
e84ff368c2 |
Add rangesensor module (#2158)
* added rangesensors to gazebo model and NPS * added module to handle the range sensors * added sender IDS and added to abi messages * added abi message to flight plan guided |
||
|
|
3bf4b8731d |
[nps] load aircraft into gazebo at run time + actuator handling (#2135)
* load aircraft into gazebo at run time + actuator handling * Remove environment from airframe |
||
|
|
5a985ef691 |
Fix #2090 (#2122)
* Add drag to gazebo ardrone model Simple linear drag with guessed coefficient, not super accurate but better than no drag at all... * Fix #2090 Set accelerometer sensor bounds to correct values. |
||
|
|
e9ff78ad00 | Fix optical flow nans when using feature management | ||
|
|
9d1e71b1ea |
Add Gazebo simulation to NPS (#2069)
* Setup code for Gazebo Currently only partially initializes the fdm struct, which produces incorrect results in the GCS. Compilation, however, already seems to work as expected! Next step is to fetch data from Gazebo. * Closed-loop flight in Gazebo Finished the first implementation of the Gazebo FDM. It is now possible to perform closed-loop flights using Paparazzi together with Gazebo. Look at the example_ardrone2.xml airframe file for the required gazebo tags. The following modifications are made: - change fdm type to "gazebo" - add definitions for ACTUATOR_THRUSTS and ACTUATOR_TORQUES. These were obtained from the JSBsim ardrone model. The oredr is the same as the ACTUATOR_NAMES. The Gazebo world needs an aircraft model that is (by default) named "paparazzi_uav". This model should include links with the names listed in ACTUATOR_NAMES in the airframe file, as these are used to apply forces on the quadrotor. Known bugs: - No fixed wing aircraft yet. - Not all fields in the fdm struct are set. Most of the atmosphere fields are not implemented yet. - AHRS and INS need to be bypassed, these do not yet work correctly. - No quadrotor models are supplied with paparazzi yet (although it is included in the example world file). * Added cameras, but sensor update causes crash As in the quick standalone examples, gazebo regularly crashes when cameras are used. This is an intermediary commit where most of the camera infrastructure is present, but not functional yet because of an unknown bug regarding Gazebo. * Simplified problem, located crash Crash occurs when gazebo::sensors::run_once() is called during the fdm update step. The exception (Ogre internal exception, cannot create GL vertex buffer) only occurs after the main loop has been performed a few times (10-20x typically). Ignoring the error by catching the exception does not make it go away. * Add ogre to fdm_gazebo makefile * Further changes for debugging, not fixed yet * FIX bug Turns out that fdm_init and fdm_run_step are not running in the same thread, which apparently caused some problems with Gazebo. The gazebo initialization code that starts the server is now moved to the run_step function, and cameras work fine now. Next step is to get the images from Gazebo to the video_thread_nps module. * Transport images to Paparazzi Added code that converts Gazebo's RGB888 images to Paparazzi's YUV422 format, and calls the registered video callbacks. * Finish video streaming Finished video streaming. Video streaming in the paparazzi master branch does not seem to work in simulation or even on a real ardrone. Therefore, reverted to v5.10 viewvideo.c and rtp.c and now the streaming works correctly. * Separate UAV model from world. Added a models/ directory to conf/simulator/gazebo, now the UAV model can be included in the world file. The models/ dir is added to Gazebo's search paths when the server is launched, so it does not require any additional steps from the user. * Move Gazebo modifications from examples/ardrone2.xml to examples/ardrone2_gazebo.xml Reverted changes to the original airframe and moved these to a separate example. * Remove .sdp file Remove .sdp file that should not have been included with commits. * Move changes in conf_example.xml to separate entry Moved the changes to conf_example.xml (selected flightplan, modules etc.) to a separate etry named 'ardrone2 (Gazebo)'. * Clean up changes to computer_vision module - Removed unused viewvideo_nps.c. - Add doc comments in video_thread_nps.c * Fix bug in conf_example Spaces in aircraft name caused compilation error, changed to 'ardrone2_gazebo'. * Fix duplicate ac_id in conf_example * Remove debug code from nps_fdm_gazebo.cpp and add comments * Reduce weight of cameras Cameras weighed 10 grams, which was quite much. Now reduced to 1 gram. * Fix camera not active During the cleanup of the ardrone gazebo model, the always_on tag was removed. Now, the cameras are activated during gazebo_video_init Also removed further debug code from nps_fdm_gazebo.cpp. * Restore master branch video streamer and rtp encoder The streamer of the master branh does not work correctly atm, but this will be moved to a separate issue. * Fix compilation warnings Fixed all compilation warnings (tested with Gazebo 8). Unused arguments are now marked as such. The NPS makefile is modified to use CXXFLAGS in addition to CFLAGS, which solves the std=c++11 related warnings. fdm_gazebo.cpp now ignores deprecated warnings, as all of these come from Gazebo. Not the cleanest solution, but it works for now. * Add documentation to fdm module xml and add copyright notices where appropriate * Fix code style Fixed code style using the tool included with paparazzi. * Fix missing model.config .gitignore caused the model.config files for the Gazebo models to be excluded from the commit. Added an exception to .gitignore and added the missing file. * Fix INS by adding placeholder atmospheric data values Added placeholder values to the atmospheric section of the NPM struct. These should be valid for low altitude, low speed flights. Previously, these values were uninitialized which caused INS to fail (incorrect altitude estimates). With these placeholder values, the INS works ok and no longer needs to be bypassed. * Fix makefile targets in video_rtp_stream and cv_colorfilter (Re)added target="ap|nps" attribute to the module .xml files. |