<commit_before>#!/usr/bin/env python
import rospy
import math
import autobot
from autobot.msg import drive_param
from sensor_msgs.msg import LaserScan
from autobot.msg import pid_input
from autobot.msg import wall_dist
from autobot.srv import *

"""
TODO:
- [x] Decide if you want to hug right/left/or closest wall
    - Right wall hugged for now to simulate right side of road
    - Update: wall decision to be made by image processing node
- [x] Send error left to hug left wall
- [ ] Use a command line argument to enable/disable debug msgs
"""


class PathConfig(object):
    __slots__ = ('wallToWatch', 'desiredTrajectory', 'velocity', 'pubRate',
                 'minFrontDist')
    """
    wallToWatch: Set which wall to hug
    options: autobot.msg.wall_dist.WALL_LEFT
             autobot.msg.wall_dist.WALL_RIGHT
             autobot.msg.wall_dist.WALL_FRONT  #< probably won't be used
    """
    wallToWatch = autobot.msg.wall_dist.WALL_RIGHT
    desiredTrajectory = 0.5  # desired distance from the wall
    minFrontDist = 2.2       # minimum required distance in front of car
    velocity = 7.3           # velocity of drive
    pubRate = 0              # publish rate of node
    enabled = True           # enable/disable state of wall hugging


errorPub = rospy.Publisher('error', pid_input, queue_size=10)
motorPub = rospy.Publisher('drive_parameters', drive_param, queue_size=10)


def HandleTogglePathFinderService(req):
    """ Handler for enabling/disabling path finder
    Responds with ack msg (bool)
    """
    global PathConfig
    PathConfig.enabled = req.state
    return TogglePathFinder(True)


def HandleAdjustWallDist(req):
    """ Handler for adjusting wall hugging parameters

    Responds with wall_dist msg and a bool to verify that the
    service command has been accepted
    """
    global PathConfig<commit_msg>Fix bad ack call for TogglePathFinder<commit_after>#!/usr/bin/env python
import rospy
import math
import autobot
from autobot.msg import drive_param
from sensor_msgs.msg import LaserScan
from autobot.msg import pid_input
from autobot.msg import wall_dist
from autobot.srv import *

"""
TODO:
- [x] Decide if you want to hug right/left/or closest wall
    - Right wall hugged for now to simulate right side of road
    - Update: wall decision to be made by image processing node
- [x] Send error left to hug left wall
- [ ] Use a command line argument to enable/disable debug msgs
"""


class PathConfig(object):
    __slots__ = ('wallToWatch', 'desiredTrajectory', 'velocity', 'pubRate',
                 'minFrontDist')
    """
    wallToWatch: Set which wall to hug
    options: autobot.msg.wall_dist.WALL_LEFT
             autobot.msg.wall_dist.WALL_RIGHT
             autobot.msg.wall_dist.WALL_FRONT  #< probably won't be used
    """
    wallToWatch = autobot.msg.wall_dist.WALL_RIGHT
    desiredTrajectory = 0.5  # desired distance from the wall
    minFrontDist = 2.2       # minimum required distance in front of car
    velocity = 7.3           # velocity of drive
    pubRate = 0              # publish rate of node
    enabled = True           # enable/disable state of wall hugging


errorPub = rospy.Publisher('error', pid_input, queue_size=10)
motorPub = rospy.Publisher('drive_parameters', drive_param, queue_size=10)


def HandleTogglePathFinderService(req):
    """ Handler for enabling/disabling path finder
    Responds with ack msg (bool)
    """
    global PathConfig
    PathConfig.enabled = req.state
    return TogglePathFinderResponse(True)


def HandleAdjustWallDist(req):
    """ Handler for adjusting wall hugging parameters

    Responds with wall_dist msg and a bool to verify that the
    service command has been accepted
    """
    global PathConfig
{'fraction_non_alphanumeric': 0.07387580299785867, 'fraction_numerical': 0.005888650963597431, 'mean_word_length': 3.180089485458613, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '7032865', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1091, 'n_words': 376}