vmount: Add parameters for servo range and offset and whether to stabilize (#8120).

Adds MNT_DO_STAB for whether to stabilize by default.
Adds MNT_RANGE_{PITCH,ROLL,YAW} for the output range of each output channel in AUX mode (instead of hardcoded 360 degrees).
Adds MNT_OFF_{PITCH,ROLL,YAW} for adjusting the zero point of each output channel.
This commit is contained in:
Matthew Edwards
2017-10-25 11:30:31 +02:00
committed by Beat Küng
parent 8ec59f0bc9
commit 2f40bc3a78
7 changed files with 149 additions and 13 deletions
+3 -3
View File
@@ -113,9 +113,9 @@ int OutputMavlink::update(const ControlData *control_data)
// vmount spec has roll, pitch on channels 0, 1, respectively; MAVLink spec has roll, pitch on channels 1, 0, respectively
// vmount uses radians, MAVLink uses degrees
vehicle_command.param1 = _angle_outputs[1] * M_RAD_TO_DEG_F;
vehicle_command.param2 = _angle_outputs[0] * M_RAD_TO_DEG_F;
vehicle_command.param3 = _angle_outputs[2] * M_RAD_TO_DEG_F;
vehicle_command.param1 = _angle_outputs[1] * M_RAD_TO_DEG_F + _config.pitch_offset;
vehicle_command.param2 = _angle_outputs[0] * M_RAD_TO_DEG_F + _config.roll_offset;
vehicle_command.param3 = _angle_outputs[2] * M_RAD_TO_DEG_F + _config.yaw_offset;
orb_publish(ORB_ID(vehicle_command), _vehicle_command_pub, &vehicle_command);