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

Potential fix for wildlife encounter animal poses #421

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
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
8 changes: 6 additions & 2 deletions vrx_gazebo/src/wildlife_scoring_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,16 @@ void WildlifeScoringPlugin::PublishAnimalLocations()
// Conversion from Gazebo Cartesian coordinates to spherical.
#if GAZEBO_MAJOR_VERSION >= 8
const ignition::math::Pose3d pose = buoy.link->WorldPose();
const ignition::math::Vector3d position =
this->world->SphericalCoords()->GlobalFromLocal(pose.Pos());
const ignition::math::Vector3d latlon =
this->world->SphericalCoords()->SphericalFromLocal(pose.Pos());
this->world->SphericalCoords()->SphericalFromLocal(position);
#else
const ignition::math::Pose3d pose = buoy.link->GetWorldPose().Ign();
const ignition::math::Vector3d position =
this->world->GetSphericalCoordinates()->GlobalFromLocal(pose.Pos());
const ignition::math::Vector3d latlon =
this->world->GetSphericalCoordinates()->SphericalFromLocal(pose.Pos());
this->world->GetSphericalCoordinates()->SphericalFromLocal(position);
#endif
const ignition::math::Quaternion<double> orientation = pose.Rot();

Expand Down