[Orxonox-commit 3323] r8012 - in code/branches/tutorial: data/levels src/orxonox/controllers src/orxonox/worldentities

dafrick at orxonox.net dafrick at orxonox.net
Thu Mar 3 16:18:35 CET 2011


Author: dafrick
Date: 2011-03-03 16:18:34 +0100 (Thu, 03 Mar 2011)
New Revision: 8012

Modified:
   code/branches/tutorial/data/levels/tutorial.oxw
   code/branches/tutorial/src/orxonox/controllers/AutonomousDroneController.cc
   code/branches/tutorial/src/orxonox/controllers/CMakeLists.txt
   code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.cc
   code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.h
   code/branches/tutorial/src/orxonox/worldentities/CMakeLists.txt
Log:

Committing muster-l?\195?\182sung.



Modified: code/branches/tutorial/data/levels/tutorial.oxw
===================================================================
--- code/branches/tutorial/data/levels/tutorial.oxw	2011-03-03 14:16:55 UTC (rev 8011)
+++ code/branches/tutorial/data/levels/tutorial.oxw	2011-03-03 15:18:34 UTC (rev 8012)
@@ -33,6 +33,14 @@
     <?lua end ?>
     
     <!-- TODO: Insert drone here. -->
+    <AutonomousDrone primaryThrust=100 auxilaryThrust=30 rotationThrust=25 collisionType="dynamic" mass = 50 linearDamping = 0.9 angularDamping = 0.7>
+        <attached>
+            <Model scale="10" mesh="drone.mesh"/>
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="10, 10, 10" />
+        </collisionShapes>
+    </AutonomousDrone>
 
   </Scene>
 </Level>

Modified: code/branches/tutorial/src/orxonox/controllers/AutonomousDroneController.cc
===================================================================
--- code/branches/tutorial/src/orxonox/controllers/AutonomousDroneController.cc	2011-03-03 14:16:55 UTC (rev 8011)
+++ code/branches/tutorial/src/orxonox/controllers/AutonomousDroneController.cc	2011-03-03 15:18:34 UTC (rev 8012)
@@ -34,6 +34,8 @@
 namespace orxonox
 {
 
+    CreateFactory(AutonomousDroneController);
+
     /**
     @brief
         Constructor.
@@ -45,6 +47,7 @@
         //TODO: Place your code here:
         // Make sure to register the object in the factory.
         // Do some kind of initialisation.
+        RegisterObject(AutonomousDroneController);
 
         // This checks that our creator really is a drone
         // and saves the pointer to the drone for the controlling commands
@@ -77,6 +80,7 @@
         // - moveFrontBack, moveRightLeft, moveUpDown
         // - rotatePitch, rotateYaw, rotateRoll
         // Apply the to myDrone (e.g. myDrone->rotateYaw(..) )
+        myDrone->rotateYaw(dt);
 
     }
 }

Modified: code/branches/tutorial/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/tutorial/src/orxonox/controllers/CMakeLists.txt	2011-03-03 14:16:55 UTC (rev 8011)
+++ code/branches/tutorial/src/orxonox/controllers/CMakeLists.txt	2011-03-03 15:18:34 UTC (rev 8012)
@@ -1,4 +1,5 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  AutonomousDroneController.cc
   Controller.cc
   HumanController.cc
   NewHumanController.cc

Modified: code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.cc
===================================================================
--- code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.cc	2011-03-03 14:16:55 UTC (rev 8011)
+++ code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.cc	2011-03-03 15:18:34 UTC (rev 8012)
@@ -35,6 +35,7 @@
 {
     //TODO: Put your code in here:
     // Create the factory for the drone.
+    CreateFactory(AutonomousDrone);
 
     /**
     @brief
@@ -46,6 +47,7 @@
     {
         //TODO: Put your code in here:
         // Register the drone class to the core.
+        RegisterObject(AutonomousDrone);
 
         this->myController_ = NULL;
 
@@ -83,9 +85,11 @@
         XMLPortParam(AutonomousDrone, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
         //TODO: Put your code in here:
         // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
-        // Make sure that the set- and get-functions exist.
+        // 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.
         // Variables can be added by the following command
-        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
+        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode);
+        XMLPortParam(AutonomousDrone, "auxiliaryThrust", setAuxiliaryThrust, getAuxiliaryThrust, xmlelement, mode);
+        XMLPortParam(AutonomousDrone, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
 
     }
 

Modified: code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.h
===================================================================
--- code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.h	2011-03-03 14:16:55 UTC (rev 8011)
+++ code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.h	2011-03-03 15:18:34 UTC (rev 8012)
@@ -108,14 +108,38 @@
                 { this->primaryThrust_ = thrust; }
             //TODO: Place your set-functions here.
             // - hint: auxiliary thrust, rotation thrust.
-
             /**
+            @brief Sets the auxiliary thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setAuxiliaryThrust( float thrust )
+                { this->auxiliaryThrust_ = thrust; }
+            /**
+            @brief Sets the rotation thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setRotationThrust( float thrust )
+                { this->rotationThrust_ = thrust; }
+            
+            /**
             @brief Gets the primary thrust to the input amount.
             @return The amount of thrust.
             */
             inline float getPrimaryThrust()
                 { return this->primaryThrust_; }
             //TODO: Place your get-functions here.
+            /**
+            @brief Gets the auxiliary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getAuxiliaryThrust()
+                { return this->auxiliaryThrust_; }
+                /**
+            @brief Gets the rotation thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getRotationThrust()
+                { return this->auxiliaryThrust_; }
 
         private:
             AutonomousDroneController *myController_; //!< The controller of the AutonomousDrone.

Modified: code/branches/tutorial/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/tutorial/src/orxonox/worldentities/CMakeLists.txt	2011-03-03 14:16:55 UTC (rev 8011)
+++ code/branches/tutorial/src/orxonox/worldentities/CMakeLists.txt	2011-03-03 15:18:34 UTC (rev 8012)
@@ -1,4 +1,5 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  AutonomousDrone.cc
   WorldEntity.cc
   StaticEntity.cc
   MovableEntity.cc




More information about the Orxonox-commit mailing list