Facility Control

 View Only
  • 1.  Sending VISCA commands via Dashboard

    Posted 01-01-2024 20:06

    I have a question regarding sending VISCA commands to our Ross PTZ-12G and PivotCam PTZ cameras. First of all, I thought I saw a command for controlling the zoom and Pan/Tilt velocity of the cameras somewhere but cannot locate it now. It appeared they could be sent as either an absolute value (an integer somewhere between the minimum and maximum speeds) or as a percentage of the maximum speed unless I'm reading it wrong.

    First question is, if I were to add a button (or a slider) on my custom panel, can I set it and the speed will maintain that level until I reset the value? In other words, could I set it for something like 50% and it would remain at that value until changed back? And what would the code (ogscript?) be for me to enable that change?

    I'm aware that on the Remote Control Panel for each camera on the Config > Operation tab there already are 2 sliders; one for "Zoom Tele/Wide Button Sensitivity" and the other for "Focus Near/Far Button Sensitivity" there is nothing for Pan/Tilt velocity. Besides, those existing buttons don't seem to affect anything as I have tested it using several different settings.

    Finally, if we are able to change the velocity of these two controls, could I tie it to whether of not the specific camera is ON AIR? In other words, let the Pan/Tilt/Zoom controls work at normal speed if the camera is in Preview or OFF AIR for adjustments but if the camera is ON AIR, slow it down to 50%, 30% or whatever.



    ------------------------------
    Steve Witwicki
    Video Technical Director
    Light of Christ Church
    ------------------------------


  • 2.  RE: Sending VISCA commands via Dashboard

    Ross Staff
    Posted 01-02-2024 08:47

    Hi Steve,

    There is an option to vary the pan/tilt speed with the zoom value.  It is called Variable Zoom in the DashBoard UI (Config->Camera) and can also be set through the camera web UI.  This will reduce the sensitivity of the pan and tilt controls as you zoom in so that you can make finer adjustments.

    The Zoom Tele/Wide Button Sensitivity and Focus Near/Far Button Sensitivity sliders in the DashBoard UI are used to determine what speed is requested when you press the Tele/Wide or Near/Far buttons on the PTZ page of the  DashBoard UI.  Effectively, when you press one of those buttons - it reads the value set on the appropriate sensitivity slider and sends that requested speed to the camera.  There is nothing equivalent for pan and tilt because we don't have any left/right or up/down buttons on our  panel.

    If you wanted to do something similar for pan/tilt, you could:

    • Create a parameter to determine your desired speed - that could then be exposed as a slider, a set of buttons, or you could write some ogscript to set the value when the on-air status changes.
    • Add some left/right  and up/down buttons to your panel - when pressed, you could read the value of your new parameter and send that as the new requested value for the pan or tilt velocity (ptzjoystick.vel.pan / ptzjoystick.vel.tilt)
    • Alternatively, if you wanted to use a slider or the cross-hairs to control velocity, but at a reduced rate - you could create your own version of the velocity parameters (ptzjoystick.vel.pantilt for a cross-hairs, or the individual ones above for a slider) and expose that on your panel instead of using the existing ones, then add ogscript code to listen for changes to the parameter, take the requested value, multiply it by your scaling parameter and then send that as a requested change to the original pan / tilt or pantilt velocity parameter

    I hope that some of these ideas help



    ------------------------------
    Barbara Sharp
    Software Developer, Technical Lead - Robotics
    Ross Video
    ------------------------------



  • 3.  RE: Sending VISCA commands via Dashboard

    Posted 01-02-2024 22:33

    That information is helpful and I appreciate the quick response. I'm wondering if there is any example code for reducing the velocity for pan or tilt (or maybe Ben Gatien could whip something up?) that I could either connect to a slider or enable when the camera is ON AIR. Obviously, when it's in PEVIEW or OFF AIR I'd need to reset it back to "full speed". Since I'm not at all proficient with creating ogscript, I'm looking for some help-although I created our custom panel for controlling our cameras, it was mostly modifying existing panels and using or modifying widgets already available. Also, does there happen to be a corresponding command for the velocity of the zoom control? Something like ptzjoystick.vel.zoom or similar?

    One more thing-currently, the zoom speed on all 3 of our PTZ 12G cameras is "OK" right now although if I could slow it down a bit that would be great. The 2 PivotCams, however, move much faster. You mentioned the Zoom Tele/Wide Button Sensitivity and Focus Near/Far Button Sensitivity sliders in the Camera Remote Control Panel (Config > Operation) and I have the settings for all 5 cameras set at the same exact (the slowest) values yet the PivotCams move much quicker than the 12G cameras. In fact, when I adjust those settings to another value for any of the cameras, it doesn't appear to change the speed at all.



    ------------------------------
    Steve Witwicki
    Video Technical Director
    Light of Christ Church
    ------------------------------



  • 4.  RE: Sending VISCA commands via Dashboard

    Posted 01-09-2024 19:04

    Any answers to my latest questions from 1/3? Even better, any sample code you could share?



    ------------------------------
    Steve Witwicki
    Video Technical Director
    Light of Christ Church
    ------------------------------



  • 5.  RE: Sending VISCA commands via Dashboard

    Posted 01-18-2024 22:40

    Hello? Wondering if someone could please look at my original post and provide some code to help me out?



    ------------------------------
    Steve Witwicki
    Video Technical Director
    Light of Christ Church
    ------------------------------



  • 6.  RE: Sending VISCA commands via Dashboard

    Ross Staff
    Posted 01-19-2024 09:14

    Hi Steve,

    Unfortunately, I don't have an example panel for this, but I can answer your specific questions and provide a few code snippets:

    • You are correct that to control zoom speed, you would use ptzjoystick.vel.zoom
    • In terms of sensitivity, as the Pivot and PTZ-12G are different camera models, it is quite possible that their zoom speed is different - for both cameras, there are 7 zoom speed steps as you move the slider from its centre point to its farthest point, but the actual speeds that those represent may vary per camera
    • The zoom tele/wide button sensitivity slider only impacts the Tele and Wide buttons in the UI - setting which of those 7 speeds they will represent.  You could make two zoom buttons (in/out) with an arbitrary speed, and then link them to tally by listening to tally.state (value of 0 means on-air) using something like this (my example only for a zoom tele button - you would have to remove my comments [**********  ] before using this)

                   <api>function updateOnButtonRelease() {

                        // Reset the value of the zoom speed to 0 when button is released
                        params.setValue("ptzjoystick.vel.zoom",0,0);
                  }
                  function onTeleButtonDown() {

                     // Read the desired speed - I'm using the fixed speed set by the slider in the config page, but you could create your own parameter
                     var spd = params.getValue("ptzjoystick.zoom.fixed.speed",0);
                      // Write the value to the zoom velocity parameter
                     params.setValue("ptzjoystick.vel.zoom",0,spd);
                }

                function onTallyChanged()

                { // This is listening to a change in tally state and using it to change the fixed speed - which will then be used when the zoom buttons are pressed

                     var tally = params.getValue("tally.state",0);

                     var zoomspd = 7;    // desired speed when off-air

                     if (tally ==0)  zoomspd = 3; // desired speed when on-air

                      params.setValue("ptzjoystick.zoom.fixed.speed",0, zoomspd);

                  
                </api>


                             <ogscript handles="onchange,onload" oid="tally.state">onTallyChanged();</ogscript>    [****** Listens for tally state change and calls the function onTallyChanged]

                          <button id="zoomTeleButton" colspan="1" expand="true" fill="both" height="60" name="Tele" onmousedown="onTeleButtonDown();" onmouseup="onButtonRelease();" rowspan="1" showlabel="false" top="10" weightx="1.0" weighty="0.0" width="150">
                               <config key="w.instantoff">true</config>     [***** a zoom tele button, with functions called when it is pressed (onmousedown) and released (onmouseup)]
                            </button>

    For pan/tilt, the process would be more complicated in 2 ways

    You would have to create your own fixed speed parameter (available range is +/- 24 for pan and tilt)
    If you are using the cross-hairs it uses a combined parameter for pan and tilt speed ptzjoystick.vel.pantilt which has a single value that has to be split in 2 to get the separate pan and tilt velocities (you can search for WIDGET_ABSOLUTE_CROSSHAIR in the DashBoard help to get an explanation of that)

     I hope that this helps

    Barbara



    ------------------------------
    Barbara Sharp
    Software Developer, Technical Lead - Robotics
    Ross Video
    ------------------------------