kopia lustrzana https://github.com/ogre/pizero_tracker
Camera WIP. camera.service. Always send SSDV.
rodzic
3ceef421f1
commit
1d4ae602f7
|
@ -66,6 +66,7 @@ def prog_opts():
|
|||
parser.add_argument('--cam_flip_v', dest='cam_flip_v', action='store', type=int)
|
||||
parser.add_argument('--cam_ssdv_res', dest='cam_ssdv_res', action='store', type=int)
|
||||
parser.add_argument('--cam_video_dur', dest='cam_video_dur', action='store', type=int)
|
||||
parser.add_argument('--cam_snapshot_interval', dest='cam_snapshot_interval', action='store', type=int)
|
||||
|
||||
args = parser.parse_args()
|
||||
ret = {
|
||||
|
@ -88,6 +89,7 @@ def prog_opts():
|
|||
if args.cam_flip_v: ret['cam_flip_v'] = args.cam_flip_v
|
||||
if args.cam_ssdv_res: ret['cam_ssdv_res'] = args.cam_ssdv_res
|
||||
if args.cam_video_dur: ret['cam_video_dur'] = args.cam_video_dur
|
||||
if args.cam_snapshot_interval: ret['cam_snapshot_interval'] = args.cam_snapshot_interval
|
||||
|
||||
# pprint(ret)
|
||||
|
||||
|
@ -241,10 +243,10 @@ def SSDV_DeliverLoop(callsign, out_ssdv_path, res):
|
|||
continue
|
||||
|
||||
if os.path.isfile(out_ssdv_path):
|
||||
print("SSDV_DeliverLoop: Output SSDV still exists.")
|
||||
continue
|
||||
|
||||
ssdv_in = PHOTO_ARR.pop()
|
||||
print("Exporting new SSDV image:", ssdv_in)
|
||||
ConvertToSSDV( ssdv_in, out_ssdv_path, res, callsign, image_id)
|
||||
image_id += 1
|
||||
|
||||
|
@ -322,7 +324,7 @@ def CameraLoop(session_dir, opts):
|
|||
# video clip
|
||||
print("Video")
|
||||
video_duration_secs = int( opts['cam_video_dur'] )
|
||||
snapshot_interval_secs = 3
|
||||
snapshot_interval_secs = int( opts['cam_snapshot_interval'] )
|
||||
CAMERA.resolution = (1280, 720)
|
||||
CAMERA.start_recording( next_path(video_dir, 'h264'))
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
# cp ./camera.service /etc/systemd/system/
|
||||
# systemctl enable camera.service
|
||||
# systemctl start camera.service
|
||||
# journalctl -u camera
|
||||
|
||||
[Unit]
|
||||
Description=piZero tracker camera
|
||||
After=network.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=root
|
||||
ExecStart=python /boot/camera.py --config /boot/tracker.cfg
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -3,6 +3,7 @@
|
|||
#include <string>
|
||||
#include <chrono>
|
||||
#include <limits>
|
||||
#include <algorithm>
|
||||
|
||||
// record value, min, max, dV/dT, averaged dV/dT
|
||||
//
|
||||
|
|
|
@ -303,8 +303,9 @@ int main1(int argc, char** argv)
|
|||
|
||||
// send SSDV image next packet
|
||||
//
|
||||
if( G.gps_fix_age() < 20
|
||||
&& G.dynamics_get("alt").dVdT() > -5 // not falling
|
||||
if( true
|
||||
// && G.gps_fix_age() < 20
|
||||
// && G.dynamics_get("alt").dVdT_avg() > -5 // not falling
|
||||
)
|
||||
{
|
||||
if( !ssdv_tiles.size() && G.cli.ssdv_image.size() )
|
||||
|
|
|
@ -14,7 +14,7 @@ Type=simple
|
|||
Restart=always
|
||||
RestartSec=1
|
||||
User=root
|
||||
ExecStart=/boot/tracker --config /boot/config.txt
|
||||
ExecStart=/boot/tracker --config /boot/tracker.cfg
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Ładowanie…
Reference in New Issue