mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 06:53:33 +08:00
Update Flight-gear bridge, Add support of TF-G2 autogyro flight-gear model (#19122)
* Add Transfer of RPM from FG to PX4, -switch FG_bridge module to ThudnderFlyaerospace * Add TF-G2 flightgear sim target * Add simulator support, fix astyle * Update SITL TF-G2 airframe, update fg bridge Co-authored-by: Vit Hanousek <vithanousek@seznam.cz>
This commit is contained in:
co-authored by
Vit Hanousek
parent
1a513153be
commit
ed14151734
@@ -76,6 +76,7 @@
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_command_ack.h>
|
||||
#include <uORB/topics/rpm.h>
|
||||
|
||||
#include <random>
|
||||
|
||||
@@ -251,6 +252,9 @@ private:
|
||||
uORB::Publication<vehicle_local_position_s> _lpos_ground_truth_pub{ORB_ID(vehicle_local_position_groundtruth)};
|
||||
uORB::Publication<input_rc_s> _input_rc_pub{ORB_ID(input_rc)};
|
||||
|
||||
//rpm
|
||||
uORB::Publication<rpm_s> _rpm_pub{ORB_ID(rpm)};
|
||||
|
||||
// HIL GPS
|
||||
static constexpr int MAX_GPS = 3;
|
||||
uORB::PublicationMulti<sensor_gps_s> *_sensor_gps_pubs[MAX_GPS] {};
|
||||
|
||||
@@ -424,6 +424,17 @@ void Simulator::handle_message(const mavlink_message_t *msg)
|
||||
case MAVLINK_MSG_ID_HIL_STATE_QUATERNION:
|
||||
handle_message_hil_state_quaternion(msg);
|
||||
break;
|
||||
|
||||
case MAVLINK_MSG_ID_RAW_RPM:
|
||||
mavlink_raw_rpm_t rpm;
|
||||
mavlink_msg_raw_rpm_decode(msg, &rpm);
|
||||
rpm_s rpmmsg{};
|
||||
rpmmsg.timestamp = hrt_absolute_time();
|
||||
rpmmsg.indicated_frequency_rpm = rpm.frequency;
|
||||
rpmmsg.estimated_accurancy_rpm = 0;
|
||||
|
||||
_rpm_pub.publish(rpmmsg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user