37 GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
38 auto result = msgs::SphericalCoordinatesType::LOCAL2;
39 GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION
42 case math::SphericalCoordinates::CoordinateType::ECEF:
43 result = msgs::SphericalCoordinatesType::ECEF;
45 case math::SphericalCoordinates::CoordinateType::GLOBAL:
46 result = msgs::SphericalCoordinatesType::GLOBAL;
48 case math::SphericalCoordinates::CoordinateType::SPHERICAL:
49 result = msgs::SphericalCoordinatesType::SPHERICAL;
51 case math::SphericalCoordinates::CoordinateType::LOCAL:
52 result = msgs::SphericalCoordinatesType::LOCAL;
54 GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
55 case math::SphericalCoordinates::CoordinateType::LOCAL2:
56 result = msgs::SphericalCoordinatesType::LOCAL2;
58 GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION
67 const msgs::SphericalCoordinatesType &_sc)
71 case msgs::SphericalCoordinatesType::ECEF:
72 return math::SphericalCoordinates::CoordinateType::ECEF;
73 case msgs::SphericalCoordinatesType::GLOBAL:
74 return math::SphericalCoordinates::CoordinateType::GLOBAL;
75 case msgs::SphericalCoordinatesType::SPHERICAL:
76 return math::SphericalCoordinates::CoordinateType::SPHERICAL;
77 case msgs::SphericalCoordinatesType::LOCAL:
78 return math::SphericalCoordinates::CoordinateType::LOCAL;
79 GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
80 case msgs::SphericalCoordinatesType::LOCAL2:
81 return math::SphericalCoordinates::CoordinateType::LOCAL2;
82 GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION
86 GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
87 return math::SphericalCoordinates::CoordinateType::LOCAL2;
88 GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION
92inline void Set(gz::msgs::SphericalCoordinates *_msg,
95 if (_data.
Surface() == math::SphericalCoordinates::EARTH_WGS84)
97 _msg->set_surface_model(msgs::SphericalCoordinates::EARTH_WGS84);
99 else if (_data.
Surface() == math::SphericalCoordinates::MOON_SCS)
101 _msg->set_surface_model(msgs::SphericalCoordinates::MOON_SCS);
104 math::SphericalCoordinates::CUSTOM_SURFACE)
106 _msg->set_surface_model(
107 msgs::SphericalCoordinates::CUSTOM_SURFACE);
113 std::cerr <<
"Unrecognized spherical surface type ["
115 <<
"]. Not populating message field." <<
std::endl;
124 const gz::msgs::SphericalCoordinates &_msg)
126 if (_msg.surface_model() == msgs::SphericalCoordinates::EARTH_WGS84)
128 _data->
SetSurface(math::SphericalCoordinates::EARTH_WGS84);
130 else if (_msg.surface_model() == msgs::SphericalCoordinates::MOON_SCS)
132 _data->
SetSurface(math::SphericalCoordinates::MOON_SCS);
134 else if (_msg.surface_model() == msgs::SphericalCoordinates::CUSTOM_SURFACE)
136 _data->
SetSurface(math::SphericalCoordinates::CUSTOM_SURFACE,
137 _msg.surface_axis_equatorial(),
138 _msg.surface_axis_polar());
142 std::cerr <<
"Unrecognized spherical surface type ["
143 << _msg.surface_model()
144 <<
"]. Not populating data field." <<
std::endl;
148 lat.SetDegree(_msg.latitude_deg());
152 lon.SetDegree(_msg.longitude_deg());
156 head.SetDegree(_msg.heading_deg());