Skip to content

Commit

Permalink
Apply codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Flova committed Jan 19, 2024
1 parent 05035a5 commit 3b9f322
Show file tree
Hide file tree
Showing 235 changed files with 5,017 additions and 4,342 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
Communicates with the animation action server and plays predefined animations.
"""
from bitbots_msgs.action import Dynup, LookAt, PlayAnimation
from rclpy.action import ActionClient
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.duration import Duration
from rclpy.node import Node

from bitbots_msgs.action import Dynup, LookAt, PlayAnimation


class AnimationCapsule:
def __init__(self, node: Node):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
Provides information about the current game state.
"""
from bitbots_msgs.msg import GameState
from bitbots_utils.utils import get_parameters_from_other_node
from rclpy.node import Node

from bitbots_msgs.msg import GameState


class GameStatusCapsule:
def __init__(self, node: Node):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
if TYPE_CHECKING:
from bitbots_blackboard.blackboard import BodyBlackboard

from bitbots_msgs.action import Kick
from rclpy.action import ActionClient
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.duration import Duration
from rclpy.time import Time

from bitbots_msgs.action import Kick


class KickCapsule:
__blackboard: "BodyBlackboard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"""
from typing import Optional

from bitbots_msgs.msg import HeadMode, RobotControlState
from bitbots_utils.utils import get_parameters_from_other_node
from rclpy.duration import Duration
from rclpy.node import Node
from std_msgs.msg import Bool

from bitbots_msgs.msg import HeadMode, RobotControlState


class MiscCapsule:
def __init__(self, node: Node):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Dict, List, Optional, Tuple

import numpy as np
from bitbots_msgs.msg import Strategy, TeamData
from bitbots_utils.utils import get_parameters_from_other_node
from geometry_msgs.msg import PointStamped, Pose
from rclpy.clock import ClockType
Expand All @@ -15,6 +14,8 @@
from ros2_numpy import numpify
from std_msgs.msg import Float32

from bitbots_msgs.msg import Strategy, TeamData


class TeamDataCapsule:
def __init__(self, node: Node):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from std_msgs.msg import Bool

from bitbots_blackboard.blackboard import BodyBlackboard


class AvoidBall(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from bitbots_msgs.msg import Strategy
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_msgs.msg import Strategy


class ChangeAction(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement


class ChangeRole(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from std_msgs.msg import Bool

from bitbots_blackboard.blackboard import BodyBlackboard


class DeactivateHCM(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import numpy as np
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import Twist

from bitbots_blackboard.blackboard import BodyBlackboard


class DribbleForward(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement


class ForgetBall(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import rclpy
from bitbots_msgs.action import Dynup
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_msgs.action import Dynup


class GetWalkready(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import numpy as np
import tf2_ros as tf2
from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_utils.transforms import quat_from_yaw
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import PoseStamped
from rclpy.duration import Duration

from bitbots_blackboard.blackboard import BodyBlackboard


class GoToRelativePosition(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_blackboard.capsules.pathfinding_capsule import BallGoalType
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import Vector3
from rclpy.duration import Duration
from std_msgs.msg import ColorRGBA
from visualization_msgs.msg import Marker

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_blackboard.capsules.pathfinding_capsule import BallGoalType


class GoToBall(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from tf2_geometry_msgs import PoseStamped

from bitbots_blackboard.blackboard import BodyBlackboard


class GoToBlockPosition(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import math

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import Quaternion
from tf2_geometry_msgs import PoseStamped
from tf_transformations import quaternion_from_euler

from bitbots_blackboard.blackboard import BodyBlackboard


class GoToCornerKickPosition(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import math

import numpy as np
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import Quaternion
from tf2_geometry_msgs import PoseStamped
from tf_transformations import quaternion_from_euler

from bitbots_blackboard.blackboard import BodyBlackboard


class GoToDefensePosition(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_utils.transforms import quat_from_yaw
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from tf2_geometry_msgs import PoseStamped

from bitbots_blackboard.blackboard import BodyBlackboard


class AbstractGoToPassPosition(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from tf2_geometry_msgs import PoseStamped

from bitbots_blackboard.blackboard import BodyBlackboard


class GoToRolePosition(AbstractActionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import rclpy
from bitbots_msgs.action import LookAt
from bitbots_msgs.msg import HeadMode
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_msgs.action import LookAt
from bitbots_msgs.msg import HeadMode


class AbstractHeadModeElement(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from bitbots_msgs.action import Kick
from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_utils.transforms import quat_from_yaw
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_msgs.action import Kick


class AbstractKickAction(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from abc import ABC, abstractmethod

from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement


class AbstractPlayAnimation(AbstractActionElement, ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import random

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import Twist
from rclpy.duration import Duration

from bitbots_blackboard.blackboard import BodyBlackboard


class CancelPathplanning(AbstractActionElement):
"""Only cancel the pathplanning goal without completly stopping the walking"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_action_element import AbstractActionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_action_element import AbstractActionElement


class StartTimer(AbstractActionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import math
from typing import Optional

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_utils.transforms import quat_from_yaw
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
from geometry_msgs.msg import PoseStamped, Twist

from bitbots_blackboard.blackboard import BodyBlackboard


class TurnAround(AbstractActionElement):
def __init__(self, blackboard, dsd, parameters=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import rclpy
import tf2_ros as tf2
from ament_index_python import get_package_share_directory
from bitbots_msgs.msg import GameState, RobotControlState, TeamData
from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_tf_listener import TransformListener
from dynamic_stack_decider.dsd import DSD
from geometry_msgs.msg import PoseWithCovarianceStamped, Twist, TwistWithCovarianceStamped
Expand All @@ -23,7 +23,7 @@
from rclpy.node import Node
from soccer_vision_3d_msgs.msg import RobotArray

from bitbots_blackboard.blackboard import BodyBlackboard
from bitbots_msgs.msg import GameState, RobotControlState, TeamData


class BodyDSD:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import math

from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class AlignedToGoal(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class AvoidBall(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import math

from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class BallClose(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class BallDangerous(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class BallInDefensiveArea(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class BallKickArea(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
from rclpy.duration import Duration

from bitbots_blackboard.blackboard import BodyBlackboard


class BallSeen(AbstractDecisionElement):
blackboard: BodyBlackboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class ClosestToBallNoGoalie(AbstractDecisionElement):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement

from bitbots_blackboard.blackboard import BodyBlackboard
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement


class ConfigRole(AbstractDecisionElement):
Expand Down
Loading

0 comments on commit 3b9f322

Please sign in to comment.