15 #include <unordered_map> 25 tf2_listener(tf2_buffer, true),
35 gps_satellites_visible(0),
38 fcu_caps_known(false),
45 egm96_5 = std::make_shared<GeographicLib::Geoid>(
"egm96-5",
"",
true,
true);
47 catch (
const std::exception &
e) {
50 " | Run install_geographiclib_dataset.sh script in order to install Geoid Model dataset!");
146 geometry_msgs::Quaternion q;
147 q.w = 1.0; q.x = q.y = q.z = 0.0;
159 geometry_msgs::Quaternion q;
160 q.w = 1.0; q.x = q.y = q.z = 0.0;
172 geometry_msgs::Vector3 v;
173 v.x = v.y = v.z = 0.0;
185 geometry_msgs::Vector3 v;
186 v.x = v.y = v.z = 0.0;
195 float eph,
float epv,
196 int fix_type,
int satellites_visible)
230 geometry_msgs::TransformStamped static_transformStamped;
233 static_transformStamped.header.frame_id = frame_id;
234 static_transformStamped.child_frame_id = child_id;
std::atomic< uint8_t > autopilot
sensor_msgs::NavSatFix::Ptr gps_fix
void publish_static_transform(const std::string &frame_id, const std::string &child_id, const Eigen::Affine3d &tr)
Publishes static transform.
geometry_msgs::Quaternion get_attitude_orientation_enu()
Get Attitude orientation quaternion.
MAV_AUTOPILOT get_autopilot()
Returns autopilot type.
void update_connection_status(bool conn_)
void transformEigenToMsg(const Eigen::Affine3d &e, geometry_msgs::Transform &m)
sensor_msgs::Imu::Ptr imu_enu_data
mavlink::common::MAV_TYPE MAV_TYPE
mavlink::common::MAV_AUTOPILOT MAV_AUTOPILOT
tf2_ros::StaticTransformBroadcaster tf2_static_broadcaster
std::function< void(bool)> ConnectionCb
geometry_msgs::Quaternion get_attitude_orientation_ned()
Get Attitude orientation quaternion.
void update_capabilities(bool known, uint64_t caps=0)
void update_attitude_imu_enu(sensor_msgs::Imu::Ptr &imu)
Store IMU data [ENU].
std::atomic< uint8_t > type
#define ROS_FATAL_STREAM(args)
std::shared_ptr< GeographicLib::Geoid > egm96_5
Geoid dataset used to convert between AMSL and WGS-84.
void add_connection_change_handler(ConnectionCb cb)
Add connection change handler callback.
geometry_msgs::Vector3 get_attitude_angular_velocity_ned()
Get angular velocity from IMU data.
std::lock_guard< std::recursive_mutex > lock_guard
std::atomic< bool > connected
static uint64_t get_default_caps(UAS::MAV_AUTOPILOT ap_type)
std::atomic< bool > fcu_caps_known
sensor_msgs::Imu::Ptr get_attitude_imu_ned()
Get IMU data [NED].
std::recursive_mutex mutex
void update_heartbeat(uint8_t type_, uint8_t autopilot_, uint8_t base_mode_)
Eigen::Quaterniond quaternion_from_rpy(const Eigen::Vector3d &rpy)
Convert euler angles to quaternion.
sensor_msgs::NavSatFix::Ptr get_gps_fix()
Retunrs last GPS RAW message.
uint64_t get_capabilities()
PX4 custom mode constantsPX4 custom flight modes.
std::atomic< uint8_t > base_mode
ROSCPP_DECL void shutdown()
sensor_msgs::Imu::Ptr imu_ned_data
void update_attitude_imu_ned(sensor_msgs::Imu::Ptr &imu)
Store IMU data [NED].
sensor_msgs::Imu::Ptr get_attitude_imu_enu()
Get IMU data [ENU].
void update_gps_fix_epts(sensor_msgs::NavSatFix::Ptr &fix, float eph, float epv, int fix_type, int satellites_visible)
Store GPS RAW data.
std::atomic< uint64_t > fcu_capabilities
geometry_msgs::Vector3 get_attitude_angular_velocity_enu()
Get angular velocity from IMU data.
int gps_satellites_visible
std::vector< ConnectionCb > connection_cb_vec
constexpr std::underlying_type< _T >::type enum_value(_T e)
void get_gps_epts(float &eph, float &epv, int &fix_type, int &satellites_visible)
Returns EPH, EPV, Fix type and satellites visible.
std::shared_ptr< MAVConnInterface > Ptr