@@ -116,6 +116,33 @@ vManager.eventEmitter.on('videostreaminfo', (msg, senderSysId, senderCompId, tar
116
116
}
117
117
} )
118
118
119
+ // Got a CAMERA_SETTINGS event, send to flight controller
120
+ vManager . eventEmitter . on ( 'camerasettings' , ( msg , senderSysId , senderCompId , targetComponent ) => {
121
+ try {
122
+ if ( fcManager . m ) {
123
+ fcManager . m . sendCommandAck ( common . CameraSettings . MSG_ID , 0 , senderSysId , senderCompId , targetComponent )
124
+ fcManager . m . sendData ( msg , senderCompId )
125
+ }
126
+ } catch ( err ) {
127
+ console . log ( err )
128
+ }
129
+ } )
130
+
131
+ // Got a DO_DIGICAM_CONTROL event, send to flight controller
132
+ //vManager.eventEmitter.on('digicamcontrol', (msg, senderSysId, senderCompId, targetComponent) => {
133
+ vManager . eventEmitter . on ( 'digicamcontrol' , ( senderSysId , senderCompId , targetComponent ) => {
134
+ console . log ( "index.js:digicamcontrol event received" )
135
+ try {
136
+ if ( fcManager . m ) {
137
+ // 203 = MAV_CMD_DO_DIGICAM_CONTROL
138
+ fcManager . m . sendCommandAck ( 203 , 0 , senderSysId , senderCompId , targetComponent )
139
+ //fcManager.m.sendData(msg, senderCompId)
140
+ }
141
+ } catch ( err ) {
142
+ console . log ( err )
143
+ }
144
+ } )
145
+
119
146
// Connecting the flight controller datastream to the logger
120
147
// and ntrip and video
121
148
fcManager . eventEmitter . on ( 'gotMessage' , ( packet , data ) => {
@@ -428,7 +455,7 @@ app.get('/api/softwareinfo', (req, res) => {
428
455
429
456
app . get ( '/api/videodevices' , ( req , res ) => {
430
457
vManager . populateAddresses ( )
431
- vManager . getVideoDevices ( ( err , devices , active , seldevice , selRes , selRot , selbitrate , selfps , SeluseUDP , SeluseUDPIP , SeluseUDPPort , timestamp , fps , FPSMax , vidres , useCameraHeartbeat , selMavURI ) => {
458
+ vManager . getVideoDevices ( ( err , devices , active , seldevice , selRes , selRot , selbitrate , selfps , SeluseUDP , SelusePhotoMode , SeluseUDPIP , SeluseUDPPort , timestamp , fps , FPSMax , vidres , useCameraHeartbeat , useMavControl , selMavURI ) => {
432
459
if ( ! err ) {
433
460
res . setHeader ( 'Content-Type' , 'application/json' )
434
461
res . send ( JSON . stringify ( {
@@ -443,13 +470,15 @@ app.get('/api/videodevices', (req, res) => {
443
470
bitrate : selbitrate ,
444
471
fpsSelected : selfps ,
445
472
UDPChecked : SeluseUDP ,
473
+ photoMode : SelusePhotoMode ,
446
474
useUDPIP : SeluseUDPIP ,
447
475
useUDPPort : SeluseUDPPort ,
448
476
timestamp,
449
477
error : null ,
450
478
fps : fps ,
451
479
FPSMax : FPSMax ,
452
480
enableCameraHeartbeat : useCameraHeartbeat ,
481
+ enableMavControl : useMavControl ,
453
482
mavStreamSelected : selMavURI
454
483
} ) )
455
484
} else {
@@ -697,8 +726,10 @@ app.post('/api/startstopvideo', [check('active').isBoolean(),
697
726
check ( 'height' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isInt ( { min : 1 } ) ,
698
727
check ( 'width' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isInt ( { min : 1 } ) ,
699
728
check ( 'useUDP' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isBoolean ( ) ,
729
+ check ( 'usePhotoMode' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isBoolean ( ) ,
700
730
check ( 'useTimestamp' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isBoolean ( ) ,
701
731
check ( 'useCameraHeartbeat' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isBoolean ( ) ,
732
+ check ( 'useMavControl' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isBoolean ( ) ,
702
733
check ( 'useUDPPort' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isPort ( ) ,
703
734
check ( 'useUDPIP' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isIP ( ) ,
704
735
check ( 'bitrate' ) . if ( check ( 'active' ) . isIn ( [ true ] ) ) . isInt ( { min : 50 , max : 50000 } ) ,
@@ -712,7 +743,7 @@ app.post('/api/startstopvideo', [check('active').isBoolean(),
712
743
return res . status ( 422 ) . json ( ret )
713
744
}
714
745
// user wants to start/stop video streaming
715
- vManager . startStopStreaming ( req . body . active , req . body . device , req . body . height , req . body . width , req . body . format , req . body . rotation , req . body . bitrate , req . body . fps , req . body . useUDP , req . body . useUDPIP , req . body . useUDPPort , req . body . useTimestamp , req . body . useCameraHeartbeat , req . body . mavStreamSelected , ( err , status , addresses ) => {
746
+ vManager . startStopStreaming ( req . body . active , req . body . device , req . body . height , req . body . width , req . body . format , req . body . rotation , req . body . bitrate , req . body . fps , req . body . useUDP , req . body . usePhotoMode , req . body . useUDPIP , req . body . useUDPPort , req . body . useTimestamp , req . body . useCameraHeartbeat , req . body . useMavControl , req . body . mavStreamSelected , ( err , status , addresses ) => {
716
747
if ( ! err ) {
717
748
res . setHeader ( 'Content-Type' , 'application/json' )
718
749
const ret = { streamingStatus : status , streamAddresses : addresses }
0 commit comments