Difference between revisions of "Event logger"

From ElphelWiki
Jump to: navigation, search
(Description)
(from command line (10393))
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
+
===Features===
 +
* ~1 micro second precision
 +
* Up to 4 source channels:
 +
** IMU
 +
** GPS
 +
** Image Acquisition
 +
** External General Purpose Input (e.g., odometer - 3..5V pulses)
 +
 
 +
===Description===
 +
 
 +
The FPGA-based Event Logger uses local clock for time-stamping, so each log entry (IMU, GPS, Image Acquisition and External Input) is recorded with timing info.
 +
 
 +
 
 +
In a single camera each acquired image has a timestamp in its header (Exif). The log entry for images has this timestamp recorded at the logger (local) time.
 +
 
 +
Multiple cameras (e.g., Eyesis4π) are synchronized by the master camera to sub-microsecond, and each acquired also image has the master timestamp in Exif. The log entries for images (if logged in the camera other than master so with different local clock) have 2 fields - master timestamp (same as in image Exif) and local timestamp (same clock as used for IMU), so it is easy to match images with inertial data.
  
Logs external sensors data into a binary file marking it with local timestamps (micro-second resolution). It supports up to 4 sensor channels at the same time, e.g.:
 
1. IMU (Inertial Measurement Unit) - orientation in space
 
2. GPS - geographical location
 
3. External trigger signals from another Elphel camera.
 
4. Other sensor (e.g., odometer - 3..5V pulses).
 
  
 
A typical log record has the following format:
 
A typical log record has the following format:
 +
<font size="2">
 
  [LocalTimeStamp] [SensorData]
 
  [LocalTimeStamp] [SensorData]
 
  Examples or parsed records:
 
  Examples or parsed records:
  IMU: [LocalTimeStamp]: [wX] [wY] [wZ]  [dAngleX] [dAngleY] [dAngleZ] [accelX] [accelY] [accelZ] [veloX] [veloY] [veloZ] [temperature]
+
  [LocalTimeStamp]: IMU: [wX] [wY] [wZ]  [dAngleX] [dAngleY] [dAngleZ] [accelX] [accelY] [accelZ] [veloX] [veloY] [veloZ] [temperature]
  GPS:[LocalTimeStamp]: [NMEA sentence]
+
  [LocalTimeStamp]: GPS: [NMEA sentence]
  SRC:[LocalTimeStamp]: [MasterTimeStamp]
+
  [LocalTimeStamp]: SRC: [MasterTimeStamp]
 +
</font>
 +
===Syncing with an external device (Eyesis4PI - 10353 based)===
 +
An external device (e.g., odometer) can be connected with a camera / camera rig.
 +
 
 +
The device have to send HTTP requests to be logged to the camera on http://192.168.0.221/imu_setup.php?msg=message_to_log (message is limited to 56 bytes) and 3..5V pulses on the two middle wires of the J15 connector. '''!! Make sure only the two middle wires are connected and the externals one are not. Since the camera's input trigger is optoisolated, but not the trigger output. !!'''
 +
 
 +
