Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 3, 2011, 4:18:34 PM (14 years ago)
Author:
dafrick
Message:

Committing muster-lösung.

Location:
code/branches/tutorial/src/orxonox/worldentities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.cc

    r8011 r8012  
    3636    //TODO: Put your code in here:
    3737    // Create the factory for the drone.
     38    CreateFactory(AutonomousDrone);
    3839
    3940    /**
     
    4748        //TODO: Put your code in here:
    4849        // Register the drone class to the core.
     50        RegisterObject(AutonomousDrone);
    4951
    5052        this->myController_ = NULL;
     
    8486        //TODO: Put your code in here:
    8587        // 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.
    8789        // 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);
    8993
    9094    }
  • code/branches/tutorial/src/orxonox/worldentities/AutonomousDrone.h

    r8011 r8012  
    109109            //TODO: Place your set-functions here.
    110110            // - 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           
    112124            /**
    113125            @brief Gets the primary thrust to the input amount.
     
    117129                { return this->primaryThrust_; }
    118130            //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_; }
    119143
    120144        private:
  • code/branches/tutorial/src/orxonox/worldentities/CMakeLists.txt

    r7163 r8012  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
     2  AutonomousDrone.cc
    23  WorldEntity.cc
    34  StaticEntity.cc
Note: See TracChangeset for help on using the changeset viewer.