# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/10_webots.ipynb.

# %% auto 0
__all__ = ['WebotsHelper']

# %% ../nbs/10_webots.ipynb 3
class WebotsHelper():
    
    def __init__(self, name=None, mode=1):
        self.name = name
        self.mode = mode
        if self.mode==1:
            self.sensor_names = [ 'LHipPitch', 'LKneePitch', 'LAnklePitch', 'RHipPitch', 'RKneePitch', 'RAnklePitch']
            self.num_sensors=len(self.sensor_names)
            self.num_links=self.num_sensors

    def get_sensor_indexes(self):
        if self.mode==1:
            return [i for i in range(self.num_sensors)]
        
        
    def get_sensor_names(self):
        return self.sensor_names

    def get_references(self):
        if self.mode==1:
            return [0.5]#[i for i in range(self.num_sensors)]
        
    def get_sensor_values(self, msg):            
        return list(msg.values())
    
    def get_num_links(self):
        return self.num_links
        
    def get_actions_dict(self, inputs):
        actions = {}
        for i in range(len(inputs)):
            actions[self.sensor_names[i]]=round(inputs[i], 3)
                               
        return actions