For testing purposes we used an [http://www.arduino.cc/en/Guide/ArduinoYun Arduino Yún] with [https://www.adafruit.com/products/1272 Adafruit Ultimate GPS Logger Shield]. The GPS was used only to send a PPS to the camera's J15 port while Arduino Yún was running a simple script such as:
 +
echo "" > wifi.log ; i=0; while true; do wget http://192.168.0.221/imu_setup.php?msg=$i -O /dev/null -o /dev/null; echo $i ; echo $i >> wifi.log ; iwlist wlan0 scan >> wifi.log ; i=`expr $i + 1`; done
 +
 
 +
This script is logging an incrementing number both to the camera log and Yún's file system, WiFi scanning is also recorded to the Yún's log. So later both log files can be synchronized in post-processing.
 +
 
 +
===How to record log on the camera===
 +
====over network====
 +
(see http://192.168.0.9/logger_launcher.php source for options and details):
 +
* START: http://192.168.0.9/logger_launcher.php?file=/absolute_path/name.log&index=1&n=10000000&mount_point=/absolute_path
 +
mount_point=/absolute_path - the path at which the storage is mounted (usb or nfs)
 +
* STOP:  http://192.168.0.9/phpshell.php?command=killall%20-1%20log_imu
 +
====from command line (10393 only)====
 +
* START:
 +
mkdir /www/pages/logs
 +
cat /dev/imu > /www/pages/logs/test.log
 +
* STOP:
 +
CTRL-C or killall cat
 +
 
 +
===View recorded logs (read_imu_log.php)===
 +
====from 10393s camera====
 +
<b>http://192.168.0.9/read_imu_log.php</b>
 +
* looks for logs in <i>/www/pages/logs</i> (automatically created on the first access)
 +
* displays and filters messages - EXT, GPS (NMEA GPVTG, GPGSA, GPGGA, GPRMC), IMU, IMG (4 ports)
 +
* can convert a log to a CSV file (is saved to PC)
 +
 
 +
===Notes===
 +
* GPS data is written to both, the event log and the image header (Exif).
 +
* IMU data is written only to the event log.
 +
* Example IMU ([http://www.analog.com/en/mems-sensors/imu/adis16375/products/product.html ADIS16375]) samples rate is 2460Hz.
 +
* Example GPS receiver (Garmin 18x serial) samples rate is 5Hz in NMEA or other configured format.
 +
 
 +
===Examples===
 +
====Raw====
 +
Raw '''*.log''' files are found [http://community.elphel.com/files/imu/ here]
 +
====Parsed====
 +
[http://community.elphel.com/files/imu/parsed_log_example.txt parsed_log_example.txt] (41.3MB) - [http://community.elphel.com/files/imu/ here]
 +
 
 +
====Tools for parsing logs====
 +
[http://community.elphel.com/files/imu/ Download] one of the raw logs.
 +
* '''PHP:''' Download [http://community.elphel.com/files/imu/read_imu_log.php_txt read_imu_log.php_txt], rename it to '''*.php''' and run on a PC with PHP installed.
 +
* '''Java:''' Download [http://community.elphel.com/files/imu/java/ IMUDataProcessing] project for [http://www.eclipse.org/ Eclipse].
  
Is used in Eyesis and Eyesis-4PI. Can be used with any other Elphel camera.
+
[[Category:Event_logger]]
  
 
<!--==Links==
 
<!--==Links==
 
* http://blog.elphel.com/2011/10/elphel-eyesis-4%CF%80-preassembly-stage/-->
 
* http://blog.elphel.com/2011/10/elphel-eyesis-4%CF%80-preassembly-stage/-->

Latest revision as of 17:01, 17 April 2017

Features

  • ~1 micro second precision
  • Up to 4 source channels:
    • IMU
    • GPS
    • Image Acquisition
    • External General Purpose Input (e.g., odometer - 3..5V pulses)

Description

The FPGA-based Event Logger uses local clock for time-stamping, so each log entry (IMU, GPS, Image Acquisition and External Input) is recorded with timing info.


In a single camera each acquired image has a timestamp in its header (Exif). The log entry for images has this timestamp recorded at the logger (local) time.

Multiple cameras (e.g., Eyesis4π) are synchronized by the master camera to sub-microsecond, and each acquired also image has the master timestamp in Exif. The log entries for images (if logged in the camera other than master so with different local clock) have 2 fields - master timestamp (same as in image Exif) and local timestamp (same clock as used for IMU), so it is easy to match images with inertial data.


A typical log record has the following format:

[LocalTimeStamp] [SensorData]
Examples or parsed records:
[LocalTimeStamp]: IMU: [wX] [wY] [wZ]  [dAngleX] [dAngleY] [dAngleZ] [accelX] [accelY] [accelZ] [veloX] [veloY] [veloZ] [temperature]
[LocalTimeStamp]: GPS: [NMEA sentence]
[LocalTimeStamp]: SRC: [MasterTimeStamp]

Syncing with an external device (Eyesis4PI - 10353 based)

An external device (e.g., odometer) can be connected with a camera / camera rig.

The device have to send HTTP requests to be logged to the camera on http://192.168.0.221/imu_setup.php?msg=message_to_log (message is limited to 56 bytes) and 3..5V pulses on the two middle wires of the J15 connector. !! Make sure only the two middle wires are connected and the externals one are not. Since the camera's input trigger is optoisolated, but not the trigger output. !!

For testing purposes we used an Arduino Yún with Adafruit Ultimate GPS Logger Shield. The GPS was used only to send a PPS to the camera's J15 port while Arduino Yún was running a simple script such as:

echo "" > wifi.log ; i=0; while true; do wget http://192.168.0.221/imu_setup.php?msg=$i -O /dev/null -o /dev/null; echo $i ; echo $i >> wifi.log ; iwlist wlan0 scan >> wifi.log ; i=`expr $i + 1`; done

This script is logging an incrementing number both to the camera log and Yún's file system, WiFi scanning is also recorded to the Yún's log. So later both log files can be synchronized in post-processing.

How to record log on the camera

over network

(see http://192.168.0.9/logger_launcher.php source for options and details):

mount_point=/absolute_path - the path at which the storage is mounted (usb or nfs)

from command line (10393 only)

  • START:
mkdir /www/pages/logs
cat /dev/imu > /www/pages/logs/test.log
  • STOP:
CTRL-C or killall cat

View recorded logs (read_imu_log.php)

from 10393s camera

http://192.168.0.9/read_imu_log.php

  • looks for logs in /www/pages/logs (automatically created on the first access)
  • displays and filters messages - EXT, GPS (NMEA GPVTG, GPGSA, GPGGA, GPRMC), IMU, IMG (4 ports)
  • can convert a log to a CSV file (is saved to PC)

Notes

  • GPS data is written to both, the event log and the image header (Exif).
  • IMU data is written only to the event log.
  • Example IMU (ADIS16375) samples rate is 2460Hz.
  • Example GPS receiver (Garmin 18x serial) samples rate is 5Hz in NMEA or other configured format.

Examples

Raw

Raw *.log files are found here

Parsed

parsed_log_example.txt (41.3MB) - here

Tools for parsing logs

Download one of the raw logs.