Skip to content

Commit

Permalink
feat: apply ros2_message_to_dict to GetROS2TransformTool output
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejmajek committed Jan 25, 2025
1 parent 382f139 commit 0697d45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rai/rai/tools/ros2/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ def _run(self, tool_input: GetROS2TransformToolInput) -> str:
source_frame=tool_input.source_frame,
timeout_sec=tool_input.timeout_sec,
)
return str(transform)
return stringify_dict(ros2_message_to_dict(transform))
3 changes: 2 additions & 1 deletion tests/tools/test_tool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from typing import Any, Dict, List, Type

import pytest
from geometry_msgs.msg import Point
from geometry_msgs.msg import Point, TransformStamped
from langchain_core.messages import AIMessage, ToolCall
from langchain_core.tools import BaseTool
from nav2_msgs.action import NavigateToPose
Expand Down Expand Up @@ -72,6 +72,7 @@ def _run(self, tool_input: TestToolInput) -> str:
Point(),
Image(),
TFMessage(),
TransformStamped(),
NavigateToPose.Goal(),
NavigateToPose.Result(),
NavigateToPose.Feedback(),
Expand Down

0 comments on commit 0697d45

Please sign in to comment.