17 #include <unordered_map> 25 using mavlink::common::MAV_SENSOR_ORIENTATION;
36 constexpr
auto DEG_TO_RAD = (M_PI / 180.0);
38 return std::make_pair(name, rot);
124 std::string
to_string(MAV_SENSOR_ORIENTATION orientation)
134 return it->second.first;
144 return Eigen::Quaterniond::Identity();
147 return it->second.second;
156 if (kv.second.first == sensor_orientation)
163 int idx = std::stoi(sensor_orientation, 0, 0);
164 if (0 > idx || sensor_orientations.find(idx) == sensor_orientations.end()) {
165 ROS_ERROR_NAMED(
"uas",
"SENSOR: orientation index out of bound: %d", idx);
171 catch (std::invalid_argument &ex) {
#define ROS_ERROR_STREAM_NAMED(name, args)
std::string to_string(MAV_SENSOR_ORIENTATION orientation)
Eigen::Quaterniond sensor_orientation_matching(mavlink::common::MAV_SENSOR_ORIENTATION orientation)
Function to match the received orientation received by MAVLink msg and the rotation of the sensor rel...
static const OrientationPair make_orientation(const std::string &name, const double roll, const double pitch, const double yaw)
std::string to_string(timesync_mode e)
std::pair< const std::string, const Eigen::Quaterniond > OrientationPair
Eigen::Quaterniond quaternion_from_rpy(const Eigen::Vector3d &rpy)
Convert euler angles to quaternion.
int sensor_orientation_from_str(const std::string &sensor_orientation)
Retrieve sensor orientation number from alias name.
#define ROS_ERROR_NAMED(name,...)
Frame transformation utilities.
static const std::unordered_map< typename std::underlying_type< MAV_SENSOR_ORIENTATION >::type, const OrientationPair > sensor_orientations
constexpr std::underlying_type< _T >::type enum_value(_T e)