Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KLT flow, CAN support and camera driver improvements #68

Open
wants to merge 149 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
b7faf41
implementation of klt based flow on one pyramid level (+/- 1 pixel fl…
tpetri Jul 25, 2014
75cedc7
added image pyramid, now the maximum flow is around 4 pixels between …
tpetri Jul 29, 2014
de9a6e1
moved gyro compensation from flow.c to main.c, removed clamping to ma…
tpetri Jul 30, 2014
32e6107
Merge branch 'gyro_comp_refactor' of github.com:PX4/Flow into klt_flow
tpetri Jul 30, 2014
3e85ec5
sign mistake
tpetri Jul 30, 2014
876bb17
Merge branch 'gyro_comp_refactor' of github.com:PX4/Flow into klt_flow
tpetri Jul 30, 2014
e797078
clean up
tpetri Jun 23, 2015
aebaee9
Merge branch 'klt_flow2' into feature/combine-algorithms
Jun 30, 2015
589075b
Added gyro compensation to KLT algorithm
Jul 1, 2015
9b510d8
- Fixed Gyro Compensation
Jul 2, 2015
078ef6d
-cleanup
Jul 3, 2015
2501b87
implemented simple high pass filter to pre-process the images
Jul 3, 2015
bf1a87e
Added median flow
Jul 8, 2015
0ae3f70
move timer functions and flow result accumulation functions into sepa…
Jul 9, 2015
51059d9
make the code work.
Jul 9, 2015
8cb3c49
better fix than before.
Jul 9, 2015
0dfddb6
move calculation of mean flow out of flow measurement functions. clea…
Jul 9, 2015
b3552db
added some remarks about future improvements
Jul 9, 2015
c899a12
Merge branch 'cleanup-codebase' into feature/combine-algorithms
Jul 9, 2015
526c520
Gyro compensation & bug fixes
Jul 10, 2015
02b16c8
- Added switch for the minimum outlier threshold for the two algorithms
Jul 10, 2015
995548a
- Added check if klt flow is outside of 2*topPyrStep.
Jul 10, 2015
ec201c5
- Re-added flow in meter using the same calculation as before
Jul 10, 2015
f923e35
- Removed all traces from sensor position (BOTTOM, TOP, FRONT, ...), …
Jul 10, 2015
3abbca0
finally fixed the boot time us function. it now consistently counts UP.
Jul 11, 2015
6c76a3d
experimented with higher block count and lower iterations for KLT. ad…
Jul 11, 2015
9265c5a
Merge branch 'feature/combine-algorithms' of github.com:leitwert/Flow…
Jul 11, 2015
34201b7
small code cleanup
Jul 13, 2015
0192245
some more tweaking to KLT. Implemented corner detector to decide whet…
Jul 13, 2015
a9141eb
implemented forcing capturing two images in fast sequence if algorith…
Jul 13, 2015
173b529
increase processor speed to 192MHz. Looking good so far. 465Hz frame …
Jul 13, 2015
53507e0
Merge branch 'experiment/tweak-klt-block-count' into feature/combine-…
Jul 13, 2015
ffcccdc
reorder and rename parameters to have a coherent naming scheme. fix p…
Jul 13, 2015
65946f8
Remove now obsolete quality_measurement from code.
Jul 13, 2015
9eb6112
implemented changing video downlink rate.
Jul 13, 2015
7a02bb1
make VIDEO_ONLY mode work again.
Jul 13, 2015
4a435cd
Merge branch 'feature/combine-algorithms'
Jul 13, 2015
bef8bb3
include the new source files in CMakeLists.txt
Jul 14, 2015
63a7aac
add (some) missing register definitions and change naming convention …
Jul 14, 2015
1cef37d
fixed result accumulator to comply with expected scaling of i2c frames
Jul 14, 2015
1113d0e
Merge branch 'master' into fix/mt9v034-driver
Jul 14, 2015
0a84b0c
Merge branch 'fix/mt9v034-driver'
Jul 15, 2015
66a2554
introduced new parameter KLT_GYRO_ASSIST and turned gyro compensation…
Jul 15, 2015
ce75cce
Lidar driver in place of the sonar driver
tcauchois Jul 29, 2015
1a1a1d3
Up distance sample rate to 50Hz, 5-sample median filter
tcauchois Jul 29, 2015
d3509fa
initial prototype of the new camera driver.
Aug 4, 2015
ef4eff2
fixed comments about the system clocks to match the actual system clo…
Aug 4, 2015
ce49c1d
updates to the documentation, added missing struct definitions.
Aug 4, 2015
678ca42
changes to the camera sensor and transport interfaces. started implem…
Aug 4, 2015
c42f6df
WIP. start to move code around into new functions that do the initial…
Aug 4, 2015
a197670
use bool for success/fail return status.
Aug 5, 2015
9d3ef04
finished cleaning up camera sensor configuration code. updated code w…
Aug 5, 2015
ef308b5
finished camera sensor interface for mt9v034.
Aug 5, 2015
31b9aa6
implemented image streaming logic. updated some of the documentation.
Aug 5, 2015
b037596
finished camera_transport_interface for the DCMI module. code is now …
Aug 5, 2015
f4b010d
- updated main to use new API.
Aug 5, 2015
a4d6288
Merge remote-tracking branch 'upstream/master'
Aug 5, 2015
0721617
Merge branch 'master' into refactor/dcmi-driver
Aug 5, 2015
18798ee
made code compile. testing is next.
Aug 5, 2015
8fa137e
fixed warnings in code.
Aug 5, 2015
757f011
fixed bug in camera.c. The code now runs. However there is an issue w…
Aug 5, 2015
b409ca6
fixed transfer alignment issue in camera driver.
Aug 5, 2015
f2fc46d
fixed filter to not use space inside the image to do the computation.
Aug 5, 2015
3a629fd
made initialisation and buffer alignment more reliable.
Aug 5, 2015
7fdc1b1
increase I2C bus speed to make it possible to switch sensor contexts …
Aug 5, 2015
7c04517
cleanup i2c code.
Aug 5, 2015
917cf94
implemented snapshot mode and tested it. it works!
Aug 5, 2015
e8a2b60
default VIDEO_ONLY parameter to ON. flow calculation still works in t…
Aug 5, 2015
329ff49
implemented auto exposure control algorithm wich bypasses the buggy a…
Aug 6, 2015
c8f24b4
implemented high resolution shutter and improved CPU usage of auto ex…
Aug 6, 2015
f63ee6a
fixed interrupt priorities: DCMI driver needs highes priority.
Aug 6, 2015
4342c16
bugfix in exposure algorithm.
Aug 6, 2015
c81e07d
fixed comparision with desired brightness: prevent invalid inputs.
Aug 6, 2015
05e42cb
improved documentation and generalized variable names. implemented to…
Aug 7, 2015
14962f8
implemented de-synchronization detection and recovery.
Aug 7, 2015
2643030
Merge branch 'refactor/dcmi-driver'
Aug 7, 2015
e992fdb
- Reverted SystemCoreClock to original setting. Overclocking is not n…
Aug 13, 2015
0c9c94c
- Fixed issue where high gyro values (like shaking) lead to a crash. …
Aug 14, 2015
0c05b0a
Don't fail on possibly-spurious warning
kevinmehall Aug 18, 2015
5c02f07
Merge Leitwert pull request
kevinmehall Aug 18, 2015
d792be0
Merge branch 'david-make-uavcan' into integration
kevinmehall Aug 19, 2015
6493c8f
Switch device descriptor to structure definition
kevinmehall Jul 23, 2015
430c01d
Move CDC descriptors to composite device, using structures
kevinmehall Jul 23, 2015
16af0b3
Add image transfer endpoints
kevinmehall Jul 24, 2015
d33cf8d
Send metadata with USB image
kevinmehall Aug 19, 2015
2bc3edc
Merge branch 'km-usb' into integration
kevinmehall Aug 19, 2015
bba29e4
Merge remote-tracking branch 'origin/master' into integration
kevinmehall Aug 25, 2015
317da1f
Move LED control to src/drivers/boards
kevinmehall Aug 26, 2015
09c0aab
Move i2c struct filling into result_accumulator
kevinmehall Aug 27, 2015
be74b0d
Split i2c_slave (V1) and uavcan (V2) into separate modules
kevinmehall Aug 27, 2015
4d5afe0
Merge remote-tracking branch '3drobotics/master'
Aug 31, 2015
4054060
Merge '3dr/feature.lidar'
kevinmehall Aug 31, 2015
488a1be
Merge branch 'km-led'
kevinmehall Aug 31, 2015
be2bb49
Hack: Clear extra I2C RxNE interrupts
kevinmehall Aug 31, 2015
15be42a
Send ground distance even if flow data is invalid
kevinmehall Aug 31, 2015
c04310e
Merge branch 'km-lidar'
kevinmehall Sep 1, 2015
9cf78c3
implemented checks in camera buffer management.
Sep 1, 2015
2b0eef8
fixed updating meta data of KLT image. now the preprocessing is only …
Sep 3, 2015
b530c54
fixed buffer_count check in camera_init.
Sep 3, 2015
f8a0cb7
Merge branch 'leitwert-fix/buffer-management-and-preprocessing'
kevinmehall Sep 3, 2015
f882d3d
Explict check for index-out-of-bounds warning
kevinmehall Sep 3, 2015
e5c4c78
Fix uninitialized variable and float comparison in exposure adjustment
kevinmehall Sep 8, 2015
334c6b8
Include UAVCAN timestamp and range data in USB packet
kevinmehall Sep 8, 2015
4a98fe2
Fill range data, and send UAVCAN messages at proper rate
kevinmehall Sep 9, 2015
1c344a9
Merge upstream PX4
kevinmehall Sep 10, 2015
143eb21
Replace optical_flow.LegacyRawSample with optical_flow.RawSample
tcauchois Sep 16, 2015
96976a9
Fix parsing issue on old compilers
tcauchois Sep 16, 2015
97e3c21
Add sensor id to uavcan message
tcauchois Sep 16, 2015
a205c40
Integrate Pavel's suggestions to optical_flow.RawSample
tcauchois Sep 18, 2015
9ea5d3c
Remove unused implementation of itoa
kevinmehall Sep 17, 2015
12b2686
Remove nearly-unused mavlink debug channel and associated integer con…
kevinmehall Sep 17, 2015
2274c7f
Remove unused image filtering
kevinmehall Sep 18, 2015
44c4147
mt9v034: write reserved registers with recommended values from Rev G …
kevinmehall Sep 21, 2015
344c5c0
uavcan: Refactor data handling
kevinmehall Sep 21, 2015
d04c5e7
uavcan: fix typos
kevinmehall Sep 21, 2015
7d57799
Merge pull request #39 from 3drobotics/km-uavcan-refactor
kevinmehall Sep 22, 2015
286063a
Changes to optical_flow.RawSample: fix comments, nuke covariances
tcauchois Sep 22, 2015
11a5fa0
Merge remote-tracking branch 'origin/master'
tcauchois Sep 22, 2015
0f9e158
get_boot_time_us: check if there is a preempted systick interrupt pen…
kevinmehall Sep 24, 2015
8a82ff2
Revert "mt9v034: write reserved registers with recommended values fro…
kevinmehall Sep 24, 2015
38d8b3b
mt9v034: Refactor to reduce duplicate code
kevinmehall Sep 28, 2015
070d84a
lidarlite: mark sample invalid and reset i2c on timeout
kevinmehall Sep 29, 2015
748bf1e
Refactor result_accumulator_feed
kevinmehall Sep 30, 2015
59c05f3
Change result accumulator to handle dropped frame time correctly
kevinmehall Sep 30, 2015
50f460f
Implement maximum velocity calculation algorithm.
Aug 31, 2015
26b2bfb
Make velocity calculation 1-dimensional, and pass it over UAVCAN
kevinmehall Sep 30, 2015
3b32e83
Don't send invalid ground distance over USB
kevinmehall Oct 1, 2015
90640a8
i2c_slave: Test individual interrupt-pending bits.
kevinmehall Oct 8, 2015
80f9cfc
Merge pull request #46 from 3drobotics/i2cfix
kevinmehall Oct 9, 2015
11776e8
Rename lidar -> lidar-lite
kevinmehall Oct 9, 2015
e478c63
Add Lightware SF10 Lidar driver
kevinmehall Oct 10, 2015
8d4fe40
mt9v034: write reserved registers with recommended values from Rev G …
kevinmehall Sep 21, 2015
366f80e
Increase minimum horizontal blanking to reduce corruption.
kevinmehall Oct 8, 2015
c87c937
Merge pull request #47 from 3drobotics/km-camera
kevinmehall Oct 12, 2015
a4a89f6
Merge pull request #49 from 3drobotics/lightware
kevinmehall Oct 12, 2015
5bb7a8b
Clean remaining sign-compare warnings
kevinmehall Oct 12, 2015
cef5809
Clean all other warnings
kevinmehall Oct 12, 2015
5518ac3
Refactor main loop poll for frame
kevinmehall Oct 12, 2015
1878226
Fix typo
kevinmehall Oct 14, 2015
190f7cf
Merge pull request #50 from 3drobotics/cleanup
kevinmehall Oct 14, 2015
9d2a793
Remove unfinished interface to transfer snapshot images asynchronousl…
kevinmehall Oct 28, 2015
b6ec5be
Revert refactor of USB descriptors.
kevinmehall Oct 28, 2015
99f4b26
Build fix
LorenzMeier Dec 10, 2015
ee73c63
Boost max exposure for indoor environments
LorenzMeier Dec 10, 2015
dacb2f1
Code style fix
LorenzMeier Dec 10, 2015
2a014d3
Remove unused headers
LorenzMeier Dec 10, 2015
11bdc5b
Flow sending: Condition on USB_SEND_VIDEO only
LorenzMeier Dec 10, 2015
991071a
Remove unused config param
LorenzMeier Dec 10, 2015
d24c035
Be less excessive on exposure
LorenzMeier Dec 10, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,25 @@ set(PERIPH_SRC
)

set(PX4FLOW_HDRS
inc/camera.h
inc/communication.h
inc/dcmi.h
inc/debug.h
inc/filter.h
inc/flow.h
inc/gyro.h
inc/i2c_frame.h
inc/i2c.h
inc/led.h
inc/main.h
inc/mavlink_bridge_header.h
inc/mt9v034.h
inc/result_accumulator.h
inc/settings.h
inc/sonar.h
inc/sonar_mode_filter.h
inc/stm32f4xx_conf.h
inc/stm32f4xx_it.h
inc/timer.h
inc/usart.h
inc/usb_conf.h
inc/usbd_cdc_vcp.h
Expand All @@ -206,29 +209,30 @@ set(PX4FLOW_HDRS
)

set(PX4FLOW_SRC
inc/camera.c
src/communication.c
src/dcmi.c
src/debug.c
src/filter.c
src/flow.c
src/gyro.c
src/i2c.c
src/led.c
src/main.c
src/mt9v034.c
src/reset.c
src/result_accumulator.c
src/settings.c
src/sonar.c
src/sonar_mode_filter.c
src/stm32f4xx_it.c
src/system_stm32f4xx.c
src/timer.c
src/usart.c
src/usb_bsp.c
src/usbd_cdc_vcp.c
src/usbd_desc.c
src/usbd_usr.c
src/utils.c
src/system_stm32f4xx.c
src/stm32f4xx_it.c
)

# building
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
# Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -29,6 +28,7 @@
# POSSIBILITY OF SUCH DAMAGE.
#


#
# Top-level Makefile for building PX4 firmware images.
#
Expand Down
67 changes: 0 additions & 67 deletions inc/no_warnings.h

This file was deleted.

3 changes: 2 additions & 1 deletion makefiles/baremetal/config_px4flow-v1_default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ MODULES += drivers/boards/px4flow-v1
#
# General system control
#
##TODO EXPECT I2C - MODULES += modules/uavcannode
MODULES += modules/i2c_slave

# C support
MODULES += modules/libc

# Flow
MODULES += modules/flow

MODULES += modules/sonar


# Generate parameter XML file
Expand Down
2 changes: 1 addition & 1 deletion makefiles/baremetal/config_px4flow-v2_default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MODULES += modules/libc
# Flow
MODULES += modules/flow


MODULES += modules/lidar-sf10

# Generate parameter XML file
#GEN_PARAM_XML = 1
Expand Down
1 change: 1 addition & 0 deletions src/drivers/boards/px4flow-v1/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ABS_BOOTLOADER_SRC := $(PX4_BOOTLOADER_BASE)src/

SRCS = \
px4flow_init.c \
px4flow_led.c \

BOOTLOADER_SRC = \
$(ABS_BOOTLOADER_SRC)common/boot_app_shared.c \
Expand Down
127 changes: 0 additions & 127 deletions src/drivers/boards/px4flow-v1/px4flow_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,131 +134,4 @@ __EXPORT int board_reset(int status)
}


/****************************************************************************
* Name: board_led_initialize
*
* Description:
* This functions is called very early in initialization to perform board-
* specific initialization of LED-related resources. This includes such
* things as, for example, configure GPIO pins to drive the LEDs and also
* putting the LEDs in their correct initial state.
*
* NOTE: In most architectures, board_led_initialize() is called from
* board-specific initialization logic. But there are a few architectures
* where this initialization function is still called from common chip
* architecture logic. This interface is not, however, a common board
* interface in any event and, hence, the usage of the name
* board_led_initialize is deprecated.
*
* WARNING: This interface name will eventually be removed; do not use it
* in new board ports. New implementations should use the naming
* conventions for "Microprocessor-Specific Interfaces" or the "Board-
* Specific Interfaces" as described above.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/

__EXPORT void board_led_initialize(void)
{

}

/****************************************************************************
* Name: board_led_on
*
* Description:
* Set the LED configuration into the ON condition for the state provided
* by the led parameter. This may be one of:
*
* LED_STARTED NuttX has been started
* LED_HEAPALLOCATE Heap has been allocated
* LED_IRQSENABLED Interrupts enabled
* LED_STACKCREATED Idle stack created
* LED_INIRQ In an interrupt
* LED_SIGNAL In a signal handler
* LED_ASSERTION An assertion failed
* LED_PANIC The system has crashed
* LED_IDLE MCU is in sleep mode
*
* Where these values are defined in a board-specific way in the standard
* board.h header file exported by every architecture.
*
* Input Parameters:
* led - Identifies the LED state to put in the ON state (which may or may
* not equate to turning an LED on)
*
* Returned Value:
* None
*
****************************************************************************/

__EXPORT void board_led_on(int led)
{

}

/****************************************************************************
* Name: board_led_off
*
* Description:
* Set the LED configuration into the OFF condition for the state provided
* by the led parameter. This may be one of:
*
* LED_INIRQ Leaving an interrupt
* LED_SIGNAL Leaving a signal handler
* LED_ASSERTION Recovering from an assertion failure
* LED_PANIC The system has crashed (blinking).
* LED_IDLE MCU is not in sleep mode
*
* Where these values are defined in a board-specific way in the standard
* board.h header file exported by every architecture.
*
* Input Parameters:
* led - Identifies the LED state to put in the OFF state (which may or may
* not equate to turning an LED off)
*
* Returned Value:
* None
*
****************************************************************************/

__EXPORT void board_led_off(int led)
{

}

/****************************************************************************
* Name: board_crashdump
*
* Description:
* If CONFIG_BOARD_CRASHDUMP is selected then up_asseert will call out to
* board_crashdump prior to calling exit in the case of an assertion failure.
* Or in the case of a hardfault looping indefinitely. board_crashdump then
* has a chance to save the state of the machine. The provided
* board_crashdump should save as much information as it can about the cause
* of the fault and then most likely reset the system.
*
* N.B. There are limited system resources that can be used by the provided
* board_crashdump function. The tems from the fact that most critical/fatal
* crashes are because of a hard fault or during interrupt processing.
* In these cases, up_assert is running from the context of an interrupt
* handlerand it is impossible to use any device driver in this context.
*
* Also consider the following: Who knows what state the system is in? Is
* memory trashed? Is the Heap intact? Therefore all we can expect to do in
* board_crashdump is save the "machine state" in a place where on the next
* reset we can write it to more sophisticated storage in a sane operating
* environment.
*
****************************************************************************/

__EXPORT void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename,
int lineno)
{

}
Loading