Differences

This shows you the differences between two versions of the page.

Link to this comparison view

doc:pycram:process_modules [2021/06/10 12:01] – created jdechdoc:pycram:process_modules [2021/06/11 08:29] (current) jdech
Line 26: Line 26:
         else:         else:
             logerr(f"No Process Module could be found for robot {robot_name}")             logerr(f"No Process Module could be found for robot {robot_name}")
- </code+ </code>
 The robot name is the name of the currently loaded robot extracted from the robot description.  The robot name is the name of the currently loaded robot extracted from the robot description. 
 The robot type is a class attribute of the ProcessModule class which is set in the high-level plan with either the decorator 'with_real_robot' or the with statement.  The robot type is a class attribute of the ProcessModule class which is set in the high-level plan with either the decorator 'with_real_robot' or the with statement. 
 Lastly, the type is the cmd property of the motion designator for which the process module is being chosen.  Lastly, the type is the cmd property of the motion designator for which the process module is being chosen. 
  
 +Too differentiate between the process modules for the real and simulated robot, two dictionary's need to be created. For choosing the process module simply the type can be used after evaluating if the process module should be for the real or simulated robot. 
 +
 +This method for choosing a process module then needs to be registered as a resolver, this is done by appending the method to the list of resolvers in the ProcessModule class atribute. An example of this can be seen below
 +<code>ProcessModule.resolvers.append(available_process_modules)</code>
 +
 +==== Importing in the final plan ====
 +For the registration to take effect the files, which cointains the 'available_process_modules' method, has to be imported in the final plan. This is because the code for appending the method to the list of resolvers has to be executed before the plan.