<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Node that will subscribe to a commanded velocity and move a Foscam PTZ camera.
"""

# ROS.
import rospy
from geometry_msgs.msg import Twist
import urllib
from enum import Enum

class Commands(Enum): # pylint: disable=no-init
# pylint: disable=too-few-public-methods
    """
    Available PTZ commands.
    """
    move_up = 0
    stop_up = 1
    move_down = 2
    stop_down = 3
    move_left = 4
    stop_left = 5
    move_right = 6
    stop_right = 7
# pylint: enable=too-few-public-methods

class FoscamPTZ(object):
    """
    Get velocities and move camera.
    """
    def __init__(self):
        self.username = rospy.get_param('~username', 'admin')
        self.password = rospy.get_param('~password', '')
        self.ip_address = rospy.get_param('~ip_address', '192.168.1.1')
        self.port = rospy.get_param('~port', '80')
        self.stopped = False

        rospy.Subscriber('twist', Twist, self.twist_cb)

        rospy.spin()

    def twist_cb(self, msg):
        """
        Convert desired velocities into motion commands.
        """
# pylint: disable=no-member
        # Don't bother sending commands if all zeroes are requested.
        if msg.linear.x == 0.0 and msg.angular.z == 0:
            if self.stopped:
                return
            direction = Commands.stop_up.value
            self.move(direction)
            direction = Commands.stop_left.value<commit_msg>Fixed pylint warnings.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Node that will subscribe to a commanded velocity and move a Foscam PTZ camera.
"""

import urllib
from enum import Enum
import rospy
from geometry_msgs.msg import Twist

#pylint: disable=no-init
# pylint: disable=too-few-public-methods
class Commands(Enum):
    """
    Available PTZ commands.
    """
    move_up = 0
    stop_up = 1
    move_down = 2
    stop_down = 3
    move_left = 4
    stop_left = 5
    move_right = 6
    stop_right = 7
# pylint: enable=too-few-public-methods
# pylint: enable=no-init

class FoscamPTZ(object):
    """
    Get velocities and move camera.
    """
    def __init__(self):
        self.username = rospy.get_param('~username', 'admin')
        self.password = rospy.get_param('~password', '')
        self.ip_address = rospy.get_param('~ip_address', '192.168.1.1')
        self.port = rospy.get_param('~port', '80')
        self.stopped = False

        rospy.Subscriber('twist', Twist, self.twist_cb)

        rospy.spin()

    def twist_cb(self, msg):
        """
        Convert desired velocities into motion commands.
        """
# pylint: disable=no-member
        # Don't bother sending commands if all zeroes are requested.
        if msg.linear.x == 0.0 and msg.angular.z == 0:
            if self.stopped:
                return
            direction = Commands.stop_up.value
            self.move(direction)
            direction = Commands.stop_left.value
{'fraction_non_alphanumeric': 0.11846571622539036, 'fraction_numerical': 0.01493550577053632, 'mean_word_length': 2.4108796296296298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2314862', 'n_tokens_mistral': 1005, 'n_tokens_neox': 943, 'n_words': 236}