Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:pycram:own_robot [2021/02/11 11:54] – [A robot description for your robot] jdechtutorials:pycram:own_robot [2021/02/11 12:44] (current) jdech
Line 17: Line 17:
     * Joint configurations, for example the parking position of the arms.      * Joint configurations, for example the parking position of the arms. 
 === Initialization === === Initialization ===
-In PyCRAM the robot description is a class which extends the RobotDescription class. The attributes to initialize are moistly self explanatory. +In PyCRAM the robot description is a class which extends the RobotDescription class. The attributes to initialize this class are: 
-    * Name is the general name of the robot +    * Nameis the general name of the robot 
-    * base_frame is the origin of the URDF while base_link is the base link in the URDf +    * base_frameis the origin of the URDF while base_link is the base link in the URDf 
-    * torso_link and torso_joint are the names of the torso joint and link, if there are any +    * torso_link and torso_jointare the names of the torso joint and link, if there are any 
-    * ik_joints means all non-fixed joints this is used for ik resolution and has to be given. +    * ik_jointsmeans all non-fixed joints this is used for ik resolution and has to be given. 
     * Optionally an odom frame and the corresponding joints can also be specified.     * Optionally an odom frame and the corresponding joints can also be specified.
 This then looks like this: This then looks like this:
Line 87: Line 87:
  
 This is just an example on how the code could look like for an robot in the simulation environment, but  there are no restrictions to the code. For example, for a real robot there could be a ROS publisher which publishes to a topic to move the robot.  This is just an example on how the code could look like for an robot in the simulation environment, but  there are no restrictions to the code. For example, for a real robot there could be a ROS publisher which publishes to a topic to move the robot. 
 +
 +=== Registration === 
 +For PyCRAM to be able to choose the right process modules the process modules has to be registered. The registration basically tells PyCRAM which process modules are available and for which kind of designator they are intended. If a desiginator is performed PyCRAM then queries this registration to choose the right process module for this designator. 
 +
 +To register your implemented process modules to PyCRAM you need to create a new class which extends the PyCRAM ProcessModules class, don't confuse this with the ProcessModule class which is for implementing the process modules. 
 +
 +The constructor of this class takes the objects of the process modules as arguments, the rest of choosing the right process modules is done by PyCRAM in the background. The constructor takes the process modules in the following order:
 +    * navigation
 +    * pick_up 
 +    * place 
 +    * accessing 
 +    * park_arms 
 +    * move_head 
 +    * opening_gripper 
 +    * closing_gripper 
 +    * detecting 
 +    * move_tcp 
 +    * move_joints 
 +    * world_state_detecting 
 +At the moment the process modules have to be in this order, so PyCRAM can find the right process module for the respective designator. You don't have to provide all process modules and can always write None instead of the process module, but keep in mind that in this case the execution of the respective designator would fail. 
 +Here is how this looks like for the boxy robot. 
 +<code>class BoxyProcessModules(ProcessModules):
 +
 +    def __init__(self):
 +        if not BoxyProcessModules.initialized:
 +            super().__init__(BoxyNavigation(), BoxyPickUp(), BoxyPlace(), BoxyAccessing(), BoxyParkArms(),
 +                             BoxyMoveHead(), BoxyMoveGripper(), BoxyMoveGripper(), BoxyDetecting(), BoxyMoveTCP(),
 +                             BoxyMoveJoints(), BoxyWorldStateDetecting())
 +</code>