1

I'd like a recommandation on how to approach the problem I'm facing as a software developer.

Context:

I have an IP Camera that can be moved with a PTZ (Pan, Tilt, Zoom) command that can be called like so:

PTZ(float pan, float tilt, float zoom)

I have a joystick that update its input values every ~0.0001 sec and the available input values are:

  • joystickX: from -1(left) to 1(right) 0 being the center
  • joystickY: from -1(down) to 1(up) 0 being the center
  • joystickMagnitude: from 0(untouched) to 1(completely pushed)
  • zoomButton+: pressed(zoomValue = 1) or not
  • zoomButton-: pressed(zoomValue = -1) or not

Right now, every time the joystick values are updated, a message to the camera is sent, so it's kinda spamming the camera every ~0.0001 sec with PTZ messages.

Ex:

  • Joystick input value update
  • PTZ(joystickX*joystickMagnitude, joystickY*joystickMagnitude, zoomValue) message sent
  • Repeat in ~0.0001 sec

Question:

What would be the best approach to be able to control the camera with the joystick without spamming PTZ messages?

5
  • 1
    Please note this site is about recommending software, not assets or resources like howtos, manuals/tutorials, code fragments, etc.
    – Izzy
    Jan 9, 2020 at 23:22
  • Stick something in the middle! What it will be depends on your technical skills. For instance, a sub $5 Arduino could read the input from the joystick and only forward every 5th or 10th message, or only those with a (significant) change. Do the joystick or camera have a support forum? Try there Jan 10, 2020 at 12:40
  • Aha! it's an IP camera, so maybe you can but some form of router or configure a firewall, to filter the messages without having to know programming. Good luck & let us know if you get a solution Jan 10, 2020 at 12:41
  • @Izzy Thanks for the intel, I wasn't sure if I was at the right place at first (:
    – LoukMouk
    Jan 10, 2020 at 13:20
  • 1
    @MawgsaysreinstateMonica Thanks for the tip! I'll sure try and look into what you proposed (:
    – LoukMouk
    Jan 10, 2020 at 13:22

0

Browse other questions tagged or ask your own question.