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

Adds a message that allows loading environments via a topic #320

Merged
merged 14 commits into from
Aug 4, 2023
Prev Previous commit
Next Next commit
Get rid of compiler
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
  • Loading branch information
arjo129 committed May 10, 2023
commit 101a7238be21e0fdaeb361d34384d58b1099ae1b
25 changes: 17 additions & 8 deletions src/Utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ namespace gz
return math::SphericalCoordinates::CoordinateType::LOCAL;
case msgs::SphericalCoordinatesType::LOCAL2:
return math::SphericalCoordinates::CoordinateType::LOCAL2;
arjo129 marked this conversation as resolved.
Show resolved Hide resolved
}
std::cerr << "Invalid coordinate type passed" << std::endl;
default:
std::cerr << "Invalid coordinate type passed" << std::endl;
}
return math::SphericalCoordinates::CoordinateType::LOCAL2;
}

Expand Down Expand Up @@ -374,20 +375,28 @@ namespace gz
msgs::SphericalCoordinatesType ConvertCoord(
const math::SphericalCoordinates::CoordinateType &_sc)
{
auto result = msgs::SphericalCoordinatesType::LOCAL2;
switch (_sc)
{
case math::SphericalCoordinates::CoordinateType::ECEF:
return msgs::SphericalCoordinatesType::ECEF;
result = msgs::SphericalCoordinatesType::ECEF;
break;
case math::SphericalCoordinates::CoordinateType::GLOBAL:
return msgs::SphericalCoordinatesType::GLOBAL;
result = msgs::SphericalCoordinatesType::GLOBAL;
break;
case math::SphericalCoordinates::CoordinateType::SPHERICAL:
return msgs::SphericalCoordinatesType::SPHERICAL;
result = msgs::SphericalCoordinatesType::SPHERICAL;
break;
case math::SphericalCoordinates::CoordinateType::LOCAL:
return msgs::SphericalCoordinatesType::LOCAL;
result = msgs::SphericalCoordinatesType::LOCAL;
break;
case math::SphericalCoordinates::CoordinateType::LOCAL2:
result = msgs::SphericalCoordinatesType::LOCAL2;
break;
default:
return msgs::SphericalCoordinatesType::LOCAL2;
std::cerr << "Invalid coordinate type passed" << std::endl;
}
std::cerr << "Invalid coordinate type passed" << std::endl;
return result;
}

/////////////////////////////////////////////
Expand Down