Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 53 and Version 54 of pps/tutorial


Ignore:
Timestamp:
Sep 30, 2013, 11:09:26 AM (11 years ago)
Author:
smerkli
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • pps/tutorial

    v53 v54  
    9898}}}
    9999 4. Now go to the function called ''XMLPort''. ''XMLPort'' allows you to specify how your class can be instantiated (i.e. how an object can be created) purely through XML. This is important when we want to create levels, which in Orxonox are specified in XML files.
    100 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, whether what you have been doing could be correct or not.
     100The AutonomousDrone has two variables called ''auxiliaryThrust_'' and ''rotationThrust_'' defined in the header file (''src/orxonox/worldentities/AutonomousDrone.h''). To be able to set these variables to values from XML, we need
     101to add some code to the XMLPort function. There is already an example for the ''primaryThrust_'' variable.
     102
     103Add similar calls for ''auxiliaryThrust_'' and ''rotationThrust_'' using the following scheme:
     104
    101105{{{
    102106XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)