Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 19 and Version 20 of pps/tutorial


Ignore:
Timestamp:
Mar 3, 2011, 3:39:16 PM (14 years ago)
Author:
dafrick
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • pps/tutorial

    v19 v20  
    1515 3. Now get the latest revision of the tutorial:
    1616{{{
    17 svn co https://svn.orxonox.net/game/code/branches/tutorial2 tutorial
     17svn co https://svn.orxonox.net/game/code/branches/tutorial tutorial
    1818}}}
    1919 4. Prepare to build:
     
    2525 5. Now build for the first time (may take some time, further builds will be faster):
    2626{{{
    27 make -j4  #-j4 means to create 4 parallel compile processes
     27make -j3  #-j3 means to create 3 parallel compile processes
    2828}}}
    2929 6. Additionally you can use [wiki:KDevelop3] as IDE to develop (if you don't want to use the console ;))
     
    4545We created for you the skeleton of an autonomous drone. You can find the code in the files ''src/orxonox/worldentities/AutonomousDrone.{cc|h}'' and ''src/orxonox/controllers/AutonomousDroneController.{cc|h}''.
    4646
    47  1. Open the file ''AutonomousDrone.cc'' and have a look at the code (''src/orxonox/worldentities/'').
    48  2. In order to be able to create an AutonomousDrone object from the XML file or somewhere else just by the class name, you need to add a call of ''CreateFactory(Classname)'' somewhere inside the ''.cc'' (global, inside the namespace).
     47 1. Open the file ''AutonomousDrone.cc'' and have a look at the code (the file can be found in ''src/orxonox/worldentities/'').
     48 2. In order to be able to create an AutonomousDrone object from the XML file just by using the class name, you need to add a call of ''CreateFactory(Classname)'' somewhere inside the ''.cc'' (global, inside the namespace). This is best done just above the constructor.
    4949{{{
    50 CreateFactory(ClassX)
     50CreateFactory(ClassX);
    5151}}}
    5252 3. Make sure that each drone object gets registered to the core by adding a call of ''RegisterObject(Classname)'' inside the constructor.
    5353{{{
    54 RegisterObject(ClassXY)
     54RegisterObject(ClassX);
    5555}}}
    56  4. Now go to the XMLPort function and add the calls for the two variables ''auxiliaryThrust_'' and ''rotationThrust_''. As you can see, the XMLPort function for the variable ''primaryThurst_'' has already been specified.
     56 4. Now go to the function called ''XMLPort'' and add the calls for the two variables ''auxiliaryThrust_'' and ''rotationThrust_''. As you can see, the XMLPort function for the variable ''primaryThurst_'' has already been specified. Now add the calls for the other two variables accordingly, you can compare your function calls to the call for ''primaryThrust_'' to get a feel for, what you have been doing could be correct or not.
    5757{{{
    5858XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
     
    6262
    6363That's it for the AutonomousDrone class.
     64
     65If you have been having problems, consider the following suggestions, that might help you resolve them.
     66 * Is the classname that you specified for ''CreateFactory(Classname)'' and ''RegisterObject(Classname)'' correct? If it is either ''Classname'', ''ClassX'' or ''ClassXY'', then it is incorrect, try to think about what it should be. If you can't find the solution ask one of the assistants.
     67 * Have you created 2 set-functions and 2 get-functions for the two variables ''auxiliaryThrust_'' and ''rotationThrust_''?
    6468
    6569== The AutonomousDroneController ==