Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoop committed Jun 9, 2017
2 parents 0a6e32b + f84bed5 commit 552ff95
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 26 deletions.
26 changes: 18 additions & 8 deletions manifests/maverick-modules/base/files/preprelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ if [ -e /var/swap ]; then
rm /var/swap
fi

# Ensure maverick set to stable branch
echo "MAVERICK_BRANCH=stable" >/srv/maverick/data/config/maverick/maverick-branch.conf
chown mav:mav /srv/maverick/data/config/maverick/maverick-branch.conf

# Remove initial bootstrap maverick from common locations
rm -rf /root/maverick
rm -rf /home/pi/maverick
Expand Down Expand Up @@ -65,13 +69,6 @@ rm -rf /srv/maverick/.gitconfig /srv/maverick/.git-credential-cache /srv/maveric
rm -rf /srv/maverick/.[Xx]*
rm -rf /srv/maverick/.ros/log/*

# Clean up maverick data
find /srv/maverick/data/logs -type f -delete
rm -f /srv/maverick/data/vision_landing/*
find /srv/maverick/var/log -path /srv/maverick/var/log/build -prune -o -type f -exec rm -f {} \;
rm -rf /srv/maverick/var/log/ros/fc/* /srv/maverick/var/log/ros/sitl/*
rm -f /srv/maverick/var/run/*

# Remove maverick config
find /srv/maverick/data/config -type f -delete
rm /srv/maverick/software/maverick/conf/localconf.json
Expand All @@ -83,4 +80,17 @@ cd /srv/maverick/software/maverick; git checkout conf/localconf.json
if [ -e /boot/efi ]; then
mkdir /boot/efi/EFI/BOOT
cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi
fi
fi

echo "Running maverick to regenerate any removed files"
maverick configure
systemctl stop maverick-*

# Clean up maverick data
find /srv/maverick/data/logs -type f -delete
find /srv/maverick/data/mavlink -type f -delete
rm -f /srv/maverick/data/vision_landing/*
find /srv/maverick/var/log -path /srv/maverick/var/log/build -prune -o -type f -exec rm -f {} \;
rm -f /srv/maverick/var/log/vision_landing/last.log
rm -rf /srv/maverick/var/log/ros/fc/* /srv/maverick/var/log/ros/sitl/*
rm -f /srv/maverick/var/run/*
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
class maverick_hardware::peripheral::seekthermal (
$libseek_thermal = true,
$libseek_thermal_source = "https://github.com/maartenvds/libseek-thermal.git",
$libseek_thermal_source = "https://github.com/fnoop/libseek-thermal.git",
$libseek_thermal_revision = "master",
$libseek = false,
$seek_id = "0010", # 0010 for Compact, 0011 for Compact Pro
) {

# If Seek Thermal camera isn't detected (ie. plugged in), then use $seek_id
if $seekthermal_modelid != "None" {
$_seekid = $seekthermal_modelid
} else {
$_seekid = $seek_id
}

# Install udev rule so seek thermal can be used by mav user
file { "/etc/udev/rules.d/95-seekthermal.rules":
owner => "root",
group => "root",
mode => "644",
content => "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"289d\", ATTRS{idProduct}==\"${$seekthermal_modelid}\", MODE=\"0664\", OWNER=\"mav\", GROUP=\"mav\"\n",
content => "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"289d\", ATTRS{idProduct}==\"${$_seekid}\", MODE=\"0664\", OWNER=\"mav\", GROUP=\"mav\"\n",
}

# Install libseek-thermal
Expand All @@ -36,6 +44,7 @@
command => "/usr/bin/make install PREFIX=/srv/maverick/software/libseek-thermal",
cwd => "/srv/maverick/var/build/libseek-thermal",
creates => "/srv/maverick/software/libseek-thermal/lib/libseek.so",
before => Service["maverick-vision_seek"],
} ->
file { "/srv/maverick/var/build/.install_flag_libseek-thermal":
ensure => present,
Expand Down
15 changes: 9 additions & 6 deletions manifests/maverick-modules/maverick_vision/files/vision_seek.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Set defaults, can be overriden in /srv/maverick/data/config/vision/vision_seek.conf
FPS=
FFC=
SCALE=
COLORMAP=
ROTATE=
SCALE=1.0
COLORMAP=-1
ROTATE=90
CAMTYPE=seek
OUTPUT=window

Expand All @@ -19,7 +19,9 @@ else
_FPS=""
fi
if [ ! -z $FFC ]; then
_FFC="-FFC $FFC"
_FFC="--FFC=$FFC"
else
_FFC=""
fi
if [ ! -z $SCALE ]; then
_SCALE="--scale=$SCALE"
Expand All @@ -42,10 +44,11 @@ else
_CAMTYPE=""
fi
if [ ! -z "$OUTPUT" ]; then
_OUTPUT="-o \"$OUTPUT\""
_OUTPUT="--output=\"$OUTPUT\""
else
_OUTPUT=""
fi

# Call vision_seek with configured arguments
/srv/maverick/software/libseek-thermal/bin/seek_viewer $_FPS $_SCALE $_COLORMAP $_ROTATE $_CAMTYPE $FFC -o "$OUTPUT"
echo /srv/maverick/software/libseek-thermal/bin/seek_viewer $_FPS $_SCALE $_COLORMAP $_ROTATE $_CAMTYPE $_FFC -o "$OUTPUT"
/srv/maverick/software/libseek-thermal/bin/seek_viewer $_FPS $_SCALE $_COLORMAP $_ROTATE $_CAMTYPE $_FFC -o "$OUTPUT"
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
# Config file for vision_seek

# FPS - Kludge factor for gstreamer filesink interpolation
# FPS - Kludge factor for gstreamer filesink interpolation. 7 is about right for Pi Zero
FPS=

# FFC - Flat Field Correction - .png file created by FFC calibration
FFC=

# Scale output image size by multiple
SCALE=
SCALE=1.0

# Apply opencv colormap: http://docs.opencv.org/3.2.0/d3/d50/group__imgproc__colormap.html
# Note this has to be integer value relating to enum, not the enum itself
COLORMAP=
# Note this has to be integer value relating to enum, not the enum itself.
# -1 means no map applied
COLORMAP=2

# Rotate output image in degrees, only possible values are 90,180,270
ROTATE=
ROTATE=90

# Camtype is seek or seekpro
CAMTYPE=
CAMTYPE=seek

# Opencv/Gstreamer output pipeline, eg:
### Video Output
#
# window output opens a local window. Must be started using vision_seek.sh not by system service, and
# either from desktop or x-forwarded ssh session.
# OUTPUT=window
#
# filename output saves a raw video to file. Easiest and best quality.
OUTPUT=/srv/maverick/data/vision/vision_seek/seek.avi
#
# gstreamer output uses a gstreamer pipeline. Note, it *must* start with appsrc
# OUTPUT="appsrc ! videoconvert ! video/x-raw,format=NV12 ! vaapih264enc ! mpegtsmux ! filesink location=/srv/maverick/data/vision/vision_seek/vision_seek.avi"
# OUTPUT="appsrc ! autovideoconvert ! omxh264enc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.1.x port=5000 sync=false"
# OUTPUT="window"
OUTPUT=
#
# raspberry h264 streaming, client end would be: gst-launch-1.0 -v udpsrc port=5000 buffer-size=0 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! decodebin ! autovideosink sync=false
# OUTPUT="appsrc ! decodebin ! queue ! videoconvert ! omxh264enc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.1.243 port=5000 sync=false"
#
# raspberry mjpeg streaming, client end would be: st-launch-1.0 -v udpsrc port=5000 buffer-size=0 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! decodebin ! autovideosink sync=false
# OUTPUT="appsrc ! queue ! videoconvert ! video/x-raw,format=I420 ! jpegenc ! rtpjpegpay ! udpsink host=192.168.1.244 port=5000 sync=false"

0 comments on commit 552ff95

Please sign in to comment.