EnkiMarxbot.cpp
Go to the documentation of this file.
00001 /*
00002         Aseba - an event-based framework for distributed robot control
00003         Copyright (C) 2007--2012:
00004                 Stephane Magnenat <stephane at magnenat dot net>
00005                 (http://stephane.magnenat.net)
00006                 and other contributors, see authors.txt for details
00007         
00008         This program is free software: you can redistribute it and/or modify
00009         it under the terms of the GNU Lesser General Public License as published
00010         by the Free Software Foundation, version 3 of the License.
00011         
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU Lesser General Public License for more details.
00016         
00017         You should have received a copy of the GNU Lesser General Public License
00018         along with this program. If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #include <enki/PhysicalEngine.h>
00022 #include <enki/robots/e-puck/EPuck.h>
00023 #include <viewer/Viewer.h>
00024 #include "AsebaMarxbot.h"
00025 #include <iostream>
00026 #include <QtGui>
00027 #include <QtDebug>
00028 
00029 namespace Enki
00030 {
00031         class MarxbotViewer: public ViewerWidget
00032         {
00033         public:
00034                 MarxbotViewer(World* world) : ViewerWidget(world) {}
00035                 
00036                 void renderObjectsTypesHook()
00037                 {
00038                         managedObjectsAliases[&typeid(AsebaMarxbot)] = &typeid(Marxbot);
00039                 }
00040         };
00041 }
00042 
00043 
00044 int main(int argc, char *argv[])
00045 {
00046         QApplication app(argc, argv);
00047         
00048         // Create the world
00049         Enki::World world(200, 200);
00050         
00051         // Create viewer
00052         Enki::MarxbotViewer viewer(&world);
00053         
00054         // Create a Khepera and position it
00055         Enki::AsebaMarxbot *marXbot = new Enki::AsebaMarxbot();
00056         marXbot->pos = Enki::Point(100, 100);
00057         
00058         // objects are garbage collected by the world on destruction
00059         world.addObject(marXbot);
00060         
00061         viewer.setWindowTitle("Aseba Enki");
00062         viewer.show();
00063         
00064         return app.exec();
00065 }
00066 


aseba
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:38