Permalink
Browse files

importing code removed from Stage

  • Loading branch information...
1 parent a6983ed commit 7955300f6921c5c916db1547a5f54bd22be852a8 @rtv committed Dec 29, 2011
Showing with 1,632 additions and 77 deletions.
  1. +3 −6 CMakeLists.txt
  2. +0 −51 basic.cc
  3. +0 −20 basic.world
  4. +321 −0 dw.cc
  5. +709 −0 dw.hh
  6. BIN world/cave.png
  7. +55 −0 world/dw.world
  8. +37 −0 world/map.inc
  9. +431 −0 world/pioneer.inc
  10. +76 −0 world/sick.inc
View
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.6)
include(FindPkgConfig)
pkg_search_module( STG REQUIRED stage )
-ADD_LIBRARY( basic MODULE basic.cc )
+ADD_LIBRARY( dw MODULE dw.cc )
# expand annoying colon-separated lists into usable strings
@@ -17,12 +17,9 @@ foreach(f ${STG_LDFLAGS})
set (STG_LDFLAGS_STR "${STG_LDFLAGS_STR} ${f}")
endforeach(f)
-
-set_target_properties( basic PROPERTIES
+set_target_properties( dw PROPERTIES
COMPILE_FLAGS "${STG_CFLAGS_STR}"
LINK_FLAGS "${STG_LDFLAGS_STR} -framework opengl"
+ PREFIX ""
)
-# delete the "lib" prefix from the plugin libraries
-SET_TARGET_PROPERTIES( basic PROPERTIES PREFIX "" )
-
View
@@ -1,51 +0,0 @@
-/////////////////////////////////
-// File: basic.cc
-// Desc: minimal controller example
-// Created: 2011.10.19
-// Author: Richard Vaughan <vaughan@sfu.ca>
-// License: GPL
-/////////////////////////////////
-
-#include "stage.hh"
-using namespace Stg;
-
-static ModelPosition* position(NULL);
-
-/** this is added as a callback to a ranger model, and is called
- whenever the model is updated by Stage.
-*/
-int RangerUpdateCb( ModelRanger* mod, void* dummy)
-{
- const std::vector<ModelRanger::Sensor>& sensors = mod->GetSensors();
-
- // ( inspect the ranger data and decide what to do )
-
- // output something to prove it is working
- printf( "Hello simulated world\n" ); // console
- mod->Say( "Hello" ); // GUI window
- position->SetSpeed( 0.4, 0, 0.1 ); // output a speed command (X, Y, Z)
- return 0;
-}
-
-/** Stage calls this when the model starts up
- */
-extern "C" int Init( Model* mod )
-{
- // the controller is attached to a position model, so Init is called
- // with a pointer to this model.
- position = (ModelPosition*)mod;
- position->Subscribe(); // models are only updated if someone is subscribed to them
-
- // we obtain a pointer to the first unused ranger that is a child of this position model
- ModelRanger* ranger = (ModelRanger*) mod->GetUnusedModelOfType( "ranger" );
-
- // install a callback function that will be called every time the
- // ranger model is updated by the simulator
- ranger->AddCallback( Model::CB_UPDATE, (model_callback_t)RangerUpdateCb, NULL );
- ranger->Subscribe(); // models are only updated if someone is subscribed to them
-
-
- return 0; //ok
-}
-
-
View
@@ -1,20 +0,0 @@
-# simple.world - basic world file example
-# Authors: Richard Vaughan
-# $Id$
-
-paused 0
-
-# configure the GUI window
-window
-(
- size [ 1258.000 962.000 ] # in pixels
- scale 19.361
- center [ -6.229 -10.901 ]
- rotate [ 0 0 ]
-)
-
-position(
- pose [ 0 0 0 0 ]
- ranger()
- ctrl "basic"
-)
Oops, something went wrong.

0 comments on commit 7955300

Please sign in to comment.