Changeset 8012 for code/branches/tutorial
- Timestamp:
- Mar 3, 2011, 4:18:34 PM (14 years ago)
- Location:
- code/branches/tutorial
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutorial/data/levels/tutorial.oxw
r8011 r8012 34 34 35 35 <!-- TODO: Insert drone here. --> 36 <AutonomousDrone primaryThrust=100 auxilaryThrust=30 rotationThrust=25 collisionType="dynamic" mass = 50 linearDamping = 0.9 angularDamping = 0.7> 37 <attached> 38 <Model scale="10" mesh="drone.mesh"/> 39 </attached> 40 <collisionShapes> 41 <BoxCollisionShape position="0,0,0" halfExtents="10, 10, 10" /> 42 </collisionShapes> 43 </AutonomousDrone> 36 44 37 45 </Scene> -
code/branches/tutorial/src/orxonox/controllers/AutonomousDroneController.cc
r8011 r8012 35 35 { 36 36 37 CreateFactory(AutonomousDroneController); 38 37 39 /** 38 40 @brief … … 46 48 // Make sure to register the object in the factory. 47 49 // Do some kind of initialisation. 50 RegisterObject(AutonomousDroneController); 48 51 49 52 // This checks that our creator really is a drone … … 78 81 // - rotatePitch, rotateYaw, rotateRoll 79 82 // Apply the to myDrone (e.g. myDrone->rotateYaw(..) ) 83 myDrone->rotateYaw(dt); 80 84 81 85 } -
code/branches/tutorial/src/orxonox/controllers/CMakeLists.txt
r7163 r8012 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 AutonomousDroneController.cc 2 3 Controller.cc 3 4 HumanController.cc -
code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.cc
r8011 r8012 36 36 //TODO: Put your code in here: 37 37 // Create the factory for the drone. 38 CreateFactory(AutonomousDrone); 38 39 39 40 /** … … 47 48 //TODO: Put your code in here: 48 49 // Register the drone class to the core. 50 RegisterObject(AutonomousDrone); 49 51 50 52 this->myController_ = NULL; … … 84 86 //TODO: Put your code in here: 85 87 // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort. 86 // Make sure that the set- and get-functions exist.88 // Make sure that you also create the get- and set-functions. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified, so you can get your inspiration from there. 87 89 // Variables can be added by the following command 88 // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode) 90 // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode); 91 XMLPortParam(AutonomousDrone, "auxiliaryThrust", setAuxiliaryThrust, getAuxiliaryThrust, xmlelement, mode); 92 XMLPortParam(AutonomousDrone, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode); 89 93 90 94 } -
code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.h
r8011 r8012 109 109 //TODO: Place your set-functions here. 110 110 // - hint: auxiliary thrust, rotation thrust. 111 111 /** 112 @brief Sets the auxiliary thrust to the input amount. 113 @param thrust The amount of thrust. 114 */ 115 inline void setAuxiliaryThrust( float thrust ) 116 { this->auxiliaryThrust_ = thrust; } 117 /** 118 @brief Sets the rotation thrust to the input amount. 119 @param thrust The amount of thrust. 120 */ 121 inline void setRotationThrust( float thrust ) 122 { this->rotationThrust_ = thrust; } 123 112 124 /** 113 125 @brief Gets the primary thrust to the input amount. … … 117 129 { return this->primaryThrust_; } 118 130 //TODO: Place your get-functions here. 131 /** 132 @brief Gets the auxiliary thrust to the input amount. 133 @return The amount of thrust. 134 */ 135 inline float getAuxiliaryThrust() 136 { return this->auxiliaryThrust_; } 137 /** 138 @brief Gets the rotation thrust to the input amount. 139 @return The amount of thrust. 140 */ 141 inline float getRotationThrust() 142 { return this->auxiliaryThrust_; } 119 143 120 144 private: -
code/branches/tutorial/src/orxonox/worldentities/CMakeLists.txt
r7163 r8012 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 AutonomousDrone.cc 2 3 WorldEntity.cc 3 4 StaticEntity.cc
Note: See TracChangeset
for help on using the changeset viewer.