/* * This file is part of robotreality * * Copyright(c) sschulz techfak.uni-bielefeld.de * http://opensource.cit-ec.de/projects/robotreality * * This file may be licensed under the terms of the * GNU General Public License Version 3 (the ``GPL''), * or (at your option) any later version. * * Software distributed under the License is distributed * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either * express or implied. See the GPL for the specific language * governing rights and limitations. * * You should have received a copy of the GPL along with this * program. If not, go to http://www.gnu.org/licenses/gpl.html * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The development of this software was supported by the * Excellence Cluster EXC 277 Cognitive Interaction Technology. * The Excellence Cluster EXC 277 is a grant of the Deutsche * Forschungsgemeinschaft (DFG) in the context of the German * Excellence Initiative. * */ #include "HeadProjector.h" #include int set_realtime_priority(void){ struct sched_param schp; memset(&schp, 0, sizeof(schp)); schp.sched_priority = sched_get_priority_max(SCHED_FIFO); if (sched_setscheduler(0, SCHED_FIFO, &schp) != 0) { perror("sched_setscheduler"); return 0; } return 1; } int main(int argc, char** argv){ printf("\n"); printf(",---------------------------------------------.\n"); printf("| robotreality sceneview tool |\n"); printf("`---------------------------------------------ยด\n\n"); if (argc == 2){ if ((strcmp(argv[1],"-help")==0) || (strcmp(argv[1],"--help")==0)){ printf("> usage: \n"); printf(" %s (default settings)\n", argv[0]); printf(" %s (loads given config)\n\n", argv[0]); exit(1); } } //set latency to RT if (!set_realtime_priority()){ printf("> ERROR: can not set realtime priority (run e as root!)\n"); printf(" this is BAD and you will get more latency! will continue anyway...\n"); //sleep(2); } HeadProjector *p; if (argc == 2){ p = new HeadProjector(argv[1]); }else{ p = new HeadProjector(NULL); } printf("> starting main loop\n"); p->run(); return 0; }