I can't change "NoFlyOverMaxDistance" "MaxAltitude"

Hello.
I want to use Olympe via SkyController4 to change “NoFlyOverMaxDistance” and “MaxAltitude.”
After setting, the values appear to change to the desired ones in the initial message. However, when I perform a status check again, they revert to the default values.
Please let me know if it’s not possible to make changes with Olympe or if there is an issue with the code.

●setter

def setGeofence(skyctrl):
set_dist = 100.0
set_alt = 20.0
skyctrl.connect(retry=5)
skyctrl(setPilotingSource(source=“Controller”)).wait()

assert skyctrl(
    MaxDistance(set_dist)
    >> MaxDistanceChanged()
).wait().success()
print(skyctrl.get_state(MaxDistanceChanged)["current"]) # i can see chaned value
assert skyctrl(
    MaxAltitude(set_alt)
    >> MaxAltitudeChanged()
).wait().success()
print(skyctrl.get_state(MaxAltitudeChanged)["current"]) # i can see chaned value
skyctrl.disconnect()

●getter

def getGeofence(skyctrl):
skyctrl.connect(retry=5)
skyctrl(setPilotingSource(source=“Controller”)).wait()

skyctrl(MaxDistanceChanged(_policy = 'wait'))
Max_Distance = skyctrl.get_state(MaxDistanceChanged)["current"] # i can see chaned value
skyctrl(MaxAltitudeChanged(_policy = 'wait'))
Max_Altitude = skyctrl.get_state(MaxAltitudeChanged)["current"]  # i can see default value[120m]

skyctrl.disconnect()

return Max_Distance, Max_Altitude

This topic was automatically closed after 30 days. New replies are no longer allowed.