Hey @Yuri_Rage I’m doing vehicle:set_target_angle_and_climbrate(...)
in a lua script while in GUIDED_NOGPS mode, and it seems to correctly set ATT.DesRoll in the logs, but ATT.Roll doesn’t even try to follow DesRoll. Are you aware of any bugs in master related to this? I’m using commit 44c1e9b8. The drone tracks attitude setpoint just fine in STABILIZE mode.
In the image below, I’m logging a custom message BZGO.tvy, and DesRoll is set to 0 by Ardupilot while not in flight. When liftoff happens at 19:01:44.5, DesRoll converges to tvy as my code tells it to, but no matter if tvy/DesRoll are positive or negative, Roll always lazily increases positively.
local roll_setpoint_deg = clamp(velocity_setpoint.y * acc_p, -15, 15) -- +ve (rightwards) acceleration demands +ve roll
local pitch_setpoint_deg = clamp(-velocity_setpoint.x * acc_p, -15, 15) -- +ve (forwards) acceleration demands -ve pitch
local yaw_setpoint_rad = 0.0
local climb_rate_setpoint_ms = 0.1
local use_yaw_rate = true
local yawrate_setpoint_degs = math.rad(15)
-- set vehicle angle and climb rate lua commands: https://github.com/ArduPilot/ardupilot/blob/c7c95e086c0761ec23a3d10a0ba51456fa036f25/libraries/AP_Scripting/docs/docs.lua#L2377
local set_angle_success = vehicle:set_target_angle_and_climbrate(roll_setpoint_deg, pitch_setpoint_deg, yaw_setpoint_rad, climb_rate_setpoint_ms, use_yaw_rate, yawrate_setpoint_degs)