|
|
|
@ -89,6 +89,7 @@
@@ -89,6 +89,7 @@
|
|
|
|
|
#include <uORB/topics/orbit_status.h> |
|
|
|
|
#include <uORB/topics/position_controller_status.h> |
|
|
|
|
#include <uORB/topics/position_setpoint_triplet.h> |
|
|
|
|
#include <uORB/topics/rpm.h> |
|
|
|
|
#include <uORB/topics/sensor_baro.h> |
|
|
|
|
#include <uORB/topics/sensor_combined.h> |
|
|
|
|
#include <uORB/topics/sensor_mag.h> |
|
|
|
@ -5178,6 +5179,70 @@ protected:
@@ -5178,6 +5179,70 @@ protected:
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MavlinkStreamRawRpm : public MavlinkStream |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
const char *get_name() const override |
|
|
|
|
{ |
|
|
|
|
return MavlinkStreamRawRpm::get_name_static(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static constexpr const char *get_name_static() |
|
|
|
|
{ |
|
|
|
|
return "RAW_RPM"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static constexpr uint16_t get_id_static() |
|
|
|
|
{ |
|
|
|
|
return MAVLINK_MSG_ID_RAW_RPM; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uint16_t get_id() override |
|
|
|
|
{ |
|
|
|
|
return get_id_static(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static MavlinkStream *new_instance(Mavlink *mavlink) |
|
|
|
|
{ |
|
|
|
|
return new MavlinkStreamRawRpm(mavlink); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned get_size() override |
|
|
|
|
{ |
|
|
|
|
return _rpm_sub.advertised() ? MAVLINK_MSG_ID_RAW_RPM + MAVLINK_NUM_NON_PAYLOAD_BYTES : 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
uORB::Subscription _rpm_sub{ORB_ID(rpm)}; |
|
|
|
|
|
|
|
|
|
/* do not allow top copying this class */ |
|
|
|
|
MavlinkStreamRawRpm(MavlinkStreamRawRpm &) = delete; |
|
|
|
|
MavlinkStreamRawRpm &operator = (const MavlinkStreamRawRpm &) = delete; |
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
|
explicit MavlinkStreamRawRpm(Mavlink *mavlink) : MavlinkStream(mavlink) |
|
|
|
|
{} |
|
|
|
|
|
|
|
|
|
bool send(const hrt_abstime t) override |
|
|
|
|
{ |
|
|
|
|
rpm_s rpm; |
|
|
|
|
|
|
|
|
|
if (_rpm_sub.update(&rpm)) { |
|
|
|
|
mavlink_raw_rpm_t msg{}; |
|
|
|
|
|
|
|
|
|
msg.frequency = rpm.indicated_frequency_rpm; |
|
|
|
|
|
|
|
|
|
mavlink_msg_raw_rpm_send_struct(_mavlink->get_channel(), &msg); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const StreamListItem streams_list[] = { |
|
|
|
|
create_stream_list_item<MavlinkStreamHeartbeat>(), |
|
|
|
|
create_stream_list_item<MavlinkStreamStatustext>(), |
|
|
|
@ -5241,7 +5306,8 @@ static const StreamListItem streams_list[] = {
@@ -5241,7 +5306,8 @@ static const StreamListItem streams_list[] = {
|
|
|
|
|
create_stream_list_item<MavlinkStreamAutopilotVersion>(), |
|
|
|
|
create_stream_list_item<MavlinkStreamProtocolVersion>(), |
|
|
|
|
create_stream_list_item<MavlinkStreamFlightInformation>(), |
|
|
|
|
create_stream_list_item<MavlinkStreamStorageInformation>() |
|
|
|
|
create_stream_list_item<MavlinkStreamStorageInformation>(), |
|
|
|
|
create_stream_list_item<MavlinkStreamRawRpm>() |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const char *get_stream_name(const uint16_t msg_id) |
|
|
|
|