mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-16 01:30:35 +08:00
vmount: publish mount_status
We need feedback in mavlink about the attitude of the gimbal. Therefore the gimbal output angles are published in vmount.
This commit is contained in:
@@ -41,8 +41,10 @@
|
||||
#include "output.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_global_position.h>
|
||||
#include <uORB/topics/mount_status.h>
|
||||
#include <px4_defines.h>
|
||||
#include <geo/geo.h>
|
||||
#include <math.h>
|
||||
@@ -81,6 +83,18 @@ int OutputBase::initialize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OutputBase::publish()
|
||||
{
|
||||
int instance;
|
||||
mount_status_s mount_status;
|
||||
|
||||
for (unsigned i = 0; i < 3; ++i) {
|
||||
mount_status.attitude_euler_angle[i] = _angle_outputs[i];
|
||||
}
|
||||
|
||||
orb_publish_auto(ORB_ID(mount_status), &_mount_status_pub, &mount_status, &instance, ORB_PRIO_DEFAULT);
|
||||
}
|
||||
|
||||
float OutputBase::_calculate_pitch(double lon, double lat, float altitude,
|
||||
const vehicle_global_position_s &global_position)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user