Skip to content

Commit

Permalink
Revert "fix bug in a spawner component (#725)"
Browse files Browse the repository at this point in the history
This reverts commit bbaece1.

Signed-off-by: Jan Hanca <[email protected]>
Signed-off-by: Mateusz Zak <[email protected]>
  • Loading branch information
zakmat authored and jhanca-robotecai committed Oct 31, 2024
1 parent 1af2de0 commit 0ffe3c2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Gems/ROS2/Code/Source/Spawner/ROS2SpawnerComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,8 @@ namespace ROS2
PreSpawn(id, view, transform, spawnableName, spawnableNamespace);
};

optionalArgs.m_completionCallback = [service_handle, header, ticketName, parentId = GetEntityId()](auto id, auto view)
optionalArgs.m_completionCallback = [service_handle, header, ticketName](auto id, auto view)
{
if (!view.empty())
{
const AZ::Entity* root = *view.begin();
auto* transformInterface = root->FindComponent<AzFramework::TransformComponent>();
transformInterface->SetParent(parentId);
}
SpawnEntityResponse response;
response.success = true;
response.status_message = ticketName.c_str();
Expand All @@ -275,6 +269,7 @@ namespace ROS2

auto* transformInterface = root->FindComponent<AzFramework::TransformComponent>();
transformInterface->SetWorldTM(transform);
transformInterface->SetParent(GetEntityId());

AZStd::string instanceName = AZStd::string::format("%s_%d", spawnableName.c_str(), m_counter++);
for (AZ::Entity* entity : view)
Expand Down

0 comments on commit 0ffe3c2

Please sign in to comment.