2

I am trying to move a ptz camera using the onvif client wrote in python from github I can connect to the camera Bosh 7000 Autodome. I am using the example to test move operation Here is my object to use like argument for the ContinuousMove method

>>> moverequest
{
    'ProfileToken': '0',
    'Velocity': {
        'PanTilt': {
            'x': 0.57,
            'y': -0.44,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace'
        },
        'Zoom': {
            'x': 0.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
        }
    },
    'Timeout': None
}

When I try to execute ContinuousMove() I got the next error

>>> ptz.ContinuousMove(moverequest)
Traceback (most recent call last):
  File "/home/myuser/Documents/python-onvif-zeep/onvif/client.py", line 25, in wrapped
    return func(*args, **kwargs)
  File "/home/myuser/Documents/python-onvif-zeep/onvif/client.py", line 150, in wrapped
    return call(params, callback)
  File "/home/myuser/Documents/python-onvif-zeep/onvif/client.py", line 138, in call
    ret = func(**params)
  File "/usr/local/lib/python3.7/dist-packages/zeep/proxy.py", line 45, in __call__
    kwargs,
  File "/usr/local/lib/python3.7/dist-packages/zeep/wsdl/bindings/soap.py", line 130, in send
    return self.process_reply(client, operation_obj, response)
  File "/usr/local/lib/python3.7/dist-packages/zeep/wsdl/bindings/soap.py", line 195, in process_reply
    return self.process_error(doc, operation)
  File "/usr/local/lib/python3.7/dist-packages/zeep/wsdl/bindings/soap.py", line 362, in process_error
    subcodes=subcodes,
zeep.exceptions.Fault: Action Failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myuser/Documents/python-onvif-zeep/onvif/client.py", line 27, in wrapped
    raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: Action Failed

HELP PLEASE

imbr
  • 6,226
  • 4
  • 53
  • 65
snake678
  • 21
  • 1
  • 2

1 Answers1

0

You are using http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace and http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace . According to §5.7.1.1 of the PTZ service spec:

The generic pan/tilt position space shall be provided by every PTZ node that supports absolute pan/tilt, since it does not relate to a specific physical range. Instead, the range should be defined as the full range of the PTZ unit normalized to the range -1 to 1

In section 5.7.3.1 you'll find

The generic pan/tilt velocity space shall be provided by every PTZ node, since it does not relate to a specific physical range. Instead, the range should be defined as a range of the PTZ unit’s speed normalized to the range -1 to 1, where a positive velocity would map to clockwise rotation or movement in the right/up direction.

Thus try using http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace and http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace.

Ottavio Campana
  • 4,088
  • 5
  • 31
  • 58