Methods

Methods are basically functions that are members of a class. The syntax and the usage of available methods in a MatMav object is described below.

MatMav

This is the calss constructor, and the first method that should be used to create the MatMav object. If used with no arguments, it creates an object that can connect to one target. If a positive integer argument is used (e.g. 1,2,3,...), it represents the number of target systems(vehicles).

The created object is used by all other member methods.

  • Syntax:
    % to create an object for one vehicle
    obj=MatMav();
    % or, for multiple vehicles, use
    obj=MatMav(<number of target systems>)
    
  • Example:
    mav=MatMav(2);
    
set_number_of_target_sytems

Sets the number of target vehicles (e.g. Pixhawks) to communicate with simultaneously. This method set the number_of_target_sytems property. The default is 1. Setting this property is only allowed before any serial or UDP connection. Setting this property modifies the initialization of variables sizes.

  • Syntax:
    obj.set_number_of_target_sytems(<number of targets>);
    
  • Example:
    % set number of targets to 2
    obj.set_number_of_target_sytems(2);
    

results matching ""

    No results matching ""