Skip to content

Commit

Permalink
Update Getentity state to return normalized quatanion and relative to…
Browse files Browse the repository at this point in the history
… refrecne (#17)
  • Loading branch information
yuokamoto authored Oct 18, 2021
1 parent c54d106 commit 71a1955
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ void ASimulationState::GetEntityStateSrv(UROS2GenericSrv* Service)
}
AActor* Entity = Entities[Request.name];
Response.state_name = Request.name;
FVector Pos = Entity->GetActorLocation() / 100.f - RefPos;
FVector Pos = RefQuat.Inverse().RotateVector(Entity->GetActorLocation() / 100.f - RefPos);
Response.state_pose_position_x = Pos.X;
Response.state_pose_position_y = Pos.Y;
Response.state_pose_position_z = Pos.Z;
Response.state_pose_orientation = Entity->GetActorQuat() * RefQuat.Inverse();
Response.state_pose_orientation.Normalize();
LeftToRight(Response.state_pose_position_x,
Response.state_pose_position_y,
Response.state_pose_position_z,
Expand Down

0 comments on commit 71a1955

Please sign in to comment.