Move using pitch and roll in guided mode

Hello everyone

I am new to using LUA scripts and I would like to be able to move my drone via roll and pitch while remaining in GUIDED mode. To do this, I use this function:

location:offset_bearing(move_bearing, move_distance)

where move_bearing is calculated using the drone’s longitude and latitude and move_distance is a percentage of the PWM returned by my joysticks. However, when I run the LUA script and try to move my drone, it does not move Despite the fact that “gcs (6, string.format(“Moving %.2f meters towards %.2f degrees”, move_distance, move_bearing))” returns consistent movement values.

I wanted to know exactly how the function Location_ud:offset_bearing(bearing_deg, distance) works and if it is the right method to move the drone with joysticks in Guided mode. If it is not the right way to do it and you have other suggestions, it would help me a lot to know your recommendations and how to integrate them into a LUA script.

Thank you in advance.