movePseudoMap?

Forum for questions and support relating to the 1.24.x releases only.
Post Reply
richter
Posts: 6
Joined: Wed Aug 15, 2007 8:31 pm

movePseudoMap?

Post by richter » Fri Jul 23, 2010 3:39 pm

I'm working on a control script for Panasonic WV-NM100. I've used the PanasonicIP control script as a base and this has worked out pretty well thus far. I've got pan, tilt, presets, and home working. At this point I'm trying to get tracking working. As this camera only appears to support relative location, I've specified that in the control capability menu. However, I'm receiving the following error in the zmcontrol.log:

Code: Select all

zmcontrol[17059].FAT [Can't access movePseudoMap member of object of class ZoneMinder::Control::PanasonicWVNM100]
I've looked everywhere I can to find somthing on this function and I've only found it referenced once in the main documentation. Does anyone have any insight on this and could point me in the right direction? Thanks.

richter
Posts: 6
Joined: Wed Aug 15, 2007 8:31 pm

Post by richter » Mon Jul 26, 2010 2:57 am

bump.

mjsameth
Posts: 26
Joined: Mon Sep 29, 2008 8:33 pm
Location: NYC

Re: movePseudoMap?

Post by mjsameth » Fri May 11, 2012 3:42 pm

Hi,

I have a couple WV-NM100 cameras but have never been able to have zoneminder be able to control movement. Do you have a moment to post your settings? I would like to get this working.

Micah J. Sameth
Data Center Manager

richter
Posts: 6
Joined: Wed Aug 15, 2007 8:31 pm

Re: movePseudoMap?

Post by richter » Fri May 11, 2012 6:46 pm

I am out of the country right now but when I get back, I will pull this out of my SVN repo. For future reference, I was not able to get these to work with tracking due to the lack of absolute positioning.

richter
Posts: 6
Joined: Wed Aug 15, 2007 8:31 pm

Re: movePseudoMap?

Post by richter » Wed May 16, 2012 2:15 pm

Here's what I had commited to my SVN repo for this camera. I've moved on to using Foscams for their IR mode.

Code: Select all

# ==========================================================================
#
# ZoneMinder Panasonic IP Control Protocol Module, $Date: 2008-07-25 10:48:16 +0100 (Fri, 25 Jul 2008) $, $Revision: 2612 $
# Copyright (C) 2001-2008  Philip Coombes
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# ==========================================================================
#
# This module contains the implementation of the Panasonic IP camera control
# protocol
#
package ZoneMinder::Control::PanasonicWVNM100;

use 5.006;
use strict;
use warnings;

require ZoneMinder::Base;
require ZoneMinder::Control;

our @ISA = qw(ZoneMinder::Control);

our $VERSION = $ZoneMinder::Base::VERSION;

# ==========================================================================
#
# Panasonic IP Control Protocol
#
# ==========================================================================

use ZoneMinder::Debug qw(:all);
use ZoneMinder::Config qw(:all);

use Time::HiRes qw( usleep );

sub new
{
    my $class = shift;
    my $id = shift;
    my $self = ZoneMinder::Control->new( $id );
    bless( $self, $class );
    srand( time() );
    return $self;
}

our $AUTOLOAD;

sub AUTOLOAD
{
    my $self = shift;
    my $class = ref($self) || croak( "$self not object" );
    my $name = $AUTOLOAD;
    $name =~ s/.*://;
    if ( exists($self->{$name}) )
    {
        return( $self->{$name} );
    }
    Fatal( "Can't access $name member of object of class $class" );
}

sub open
{
    my $self = shift;

    $self->loadMonitor();

    use LWP::UserAgent;
    $self->{ua} = LWP::UserAgent->new;
    $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION );

    $self->{state} = 'open';
}

sub close
{
    my $self = shift;
    $self->{state} = 'closed';
}

sub printMsg
{
    my $self = shift;
    my $msg = shift;
    my $msg_len = length($msg);

    Debug( $msg."[".$msg_len."]" );
}

sub sendCmd
{
    my $self = shift;
    my $cmd = shift;

    my $result = undef;

    printMsg( $cmd, "Tx" );

    my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" );
    my $res = $self->{ua}->request($req);

    if ( $res->is_success )
    {
        $result = !undef;
    }
    else
    {
        Error( "Error check failed: '".$res->status_line()."'" );
    }

    return( $result );
}

