Changes between Version 19 and Version 20 of pps/tutorial
- Timestamp:
- Mar 3, 2011, 3:39:16 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pps/tutorial
v19 v20 15 15 3. Now get the latest revision of the tutorial: 16 16 {{{ 17 svn co https://svn.orxonox.net/game/code/branches/tutorial 2tutorial17 svn co https://svn.orxonox.net/game/code/branches/tutorial tutorial 18 18 }}} 19 19 4. Prepare to build: … … 25 25 5. Now build for the first time (may take some time, further builds will be faster): 26 26 {{{ 27 make -j 4 #-j4 means to create 4parallel compile processes27 make -j3 #-j3 means to create 3 parallel compile processes 28 28 }}} 29 29 6. Additionally you can use [wiki:KDevelop3] as IDE to develop (if you don't want to use the console ;)) … … 45 45 We 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}''. 46 46 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. 49 49 {{{ 50 CreateFactory(ClassX) 50 CreateFactory(ClassX); 51 51 }}} 52 52 3. Make sure that each drone object gets registered to the core by adding a call of ''RegisterObject(Classname)'' inside the constructor. 53 53 {{{ 54 RegisterObject(ClassX Y)54 RegisterObject(ClassX); 55 55 }}} 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. 57 57 {{{ 58 58 XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode) … … 62 62 63 63 That's it for the AutonomousDrone class. 64 65 If 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_''? 64 68 65 69 == The AutonomousDroneController ==