19 #include <mavros_msgs/OnboardComputerStatus.h> 22 namespace extra_plugins {
59 mavlink::common::msg::ONBOARD_COMPUTER_STATUS status {};
60 status.time_usec = req->header.stamp.toNSec() / 1000;
85 status.uptime = req->uptime;
86 status.type = req->type;
87 status.temperature_board = req->temperature_board;
88 status.ram_usage = req->ram_usage;
89 status.ram_total = req->ram_total;
90 std::copy(req->cpu_cores.cbegin(), req->cpu_cores.cend(), status.cpu_cores.begin());
91 std::copy(req->cpu_combined.cbegin(), req->cpu_combined.cend(), status.cpu_combined.begin());
92 std::copy(req->gpu_cores.cbegin(), req->gpu_cores.cend(), status.gpu_cores.begin());
93 std::copy(req->gpu_combined.cbegin(), req->gpu_combined.cend(), status.gpu_combined.begin());
94 std::copy(req->temperature_core.cbegin(), req->temperature_core.cend(), status.temperature_core.begin());
95 std::copy(req->fan_speed.cbegin(), req->fan_speed.cend(), status.fan_speed.begin());
96 std::copy(req->storage_type.cbegin(), req->storage_type.cend(), status.storage_type.begin());
97 std::copy(req->storage_usage.cbegin(), req->storage_usage.cend(), status.storage_usage.begin());
98 std::copy(req->storage_total.cbegin(), req->storage_total.cend(), status.storage_total.begin());
99 std::copy(req->link_type.cbegin(), req->link_type.cend(), status.link_type.begin());
100 std::copy(req->link_tx_rate.cbegin(), req->link_tx_rate.cend(), status.link_tx_rate.begin());
101 std::copy(req->link_rx_rate.cbegin(), req->link_rx_rate.cend(), status.link_rx_rate.begin());
102 std::copy(req->link_tx_max.cbegin(), req->link_tx_max.cend(), status.link_tx_max.begin());
103 std::copy(req->link_rx_max.cbegin(), req->link_rx_max.cend(), status.link_rx_max.begin());
106 std::cout <<
"timestamp: " << status.time_usec <<
"\n";
108 UAS_FCU(
m_uas)->send_message_ignore_drop(status, req->component);
std::shared_ptr< MAVConnInterface const > ConstPtr
void status_cb(const mavros_msgs::OnboardComputerStatus::ConstPtr &req)
Send onboard computer status to FCU and groundstation.
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void initialize(UAS &uas_) override
ros::NodeHandle status_nh
#define UAS_FCU(uasobjptr)
OnboardComputerStatusPlugin()
std::vector< HandlerInfo > Subscriptions
void initialize(UAS &uas_) override
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
ros::Subscriber status_sub
Subscriptions get_subscriptions() override