Permalink
Browse files

fixed bug in fasr2 controller caused by new ranger model

  • Loading branch information...
1 parent 22ff5b0 commit 90feb73e9fe5706ffa83f57fdf835f9a99aece47 @rtv committed Nov 26, 2010
Showing with 5 additions and 5 deletions.
  1. +1 −1 examples/ctrl/fasr2.cc
  2. +2 −2 libstage/model_ranger.cc
  3. +2 −2 libstage/stage.hh
View
@@ -563,7 +563,7 @@ class Robot
const std::vector<ModelRanger::Sensor>& sensors = sonar->GetSensors();
for( unsigned int s = BACK_SENSOR_FIRST; s <= BACK_SENSOR_LAST; ++s )
- if( sensors[s].ranges[0] < wait_distance)
+ if( sensors[s].ranges.size() < 1 || sensors[s].ranges[0] < wait_distance)
{
pos->Say( "Waiting..." );
pos->SetXSpeed( 0.0 );
View
@@ -149,8 +149,8 @@ void ModelRanger::Sensor::Load( Worldfile* wf, int entity )
col.Load( wf, entity );
fov = wf->ReadAngle( entity, "fov", fov );
sample_count = wf->ReadInt( entity, "samples", sample_count );
- ranges.resize(sample_count);
- intensities.resize(sample_count);
+ //ranges.resize(sample_count);
+ //intensities.resize(sample_count);
}
void ModelRanger::Load( void )
View
@@ -2742,8 +2742,8 @@ namespace Stg
fov( 0.1 ),
sample_count(1),
col( 0,1,0,0.3 ),
- ranges(sample_count),
- intensities(sample_count)
+ ranges(),
+ intensities()
{}
void Update( ModelRanger* rgr );

0 comments on commit 90feb73

Please sign in to comment.