Skip to content

Commit

Permalink
[computeProjectionMatrix] always use Z forward
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthou committed Aug 22, 2023
1 parent ce290d7 commit 179a52e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/Perception/Managers/ObjectsPerceptionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,7 @@ std::unordered_set<int> ObjectsPerceptionManager::getObjectsInCamera()
myself_agent_->getFieldOfView().getRatio(),
myself_agent_->getFieldOfView().getClipNear(),
myself_agent_->getFieldOfView().getClipFar());

std::array<double, 3> axes = {1,0,0};
if(myself_agent_->getType() == AgentType_e::ROBOT)
axes = {0,0,1};

Pose target_pose = myself_agent_->getHead()->pose() * Pose(axes, {0,0,0,1});
Pose target_pose = myself_agent_->getHead()->pose() * Pose({0,0,1}, {0,0,0,1});
auto head_pose_trans = myself_agent_->getHead()->pose().arrays().first;
auto target_pose_trans = target_pose.arrays().first;
auto view_matrix = bullet_client_->computeViewMatrix({(float)head_pose_trans[0], (float)head_pose_trans[1], (float)head_pose_trans[2]},
Expand Down
2 changes: 1 addition & 1 deletion src/SituationAssessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void SituationAssessor::processHumans(std::map<std::string, std::unordered_set<i
human.second->getFieldOfView().getRatio(),
human.second->getFieldOfView().getClipNear(),
human.second->getFieldOfView().getClipFar());
Pose target_pose = human.second->getHead()->pose() * Pose({1,0,0}, {0,0,0,1});
Pose target_pose = human.second->getHead()->pose() * Pose({0,0,1}, {0,0,0,1});
auto head_pose_trans = human.second->getHead()->pose().arrays().first;
auto target_pose_trans = target_pose.arrays().first;
auto view_matrix = bullet_client_->computeViewMatrix({(float)head_pose_trans[0], (float)head_pose_trans[1], (float)head_pose_trans[2]},
Expand Down

0 comments on commit 179a52e

Please sign in to comment.