Changeset 11136
- Timestamp:
- Mar 9, 2016, 5:26:32 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutorial6/src/orxonox/controllers/AutonomousDroneController.cc
r11134 r11136 34 34 namespace orxonox 35 35 { 36 //TODO: Put your code in here: 37 // Create the factory for the drone controller. 36 38 37 39 /** … … 44 46 { 45 47 //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. 47 49 48 50 // This checks that our context really is a drone … … 50 52 /* NOTE from Sandro: This is currently broken */ 51 53 //AutonomousDrone* drone = dynamic_cast<AutonomousDrone*>(context); 52 //assert(drone != NULL);54 //assert(drone != nullptr); 53 55 //this->setControllableEntity(drone); 54 56 } … … 75 77 */ 76 78 //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; 78 82 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. 86 93 94 95 96 } 87 97 } 88 98 }
Note: See TracChangeset
for help on using the changeset viewer.