Skip to content
Browse files

fixed platform-varying float type bug

  • Loading branch information...
1 parent 1a9d557 commit ec78a1c0ff085868928575f0187ac3fdb20c7169 @rtv committed
Showing with 16 additions and 16 deletions.
  1. +2 −1 CMakeLists.txt
  2. +1 −2 libstage/CMakeLists.txt
  3. +5 −5 libstage/model.cc
  4. +1 −1 libstage/stage.hh
  5. +3 −3 libstage/typetable.cc
  6. +4 −4 worlds/fasr.world
View
3 CMakeLists.txt
@@ -40,7 +40,8 @@ ENDIF (NOT PROJECT_OS_WIN AND NOT PROJECT_OS_SOLARIS)
#####################################
# Build type cflags
-SET (CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG ${WALL} " CACHE INTERNAL "C Flags for release" FORCE)
+SET (OPTIMIZE "-O2")
+SET (CMAKE_CXX_FLAGS_RELEASE " ${OPTIMIZE} -DNDEBUG ${WALL} " CACHE INTERNAL "C Flags for release" FORCE)
SET (CMAKE_CXX_FLAGS_DEBUG " -ggdb ${WALL} " CACHE INTERNAL "C Flags for debug" FORCE)
SET (CMAKE_CXX_FLAGS_PROFILE " -ggdb -pg ${WALL} " CACHE INTERNAL "C Flags for profile" FORCE)
View
3 libstage/CMakeLists.txt
@@ -72,10 +72,9 @@ set_source_files_properties( ${stagebinarySrcs} PROPERTIES COMPILE_FLAGS "${FLTK
#set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION})
#set(MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION})
#set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2010. All Rights Reserved.")
-
# add_executable( stagebinary MACOSX_BUNDLE ${stagebinarySrcs} )
-add_executable( stagebinary MACOSX_BUNDLE ${stagebinarySrcs} )
+add_executable( stagebinary ${stagebinarySrcs} )
# Apple seems to have trouble when libstage and stagebinary are linked against FLTK
# Newer Linux distributions won't allow stagebinary to inherit libstage's links to fltk, so we need
View
10 libstage/model.cc
@@ -646,10 +646,10 @@ bool Model::IsRelated( const Model* that ) const
}
point_t Model::LocalToGlobal( const point_t& pt) const
- {
- const Pose gpose = LocalToGlobal( Pose( pt.x, pt.y, 0, 0 ) );
- return point_t( gpose.x, gpose.y );
- }
+{
+ const Pose gpose = LocalToGlobal( Pose( pt.x, pt.y, 0, 0 ) );
+ return point_t( gpose.x, gpose.y );
+}
void Model::LocalToPixels( const std::vector<point_t>& local,
@@ -661,7 +661,7 @@ void Model::LocalToPixels( const std::vector<point_t>& local,
{
Pose ptpose = gpose + Pose( it->x, it->y, 0, 0 );
global.push_back( point_int_t( (int32_t)floor( ptpose.x * world->ppm) ,
- (int32_t)floor( ptpose.y * world->ppm) ));
+ (int32_t)floor( ptpose.y * world->ppm) ));
}
}
View
2 libstage/stage.hh
@@ -2808,7 +2808,7 @@ namespace Stg
Color col;
std::vector<meters_t> ranges;
- std::vector<float> intensities;
+ std::vector<float_t> intensities;
Sensor() : pose( 0,0,0,0 ),
size( 0.02, 0.02, 0.02 ), // teeny transducer
View
6 libstage/typetable.cc
@@ -2,7 +2,7 @@
using namespace Stg;
-/* Template used to created named wrappers for model constructors */
+/* Create named wrappers for model constructors */
template <class T>
Model* Creator( World* world, Model* parent, const std::string& type )
{
@@ -10,9 +10,9 @@ Model* Creator( World* world, Model* parent, const std::string& type )
}
static void Register( const std::string& type,
- creator_t func )
+ creator_t func )
{
- Model::name_map[ type ] = func;
+ Model::name_map[type] = func;
}
/** Map model names to named constructors for each model type */
View
8 worlds/fasr.world
@@ -7,16 +7,16 @@ include "pioneer.inc"
include "map.inc"
include "sick.inc"
-speedup 20.000
-paused 1
+speedup 0 # 20.000
+paused 0
# time at which to pause (in GUI mode) or quit (in headless mode) the simulation
#quit_time 3600 # 1 hour of simulated time
-#quit_time 1800 # hour of simulated time
+quit_time 1800 # 30 mins of simulated time
resolution 0.02
-threads 8
+threads 0
# configure the GUI window
window

0 comments on commit ec78a1c

Please sign in to comment.
Something went wrong with that request. Please try again.