Improving the example using sweep_look instead of throw_stone as a local tool
Browse files
src/reachy_mini_conversation_app/profiles/example/instructions.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
[identities/witty_identity]
|
| 2 |
-
[passion_for_lobster_jokes]
|
|
|
|
|
|
| 1 |
[identities/witty_identity]
|
| 2 |
+
[passion_for_lobster_jokes]
|
| 3 |
+
You can perform a sweeping look around the room using the "sweep_look" tool to take in your surroundings.
|
src/reachy_mini_conversation_app/{tools → profiles/example}/sweep_look.py
RENAMED
|
@@ -105,7 +105,7 @@ class SweepLook(Tool):
|
|
| 105 |
return_to_center_final = GotoQueueMove(
|
| 106 |
target_head_pose=center_head_pose,
|
| 107 |
start_head_pose=right_head_pose,
|
| 108 |
-
target_antennas=(
|
| 109 |
start_antennas=(current_antenna1, current_antenna2),
|
| 110 |
target_body_yaw=current_body_yaw, # Return to original body yaw
|
| 111 |
start_body_yaw=current_body_yaw - max_angle,
|
|
@@ -121,7 +121,6 @@ class SweepLook(Tool):
|
|
| 121 |
deps.movement_manager.queue_move(return_to_center_final)
|
| 122 |
|
| 123 |
# Calculate total duration and mark as moving
|
| 124 |
-
# left(20s) + hold_left(5s) + center_from_left(20s) + right(20s) + hold_right(5s) + center_final(20s)
|
| 125 |
total_duration = transition_duration * 4 + hold_duration * 2
|
| 126 |
deps.movement_manager.set_moving_state(total_duration)
|
| 127 |
|
|
|
|
| 105 |
return_to_center_final = GotoQueueMove(
|
| 106 |
target_head_pose=center_head_pose,
|
| 107 |
start_head_pose=right_head_pose,
|
| 108 |
+
target_antennas=(current_antenna1, current_antenna2),
|
| 109 |
start_antennas=(current_antenna1, current_antenna2),
|
| 110 |
target_body_yaw=current_body_yaw, # Return to original body yaw
|
| 111 |
start_body_yaw=current_body_yaw - max_angle,
|
|
|
|
| 121 |
deps.movement_manager.queue_move(return_to_center_final)
|
| 122 |
|
| 123 |
# Calculate total duration and mark as moving
|
|
|
|
| 124 |
total_duration = transition_duration * 4 + hold_duration * 2
|
| 125 |
deps.movement_manager.set_moving_state(total_duration)
|
| 126 |
|
src/reachy_mini_conversation_app/profiles/example/throw_stone.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
"""Example of a profile built using a custom tool and custom instructions."""
|
| 2 |
-
|
| 3 |
-
import logging
|
| 4 |
-
from typing import Any, Dict
|
| 5 |
-
|
| 6 |
-
from reachy_mini_conversation_app.tools.core_tools import Tool, ToolDependencies
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
logger = logging.getLogger(__name__)
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
class ThrowStone(Tool):
|
| 13 |
-
"""Example of custom tool call."""
|
| 14 |
-
|
| 15 |
-
name = "throw_stone"
|
| 16 |
-
description = "Throw a stone."
|
| 17 |
-
parameters_schema = {
|
| 18 |
-
"type": "object",
|
| 19 |
-
"properties": {
|
| 20 |
-
"stone_type": {
|
| 21 |
-
"type": "string",
|
| 22 |
-
"description": "Optional type of stone to be thrown.",
|
| 23 |
-
},
|
| 24 |
-
},
|
| 25 |
-
"required": [],
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
async def __call__(self, deps: ToolDependencies, **kwargs: Any) -> Dict[str, Any]:
|
| 29 |
-
"""Execute the throw_stone tool."""
|
| 30 |
-
stone_type = kwargs.get("stone_type", "Default stone")
|
| 31 |
-
logger.info(f"🥌 Throwing stone of type {stone_type}")
|
| 32 |
-
return {"status": "A stone has been thrown", "stone_type": stone_type}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/reachy_mini_conversation_app/profiles/example/tools.txt
CHANGED
|
@@ -1,15 +1,14 @@
|
|
| 1 |
# SELECT THE TOOLS YOU WANT TO ENABLE
|
| 2 |
|
| 3 |
dance
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
# camera
|
| 8 |
# do_nothing
|
| 9 |
# head_tracking
|
| 10 |
# move_head
|
| 11 |
-
sweep_look
|
| 12 |
|
| 13 |
# AN EXAMPLE OF A CUSTOM TOOL DEFINED LOCALLY
|
| 14 |
-
|
| 15 |
|
|
|
|
| 1 |
# SELECT THE TOOLS YOU WANT TO ENABLE
|
| 2 |
|
| 3 |
dance
|
| 4 |
+
stop_dance
|
| 5 |
+
play_emotion
|
| 6 |
+
stop_emotion
|
| 7 |
# camera
|
| 8 |
# do_nothing
|
| 9 |
# head_tracking
|
| 10 |
# move_head
|
|
|
|
| 11 |
|
| 12 |
# AN EXAMPLE OF A CUSTOM TOOL DEFINED LOCALLY
|
| 13 |
+
sweep_look
|
| 14 |
|