Skip to content
jmartensen edited this page Oct 26, 2018 · 14 revisions

In Phobos, motors and corresponding controllers are stored in two separate phobostypes and objects. This may be viewed as to complicated for some usecases since most engines like ODE, BulletPhysics or RBDL take direct influence on a certain joint. However, to enable custom motor or controller models, e.g. by Functional Mockup Units, both types have been implemented.

Motors

Adding a Motor

Adding a Motor / Controller / Sensor Definition

Phobos aims to be extendable. Custom definitions can be , simply add an entry to ~/phobos/config/defaultMotors.yml , where all motor information is stored as seen below:

motors:
    # Example motors
    motor_name: # Name within phobos
        general: # General parameters of the motor
            type: super_motor # Internal motor type, maybe used for simulator 
            shape: resource://dc # Graphical representation
            size: 0.2 # Size of the graphical representation
            categories: # Category of the motor
                - generic
        controller: super_controller # Controller used for this controller
        maxSpeed: 3.141 # Default value for the max speed
        maxEffort: 50.0 # Default value for the max effort
        CustomParameter: Foo # Bar

A similar approach can be taken to add or edit current controller models within ~/phobos/config/defaultControllers.yml

controllers:
    # generic controllers
    pid: # Name of the controller
        general: # General information for phobos
            type: PID # Controller type
            shape: resource://pid # Graphical representation
            size: 0.2 # Size of the graphical representation
            categories:  # Categories of the controller
                - generic
                - motor
        p: 20.0 # Parameter of the PID
        i: 1.0
        d: 0.1

Likewise, a new sensor is added by adding an entry to ~/phobos/config/defaultSensors.yml:

sensors:
    # scanning sensors
    Ray_sensor: # Name
        general:  # General parameters of the sensor
            type: ray_sensor # Sensor type, maybe used for simulator
            shape: resource://ray # Graphical representation
            size: 0.2 # Size of the graphical representation
            categories: # Categories of the sensor
                - scanning 
                - SDF
        width: 144 # General parameter follow this line
        height: 1 
        opening_width: &0.5*math.pi& # Special default value for parsing 
        opening_height: &0.5*math.pi& 
        max_distance: 100
        min_distance: 0
        mars: # Special parameter used for exporting to smurf / mars
            type: RaySensor
        sdf: # Special parameters used for SDF export
            type: ray
            scan:
                horizontal:
                    samples: 1
                    resolution: 1
                    min_angle: 0.
                    max_angle: 0.
                vertical:
                    samples: 1
                    resolution: 1
                    min_angle: 0.
                    max_angle: 0.

You are free to add any custom parameter into the definitions you like. However, the information is than parsed according to the related parser and used if the simulation engine is able to interpret the values.

In Phobos, motors do not have a separate visual representation but are represented by the link that also represents the joint they are attached to. Thus, a motor's information is simply stored inside the appropriate link using the motor namespace.

Every motor in Phobos needs to specify a name, a type, and maximum values for effort and velocity (maxEffort / maxSpeed). The motor types currently supported by Phobos are PID and DC, with the former additionally specifying p, i, and d values. <<<<<<< HEAD

TODO how to use the operator TODO add image

phobosV1

Clone this wiki locally