Skip to content

Commit 3c97b4d

Browse files
committed
working implementation (llm doesn't start)
1 parent c692ebb commit 3c97b4d

10 files changed

Lines changed: 382 additions & 11 deletions

File tree

pixi.lock

Lines changed: 353 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ syrupy = ">=5.0.0, <6"
223223
exhale = ">=0.3.7, <0.4"
224224
mycroft-mimic3-tts = ">=0.2.4, <0.3"
225225
pyttsx3 = ">=2.99, <3"
226+
langchain-openai = ">=0.3.0, <1"
227+
python-dotenv = ">=1.0, <2"
226228

227229
[feature.ros.target.linux-64.pypi-dependencies]
228230
onnxruntime-webgpu = ">=1.24.0.dev20251218001, <2"

src/bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/actions/llm_map_freekick.py renamed to src/bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/actions/llm_map_freekick_action.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from bitbots_blackboard.body_blackboard import BodyBlackboard
2-
from bitbots_llm_map.bitbots_llm_map.plan_executor import PlanExecutor
3-
from bitbots_llm_map.bitbots_llm_map.planner_interface import PlannerInterface
4-
from bitbots_llm_map.bitbots_llm_map.problem_generator import ProblemGenerator
2+
from bitbots_llm_map.plan_executor import PlanExecutor
3+
from bitbots_llm_map.planner_interface import PlannerInterface
4+
from bitbots_llm_map.problem_generator import ProblemGenerator
55
from dynamic_stack_decider import AbstractActionElement
66
from rclpy.logging import get_logger
77

88

9-
class LLMMapFreeKick(AbstractActionElement):
9+
class LLMMapFreeKickAction(AbstractActionElement):
1010
blackboard: BodyBlackboard
1111

1212
def __init__(self, blackboard, dsd, parameters=None):

src/bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/main.dsd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ $AvoidBall
4949
YES --> @AvoidBallInactive
5050
NO --> @ChangeAction + action:going_to_ball, @LookAtFieldFeatures, @GoToBall + target:map + distance:%ball_far_approach_dist
5151

52+
#LLMMapFreeKick
53+
@LLMMapFreeKickAction
54+
5255
#PositioningReady
5356
$GoalScoreRecently
5457
YES --> $ConfigRole
@@ -104,7 +107,7 @@ $DoOnce
104107
OUR --> #SearchBall
105108
OTHER --> @AvoidBallActive, @LookAtFieldFeatures, @WalkInPlace + duration:2, @GoToRelativePosition + x:1 + y:0 + t:0, @Stand
106109
YES --> $RankToBallNoGoalie
107-
FIRST --> @LLMMapFreeKick
110+
FIRST --> #LLMMapFreeKick
108111
SECOND --> @ChangeAction + action:positioning, @LookAtFieldFeatures, @AvoidBallActive, @GoToDefensePosition + mode:freekick_second
109112
THIRD --> @ChangeAction + action:positioning, @LookAtFieldFeatures, @AvoidBallActive, @GoToDefensePosition
110113

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(bitbots_llm_map)
3+
4+
find_package(ament_cmake REQUIRED)
5+
6+
ament_python_install_package(${PROJECT_NAME})
7+
8+
ament_package()

src/bitbots_behavior/bitbots_llm_map/bitbots_llm_map/__init__.py

Whitespace-only changes.

src/bitbots_behavior/bitbots_llm_map/bitbots_llm_map/behavior_dsd/llm_map_freekick.dsd

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/bitbots_behavior/bitbots_llm_map/bitbots_llm_map/problem_generator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import os
22

3+
from dotenv import load_dotenv
34
from langchain_openai import ChatOpenAI
45
from rclpy.logging import get_logger
56

7+
load_dotenv()
8+
69

710
class ProblemGenerator:
811
def __init__(self):
@@ -19,6 +22,6 @@ def __init__(self):
1922
def _load_domain(self):
2023
path = os.path.join(os.path.dirname(__file__), "../pddl/domain.pddl")
2124
if not os.path.exists(path):
22-
raise FileNotFoundError(f"domain.pddl nicht gefunden: {path}")
25+
raise FileNotFoundError(f"domain.pddl not found: {path}")
2326
with open(path, encoding="utf-8") as f:
2427
return f.read()

src/bitbots_behavior/bitbots_llm_map/bitbots_llm_map/pddl/domain.pddl renamed to src/bitbots_behavior/bitbots_llm_map/pddl/domain.pddl

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from distutils.core import setup
2+
3+
from catkin_pkg.python_setup import generate_distutils_setup
4+
5+
d = generate_distutils_setup(packages=["bitbots_llm_map"], package_dir={"": "src"})
6+
7+
setup(**d)

0 commit comments

Comments
 (0)