Problem with Controlling PTZ Cameras via API in Node.js
CompletedHello, dear community!
I'm working on integrating PTZ control for a camera in a CCTV system using Node.js and have encountered some difficulties. I would be grateful for any help or advice.
Problem:
I'm trying to control a PTZ camera via an API. My task is to rotate the camera to a certain angle using the AbsoluteDeviceMovePtzCommand. I pass the rotation angle to the command, but the camera does not rotate to the expected position.
**Technologies and approaches used:**
Programming language: Node.js.
Request library: axios for sending HTTP requests to the camera API.
The camera API supports two commands for position control: RelativeMovePtzCommand and AbsoluteDeviceMovePtzCommand.
I used the formula (rotationDegrees / 180) - 1 to convert the rotation angle from degrees to yaw value in the range [-1, 1], however the results were inconsistent.
Perhaps there are some features in the camera API that I do not take into account. For example, should the current camera position be taken into account before sending an absolute positioning command?
Is there a standard approach or best practices for doing this kind of task that I could apply to my project?
Already Tried:
I have tried different scales and transformations for the yaw value without success.
Tried to use the RelativeMovePtzCommand for testing and debugging, but the results were also unpredictable.
I would be very grateful for any help or direction in resolving this issue. If anyone has faced similar challenges or has experience in controlling PTZ cameras via API, please share your experience or tips.
Thanks in advance!
-
Hi Jarvice Jhafar,
Thanks for your questions. We understand the use cases, but we might need some more information to your situation.
1) What is the return code of the API? Ex: 200, 403, 503...etc
2) What is the request you send? Can you provide the full URL to us?
3) If the formula does not deliver the consistent issue, it is highly likely the PTZ on the camera should be checked again. Have you tried Absolutely Move and if that works?Thanks,
0
Please sign in to leave a comment.
Comments
1 comment