Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .rsyncignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ src/bitbots_misc/bitbots_parameter_blackboard/config/game_settings.yaml
__pycache__

# Don't sync the simulation environments
src/bitbots_simulation/bitbots_webots_sim/
src/bitbots_simulation/bitbots_mujoco_sim/
28 changes: 8 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"ansible",
"antiwindup",
"autoconnect",
"basler",
"bitbot",
"bitbots",
"bringup",
"buildtool",
"cartesian",
"coef",
"colcon",
Expand All @@ -28,7 +28,6 @@
"dsize",
"dtype",
"dynamixel",
"dynup",
"euler",
"externproto",
"fetchrobotics",
Expand All @@ -41,6 +40,7 @@
"gaussian",
"goalkick",
"hexsha",
"highlevel",
"hlvs",
"holonomic",
"hostnames",
Expand All @@ -52,6 +52,7 @@
"isort",
"joern",
"jupyter",
"kalliope",
"kalman",
"Leph",
"linalg",
Expand All @@ -60,19 +61,23 @@
"mmse",
"moveit",
"msgify",
"mujoco",
"mutex",
"mypy",
"nanosec",
"ndarray",
"neff",
"nmcli",
"numpify",
"numpy",
"nvidia",
"odom",
"odometry",
"particlefilter",
"pathfinding",
"penaltykick",
"penaltyshoot",
"piplus",
"playsound",
"pointcloud",
"pointclouds",
Expand Down Expand Up @@ -108,6 +113,7 @@
"srdf",
"ssid",
"std_srvs",
"teamcom",
"teamcomm",
"teamplayer",
"teleop",
Expand Down Expand Up @@ -135,7 +141,6 @@
"files.autoSaveDelay": 500,
"files.insertFinalNewline": true,
"python.analysis.typeCheckingMode": "off",
"esbonio.sphinx.confDir": "",
"files.associations": {
"cctype": "cpp",
"clocale": "cpp",
Expand Down Expand Up @@ -226,25 +231,18 @@
"python.autoComplete.extraPaths": [
"build/system_monitor",
"install/system_monitor/lib/python3.12/site-packages",
"build/bitbots_robocup_api",
"install/bitbots_robocup_api/lib/python3.12/site-packages",
"install/bitbots_pybullet_sim/lib/python3.12/site-packages",
"install/bitbots_webots_sim/lib/python3.12/site-packages",
"build/bitbots_vision",
"install/bitbots_vision/lib/python3.12/site-packages",
"build/bitbots_team_data_sim_rqt",
"install/bitbots_team_data_sim_rqt/lib/python3.12/site-packages",
"install/bitbots_team_communication/lib/python3.12/site-packages",
"install/bitbots_quintic_walk/lib/python3.12/site-packages",
"build/bitbots_localization_handler",
"install/bitbots_localization_handler/lib/python3.12/site-packages",
"install/bitbots_localization/lib/python3.12/site-packages",
"install/bitbots_parameter_blackboard/lib/python3.12/site-packages",
"build/bitbots_animation_rqt",
"install/bitbots_animation_rqt/lib/python3.12/site-packages",
"install/bitbots_hcm/lib/python3.12/site-packages",
"install/bitbots_dynup/lib/python3.12/site-packages",
"install/bitbots_dynamic_kick/lib/python3.12/site-packages",
"build/bitbots_body_behavior",
"install/bitbots_body_behavior/lib/python3.12/site-packages",
"install/bitbots_blackboard/lib/python3.12/site-packages",
Expand All @@ -261,7 +259,6 @@
"build/bitbots_path_planning",
"install/bitbots_path_planning/lib/python3.12/site-packages",
"install/bitbots_msgs/lib/python3.12/site-packages",
"install/bitbots_moveit_bindings/lib/python3.12/site-packages",
"build/bitbots_ball_filter",
"install/bitbots_ball_filter/lib/python3.12/site-packages",
".pixi/envs/default/lib/python/site-packages",
Expand All @@ -270,25 +267,18 @@
"python.analysis.extraPaths": [
"build/system_monitor",
"install/system_monitor/lib/python3.12/site-packages",
"build/bitbots_robocup_api",
"install/bitbots_robocup_api/lib/python3.12/site-packages",
"install/bitbots_pybullet_sim/lib/python3.12/site-packages",
"install/bitbots_webots_sim/lib/python3.12/site-packages",
"build/bitbots_vision",
"install/bitbots_vision/lib/python3.12/site-packages",
"build/bitbots_team_data_sim_rqt",
"install/bitbots_team_data_sim_rqt/lib/python3.12/site-packages",
"install/bitbots_team_communication/lib/python3.12/site-packages",
"install/bitbots_quintic_walk/lib/python3.12/site-packages",
"build/bitbots_localization_handler",
"install/bitbots_localization_handler/lib/python3.12/site-packages",
"install/bitbots_localization/lib/python3.12/site-packages",
"install/bitbots_parameter_blackboard/lib/python3.12/site-packages",
"build/bitbots_animation_rqt",
"install/bitbots_animation_rqt/lib/python3.12/site-packages",
"install/bitbots_hcm/lib/python3.12/site-packages",
"install/bitbots_dynup/lib/python3.12/site-packages",
"install/bitbots_dynamic_kick/lib/python3.12/site-packages",
"build/bitbots_body_behavior",
"install/bitbots_body_behavior/lib/python3.12/site-packages",
"install/bitbots_blackboard/lib/python3.12/site-packages",
Expand All @@ -305,7 +295,6 @@
"build/bitbots_path_planning",
"install/bitbots_path_planning/lib/python3.12/site-packages",
"install/bitbots_msgs/lib/python3.12/site-packages",
"install/bitbots_moveit_bindings/lib/python3.12/site-packages",
"build/bitbots_ball_filter",
"install/bitbots_ball_filter/lib/python3.12/site-packages",
".pixi/envs/default/lib/python/site-packages",
Expand All @@ -314,7 +303,6 @@
"cmake.configureOnOpen": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"restructuredtext.pythonRecommendation.disabled": true,
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
Expand Down
2 changes: 0 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ ros-jazzy-tf2-ros = ">=0.36.14,<0.37"
ros-jazzy-topic-tools = ">=1.3.3,<2"
ros-jazzy-trajectory-msgs = ">=5.3.6,<6"
ros-jazzy-transmission-interface = ">=4.37.0,<5"
ros-jazzy-turtlesim = ">=1.8.3,<2"
ros-jazzy-urdf = ">=2.10.0,<3"
ros-jazzy-urdfdom-py = ">=1.2.1,<2"
ros-jazzy-vision-msgs = ">=4.1.1,<5"
Expand Down Expand Up @@ -212,7 +211,6 @@ RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity}] [{name}]: {message} ({function_name}
RMW_IMPLEMENTATION = "rmw_zenoh_cpp"
COLCON_LOG_LEVEL = "30"
PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated"
WEBOTS_HOME = "$CONDA_PREFIX/share/webots"
ALSA_PLUGIN_DIR = "/usr/lib/x86_64-linux-gnu/alsa-lib"


Expand Down
4 changes: 0 additions & 4 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,3 @@ These different tasks can be performed:
```shell
./deploy_robots.py --package bitbots_utils nuc1
```

## `make_basler.sh`

Downloads and installs the Basler Pylon SDK for Linux. This is needed to communicate with our camera.
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
from enum import Flag
from typing import Optional

from rclpy.action import ActionClient
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.duration import Duration
from rclpy.publisher import Publisher
from rclpy.time import Time
from std_msgs.msg import Bool

from bitbots_blackboard.capsules import AbstractBlackboardCapsule
from bitbots_msgs.action import Kick


class KickCapsule(AbstractBlackboardCapsule):
"""Communicates with the dynamic_kick action server to kick the ball."""

last_feedback: Optional[Kick.Feedback] = None
last_feedback_received: Optional[Time] = None
last_goal: Optional[Kick.Goal] = None
last_goal_sent: Optional[Time] = None
"""Communicates with the action server to kick the ball."""

is_currently_kicking: bool = False

__connected: bool = False
__action_client: Optional[ActionClient] = None

class WalkKickTargets(Flag):
"""
Define the target for the walk kick (e.g. left or right foot)
Expand All @@ -42,7 +28,6 @@ def __init__(self, node, blackboard):
:param blackboard: Global blackboard instance
"""
self.walk_kick_pub = self._node.create_publisher(Bool, "/kick", 1)
# self.connect_dynamic_kick() Do not connect if dynamic_kick is disabled
self.rl_kick_active_pub = self._node.create_publisher(Bool, "rl_kick_active", 1)

def walk_kick(self, target: WalkKickTargets) -> None:
Expand All @@ -52,46 +37,8 @@ def walk_kick(self, target: WalkKickTargets) -> None:
"""
self.walk_kick_pub.publish(Bool(data=target.value))

def connect_dynamic_kick(self) -> None:
topic = self._blackboard.config["dynamic_kick"]["topic"]
self.__action_client = ActionClient(self._node, Kick, topic, callback_group=ReentrantCallbackGroup())
self.__connected = self.__action_client.wait_for_server(self._blackboard.config["dynamic_kick"]["wait_time"])

if not self.__connected:
self._node.get_logger().error(f"No dynamic_kick server running on {topic}")

def dynamic_kick(self, goal: Kick.Goal) -> None:
"""
:param goal: Goal to kick to
:type goal: KickGoal
:raises RuntimeError: when not connected to dynamic_kick server
"""
raise NotImplementedError("The dynamic_kick is disabled currently")
if not self.__connected:
# try to connect again
self.__connected = self.__action_client.wait_for_server(
Duration(seconds=self._blackboard.config["dynamic_kick"]["wait_time"])
)
if not self.__connected:
raise RuntimeError("Not connected to any dynamic_kick server")

self.is_currently_kicking = True
self.__action_client.send_goal_async(goal, self.__feedback_cb).add_done_callback(
lambda future: future.result().get_result_async().add_done_callback(lambda _: self.__done_cb())
)

self.last_goal = goal
self.last_goal_sent = self._node.get_clock().now()

def start_rl_kick(self):
self.rl_kick_active_pub.publish(Bool(data=True))

def stop_rl_kick(self):
self.rl_kick_active_pub.publish(Bool(data=False))

def __feedback_cb(self, feedback):
self.last_feedback: Kick.Feedback = feedback.feedback
self.last_feedback_received = self._node.get_clock().now()

def __done_cb(self):
self.is_currently_kicking = False
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from std_msgs.msg import Bool

from bitbots_blackboard.capsules import AbstractBlackboardCapsule
from bitbots_msgs.msg import Audio, HeadMode, RobotControlState
from bitbots_msgs.msg import TTS, HeadMode, RobotControlState

THeadMode: TypeAlias = Literal[ # type: ignore[valid-type]
HeadMode.TRACK_BALL,
Expand All @@ -23,7 +23,7 @@ class MiscCapsule(AbstractBlackboardCapsule):
def __init__(self, node, blackboard):
super().__init__(node, blackboard)
self.head_pub = self._node.create_publisher(HeadMode, "head_mode", 10)
self.speak_pub = self._node.create_publisher(Audio, "speak", 10)
self.speak_pub = self._node.create_publisher(TTS, "speak", 10)

# Config
gamestate_settings = get_parameters_from_other_node(
Expand Down
1 change: 0 additions & 1 deletion src/bitbots_behavior/bitbots_blackboard/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<depend>rclpy</depend>
<depend>ros2_numpy</depend>
<depend>tf_transformations</depend>
<exec_depend>bio_ik_msgs</exec_depend>
<exec_depend>bitbots_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
Expand Down
Loading
Loading