[Orxonox-commit 6490] r11136 - code/branches/tutorial6/src/orxonox/controllers
fvultier at orxonox.net
fvultier at orxonox.net
Wed Mar 9 17:26:32 CET 2016
Author: fvultier
Date: 2016-03-09 17:26:32 +0100 (Wed, 09 Mar 2016)
New Revision: 11136
Modified:
code/branches/tutorial6/src/orxonox/controllers/AutonomousDroneController.cc
Log:
Made tutorial compatible with the new core.
Modified: code/branches/tutorial6/src/orxonox/controllers/AutonomousDroneController.cc
===================================================================
--- code/branches/tutorial6/src/orxonox/controllers/AutonomousDroneController.cc 2016-03-07 15:13:18 UTC (rev 11135)
+++ code/branches/tutorial6/src/orxonox/controllers/AutonomousDroneController.cc 2016-03-09 16:26:32 UTC (rev 11136)
@@ -33,6 +33,8 @@
namespace orxonox
{
+ //TODO: Put your code in here:
+ // Create the factory for the drone controller.
/**
@brief
@@ -43,13 +45,13 @@
AutonomousDroneController::AutonomousDroneController(Context* context) : Controller(context)
{
//TODO: Place your code here:
- // Make sure to register the object and create the factory.
+ // Make sure to register the object and create the factory.
// This checks that our context really is a drone
// and saves the pointer to the drone for the controlling commands
/* NOTE from Sandro: This is currently broken */
//AutonomousDrone* drone = dynamic_cast<AutonomousDrone*>(context);
- //assert(drone != NULL);
+ //assert(drone != nullptr);
//this->setControllableEntity(drone);
}
@@ -74,15 +76,23 @@
* This will be reverted once the framework update is complete
*/
//AutonomousDrone *myDrone = static_cast<AutonomousDrone*>(this->getControllableEntity());
- ObjectList<AutonomousDrone>::iterator it = ObjectList<AutonomousDrone>::begin();
+ ObjectList<AutonomousDrone> objectList;
+ ObjectList<AutonomousDrone>::iterator it = objectList.begin();
+ AutonomousDrone* myDrone = *it;
- //TODO: Place your code here:
- // Steering commands
- // You can use the commands provided by the AutonomousDrone to steer it:
- // - moveFrontBack, moveRightLeft, moveUpDown
- // - rotatePitch, rotateYaw, rotateRoll
- // 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.
- // Apply them to myDrone (e.g. myDrone->rotateYaw(..) )
+ if (myDrone != nullptr)
+ {
+ //TODO: Place your code here:
+ // Steering commands
+ // You can use the commands provided by the AutonomousDrone to steer it:
+ // - moveFrontBack, moveRightLeft, moveUpDown
+ // - rotatePitch, rotateYaw, rotateRoll
+ // 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.
+ // Apply them to myDrone (e.g. myDrone->rotateYaw(..) )
+ // dt is the time passed since the last call of the tick function in seconds.
+
+
+ }
}
}
More information about the Orxonox-commit
mailing list