sub cameraReset
{
    my $self = shift;
    Debug( "Camera Reset" );
    my $cmd = "nphRestart?PAGE=Restart&Restart=OK";
    $self->sendCmd( $cmd );
}

sub moveRelUp
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Up $step" );
    my $cmd = "cgi-bin/camctrl?tilt=-$step";
    $self->sendCmd( $cmd );
}

sub moveRelDown
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Down $step" );
    my $cmd = "cgi-bin/camctrl?tilt=$step";
    $self->sendCmd( $cmd );
}

sub moveRelLeft
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'panstep' );
    Debug( "Step Left $step" );
    my $cmd = "cgi-bin/camctrl?pan=-$step";
    $self->sendCmd( $cmd );
}

sub moveRelRight
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'panstep' );
    Debug( "Step Right $step" );
    my $cmd = "cgi-bin/camctrl?pan=$step";
    $self->sendCmd( $cmd );
}

sub moveRelUpRight
{
    my $self = shift;
    my $params = shift;
    my $panstep = $self->getParam( $params, 'panstep' );
    my $tiltstep = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Up/Right $tiltstep/$panstep" );
    my $cmd = "cgi-bin/camctrl?pan=$panstep&tilt=-$tiltstep";
    $self->sendCmd( $cmd );
}

sub moveRelUpLeft
{
    my $self = shift;
    my $params = shift;
    my $panstep = $self->getParam( $params, 'panstep' );
    my $tiltstep = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Up/Left $tiltstep/$panstep" );
    my $cmd = "cgi-bin/camctrl?pan=-$panstep&tilt=-$tiltstep";
    $self->sendCmd( $cmd );
}

sub moveRelDownRight
{
    my $self = shift;
    my $params = shift;
    my $panstep = $self->getParam( $params, 'panstep' );
    my $tiltstep = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Down/Right $tiltstep/$panstep" );
    my $cmd = "cgi-bin/camctrl?pan=$panstep&tilt=$tiltstep";
    $self->sendCmd( $cmd );
}

sub moveRelDownLeft
{
    my $self = shift;
    my $params = shift;
    my $panstep = $self->getParam( $params, 'panstep' );
    my $tiltstep = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Down/Left $tiltstep/$panstep" );
    my $cmd = "cgi-bin/camctrl?pan=-$panstep&tilt=$tiltstep";
    $self->sendCmd( $cmd );
}

sub movePseudoMap
{
    my $self = shift;
    my $params = shift;
    my $panstep = $self->getParam( $params, 'panstep' );
    my $tiltstep = $self->getParam( $params, 'tiltstep' );
    Debug( "Step Down/Left $tiltstep/$panstep" );
    my $cmd = "cgi-bin/camctrl?pan=$panstep&tilt=$tiltstep";
    $self->sendCmd( $cmd );
}

sub presetClear
{
    my $self = shift;
    my $params = shift;
    my $preset = $self->getParam( $params, 'preset' );
    Debug( "Clear Preset $preset" );
    my $cmd = "nphPresetNameCheck?Data=$preset";
    $self->sendCmd( $cmd );
}

sub presetSet
{
    my $self = shift;
    my $params = shift;
    my $preset = $self->getParam( $params, 'preset' );
    Debug( "Set Preset $preset" );
    my $cmd = "nphPresetNameCheck?PresetName=$preset&Data=$preset";
    $self->sendCmd( $cmd );
}

sub presetGoto
{
    my $self = shift;
    my $params = shift;
    my $preset = $self->getParam( $params, 'preset' );
    Debug( "Goto Preset $preset" );
    my $cmd = "cgi-bin/camctrl?preset=$preset";
    $self->sendCmd( $cmd );
}

sub presetHome
{
    my $self = shift;
    Debug( "Home Preset" );
    my $cmd = "cgi-bin/camctrl?preset=1";
    $self->sendCmd( $cmd );
}

1;
__END__
# Below is stub documentation for your module. You'd better edit it!

=head1 NAME

ZoneMinder::Database - Perl extension for blah blah blah

=head1 SYNOPSIS

  use ZoneMinder::Database;
  blah blah blah

=head1 DESCRIPTION

Stub documentation for ZoneMinder, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.

=head2 EXPORT

None by default.



=head1 SEE ALSO

Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.

If you have a mailing list set up for your module, mention it here.

If you have a web site set up for your module, mention it here.

=head1 AUTHOR

Philip Coombes, E<lt>philip.coombes@zoneminder.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2001-2008  Philip Coombes

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.


=cut

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests