Skip to content

Commit 795a9b0

Browse files
authored
fix: pass copied goal to set_message_fields as it modifies goal contents in ROS 2 Jazzy (#699)
1 parent 8ec2eb3 commit 795a9b0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/rai_core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "rai_core"
7-
version = "2.5.0"
7+
version = "2.5.1"
88
description = "Core functionality for RAI framework"
99
authors = ["Maciej Majek <[email protected]>", "Bartłomiej Boczek <[email protected]>", "Kajetan Rachwał <[email protected]>"]
1010
readme = "README.md"

src/rai_core/rai/communication/ros2/api/action.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ def send_goal(
213213

214214
action_cls = import_message_from_str(action_type)
215215
action_goal = action_cls.Goal() # type: ignore
216-
rosidl_runtime_py.set_message.set_message_fields(action_goal, goal)
216+
rosidl_runtime_py.set_message.set_message_fields(
217+
action_goal, copy.deepcopy(goal)
218+
)
217219

218220
action_client = ActionClient(self.node, action_cls, action_name)
219221
if not action_client.wait_for_server(timeout_sec=timeout_sec): # type: ignore

0 commit comments

Comments
 (0)