I tested this out but didn’t have any luck. I am able to move the gimbal while on the ground but when I send the take off command to the drone, the gimbal locks back to center.
I see this in the ulogcat logs, which seems to indicate that I have in fact replaced the states:
12-31 18:01:15.099 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.relative_move' is not marked as required by any Flight Supervisor state
12-31 18:01:15.099 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.absolute_move' is not marked as required by any Flight Supervisor state
12-31 18:01:15.099 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.lookat_piloting' is not marked as required by any Flight Supervisor state
12-31 18:01:15.099 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.poi_piloting' is not marked as required by any Flight Supervisor state
12-31 18:01:15.099 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.flightplan' is not marked as required by any Flight Supervisor state
12-31 18:01:15.099 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.descent_to_position' is not marked as required by any Flight Supervisor state
12-31 18:01:15.100 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.magic_carpet' is not marked as required by any Flight Supervisor state
12-31 18:01:15.100 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.camera_rotation_move' is not marked as required by any Flight Supervisor state
12-31 18:01:15.100 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.lookat_gotofix' is not marked as required by any Flight Supervisor state
12-31 18:01:15.100 W fsup.StateMachine(fsup-418) : Guidance mode 'com.parrot.missions.default.poi_gotofix' is not marked as required by any Flight Supervisor state
Also, once I am in the air I am not able to move the drone. Is this because I’m using a ground guidance mode? Is there a way I can instead modify the guidance modes so they all unlock the gimbal instead of making a guidance mode and assigning it to all states?
Here is my code that I’m using. It’s a modification to the Hello airsdk mission’s fsup/flying/stage.py
. I have also updated HelloGroundMode’s configure method in guidance/hello.py
to unlock the yaw and pitch of the gimbal.
from fsup.missions.default.flying.stage import FLYING_STAGE as DEF_FLYING_STAGE
from fsup.missions.default.flying.manual import Manual
from fsup.missions.default.flying.flightplan import FlightPlan
from fsup.missions.default.flying.lookat import LookAt
from fsup.missions.default.flying.poi import Poi
from fsup.missions.default.flying.rth import Rth
import samples.hello.guidance.messages_pb2 as my_gdnc_mode_msgs
from ..uid import UID
MY_GUIDANCE_MODE_NAME = UID + ".ground"
class MyManual(Manual):
def enter(self, msg):
super().enter(msg)
self.set_guidance_mode(MY_GUIDANCE_MODE_NAME, my_gdnc_mode_msgs.Config())
class MyFlightPlan(FlightPlan):
def enter(self, msg):
super().enter(msg)
self.set_guidance_mode(MY_GUIDANCE_MODE_NAME, my_gdnc_mode_msgs.Config())
class MyLookAt(LookAt):
def enter(self, msg):
super().enter(msg)
self.set_guidance_mode(MY_GUIDANCE_MODE_NAME, my_gdnc_mode_msgs.Config())
class MyPoi(Poi):
def enter(self, msg):
super().enter(msg)
self.set_guidance_mode(MY_GUIDANCE_MODE_NAME, my_gdnc_mode_msgs.Config())
class MyRth(Rth):
def enter(self, msg):
super().enter(msg)
self.set_guidance_mode(MY_GUIDANCE_MODE_NAME, my_gdnc_mode_msgs.Config())
MY_MANUAL_STATE = {
"name": "manual",
"class": MyManual,
}
MY_FLIGHTPLAN_STATE = {
"name": "flightplan",
"class": MyFlightPlan,
}
MY_LOOKAT_STATE = {
"name": "lookat",
"class": MyLookAt,
}
MY_POI_STATE = {
"name": "poi",
"class": MyPoi,
}
MY_RTH_STATE = {
"name": "rth",
"class": MyRth,
}
FLYING_STAGE = {
"name": "flying",
"class": DEF_FLYING_STAGE["class"],
"initial": "manual",
"children": [MY_MANUAL_STATE, MY_FLIGHTPLAN_STATE, MY_LOOKAT_STATE, MY_POI_STATE, MY_RTH_STATE],
}