Skip to content

Commit

Permalink
Rely on continuous move will fix the PTZFunctions later
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Aug 29, 2023
1 parent c71cb71 commit 31cc3d8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions machinery/src/onvif/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func HandleONVIFActions(configuration *models.Configuration, communication *mode
log.Log.Info("HandleONVIFActions: functions: " + strings.Join(functions, ", "))

// Check if we need to use absolute or continuous move
canAbsoluteMove := false
/*canAbsoluteMove := false
canContinuousMove := false
if len(functions) > 0 {
Expand All @@ -70,9 +70,17 @@ func HandleONVIFActions(configuration *models.Configuration, communication *mode
canContinuousMove = true
}
}
}*/

// Ideally we should be able to use the AbsolutePanTiltMove function, but it looks like
// the current detection through GetPTZFuntionsFromDevice is not working properly. Therefore we will fallback
// on the ContinuousPanTiltMove function which is more compatible with more cameras.
err = AbsolutePanTiltMoveFake(device, configurations, token, x, y, z)
if err != nil {
log.Log.Error("HandleONVIFActions (AbsolutePanTitleMoveFake): " + err.Error())
}

if canAbsoluteMove {
/*if canAbsoluteMove {
err = AbsolutePanTiltMove(device, configurations, token, x, y, z)
if err != nil {
log.Log.Error("HandleONVIFActions (AbsolutePanTitleMove): " + err.Error())
Expand All @@ -82,7 +90,7 @@ func HandleONVIFActions(configuration *models.Configuration, communication *mode
if err != nil {
log.Log.Error("HandleONVIFActions (AbsolutePanTitleMoveFake): " + err.Error())
}
}
}*/

} else if onvifAction.Action == "ptz" {

Expand Down

0 comments on commit 31cc3d8

Please sign in to comment.