19 #include <mavros_msgs/CompanionProcessStatus.h> 22 namespace extra_plugins {
27 using mavlink::minimal::MAV_COMPONENT;
68 mavlink::minimal::msg::HEARTBEAT heartbeat {};
70 heartbeat.type =
enum_value(MAV_TYPE::ONBOARD_CONTROLLER);
71 heartbeat.autopilot =
enum_value(MAV_AUTOPILOT::PX4);
72 heartbeat.base_mode =
enum_value(MAV_MODE_FLAG::CUSTOM_MODE_ENABLED);
73 heartbeat.system_status = req->state;
76 utils::to_string_enum<MAV_COMPONENT>(req->component) <<
" companion process status: " <<
77 utils::to_string_enum<MAV_STATE>(heartbeat.system_status) << std::endl << heartbeat.to_yaml());
79 UAS_FCU(
m_uas)->send_message_ignore_drop(heartbeat, req->component);
std::shared_ptr< MAVConnInterface const > ConstPtr
mavlink::minimal::MAV_TYPE MAV_TYPE
#define ROS_DEBUG_STREAM_NAMED(name, args)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
mavlink::minimal::MAV_STATE MAV_STATE
ros::Subscriber status_sub
Subscriptions get_subscriptions() override
#define UAS_FCU(uasobjptr)
mavlink::minimal::MAV_MODE_FLAG MAV_MODE_FLAG
ros::NodeHandle status_nh
void status_cb(const mavros_msgs::CompanionProcessStatus::ConstPtr &req)
Send companion process status to FCU over a heartbeat message.
std::vector< HandlerInfo > Subscriptions
mavlink::minimal::MAV_AUTOPILOT MAV_AUTOPILOT
void initialize(UAS &uas_) override
void initialize(UAS &uas_) override
CompanionProcessStatusPlugin()
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
constexpr std::underlying_type< _T >::type enum_value(_T e)