Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed temp files

  • Loading branch information...
commit f785559e7691b40cdf2e7992061b0938b73aec70 1 parent 29c0775
Richard Vaughan authored
Showing with 0 additions and 504 deletions.
  1. +0 −340 CMakeCache.txt
  2. +0 −164 backup.wheel.cc
View
340 CMakeCache.txt
@@ -1,340 +0,0 @@
-# This is the CMakeCache file.
-# For build in directory: /Users/vaughan/Dropbox/wheel
-# It was generated by CMake: /opt/local/bin/cmake
-# You can edit this file to change values found and used by cmake.
-# If you do not want to change any of the values, simply exit the editor.
-# If you do want to change a value, simply edit, save, and exit the editor.
-# The syntax for the file is as follows:
-# KEY:TYPE=VALUE
-# KEY is the name of a variable in the cache.
-# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
-# VALUE is the current value for the KEY.
-
-########################
-# EXTERNAL cache entries
-########################
-
-//Path to a program.
-CMAKE_AR:FILEPATH=/usr/bin/ar
-
-//For backwards compatibility, what version of CMake commands and
-// syntax should this version of CMake try to support.
-CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4
-
-//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
-// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
-CMAKE_BUILD_TYPE:STRING=
-
-//Enable/Disable color output during build.
-CMAKE_COLOR_MAKEFILE:BOOL=ON
-
-//CXX compiler.
-CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
-
-//Flags used by the compiler during all build types.
-CMAKE_CXX_FLAGS:STRING='-arch i386 -I/opt/local/include '
-
-//Flags used by the compiler during debug builds.
-CMAKE_CXX_FLAGS_DEBUG:STRING=-g
-
-//Flags used by the compiler during release minsize builds.
-CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
-
-//Flags used by the compiler during release builds (/MD /Ob1 /Oi
-// /Ot /Oy /Gs will produce slightly less optimized but smaller
-// files).
-CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
-
-//Flags used by the compiler during Release with Debug Info builds.
-CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g
-
-//C compiler.
-CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc
-
-//Flags used by the compiler during all build types.
-CMAKE_C_FLAGS:STRING=
-
-//Flags used by the compiler during debug builds.
-CMAKE_C_FLAGS_DEBUG:STRING=-g
-
-//Flags used by the compiler during release minsize builds.
-CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
-
-//Flags used by the compiler during release builds (/MD /Ob1 /Oi
-// /Ot /Oy /Gs will produce slightly less optimized but smaller
-// files).
-CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
-
-//Flags used by the compiler during Release with Debug Info builds.
-CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g
-
-//Flags used by the linker.
-CMAKE_EXE_LINKER_FLAGS:STRING=-L/opt/local/lib
-
-//Flags used by the linker during debug builds.
-CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
-
-//Flags used by the linker during release minsize builds.
-CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
-
-//Flags used by the linker during release builds.
-CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
-
-//Flags used by the linker during Release with Debug Info builds.
-CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-
-//Path to a program.
-CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool
-
-//Install path prefix, prepended onto install directories.
-CMAKE_INSTALL_PREFIX:PATH=/usr/local
-
-//Path to a program.
-CMAKE_LINKER:FILEPATH=/usr/bin/ld
-
-//Path to a program.
-CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
-
-//Flags used by the linker during the creation of modules.
-CMAKE_MODULE_LINKER_FLAGS:STRING=-L/opt/local/lib
-
-//Flags used by the linker during debug builds.
-CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
-
-//Flags used by the linker during release minsize builds.
-CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
-
-//Flags used by the linker during release builds.
-CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
-
-//Flags used by the linker during Release with Debug Info builds.
-CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-
-//Path to a program.
-CMAKE_NM:FILEPATH=/usr/bin/nm
-
-//Path to a program.
-CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND
-
-//Path to a program.
-CMAKE_OBJDUMP:FILEPATH=CMAKE_OBJDUMP-NOTFOUND
-
-//Build architectures for OSX
-CMAKE_OSX_ARCHITECTURES:STRING=i386
-
-//isysroot used for universal binary support
-CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.6.sdk
-
-//Path to a program.
-CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
-
-//Flags used by the linker during the creation of dll's.
-CMAKE_SHARED_LINKER_FLAGS:STRING=-L/opt/local/lib
-
-//Flags used by the linker during debug builds.
-CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
-
-//Flags used by the linker during release minsize builds.
-CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
-
-//Flags used by the linker during release builds.
-CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
-
-//Flags used by the linker during Release with Debug Info builds.
-CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-
-//If set, runtime paths are not added when using shared libraries.
-CMAKE_SKIP_RPATH:BOOL=NO
-
-//Path to a program.
-CMAKE_STRIP:FILEPATH=/usr/bin/strip
-
-//If true, cmake will use relative paths in makefiles and projects.
-CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
-
-//If this value is on, makefiles will be generated without the
-// .SILENT directive, and all commands will be echoed to the console
-// during the make. This is useful for debugging only. With Visual
-// Studio IDE projects all commands are done without /nologo.
-CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
-
-//Single output directory for building all executables.
-EXECUTABLE_OUTPUT_PATH:PATH=
-
-//Single output directory for building all libraries.
-LIBRARY_OUTPUT_PATH:PATH=
-
-//pkg-config executable
-PKG_CONFIG_EXECUTABLE:FILEPATH=/opt/local/bin/pkg-config
-
-//Value Computed by CMake
-Project_BINARY_DIR:STATIC=/Users/vaughan/Dropbox/wheel
-
-//Value Computed by CMake
-Project_SOURCE_DIR:STATIC=/Users/vaughan/Dropbox/wheel
-
-//Dependencies for target
-wheel_LIB_DEPENDS:STATIC=
-
-
-########################
-# INTERNAL cache entries
-########################
-
-//Advanced flag for variable: CMAKE_AR
-CMAKE_AR-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_BUILD_TOOL
-CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
-//What is the target build tool cmake is generating for.
-CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make
-//This is the directory where this CMakeCahe.txt was created
-CMAKE_CACHEFILE_DIR:INTERNAL=/Users/vaughan/Dropbox/wheel
-//Major version of cmake used to create the current loaded cache
-CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
-//Minor version of cmake used to create the current loaded cache
-CMAKE_CACHE_MINOR_VERSION:INTERNAL=6
-//Major version of cmake used to create the current loaded cache
-CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4
-//Advanced flag for variable: CMAKE_COLOR_MAKEFILE
-CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
-//Path to CMake executable.
-CMAKE_COMMAND:INTERNAL=/opt/local/bin/cmake
-//Path to cpack program executable.
-CMAKE_CPACK_COMMAND:INTERNAL=/opt/local/bin/cpack
-//Path to ctest program executable.
-CMAKE_CTEST_COMMAND:INTERNAL=/opt/local/bin/ctest
-//Advanced flag for variable: CMAKE_CXX_COMPILER
-CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
-CMAKE_CXX_COMPILER_WORKS:INTERNAL=1
-//Advanced flag for variable: CMAKE_CXX_FLAGS
-CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
-CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
-CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
-CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
-CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_C_COMPILER
-CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
-CMAKE_C_COMPILER_WORKS:INTERNAL=1
-//Advanced flag for variable: CMAKE_C_FLAGS
-CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
-CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
-CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
-CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
-CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Result of TRY_COMPILE
-CMAKE_DETERMINE_CXX_ABI_COMPILED:INTERNAL=TRUE
-//Result of TRY_COMPILE
-CMAKE_DETERMINE_C_ABI_COMPILED:INTERNAL=TRUE
-//Path to cache edit program executable.
-CMAKE_EDIT_COMMAND:INTERNAL=/opt/local/bin/ccmake
-//Executable file format
-CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
-//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
-CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
-CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
-CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
-CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
-CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Name of generator.
-CMAKE_GENERATOR:INTERNAL=Unix Makefiles
-//Start directory with the top level CMakeLists.txt file for this
-// project
-CMAKE_HOME_DIRECTORY:INTERNAL=/Users/vaughan/Dropbox/wheel
-//Advanced flag for variable: CMAKE_INSTALL_NAME_TOOL
-CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_LINKER
-CMAKE_LINKER-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_MAKE_PROGRAM
-CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
-CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
-CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
-CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
-CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
-CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_NM
-CMAKE_NM-ADVANCED:INTERNAL=1
-//number of local generators
-CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1
-//Advanced flag for variable: CMAKE_OBJCOPY
-CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_OBJDUMP
-CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_RANLIB
-CMAKE_RANLIB-ADVANCED:INTERNAL=1
-//Path to CMake installation.
-CMAKE_ROOT:INTERNAL=/opt/local/share/cmake-2.6
-//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
-CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
-CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
-CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
-CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
-CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_SKIP_RPATH
-CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_STRIP
-CMAKE_STRIP-ADVANCED:INTERNAL=1
-//uname command
-CMAKE_UNAME:INTERNAL=/usr/bin/uname
-//Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS
-CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
-//Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
-CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
-//Advanced flag for variable: PKG_CONFIG_EXECUTABLE
-PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1
-STG_CFLAGS:INTERNAL=-O2;-arch;i386;-D_THREAD_SAFE;-D_REENTRANT;-I/Users/vaughan/Stage-3/include/Stage-3.2;-I/opt/local/include;-I/opt/local/include/FL/images
-STG_CFLAGS_I:INTERNAL=
-STG_CFLAGS_OTHER:INTERNAL=-O2;-arch;i386;-D_THREAD_SAFE;-D_REENTRANT
-STG_FOUND:INTERNAL=1
-STG_INCLUDEDIR:INTERNAL=
-STG_INCLUDE_DIRS:INTERNAL=/Users/vaughan/Stage-3/include/Stage-3.2;/opt/local/include;/opt/local/include/FL/images
-STG_LDFLAGS:INTERNAL=-framework;AGL;-framework;OpenGL;-framework;Carbon;-framework;ApplicationServices;-L/Users/vaughan/Stage-3/lib;-L/opt/local/lib;-lstage;-lfltk_images;-lfltk_png;-lfltk_z;-lfltk_jpeg;-lfltk_gl;-lfltk;-lpthread
-STG_LDFLAGS_OTHER:INTERNAL=-framework;AGL;-framework;OpenGL;-framework;Carbon;-framework;ApplicationServices
-STG_LIBDIR:INTERNAL=
-STG_LIBRARIES:INTERNAL=stage;fltk_images;fltk_png;fltk_z;fltk_jpeg;fltk_gl;fltk;pthread
-STG_LIBRARY_DIRS:INTERNAL=/Users/vaughan/Stage-3/lib;/opt/local/lib
-STG_LIBS:INTERNAL=
-STG_LIBS_L:INTERNAL=
-STG_LIBS_OTHER:INTERNAL=
-STG_LIBS_PATHS:INTERNAL=
-STG_PREFIX:INTERNAL=/Users/vaughan/Stage-3
-STG_STATIC_CFLAGS:INTERNAL=-O2;-arch;i386;-D_THREAD_SAFE;-D_REENTRANT;-I/Users/vaughan/Stage-3/include/Stage-3.2;-I/opt/local/include;-I/opt/local/include/FL/images
-STG_STATIC_CFLAGS_I:INTERNAL=
-STG_STATIC_CFLAGS_OTHER:INTERNAL=-O2;-arch;i386;-D_THREAD_SAFE;-D_REENTRANT
-STG_STATIC_INCLUDE_DIRS:INTERNAL=/Users/vaughan/Stage-3/include/Stage-3.2;/opt/local/include;/opt/local/include/FL/images
-STG_STATIC_LDFLAGS:INTERNAL=-framework;AGL;-framework;OpenGL;-framework;Carbon;-framework;ApplicationServices;-L/Users/vaughan/Stage-3/lib;-L/opt/local/lib;-lstage;-lfltk_images;-lfltk_png;-lfltk_z;-lfltk_jpeg;-lfltk_gl;-lfltk;-lpthread
-STG_STATIC_LDFLAGS_OTHER:INTERNAL=-framework;AGL;-framework;OpenGL;-framework;Carbon;-framework;ApplicationServices
-STG_STATIC_LIBDIR:INTERNAL=
-STG_STATIC_LIBRARIES:INTERNAL=stage;fltk_images;fltk_png;fltk_z;fltk_jpeg;fltk_gl;fltk;pthread
-STG_STATIC_LIBRARY_DIRS:INTERNAL=/Users/vaughan/Stage-3/lib;/opt/local/lib
-STG_STATIC_LIBS:INTERNAL=
-STG_STATIC_LIBS_L:INTERNAL=
-STG_STATIC_LIBS_OTHER:INTERNAL=
-STG_STATIC_LIBS_PATHS:INTERNAL=
-STG_VERSION:INTERNAL=3.2.2
-STG_stage_INCLUDEDIR:INTERNAL=
-STG_stage_LIBDIR:INTERNAL=
-STG_stage_PREFIX:INTERNAL=
-STG_stage_VERSION:INTERNAL=
-__pkg_config_checked_STG:INTERNAL=1
-
View
164 backup.wheel.cc
@@ -1,164 +0,0 @@
-/////////////////////////////////
-// File: wheel.cc
-// Desc: experimental
-// Created: 2010.6.6
-// Author: Richard Vaughan <vaughan@sfu.ca>
-// License: GPL
-/////////////////////////////////
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "stage.hh"
-using namespace Stg;
-
-typedef struct
-{
- ModelPosition* position;
- ModelRanger* ranger;
- ModelFiducial* fiducial;
-
- ModelFiducial::Fiducial* closest;
- ModelFiducial::Fiducial* closest_red;
-
- stg_radians_t closest_bearing;
- stg_meters_t closest_range;
- stg_radians_t closest_heading_error;
-
-} robot_t;
-
-// forward declare
-int RangerUpdate( ModelRanger* mod, robot_t* robot );
-int FiducialUpdate( ModelFiducial* fid, robot_t* robot );
-
-const double VSPEED = 0.4; // meters per second
-const double EXPAND_WGAIN = 1.0;//0.3; // turn speed gain
-const double FLOCK_WGAIN = 0.3; // turn speed gain
-const double SAFE_DIST = 1.0; // meters
-const double SAFE_ANGLE = 0.5; // radians
-
-
-// Stage calls this when the model starts up
-extern "C" int Init( Model* mod )
-{
- robot_t* robot = new robot_t;
- robot->position = (ModelPosition*)mod;
-
- // subscribe to the ranger, which we use for navigating
- robot->ranger = (ModelRanger*)mod->GetUnusedModelOfType( "ranger" );
- assert( robot->ranger );
-
- // ask Stage to call into our ranger update function
- robot->ranger->AddCallback( Model::CB_UPDATE, (stg_model_callback_t)RangerUpdate, robot );
-
- robot->fiducial = (ModelFiducial*)mod->GetUnusedModelOfType( "fiducial" ) ;
- assert( robot->fiducial );
- robot->fiducial->AddCallback( Model::CB_UPDATE, (stg_model_callback_t)FiducialUpdate, robot );
-
- robot->fiducial->Subscribe();
- robot->ranger->Subscribe();
- robot->position->Subscribe();
-
- return 0; //ok
-}
-
-int RangerUpdate( ModelRanger* rgr, robot_t* robot )
-{
- // compute the vector sum of the sonar ranges
- double dx=0, dy=0;
-
- const std::vector<ModelRanger::Sensor>& sensors = rgr->GetSensors();
-
- // use the front-facing sensors only
- for( unsigned int i=0; i < 8; i++ )
- {
- dx += sensors[i].range * cos( sensors[i].pose.a );
- dy += sensors[i].range * sin( sensors[i].pose.a );
- }
-
- if( (dx == 0) || (dy == 0) )
- return 0;
-
- double resultant_angle = atan2( dy, dx );
- double forward_speed = 0.0;
- double side_speed = 0.0;
- double turn_speed = EXPAND_WGAIN * resultant_angle;
-
- // if the front is clear, drive forwards
- if( (sensors[3].range > SAFE_DIST) && // forwards
- (sensors[4].range > SAFE_DIST) &&
- (sensors[5].range > SAFE_DIST ) && //
- (sensors[6].range > SAFE_DIST/2.0) &&
- (sensors[2].range > SAFE_DIST ) &&
- (sensors[1].range > SAFE_DIST/2.0) &&
- (fabs( resultant_angle ) < SAFE_ANGLE) )
- {
- forward_speed = VSPEED;
-
- // and steer to match the heading of the nearest robot
- if( robot->closest )
- turn_speed += FLOCK_WGAIN * robot->closest_heading_error;
- }
- else
- {
- // front not clear. we might be stuck, so wiggle a bit
- if( fabs(turn_speed) < 0.1 )
- turn_speed = drand48();
- }
-
- robot->position->SetSpeed( forward_speed, side_speed, turn_speed );
-
- return 0;
-}
-
-
-int FiducialUpdate( ModelFiducial* fid, robot_t* robot )
-{
- // find the closest teammate
-
- double dist = 1e6; // big
- double dist_red = 1e6; // big
-
- robot->closest = NULL;
- robot->closest_red = NULL;
-
- FOR_EACH( it, fid->GetFiducials() )
- {
- ModelFiducial::Fiducial* other = &(*it);
-
- if( other->range < dist )
- {
- dist = other->range;
- robot->closest = other;
- }
-
- Color red( "red" );
-
- if( other->mod->GetColor() == red && other->range < dist_red )
- {
- dist_red = other->range;
- robot->closest_red = other;
- }
- }
-
- if( robot->closest_red ) // if we saw someone red
- {
- robot->closest_bearing = robot->closest_red->bearing;
- robot->closest_range = robot->closest_red->range;
- robot->closest_heading_error = robot->closest_red->bearing;
-
-
- printf( "bearing %.2f\n", robot->closest_red->bearing );
- }
-// else if( robot->closest ) // if we saw someone else
-// {
-// robot->closest_bearing = robot->closest->bearing;
-// robot->closest_range = robot->closest->range;
-// robot->closest_heading_error = robot->closest->geom.a;
-// }
-
-
-
- return 0;
-}
Please sign in to comment.
Something went wrong with that request. Please try again.