Robot

From SweepMe! Wiki
Revision as of 22:03, 28 October 2021 by Afischer (talk | contribs) (Created page with "The Robot module is designed to support multi-axes machines, i.e. robots. It can load drivers which can bringe their own parameters, similar to modules like [Logger] or [Switc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Robot module is designed to support multi-axes machines, i.e. robots. It can load drivers which can bringe their own parameters, similar to modules like [Logger] or [Switch]. A specialty is that each driver can define multiple axes. The sweep value of each axis is forwarded to the driver during [apply] function.


Driver programming

Each driver needs a static variable 'axes' which is a dictionary whose keys define the possible axes:

from EmptyDeviceClass import EmptyDevice  # Loading the EmptyDevice Class

class Device(EmptyDevice):            # Creating a new Device Class by inheriting from EmptyDevice

    axes = {
            "x":{
                "Value": 0.0
                },
            "y":{
                "Value": 300.0
                },
            "z":{
                "Value": 0.0
                },
            "tool":{
                "Value": 0.0
                },
            }


    def __init__(self):              
       EmptyDevice.__init__(self)

For each axis, a further dictionary is defined that can contain further properties, e.g "Value", that defines the default value.

During the function [apply], a dictionary 'self.sweepvalues' contains the values of each axis with keys being the axes names.