Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11136


Ignore:
Timestamp:
Mar 9, 2016, 5:26:32 PM (9 years ago)
Author:
fvultier
Message:

Made tutorial compatible with the new core.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutorial6/src/orxonox/controllers/AutonomousDroneController.cc

    r11134 r11136  
    3434namespace orxonox
    3535{
     36    //TODO: Put your code in here:
     37    // Create the factory for the drone controller.
    3638
    3739    /**
     
    4446    {
    4547        //TODO: Place your code here:
    46         // Make sure to register the object and create the factory.
     48        // Make sure to register the object and create the factory.       
    4749
    4850        // This checks that our context really is a drone
     
    5052        /* NOTE from Sandro: This is currently broken */
    5153        //AutonomousDrone* drone = dynamic_cast<AutonomousDrone*>(context);
    52         //assert(drone != NULL);
     54        //assert(drone != nullptr);
    5355        //this->setControllableEntity(drone);
    5456    }
     
    7577         */
    7678        //AutonomousDrone *myDrone = static_cast<AutonomousDrone*>(this->getControllableEntity());
    77         ObjectList<AutonomousDrone>::iterator it = ObjectList<AutonomousDrone>::begin();
     79        ObjectList<AutonomousDrone> objectList;
     80        ObjectList<AutonomousDrone>::iterator it = objectList.begin();
     81        AutonomousDrone* myDrone = *it;
    7882
    79         //TODO: Place your code here:
    80         // Steering commands
    81         // You can use the commands provided by the AutonomousDrone to steer it:
    82         // - moveFrontBack, moveRightLeft, moveUpDown
    83         // - rotatePitch, rotateYaw, rotateRoll
    84         // You will see, that the AutonomousDrone has two variants for each of these commands, one with a vector as input and one with just a float. Use the one with just the float as input.
    85         // Apply them to myDrone (e.g. myDrone->rotateYaw(..) )
     83        if (myDrone != nullptr)
     84        {
     85            //TODO: Place your code here:
     86            // Steering commands
     87            // You can use the commands provided by the AutonomousDrone to steer it:
     88            // - moveFrontBack, moveRightLeft, moveUpDown
     89            // - rotatePitch, rotateYaw, rotateRoll
     90            // You will see, that the AutonomousDrone has two variants for each of these commands, one with a vector as input and one with just a float. Use the one with just the float as input.
     91            // Apply them to myDrone (e.g. myDrone->rotateYaw(..) )
     92            // dt is the time passed since the last call of the tick function in seconds.
    8693
     94
     95
     96        }
    8797    }
    8898}
Note: See TracChangeset for help on using the changeset viewer.