Project

General

Profile

Actions

AVBP Mission plugin » History » Revision 11

« Previous | Revision 11/13 (diff) | Next »
Rafael Bailon-Ruiz, 2021-03-11 15:06


AVBP Mission plugin

The AVBP mission plugin is an aircraft plugin, built upon the standard Mission Manager, to supervise adaptive mapping missions.
It is defined in the cams_avbp.plugins.mission module.

Scenario definition

AVBPMission must de declared in the plugins section. The Missions plugin is required and must be included first in the list. Example:
aircrafts:
    200:
        replay: false
        type: 'pprz'
        plugins:
            # Other plugins ...
            - Missions:
                backup_file: '/PATH/TO/backup_200.bin'
                Goto: *goto_defaults
                Segment: *segment_defaults
            - AVBPMission

User remote control

You can make remote procedure calls using the http API, that you can issue with a web browser or from the command line with curl. For instance:

curl -v "http://127.0.0.1:8000/runtime/call_method/?uav_id=200&plugin=AVBPMission&method=stop" 

calls the stop method of the uav 200 defined in the AVBPMission plugin.

Event handlers

Aircraft status handlers

Status messages originated in paparazzi related to the aircraft state and mission execution status.

def flight_param_callback(self, msg):
    """ 
    Receive pprz FLIGHT_PARAM messages

    http://docs.paparazziuav.org/latest/paparazzi_messages.html#FLIGHT_PARAM
    """ 
    pass

def engine_status_callback(self, engineStatus):
    """ 
    Receive pprz ENGINE_STATUS messages

    http://docs.paparazziuav.org/latest/paparazzi_messages.html#ENGINE_STATUS
    """ 
    pass

def mission_status_callback(self, missionStatus):
    """ 
    Receive pprz MISSION_STATUS messages

    http://docs.paparazziuav.org/latest/paparazzi_messages.html#MISSION_STATUS
    """ 
    pass

def nav_status_callback(self, navStatus):
    """ 
    Receive pprz NAV_STATUS messages

    http://docs.paparazziuav.org/latest/paparazzi_messages.html#NAV_STATUS
    """ 
    pass

def ap_status_callback(self, apStatus):
    """ 
    Receive pprz AP_STATUS messages

    http://docs.paparazziuav.org/latest/paparazzi_messages.html#AP_STATUS
    """ 
    pass

Sensor sample handlers

Handler for the internal CAMS event "add_sample". It is called each time a sensor sample is disseminated from another plugin of the same UAV.

def add_sample(self, sample: ty.Union[AbstractSensorSample, SensorSample]):
    """Catch sensor samples coming from other plugins""" 
    pass

Interaction methods

These functions are not called periodically by CAMS, but manually by the operators to trigger certain actions. More can be defined provided by __pluginmethods__ is update accordingly.

def stop(self):
    """Disable the AVBPProbe plugin""" 
    pass

def pause(self, *args, **kwargs):
    """Specific stop signal just for the AVBPMission plugin""" 
    pass

def play(self, *args, **kwargs):
    """Specific start signal just for the AVBPMission plugin

    You can activate this method manually with:
    curl -v "http://127.0.0.1:8000/runtime/call_method/?uav_id=200&plugin=AVBPMission&method=play

    or browsing to http://127.0.0.1:8000/rpc (Call UAV plugin method)
    """ 
    pass

Available commands

The self argument of every plugin method (declared in __pluginmethods__) is the AircraftPprz from nephelae_paparazzi the plugin is attached to.

Create a mission

_logger.debug("Create a 'Goto' test mission")
goto_mission_params = {"wp_east": 500.0, "wp_north": 300.0, "wp_alt": 500.0}
mission = self.create_mission('Goto', insertMode=InsertMode.ReplaceAll,
                                      **goto_mission_params)
_logger.debug("mission %s created", mission)

_logger.debug("Create a 'Segment' test mission")
segment_mission_params = {"segment_east_1": 500.0, "segment_north_1": 300.0,
                                  "segment_east_2": 300.0, "segment_north_2": 500.0,
                                  "segment_alt": 500.0}
mission = self.create_mission('Segment', insertMode=InsertMode.Append,
                                      **segment_mission_params)
_logger.debug("mission %s created", mission)

These missions can either be validated with the gui (operator) OR

Updated by Rafael Bailon-Ruiz over 3 years ago · 11 revisions