def __init__(self, project, name): Task.__init__(self) Persistent.__init__(self, project.persistent, name) self.name = name self.fhs = FHS.shared(project) project.option_collector.option_decls.add(self.__class__) self.check_missing = project.options.get('check-missing', 'yes') != 'no'
def __init__(self, config_node): Task.__init__(self) self.route_node = getNode('/task/route', True) self.ap_node = getNode('/autopilot', True) self.nav_node = getNode("/navigation", True) self.targets_node = getNode('/autopilot/targets', True) self.alt_agl_ft = 0.0 self.speed_kt = 30.0 self.saved_fcs_mode = '' self.saved_nav_mode = '' self.saved_agl_ft = 0.0 self.saved_speed_kt = 0.0 self.name = config_node.getString('name') self.nickname = config_node.getString('nickname') self.coord_path = config_node.getString('coord_path') self.alt_agl_ft = config_node.getFloat('altitude_agl_ft') self.speed_kt = config_node.getFloat('speed_kt') # load a route if included in config tree if control.route.build(config_node): control.route.swap() else: print 'Detected an internal inconsistency in the route' print ' configuration. See earlier errors for details.' quit()
def __init__(self, url, path=None, overwrite=False, **kwargs): Task.__init__(self) self.url = url self.path = path self.overwrite = overwrite self.kwargs = kwargs self.size = 0
def __init__(self, robot, q_ref, exclude_dofs=None, **kwargs): """ Create task. INPUT: - ``robot`` -- a Robot object """ assert len(q_ref) == robot.nb_dofs J_posture = eye(robot.nb_dofs) if exclude_dofs is None: exclude_dofs = [] if robot.has_free_flyer: # don't include free-flyer coordinates exclude_dofs.extend([ robot.TRANS_X, robot.TRANS_Y, robot.TRANS_Z, robot.ROT_Y]) for i in exclude_dofs: J_posture[i, i] = 0. def pos_residual(): e = (q_ref - robot.q) for j in exclude_dofs: e[j] = 0. return e def jacobian(): return J_posture Task.__init__(self, jacobian, pos_residual=pos_residual, **kwargs)
def __init__(self, message, hosts): Task.__init__(self) self.__message = message self.__hosts = hosts with database.transaction() as t: t.execute("SELECT CURRENT_TIMESTAMP AT TIME ZONE 'UTC'") (self.__batch_time,) = t.fetchone()
def __init__(self, conf): Task.__init__(self, conf) self.name = "Nginx" self.addRequiredFields(["base_dir", "domain_name", "nginx_template_url"]) self.packages = ["nginx"] self.checkRequiredConf(conf)
def __init__(self, robot, link, target, **kwargs): if hasattr(target, 'robot_link'): # used for ROS communications target.robot_link = link.index # dirty elif type(target) is list: target = array(target) def _pos_residual(target_pose): residual = target_pose - link.pose if dot(residual[0:4], residual[0:4]) > 1.: return _oppose_quat * target_pose - link.pose return residual if hasattr(target, 'pose'): def pos_residual(): return _pos_residual(target.pose) elif type(target) is ndarray: def pos_residual(): return _pos_residual(target) else: # link frame target should be a pose raise Exception("Target %s has no 'pose' attribute" % type(target)) def jacobian(): return robot.compute_link_pose_jacobian(link) self.link = link Task.__init__(self, jacobian, pos_residual=pos_residual, **kwargs)
def __init__(self, conf): Task.__init__(self,conf) self.name = 'Django Install' self.addRequiredFields(['django_url','base_dir','domain_name']) self.packages = ['cron','python-mysqldb'] self.checkRequiredConf(conf)
def __init__(self, foot = core.Kick.RIGHT, desiredDistance = 2000.0): Task.__init__(self) self.kickRunning = False self.postKick = False self.foot = foot self.desiredDistance = desiredDistance self.sm = SimpleStateMachine(['startup', 'kicking', 'finish'])
def __init__(self, message, hosts): Task.__init__(self) self.__message = message self.__hosts = hosts with database.transaction() as t: t.execute("SELECT CURRENT_TIMESTAMP AT TIME ZONE 'UTC'") (self.__batch_time, ) = t.fetchone()
def __init__(self, pose, time = 0.50, reverse=False): Task.__init__(self) self.pose = pose self.time = time self.reverse = reverse walk_request.noWalk() kick_request.setNoKick()
def __init__(self, conf): Task.__init__(self,conf) self.name = 'MySql' self.packages = ['mysql-server','mysql-client'] self.addRequiredFields(['mysql_username','mysql_database_name','mysql_password']) Task.checkRequiredConf(self,conf)
def __init__(self, config, is_append=False): name = 'append_file_stat_task' if is_append else 'generate_file_stat_task' Task.__init__(self, name) self._config = config self._is_append = is_append self._stat_cache = {} self._cache_path = os.path.join(self._config['build_cache_dir'], 'stat_cache.json')
def __init__(self, tasks_list, name, image="<obrazek>", description="<opis>"): Task.__init__(self, name, image, description) self.tasks_list = tasks_list
def __init__(self): Task.__init__(self, name="Idle", priority=-1, creationTime=0, totalCpuTime=-1, ioList=IOList([]))
def __init__(self, options, option_collector): Task.__init__(self) option_collector.option_decls.add(self.__class__) src_path = options.get('src-dir', None) if src_path is None: src_path = os.getcwd() bld_path = options.get('bld-dir', None) if bld_path is None: bld_path = os.path.join(src_path, '++wonderbuild') if src_path == bld_path: raise Exception, 'build dir and source dir are the same' self.list_aliases = 'list-tasks' in options self.task_aliases = {} # {name: [tasks]} aliases = options.get('tasks', None) if aliases is not None: if len(aliases) != 0: self.requested_task_aliases = aliases.split(',') else: self.requested_task_aliases = (None,) else: self.requested_task_aliases = None # TODO See note in PurgeablePersistentDict if False: self.global_purge = options.get('purge-persistent', 'no') != 'no' else: self.global_purge = False self.processsing = False gc_enabled = gc.isenabled() if gc_enabled: try: gc.disable() except NotImplementedError: pass # jython uses the gc of the jvm try: try: f = open(os.path.join(bld_path, 'persistent.pickle'), 'rb') except IOError: raise else: try: if __debug__ and is_debug: t0 = time.time() pickle_abi_sig = cPickle.load(f) if pickle_abi_sig != abi_sig: print >> sys.stderr, colored('33', 'wonderbuild: abi sig changed: discarding persistent pickle file => full rebuild will be performed') persistent = PurgeablePersistentDict() else: persistent = cPickle.load(f) if __debug__ and is_debug: debug('project: pickle: load time: ' + str(time.time() - t0) + ' s') except: print >> sys.stderr, colored('33', 'wonderbuild: could not load persistent pickle file => full rebuild will be performed') import traceback; traceback.print_exc() raise finally: f.close() except: persistent = PurgeablePersistentDict() finally: if gc_enabled: gc.enable() self.fs = FileSystem(persistent) self.top_src_dir = self.fs.cur / src_path bld_dir = self.fs.cur / bld_path SharedTaskHolder.__init__(self, persistent, options, option_collector, bld_dir)
def __init__(self, config_node): Task.__init__(self) self.task_node = getNode("/task", True) self.ap_node = getNode("/autopilot", True) self.engine_node = getNode("/controls/engine", True) self.saved_fcs_mode = "" self.name = config_node.getString("name") self.nickname = config_node.getString("nickname")
def __init__(self, dest = 115 * core.DEG_T_RAD, stepSize = 26 * core.DEG_T_RAD, skipFirstPause = False): Task.__init__(self) self.dest = dest self.stepSize = stepSize self.pauseTime = 0.2083 self.skipFirstPause = skipFirstPause self.isPaused = True self.timer = util.Timer()
def __init__(self, time = 3.0): Task.__init__(self) self.subtask = skills.PoseSequence( cfgpose.blockright, 1.0, cfgpose.blockright, time, cfgpose.sittingPoseNoArms, 2.0, cfgpose.standingPose, 2.0 )
def __init__(self, x, y, z, roll, pitch, yaw): Task.__init__(self) self.x = x self.y = y self.z = z self.roll = roll self.pitch = pitch self.yaw = yaw
def __init__(self, fname=None): Task.__init__(self, fname) self.isMetallic = self.config.getboolean('KConverger','isMetallic') self.kInit = [ int(k) for k in split(self.config.get('KConverger','kInit')) ] self.kStep = [ int(k) for k in split(self.config.get('KConverger','kStep')) ] self.kConverger()
def __init__(self, config_node): Task.__init__(self) self.sensors_node = getNode("/sensors", True) self.gps_node = getNode("/sensors/gps", True) self.home_node = getNode("/task/home", True) self.task_node = getNode("/task", True) self.completed = False self.name = config_node.getString("name") self.nickname = config_node.getString("nickname")
def __init__(self, maxPan = 2.0, period = 3.0, numSweeps = 1, direction = 1): Task.__init__(self) self.maxPan = maxPan self.period = period self.numSweeps = numSweeps self.direction = direction self.intDirection = direction self.sweepCounter = 0 self.state = state.SimpleStateMachine(['firstScan', 'nextScans'])
def __init__(self,*args,**kwargs): # these values are part of the task state self._statemembers = ['__user__','__key__','__host__'] Task.__init__(self, *args, **kwargs ) if not 'stateobj' in kwargs: self._initWG_Task()
def __init__(self, maxPan=2.0, period=3.0, numSweeps=1, direction=1): Task.__init__(self) self.maxPan = maxPan self.period = period self.numSweeps = numSweeps self.direction = direction self.intDirection = direction self.sweepCounter = 0 self.state = state.SimpleStateMachine(['firstScan', 'nextScans'])
def __init__(self, config_node): Task.__init__(self) self.pos_node = getNode("/position", True) self.home_node = getNode("/task/home", True) self.home_node.setBool("valid", False) self.startup_node = getNode("/task/startup", True) self.gps_node = getNode("/sensors/gps", True) self.name = config_node.getString("name") self.nickname = config_node.getString("nickname")
def __init__(self, task_id, data, remote_source): '''inits the remote task from an object representing some remote source''' Task.__init__(self) self._uid = task_id self.remote_source = remote_source self._data = data self.update(fetch=False)
def __init__(self,*args,**kwargs): self._statemembers = [ '_par', '_repeat', '_config_name', '_script_name' ] Task.__init__(self, *args, **kwargs ) if len(args) == 5: self.display( OUTPUT_DEBUG, 'calling initializer for SurfaceTask' ) self._initSurfaceTask( args[3], args[4] )
def __init__(self): Task.__init__(self) core.kick_request.setNoKick() core.walk_request.noWalk() core.kick_request.kick_running_ = False core.behavior_mem.keeperDiving = core.Dive.NONE self.state = state.SimpleStateMachine(['stop', 'checkarms', 'movearms', 'sit', 'relaxknee', 'relaxbody', 'finish']) self.skippedState = False self.lower_time = 0
def __init__(self, init_pose=np.array([0., 0., 0.1, 0., 0., 0.]), init_velocities=None, init_angle_velocities=None, runtime=5., target_pos=np.array([0., 0., 10.])): """Initialize a TakeOff object.""" # invoking the __init__ of the parent class Task.__init__(self, init_pose, init_velocities, init_angle_velocities, runtime, target_pos)
def __init__(self, adb, config): Task.__init__(self, 'install_apk_task') # reload freeline config from dispatcher import read_freeline_config self._config = read_freeline_config() self._adb = adb self._apk_path = self._config['apk_path'] self._package = self._config['package'] self._launcher = self._config['launcher'] self._cache_dir = self._config['build_cache_dir']
def __init__(self,*args,**kwargs): # these values are part of the task state self._statemembers = ['_run','_ini', '_config_name'] Task.__init__(self, *args, **kwargs ) if len(args) == 4: self.display( OUTPUT_DEBUG, 'calling initializer for OmnetTask' ) self._initOmnetTask( args[3] )
def __init__(self, dest=115 * core.DEG_T_RAD, stepSize=26 * core.DEG_T_RAD, skipFirstPause=False): Task.__init__(self) self.dest = dest self.stepSize = stepSize self.pauseTime = 0.2083 self.skipFirstPause = skipFirstPause self.isPaused = True self.timer = util.Timer()
def __init__(self, string): """Generates a quiz from the inputted notes""" # The number of each type of question created Task.__init__(self) self.notes = None self.questions = [] self.question_index = -1 self.process_notes(string)
def __init__(self, task_dict,drive_functions): ''' Initialize the Gate task give the task description dictionary. Parameters: task_dict: A python dictionary containing the parameters for the waypoint task. Dictionary Form: --------------------------- { "type": "Gate_No_Visision" "name": <task_name> "timeout": <timeout_time_minutes> "line_up_position":<the Yaw/North/East/Depth position to line up too infront of the gate> "stabilization_time": <The time (sec) to wait for stabilization at line_up_position> "move_forward_dist": <The number of feet to move forward in the x direction of the sub to drive through the gate> } drive_functions: An already initialized object of drive functions. This class contains a variety of drive functions that are useful to complete tasks. ''' Task.__init__(self) self.task_dict = task_dict #Unpack the information about the task self.name = self.task_dict["name"] self.type = "Gate_No_Vision" self.timeout = self.task_dict["timeout"] * 60.0 #In Seconds now. #Timer to be used to keep track of how long the task has been going. self.timeout_timer = util_timer.Timer() self.line_up_position = self.task_dict["line_up_position"] self.position_buffer_zone = self.task_dict["position_buffer_zone"] self.depth_buffer_zone = self.task_dict["depth_buffer_zone"] self.yaw_buffer_zone = self.task_dict["yaw_buffer_zone"] self.stabilization_time = self.task_dict["stabilization_time"] self.move_forward_dist = self.task_dict["move_forward_dist"] self.drive_functions = drive_functions #If true, then the sub will attempt to go through the gate backwards self.go_through_gate_backwards = self.task_dict["go_through_gate_backwards"] if(self.go_through_gate_backwards): self.move_forward_dist *= -1 #Reverse the direction to go forward to go backwards desired_yaw = self.line_up_position[0] + 180 #Flip the yaw 180 deg to go backwards if(desired_yaw >= 360): self.line_up_position[0] = 360 - desired_yaw print(self.line_up_position[0]) else: self.line_up_position[0] = desired_yaw
def __init__(self, fname=None): Task.__init__(self, fname) self.isMetallic = self.config.getboolean('KConverger', 'isMetallic') self.kInit = [ int(k) for k in split(self.config.get('KConverger', 'kInit')) ] self.kStep = [ int(k) for k in split(self.config.get('KConverger', 'kStep')) ] self.kConverger()
def __init__(self,*args,**kwargs): if self._statemembers == None: self._statemembers = [] #self._statemembers.append( 'node' ) Task.__init__(self, *args, **kwargs ) if len(args) >= 3: self.display( OUTPUT_DEBUG, 'calling initializer for ControlTask' ) self._initControlTask( )
def __init__(self, config_node): Task.__init__(self) self.task_node = getNode("/task", True) self.ap_node = getNode("/autopilot", True) self.targets_node = getNode("/autopilot/targets", True) self.imu_node = getNode("/sensors/imu", True) self.flight_node = getNode("/controls/flight", True) self.saved_fcs_mode = "" self.timer = 0.0 self.duration_sec = 60.0 self.name = config_node.getString("name") self.nickname = config_node.getString("nickname") self.duration_sec = config_node.getFloat("duration_sec")
def __init__(self, robot, target, **kwargs): """ Add a COM tracking task. INPUT: - ``robot`` -- a CentroidalRobot object - ``target`` -- coordinates or any Body object with a 'pos' attribute """ self.robot = robot jacobian = self.robot.compute_com_jacobian pos_residual = self.compute_pos_residual(target) Task.__init__(self, jacobian, pos_residual=pos_residual, **kwargs)
def __init__(self, robot, **kwargs): """ Minimize the centroidal angular momentum. INPUT: - ``robot`` -- a CentroidalRobot object """ def vel_residual(dt): return zeros((3,)) jacobian = robot.compute_cam_jacobian Task.__init__(self, jacobian, vel_residual=vel_residual, **kwargs)
def __init__(self, config_node): Task.__init__(self) self.flight_node = getNode("/controls/flight", True) self.imu_node = getNode("/sensors/imu", True) self.name = config_node.getString("name") self.nickname = config_node.getString("nickname") if config_node.hasChild("speed_secs"): self.speed_secs = float(config_node.getString("speed_secs")) if self.speed_secs < 1.0: self.speed_secs = 1.0 else: self.speed_secs = 5
def __init__(self, configJson): # (1) Task-constructor: Task.__init__(self) # (2) prepare model-directory self.modelId, self.dirModel = ModelTaskDirBuilder.buildModelTrainTaskDir( configJson) self.pathProgress = os.path.join(self.dirModel, self.prefixProgress) # (3) prepare trainer KerasTrainer.__init__(self) self.text = 'Model Train: Image2D Cls' self.type = 'model-train-image2d-cls' self.basetype = 'model' self.icon = "/frontend/assets/icon/img/img-model1.png"
def __init__(self, fname=None): # Default values, see explanations below: configDic = { 'isNormConserving': 'True', 'ecutInit': '32', 'ecutStep': '4' } Task.__init__(self, fname) self.isNormConserving = self.config.getboolean('EcutConverger','isNormConserving') self.ecutInit = self.config.getfloat('EcutConverger','ecutInit') self.ecutStep = self.config.getfloat('EcutConverger','ecutStep') self.ecutConverger()
def __init__(self, agent, location): Task.__init__(self, agent) self.GotWood = False self.l = location self.working = [False] * 15 self.working[0] = True self.CalcHouseGrid() self.CalcRoof(self.l) self.workingR = [False] * len(self.roof) self.workingR[0] = True self.inrange = False
def __init__(self, config_node): Task.__init__(self) self.act_node = getNode("/actuators", True) self.gps_node = getNode("/sensors/gps", True) self.task_node = getNode("/task", True) # initial defaults are locked down (this is kind of a big deal!) self.master_safety = True self.safety_on_ground = True self.act_node.setBool("throttle_safety", True) self.name = config_node.getString("name") self.nickname = config_node.getString("nickname") self.safety_on_ground = config_node.getBool("safety_on_ground")
def __init__(self, name, command, working_dir=None, endpoint=None): """ :param name: task name :type name: str :param command: command to be executed :type command: str :param working_dir: path to the task's working directory :type working_dir: str :param endpoint: Globus endpoint ID :type endpoint: str """ Task.__init__(self, name, command, working_dir)
def __init__(self, config_node): Task.__init__(self) self.status_node = getNode("/status", True) self.task_node = getNode("/task", True) self.remote_link_node = getNode("/comms/remote_link", True) self.remote_link_node.setString("link", "inactive") self.link_state = False self.push_task = "" self.name = config_node.getString("name") self.nickname = config_node.getString("nickname") self.timeout_sec = config_node.getFloat("timeout_sec") if self.timeout_sec < 1.0: # set a sane default if none provided self.timetout_sec = 60.0 self.action = config_node.getString("action")
def __init__(self, config_node): Task.__init__(self) self.switches = [] self.name = config_node.getString("name") self.nickname = config_node.getString("nickname") children = config_node.getChildren(expand=True) #print "switches task children:", children for child_name in children: if re.match("switch", child_name): switch = Switch(config_node.getChild(child_name)) #print switch.__dict__ self.switches.append(switch)