Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPS sensor in Gazebo #519

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gps-modifications
Signed-off-by: Dre Westcook <[email protected]>
Dre Westcook committed Dec 30, 2020
commit 1e6300f26db7251812baa9532c96d0ab5a5c00b3
17 changes: 14 additions & 3 deletions src/systems/gps/Gps.cc
Original file line number Diff line number Diff line change
@@ -182,10 +182,21 @@ void GpsPrivate::UpdateGps(const EntityComponentManager &_ecm)
auto it = this->entitySensorMap.find(_entity);
if (it != this->entitySensorMap.end())
{
math::Vector3d linearVel;
math::Vector3d worldCoords;
math::Pose3d worldPose = _worldPose->Data();
it->second->SetLatitude(worldPose.Pos().X());
it->second->SetLongitude(worldPose.Pos().Y());
math::SphericalCoordinates sphericalCoords;

//TODO apply position noise before converting to global frame

worldCoords = sphericalCoords.SphericalFromLocalPosition(
worldPose.Pos()
);

it->second->SetLatitude(worldCoords.X());
it->second->SetLongitude(worldCoords.Y());
//TODO set altitude
//TODO set velocity

//it->second->SetPosition(worldPose.Pos().Z());
//it->second->SetVerticalVelocity(_worldLinearVel->Data().Z());
}