Commit Graph

943 Commits

Author SHA1 Message Date
Manos Kyriakakis 3ddd5d737b Changes to the Lucas-Kanade optical flow
- Corners are now detected in the previous frame(instead of the new one) and tracked to the new one

- A feature management method is available where corners are kept in memory for as long as they are tracked

- Corners can be weighted against the number of times they have been tracked

- Fast9 detection will be performed again after the number of tracked corners drops below a threshold is met and
  only in the regions of the image that have the less corners (optional)
2017-06-16 04:49:46 +02:00
Ewoud Smeur b2e22be800 WLS control allocation (#2075)
* WLS control allocation
* comments, and configure preferred act values
* keep option open to use pseudo-inverse
* add link to burkardt

Will be testflown asap tomorrow morning on BB1 and BB2
2017-06-15 18:16:19 +02:00
Michal Podhradsky 74f8b74624 First shot towards a separate HITL target (#2062)
* First shot towards a separate HITL target

* Changes in HITL - still doesn't compile

* Added makefile selection

* HITL target works for fixedwing and rotorcraft - still needs cleanup and TLC

* Removed info messages from compilation process
2017-06-13 13:39:10 -07:00
tomvand 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.
2017-06-13 22:12:11 +02:00
guidoAI 30d5e73242 Exponential gain landing pull request (#2071)
* Adding bebop to my own conf file

* Added Bebop 2 OF to my conf file

* Introducing an exponentially decaying gain and a rework of the optical flow landing module

* Fixed code style, set parameters to standard optical flow control, tested everything on Bebop 2.

* Implemented all remarks, placing function definitions in the c-file, getting the state properly, getting the time properly, making div_factor a setting.

* Set minimum of D-gain to 0
2017-06-13 22:06:42 +02:00
Michal Podhradsky e30a03cc00 Copilot fixes 2017-05-06 14:47:51 -07:00
Michal Podhradsky 626448c713 Fixed copilot module (#2060)
* Fixed copilot module to work both with rotorcraft and fixedwing firmwares

* Minor fixes

* Fixed compilation test
2017-05-06 13:27:07 -07:00
Gautier Hattenberger 0a65e14903 [autopilot] compiling generated AP for fixedwing (#2055)
* [autopilot] compiling generated AP for fixedwing

* update some old variable names for autopilot mode

* prevent oscillation on the ground with real aircraft

* add guidance loop to 'new' control

all this guidance code should really be better factorized

* fix rotorcraft autopilot for new API

* read guidance RC if needed

* use generated autopilot as soon as an autopilot file is defined

* autopilot node at airframe, firmware or target level

The autopilot can be specific to one of the firmware, or one of the
target.
At the moment, it will fail at runtime if more than one autopilot in the
same airframe since server don't know which target is in use.
2017-05-06 13:24:40 -07:00
OpenUAS 095eca2c2d Merge pull request #2048 from ETitus/EdgeFlow_fixes
Edge flow fixes. Thx to all involved for all the hard work done and testing validation . There will be some others working with the OF fixed solution, so more validation tests by others soon in the renewed Optitrack. Issues can be filed if still something is amiss.
2017-04-24 14:43:33 +02:00
Michal Podhradsky c2e314c0f1 Updated vectornav status message so it displays the right rate invariant on the frequency the message is sent 2017-04-19 18:22:05 -07:00
Michal Podhradsky ca68570d03 Mission Computer and payload computer support (#2053)
* Copilot module
* Added mission computer status
* modules_parse_datalink() now accepts arguments
* Update pprzlink
* Update cartography module to comply with the extended CAMERA_SNAPSHOT message
2017-04-19 18:11:54 +02:00
Titus ab8cf6f607 added a proper resolution parameter in EF rather than using the subpixel factor from LK 2017-03-30 23:52:49 +02:00
Wilco 0a061c57fd [MAG_CALIB_UKF] Online magnetomer calibration using unscented Kalman filter (#2043) 2017-03-22 09:37:23 +01:00
Michal Podhradsky 42c0cd27d1 [extra_dl] Extend module functionality (#2042)
use dedicated buffer
2017-03-21 11:08:15 +01:00
Gautier Hattenberger 1754ce0a41 Revert "[extra_dl] Added an example of processing a payload_command packet"
This reverts commit 7402d0a1b4.
2017-03-19 23:11:03 +01:00
Michal Podhradsky 7402d0a1b4 [extra_dl] Added an example of processing a payload_command packet 2017-03-19 12:38:38 -07:00
Michal Podhradsky 0b633e825c [imu] Vectornav as IMU (gyro and accel data only) (#2032)
* [imu] Vectornav as IMU (gyro and accel data only)

* [vectornav] Added simple Vectornav configuration tool.
2017-03-07 11:53:46 -08:00
Maximilian Laiacker ae8141490d added hott sumd radio control input (#2030)
Added Graupner HOTT SUMD serial rc control protocol.
I used the sbus implementation as base for the hott sumd input.
Tested with lisa m 2.0 uart1 and Graupner GR-12L with 9 and 12 channels.
Should work with 2 to 32 channels.
and example airframe config.
2017-03-06 21:23:53 +01:00
Michal Podhradsky 1a4cf57b0c [vms_ecu_demo] Added debugging message 2017-03-04 15:40:03 -08:00
Michal Podhradsky ae7b16411a [vms_ecu] Updated board config and added test module 2017-03-04 15:34:01 -08:00
Felix Ruess a5bb235fcb Merge pull request #2027 from martinmm/master_ins_temp_ctrl
- add temperature control module for Bebop2
- add usb dual cdc board to Bebop2 for serial modem and payload
  -  Sparkfun FIO v3 board adds simultaneous XBee serial modem and SHT75 humidity payload sensor.
2017-03-04 14:10:45 +01:00
Martin Mueller c8f657b39e [bebop2] add usb dual cdc board to Bebop2 for serial modem and payload
Sparkfun FIO v3 board adds simultaneous XBee serial modem and SHT75
humidity payload sensor.
2017-03-02 21:27:45 +01:00
Martin Mueller 784813824a add temperature control module for Parrot Bebop2/Disco
It is possible to control the temperature of the MPU6xxx in the Bebop2
and Disco through resistors powered by PWM_6. Code mostly taken from
Ardupilot

Seems this does not make a big difference even if flying in cold
conditions but does rather improve things than do harm. MPU temperature
will go to about +15 deg C in a Bebop2 at 0 deg C ambient temperature.
Having the gyro/accel calibrated at just below +50 deg C after running
the original Parrot software creates a 30+ deg C change.
2017-03-01 21:53:37 +01:00
Gautier Hattenberger aea1d5f8e9 [sdlog] update sdlog for chibios (#2029)
* [sdlog] update sdlog for chibios

- fix several small bugs
- update to fatfs 0.12b
- add status report

* calculate mass storage thread size accordingly to ffconf choice for _USE_LFN and _FS_EXFAT

* [sdlog] improved documentation
2017-03-01 13:05:48 +01:00
Michal Podhradsky 356062f2f5 [wind_estimator] Typo fix and added link to the Simulink repo 2017-02-28 13:06:43 -08:00
Gautier Hattenberger 41ae80a307 Wind estimation (#2028)
* [nps] add angle of attack and sideslip to NPS

* [module] extra_dl can work with nps

* [module] add sideslip sensor to aoa_pwm module and fix apogee board file

* [module] add wind estimation module

This module is an experimental wind estimation filter based on UKF that
aims at estimating all 3 local wind components in real-time.
It is based on ChibiOS as the algorithm runs in a dedicated thread.
The algorithm itself is generated from a Matlab/Simulink model.

* [tool] read Meso-NH meteo data and feed NPS with wind information

* [module] remove nps target from extra_dl, uart not well supported on FW

* [mesonh] remove unused UDP interface

* [chibios] add compilation error message for wind estimator module
2017-02-28 10:42:58 -08:00
kevindehecker d585ee9b08 Added Robird 2017-02-24 22:02:09 +01:00
Gautier Hattenberger 4e5d863291 [board] support of the Chimera autopilot based on STM32F7 (#2018)
* [board] support of the Chimera autopilot based on STM32F7

- based on ChibiOS only (updated to master for proper support of F7)
- requires some specific ram for DMA operations
- SBUS driver updated and support of internal inverted logic option of F7

* [chibios] fix some compilation errors

* [chibios] fix some a few PR comments

- test less MCU types
- support F1 for uart driver
- more autodetect for VTOR_INIT

* use correct path

* choose a working version of chibios

* [chibios] fix some comments from PR review

- add some doc
- protect LED
- update TRUE/FALSE for lowercase
- pick a slightly older version of chibios (wrong path in makefile not
  fixed yet)
2017-02-23 10:31:50 -08:00
Gautier Hattenberger 363dec8693 Autopilot refactor (#2009)
* [autopilot] refactor autopilot API for both firmwares

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.

* [autopilot] update the rest of the system and the conf

for using the refactored autopilot API

* [autopilot] fix some errors from CI servers

* [actuators] use dummy actuators module to prevent autoloading

* Rename Bart_heliDD_INDI.xml to tudelft_bs_helidd_indi.xml

* Rename Bart_heliDD_pid.xml to tudelft_bs_helidd_pid.xml

* Delete tudelft_course2016_bebop_colorfilter.xml

* Delete tudelft_course2016_bebop_avoider.xml

* [actuators] don't autoload actuators when set to 'none'

* [gcs] autodetect firmware for strip mode button
2017-02-19 11:45:57 +01:00
Michal Podhradsky 861986abae Vectornav as AHRS, minor fix in the float_euler stabilization settings (#2013) 2017-02-16 14:53:48 -08:00
knmcguire ed9a15ca6f Generic rotation matrix for mounted stereocamera (#1998)
This pull request adds a rotation matrix to the stereocam module group. The stereocam in combination with the lisa-s, the new lisa MXs, and the ardrone are usually mounted on there in different direction (facing backwards, forwards and downwards). Before, we had to constantly double check the direction of the velocities to transform that manually to body fixed coordinates, which was very prone to mistakes. Same goes with the derotation of optical flow on the stereocam.

This addition should make it easier and more generic for platforms with the mounted stereocamera.
2017-02-13 20:29:27 +01:00
Ewoud Smeur 6ffd819f33 Module with servo tester function (#2001)
useful for identifying the response of a servo
2017-02-12 14:36:23 +01:00
Felix Ruess a386448edb radio_control_spektrum: better document USE_DSMX define 2017-02-09 23:11:12 +01:00
Ewoud Smeur 8340f82d02 some settings for indi full (#2002) 2017-02-09 10:23:34 +01:00
kevindehecker 04025de32d Disable default uart6 intermcu port for none intermcu px4 boards (#1997) 2017-02-02 18:51:16 +01:00
Ewoud Smeur 1707c0059f Fix for buidling indi_rate (#1993)
With this commit, you can only use indi rate, when you are using
stabilization indi or indi_simple.

Also fixing spelling of stabilization
2017-01-30 22:43:56 +01:00
Gautier Hattenberger c3ec53141e [board] add support for Parrot Disco plane (#1992)
- mostly based on Bebop2
- add PWM output and SBUS input on Linux (based on ArduPilot work)
- some changes to the Linux serial port lib to handle arbitrary baudrate
  (this code could be improved and factorized in the future)
- all sensors are working, the video system is not tested
2017-01-30 00:22:09 +01:00
Felix Ruess 33e699c8e4 [modules] fix intermcu can/spi 2017-01-29 11:41:58 +01:00
Felix Ruess 32f4ce9453 [modules] fix actuators mkk_v2 2017-01-29 11:33:31 +01:00
Felix Ruess 70d003f60f [modules] fix stabilization heli_indi 2017-01-29 11:25:30 +01:00
Felix Ruess c6375f02a3 [modules] fix radio_control sbus_dual 2017-01-29 11:23:10 +01:00
Gautier Hattenberger d226bbce77 [modules] fix rate_indi module configuration 2017-01-27 01:26:56 +01:00
Gautier Hattenberger 46bec882f3 [modules] start adding MCU periph modules (#1989)
Modules for MCU peripherals. Previous subsystems or direct definition in firmware makefile are kept for now, until dependencies are properly handled.
2017-01-26 22:09:55 +01:00
Gautier Hattenberger b47c10fd00 [modules] simulator modules (SIM and NPS) (#1990) 2017-01-26 22:06:48 +01:00
Michal Podhradsky f8b4b175d0 [px4_flash] Added missing default port 2017-01-25 16:35:28 -08:00
Felix Ruess c45d0a1d91 [modules] allow nps target for some actuators modules again 2017-01-24 10:46:35 +01:00
Felix Ruess 65b056f72b [modules] actuators for more targets 2017-01-24 01:03:15 +01:00
Gautier Hattenberger 4fb2f02f69 [modules] add missing module file (settings_rc) 2017-01-19 01:11:03 +01:00
Gautier Hattenberger 1b62144bae [module] forgot the motor_mixing module that goes with actuators 2017-01-18 23:40:42 +01:00
Gautier Hattenberger f1cc62c088 Actuators modules (#1985)
Convert actuators subsystems to modules.

Some drivers (4015, 4017, pwm) makefiles are kept so that autoload for some boards is still working.
2017-01-17 17:11:42 +01:00