Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
stereocam module

StereoCamera read and decode.

Module to read and decode messages from the TU Delft stereo camera over uart. The stereo camera is designed and produced by Christophe de Wagter from the TU Delft. Baud rates tested include B38400, B230400, B921600. If entire images are being sent, it is recommended to use a STEREO_BAUD of B921600.

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

<module name="stereocam">
b'<define name="FORWARD_IMAGE_DATA" value="TRUE|FALSE" />\n '
b'<define name="STEREO_BODY_TO_STEREO_PHI" value="90" />\n '
b'<define name="STEREO_BODY_TO_STEREO_THETA" value="0" />\n '
b'<define name="STEREO_BODY_TO_STEREO_PSI" value="90" />\n '
b'<configure name="STEREO_UART" value="UARTX" />\n '
b'<configure name="STEREO_BAUD" value="BXXXXX" />\n '
</module>

Module configuration options

Configure Options

  • name: STEREO_UART value: UARTX
    Description: Sets the UART port number of the connected camera (required)
  • name: STEREO_BAUD value: BXXXXX
    Description: Sets the BAUD rate of the connected camera (required: must be same as camera)

Define Options

  • name: FORWARD_IMAGE_DATA value: TRUE|FALSE
    Description: If TRUE, a copy of received iamges is sent to the ground station over the datalink (default: TRUE)
  • name: STEREO_BODY_TO_STEREO_PHI value: 90
    Description: Rotation matrix from body to camera frame
  • name: STEREO_BODY_TO_STEREO_THETA value: 0
  • name: STEREO_BODY_TO_STEREO_PSI value: 90

Module functions

Init Functions

These initialization functions are called once on startup.

Event Functions

These event functions are called in each cycle of the module event loop.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

  • state2stereocam()
    • Frequency in Hz: 25
    • Autorun: TRUE
      Periodic function automatically starts after init.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw stereocam.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="stereocam" dir="stereocam">
<doc>
<description>
StereoCamera read and decode.
Module to read and decode messages from the TU Delft stereo camera over uart.
The stereo camera is designed and produced by Christophe de Wagter from the TU Delft.
Baud rates tested include B38400, B230400, B921600.
If entire images are being sent, it is recommended to use a STEREO_BAUD of B921600.
</description>
<configure name="STEREO_UART" value="UARTX" description="Sets the UART port number of the connected camera (required)"/>
<configure name="STEREO_BAUD" value="BXXXXX" description="Sets the BAUD rate of the connected camera (required: must be same as camera)"/>
<define name="FORWARD_IMAGE_DATA" value="TRUE|FALSE" description="If TRUE, a copy of received iamges is sent to the ground station over the datalink (default: TRUE)"/>
<define name="STEREO_BODY_TO_STEREO_PHI" value="90" description="Rotation matrix from body to camera frame"/>
<define name="STEREO_BODY_TO_STEREO_THETA" value="0"/>
<define name="STEREO_BODY_TO_STEREO_PSI" value="90"/>
</doc>
<header>
<file name="stereocam.h"/>
</header>
<init fun="stereocam_init()"/>
<periodic fun="state2stereocam()" autorun="TRUE" freq="25"/>
<event fun="stereocam_event()"/>
<makefile>
<!-- Configure default UART port and baudrate -->
<configure name="STEREO_UART" default="UART1" case="upper|lower"/>
<configure name="STEREO_BAUD" default="B921600"/>
<!-- Enable UART and set baudrate -->
<define name="USE_$(STEREO_UART_UPPER)"/>
<define name="UART_LINK" value="$(STEREO_UART_LOWER)"/>
<define name="$(STEREO_UART_UPPER)_BAUD" value="$(STEREO_BAUD)"/>
<!-- Sources and PPRZLink for transport -->
<file name="stereocam.c"/>
<file name="pprz_transport.c" dir="pprzlink/src"/>
</makefile>
</module>