From 5ab3af77156170788088c8f06f2bf7f669584d67 Mon Sep 17 00:00:00 2001 From: rtv Date: Fri, 28 Aug 2009 01:58:11 +0000 Subject: [PATCH] added vis of current draw from powerpacks --- libstage/model.cc | 4 +- libstage/model_actuator.cc | 38 ++++++++----------- libstage/model_getset.cc | 2 +- libstage/model_laser.cc | 11 ++---- libstage/model_load.cc | 32 +++++----------- libstage/model_position.cc | 65 ++++++++++++++------------------- libstage/powerpack.cc | 36 ++++++++++++++---- libstage/stage.hh | 75 +++++++++++++++++++------------------- libstage/worldgui.cc | 7 ---- worlds/simple.world | 1 - 10 files changed, 125 insertions(+), 146 deletions(-) diff --git a/libstage/model.cc b/libstage/model.cc index e30013e2a..b0148901b 100644 --- a/libstage/model.cc +++ b/libstage/model.cc @@ -110,7 +110,6 @@ using namespace Stg; // static members uint32_t Model::count = 0; std::map Model::modelsbyid; - std::map Model::name_map; void Size::Load( Worldfile* wf, int section, const char* keyword ) @@ -957,7 +956,7 @@ PowerPack* Model::FindPowerPack() const { if( power_pack ) return power_pack; - + if( parent ) return parent->FindPowerPack(); @@ -1120,4 +1119,3 @@ void Model::RasterVis::ClearPts() { pts.clear(); } - diff --git a/libstage/model_actuator.cc b/libstage/model_actuator.cc index 51052687e..92464ca12 100644 --- a/libstage/model_actuator.cc +++ b/libstage/model_actuator.cc @@ -56,8 +56,8 @@ actuator if a linear actuator the axis that the actuator will move along */ -static const double STG_ACTUATOR_WATTS_KGMS = 5.0; // cost per kg per meter per second -static const double STG_ACTUATOR_WATTS = 2.0; // base cost of position device +static const double WATTS_KGMS = 5.0; // cost per kg per meter per second +static const double WATTS_BASE = 2.0; // base cost of position device ModelActuator::ModelActuator( World* world, Model* parent, @@ -68,12 +68,11 @@ ModelActuator::ModelActuator( World* world, max_speed(1), min_position(0), max_position(1), - control_mode( STG_ACTUATOR_CONTROL_VELOCITY ), - actuator_type( STG_ACTUATOR_TYPE_LINEAR ), + control_mode( CONTROL_VELOCITY ), + actuator_type( TYPE_LINEAR ), axis(0,0,0) { - // no power consumed until we're subscribed - this->SetWatts( 0 ); + this->SetWatts( WATTS_BASE ); // sensible position defaults this->SetVelocity( Velocity(0,0,0,0) ); @@ -100,9 +99,9 @@ void ModelActuator::Load( void ) if( type_str ) { if( strcmp( type_str, "linear" ) == 0 ) - actuator_type = STG_ACTUATOR_TYPE_LINEAR; + actuator_type = TYPE_LINEAR; else if( strcmp( type_str, "rotational" ) == 0 ) - actuator_type = STG_ACTUATOR_TYPE_ROTATIONAL; + actuator_type = TYPE_ROTATIONAL; else { PRINT_ERR1( "invalid actuator type specified: \"%s\" - should be one of: \"linear\" or \"rotational\". Using \"linear\" as default.", type_str ); @@ -110,7 +109,7 @@ void ModelActuator::Load( void ) } } - if (actuator_type == STG_ACTUATOR_TYPE_LINEAR) + if (actuator_type == TYPE_LINEAR) { // if we are a linear actuator find the axis we operate in if( wf->PropertyExists( wf_entity, "axis" ) ) @@ -169,11 +168,11 @@ void ModelActuator::Update( void ) switch (actuator_type) { - case STG_ACTUATOR_TYPE_LINEAR: + case TYPE_LINEAR: { pos = PoseDiff.x * axis.x + PoseDiff.y * axis.y + PoseDiff.z * axis.z; // Dot product to find distance along axis } break; - case STG_ACTUATOR_TYPE_ROTATIONAL: + case TYPE_ROTATIONAL: { pos = PoseDiff.a; } break; @@ -186,7 +185,7 @@ void ModelActuator::Update( void ) { switch( control_mode ) { - case STG_ACTUATOR_CONTROL_VELOCITY : + case CONTROL_VELOCITY : { PRINT_DEBUG( "actuator velocity control mode" ); PRINT_DEBUG2( "model %s command(%.2f)", @@ -198,7 +197,7 @@ void ModelActuator::Update( void ) velocity = goal; } break; - case STG_ACTUATOR_CONTROL_POSITION: + case CONTROL_POSITION: { PRINT_DEBUG( "actuator position control mode" ); @@ -233,14 +232,14 @@ void ModelActuator::Update( void ) Velocity outvel; switch (actuator_type) { - case STG_ACTUATOR_TYPE_LINEAR: + case TYPE_LINEAR: { outvel.x = axis.x * velocity; outvel.y = axis.y * velocity; outvel.z = axis.z * velocity; outvel.a = 0; } break; - case STG_ACTUATOR_TYPE_ROTATIONAL: + case TYPE_ROTATIONAL: { outvel.x = outvel.y = outvel.z = 0; outvel.a = velocity; @@ -263,9 +262,6 @@ void ModelActuator::Startup( void ) Model::Startup(); PRINT_DEBUG( "position startup" ); - - this->SetWatts( STG_ACTUATOR_WATTS ); - } void ModelActuator::Shutdown( void ) @@ -277,20 +273,18 @@ void ModelActuator::Shutdown( void ) velocity.Zero(); - this->SetWatts( 0 ); - Model::Shutdown(); } void ModelActuator::SetSpeed( double speed) { - control_mode = STG_ACTUATOR_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal = speed; } void ModelActuator::GoTo( double pos) { - control_mode = STG_ACTUATOR_CONTROL_POSITION; + control_mode = CONTROL_POSITION; goal = pos; } diff --git a/libstage/model_getset.cc b/libstage/model_getset.cc index b9969b532..33f526497 100644 --- a/libstage/model_getset.cc +++ b/libstage/model_getset.cc @@ -116,7 +116,7 @@ void Model::SetGuiOutline( int val ) CallCallbacks( &gui.outline ); } -void Model::SetWatts( stg_watts_t val ) +void Model::SetWatts( stg_watts_t val ) { watts = val; CallCallbacks( &watts ); diff --git a/libstage/model_laser.cc b/libstage/model_laser.cc index 08357d32a..6f9e5df86 100644 --- a/libstage/model_laser.cc +++ b/libstage/model_laser.cc @@ -96,6 +96,9 @@ ModelLaser::ModelLaser( World* world, // set up our data buffers and raytracing SampleConfig(); + // start consuming power + watts = DEFAULT_WATTS; + AddVisualizer( &vis, true ); } @@ -111,9 +114,6 @@ void ModelLaser::Load( void ) fov = wf->ReadAngle( wf_entity, "fov", fov ); resolution = wf->ReadInt( wf_entity, "resolution", resolution ); - //showLaserData.Load( wf, wf_entity ); - //showLaserStrikes.Load( wf, wf_entity ); - if( resolution < 1 ) { PRINT_WARN( "laser resolution set < 1. Forcing to 1" ); @@ -228,17 +228,12 @@ void ModelLaser::Update( void ) void ModelLaser::Startup( void ) { Model::Startup(); - PRINT_DEBUG( "laser startup" ); - - // start consuming power - SetWatts( DEFAULT_WATTS ); } void ModelLaser::Shutdown( void ) { PRINT_DEBUG( "laser shutdown" ); - SetWatts( 0 ); // stop consuming power Model::Shutdown(); } diff --git a/libstage/model_load.cc b/libstage/model_load.cc index e38198949..1d5b9c03c 100644 --- a/libstage/model_load.cc +++ b/libstage/model_load.cc @@ -47,40 +47,28 @@ void Model::Load() power_pack->GetCapacity() ) ); } - // use my own pack or an ancestor's for the other energy properties - PowerPack* pp = FindPowerPack(); - - watts = wf->ReadFloat( wf_entity, "watts", watts ); - if( (watts > 0) && !pp ) - PRINT_WARN1( "Model %s: Setting \"watts\" has no effect unless \"joules\" is specified for this model or a parent", token ); - - watts_give = wf->ReadFloat( wf_entity, "give_watts", watts_give ); - if( (watts_give > 0.0) && !pp) - PRINT_WARN1( "Model %s: Setting \"watts_give\" has no effect unless \"joules\" is specified for this model or a parent", token ); - + watts = wf->ReadFloat( wf_entity, "watts", watts ); + watts_give = wf->ReadFloat( wf_entity, "give_watts", watts_give ); watts_take = wf->ReadFloat( wf_entity, "take_watts", watts_take ); - if( (watts_take > 0.0) & !pp ) - PRINT_WARN1( "Model %s: Setting \"watts_take\" has no effect unless \"joules\" is specified for this model or a parent", token ); - if( wf->PropertyExists( wf_entity, "debug" ) ) { PRINT_WARN2( "debug property specified for model %d %s\n", - wf_entity, this->token ); + wf_entity, this->token ); this->debug = wf->ReadInt( wf_entity, "debug", this->debug ); } - + if( wf->PropertyExists( wf_entity, "name" ) ) { char *name = (char*)wf->ReadString(wf_entity, "name", NULL ); if( name ) - { - //printf( "adding name %s to %s\n", name, this->token ); - this->token = strdup( name ); - world->AddModel( this ); // add this name to the world's table - } + { + //printf( "adding name %s to %s\n", name, this->token ); + this->token = strdup( name ); + world->AddModel( this ); // add this name to the world's table + } else - PRINT_ERR1( "Name blank for model %s. Check your worldfile\n", this->token ); + PRINT_ERR1( "Name blank for model %s. Check your worldfile\n", this->token ); } //PRINT_WARN1( "%s::Load", token ); diff --git a/libstage/model_position.cc b/libstage/model_position.cc index 1cd0e9c33..06e7cbfe8 100644 --- a/libstage/model_position.cc +++ b/libstage/model_position.cc @@ -83,9 +83,9 @@ ModelPosition::ModelPosition( World* world, const std::string& type ) : Model( world, parent, type ), goal(0,0,0,0), - control_mode( STG_POSITION_CONTROL_VELOCITY ), - drive_mode( STG_POSITION_DRIVE_DIFFERENTIAL ), - localization_mode( STG_POSITION_LOCALIZATION_GPS ), + control_mode( CONTROL_VELOCITY ), + drive_mode( DRIVE_DIFFERENTIAL ), + localization_mode( LOCALIZATION_GPS ), integration_error( drand48() * INTEGRATION_ERROR_MAX_X - INTEGRATION_ERROR_MAX_X/2.0, drand48() * INTEGRATION_ERROR_MAX_Y - INTEGRATION_ERROR_MAX_Y/2.0, drand48() * INTEGRATION_ERROR_MAX_Z - INTEGRATION_ERROR_MAX_Z/2.0, @@ -101,11 +101,6 @@ ModelPosition::ModelPosition( World* world, // assert that Update() is reentrant for this derived model thread_safe = false; - // no power consumed until we're subscribed - this->SetWatts( 0 ); - - this->SetVelocity( Velocity(0,0,0,0) ); - this->SetBlobReturn( true ); AddVisualizer( &wpvis, true ); @@ -131,11 +126,11 @@ void ModelPosition::Load( void ) if( mode_str ) { if( strcmp( mode_str, "diff" ) == 0 ) - drive_mode = STG_POSITION_DRIVE_DIFFERENTIAL; + drive_mode = DRIVE_DIFFERENTIAL; else if( strcmp( mode_str, "omni" ) == 0 ) - drive_mode = STG_POSITION_DRIVE_OMNI; + drive_mode = DRIVE_OMNI; else if( strcmp( mode_str, "car" ) == 0 ) - drive_mode = STG_POSITION_DRIVE_CAR; + drive_mode = DRIVE_CAR; else { PRINT_ERR1( "invalid position drive mode specified: \"%s\" - should be one of: \"diff\", \"omni\" or \"car\". Using \"diff\" as default.", mode_str ); @@ -202,9 +197,9 @@ void ModelPosition::Load( void ) if( loc_str ) { if( strcmp( loc_str, "gps" ) == 0 ) - localization_mode = STG_POSITION_LOCALIZATION_GPS; + localization_mode = LOCALIZATION_GPS; else if( strcmp( loc_str, "odom" ) == 0 ) - localization_mode = STG_POSITION_LOCALIZATION_ODOM; + localization_mode = LOCALIZATION_ODOM; else PRINT_ERR2( "unrecognized localization mode \"%s\" for model \"%s\"." " Valid choices are \"gps\" and \"odom\".", @@ -227,7 +222,7 @@ void ModelPosition::Update( void ) { switch( control_mode ) { - case STG_POSITION_CONTROL_VELOCITY : + case CONTROL_VELOCITY : { PRINT_DEBUG( "velocity control mode" ); PRINT_DEBUG4( "model %s command(%.2f %.2f %.2f)", @@ -238,21 +233,21 @@ void ModelPosition::Update( void ) switch( drive_mode ) { - case STG_POSITION_DRIVE_DIFFERENTIAL: + case DRIVE_DIFFERENTIAL: // differential-steering model, like a Pioneer vel.x = goal.x; vel.y = 0; vel.a = goal.a; break; - case STG_POSITION_DRIVE_OMNI: + case DRIVE_OMNI: // direct steering model, like an omnidirectional robot vel.x = goal.x; vel.y = goal.y; vel.a = goal.a; break; - case STG_POSITION_DRIVE_CAR: + case DRIVE_CAR: // car like steering model based on speed and turning angle vel.x = goal.x * cos(goal.a); vel.y = 0; @@ -264,7 +259,7 @@ void ModelPosition::Update( void ) } } break; - case STG_POSITION_CONTROL_POSITION: + case CONTROL_POSITION: { PRINT_DEBUG( "position control mode" ); @@ -282,7 +277,7 @@ void ModelPosition::Update( void ) switch( drive_mode ) { - case STG_POSITION_DRIVE_OMNI: + case DRIVE_OMNI: { // this is easy - we just reduce the errors in each axis // independently with a proportional controller, speed @@ -293,7 +288,7 @@ void ModelPosition::Update( void ) } break; - case STG_POSITION_DRIVE_DIFFERENTIAL: + case DRIVE_DIFFERENTIAL: { // axes can not be controlled independently. We have to // turn towards the desired x,y position, drive there, @@ -371,7 +366,7 @@ void ModelPosition::Update( void ) switch( localization_mode ) { - case STG_POSITION_LOCALIZATION_GPS: + case LOCALIZATION_GPS: { // compute our localization pose based on the origin and true pose Pose gpose = this->GetGlobalPose(); @@ -387,7 +382,7 @@ void ModelPosition::Update( void ) } break; - case STG_POSITION_LOCALIZATION_ODOM: + case LOCALIZATION_ODOM: { // integrate our velocities to get an 'odometry' position estimate. double dt = interval / 1e6; // update interval convert to seconds @@ -419,10 +414,8 @@ void ModelPosition::Update( void ) void ModelPosition::Startup( void ) { Model::Startup(); - + PRINT_DEBUG( "position startup" ); - - this->SetWatts( WATTS ); } void ModelPosition::Shutdown( void ) @@ -430,10 +423,8 @@ void ModelPosition::Shutdown( void ) PRINT_DEBUG( "position shutdown" ); // safety features! - bzero( &goal, sizeof(goal) ); - bzero( &velocity, sizeof(velocity) ); - - this->SetWatts( 0 ); + goal.Zero(); + velocity.Zero(); Model::Shutdown(); } @@ -449,7 +440,7 @@ void ModelPosition::SetSpeed( double x, double y, double a ) //assert( ! isnan(y) ); //assert( ! isnan(a) ); - control_mode = STG_POSITION_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal.x = x; goal.y = y; goal.z = 0; @@ -459,7 +450,7 @@ void ModelPosition::SetSpeed( double x, double y, double a ) void ModelPosition::SetXSpeed( double x ) { //assert( ! isnan(x) ); - control_mode = STG_POSITION_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal.x = x; } @@ -467,21 +458,21 @@ void ModelPosition::SetXSpeed( double x ) void ModelPosition::SetYSpeed( double y ) { //assert( ! isnan(y) ); - control_mode = STG_POSITION_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal.y = y; } void ModelPosition::SetZSpeed( double z ) { //assert( ! isnan(z) ); - control_mode = STG_POSITION_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal.z = z; } void ModelPosition::SetTurnSpeed( double a ) { //assert( ! isnan(a) ); - control_mode = STG_POSITION_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal.a = a; } @@ -493,7 +484,7 @@ void ModelPosition::SetSpeed( Velocity vel ) //assert( ! isnan(vel.z) ); //assert( ! isnan(vel.a) ); - control_mode = STG_POSITION_CONTROL_VELOCITY; + control_mode = CONTROL_VELOCITY; goal.x = vel.x; goal.y = vel.y; goal.z = vel.z; @@ -506,7 +497,7 @@ void ModelPosition::GoTo( double x, double y, double a ) //assert( ! isnan(y) ); //assert( ! isnan(a) ); - control_mode = STG_POSITION_CONTROL_POSITION; + control_mode = CONTROL_POSITION; goal.x = x; goal.y = y; goal.z = 0; @@ -515,7 +506,7 @@ void ModelPosition::GoTo( double x, double y, double a ) void ModelPosition::GoTo( Pose pose ) { - control_mode = STG_POSITION_CONTROL_POSITION; + control_mode = CONTROL_POSITION; goal = pose; } diff --git a/libstage/powerpack.cc b/libstage/powerpack.cc index 7e7a6f3e0..bfcdecda7 100644 --- a/libstage/powerpack.cc +++ b/libstage/powerpack.cc @@ -23,7 +23,10 @@ PowerPack::PowerPack( Model* mod ) : stored( 0.0 ), capacity( 0.0 ), charging( false ), - dissipated( 0.0 ) + dissipated( 0.0 ), + last_time(0), + last_joules(0.0), + last_watts(0.0) { // tell the world about this new pp mod->world->AddPowerPack( this ); @@ -48,7 +51,7 @@ void PowerPack::Print( char* prefix ) const } /** OpenGL visualization of the powerpack state */ -void PowerPack::Visualize( Camera* cam ) const +void PowerPack::Visualize( Camera* cam ) { const double height = 0.5; const double width = 0.2; @@ -64,8 +67,7 @@ void PowerPack::Visualize( Camera* cam ) const else glColor4f( 1,0,0, alpha ); // red - static char buf[6]; - snprintf( buf, 6, "%.0f", percent ); + // snprintf( buf, 32, "%.0f", percent ); glTranslatef( -width, 0.0, 0.0 ); @@ -126,9 +128,29 @@ void PowerPack::Visualize( Camera* cam ) const glLineWidth( 1.0 ); } - - // draw the percentage - //gl_draw_string( -0.2, 0, 0, buf ); + + // compute the instantaneous power output + stg_usec_t time_now = mod->world->SimTimeNow(); + stg_usec_t delta_t = time_now - last_time; + stg_watts_t watts = last_watts; + + if( delta_t > 0 ) // some sim time elapsed + { + stg_joules_t delta_j = stored - last_joules; + stg_watts_t watts = (-1e6 * delta_j) / (double)delta_t; + + last_joules = stored; + last_time = time_now; + last_watts = watts; + } + + if( fabs(watts) > 1e-5 ) // any current + { + glColor4f( 1,0,0,0.8 ); // red + char buf[32]; + snprintf( buf, 32, "%.1fW", watts ); + Gl::draw_string( -0.05,height+0.05,0, buf ); + } } diff --git a/libstage/stage.hh b/libstage/stage.hh index 5f9e4fea1..034068b46 100644 --- a/libstage/stage.hh +++ b/libstage/stage.hh @@ -146,9 +146,6 @@ namespace Stg "The text of the license may also be available online at\n" \ "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n"; - /** The maximum length of a Stage model identifier string */ - const uint32_t TOKEN_MAX = 64; - /** Convenient constant */ const double thousand = 1e3; @@ -695,8 +692,10 @@ namespace Stg void Load( Worldfile* wf, int section ); void Save( Worldfile* wf, int section ); - public: - + public: + /** The maximum length of a Stage model identifier string */ + static const uint32_t TOKEN_MAX = 64; + /** get the children of the this element */ ModelPtrVec& GetChildren(){ return children;} @@ -704,7 +703,6 @@ namespace Stg void ForEachDescendant( stg_model_callback_t func, void* arg ); /** array contains the number of each type of child model */ - //unsigned int child_type_counts[MODEL_TYPE_COUNT]; std::map child_type_counts; Ancestor(); @@ -1223,16 +1221,17 @@ namespace Stg uint32_t GetCount(){ return blocks.size(); }; const Size& GetSize(){ return size; }; const stg_point3_t& GetOffset(){ return offset; }; - - /** establish the min and max of all the blocks, so we can scale this - group later */ + + /** Establish the min and max of all the blocks, so we can scale this + group later. */ void CalcSize(); + void AppendBlock( Block* block ); void CallDisplayList( Model* mod ); void Clear() ; /** deletes all blocks from the group */ void AppendTouchingModels( ModelPtrSet& touchers ); - + /** Returns a pointer to the first model detected to be colliding with a block in this group, or NULL, if none are detected. */ Model* TestCollision(); @@ -1242,11 +1241,11 @@ namespace Stg void Map(); void UnMap(); - void DrawSolid( const Geom &geom); // draw the block in OpenGL as a solid single color - void DrawFootPrint( const Geom &geom); // draw the - // projection of the - // block onto the z=0 - // plane + /** Draw the block in OpenGL as a solid single color. */ + void DrawSolid( const Geom &geom); + + /** Draw the projection of the block onto the z=0 plane. */ + void DrawFootPrint( const Geom &geom); void LoadBitmap( Model* mod, const char* bitmapfile, Worldfile *wf ); void LoadBlock( Model* mod, Worldfile* wf, int entity ); @@ -1263,12 +1262,6 @@ namespace Stg }; - - //typedef int ctrlinit_t( Model* mod ); - //typedef void ctrlupdate_t( Model* mod ); - - // BLOCKS - class Camera { protected: @@ -1419,8 +1412,8 @@ namespace Stg timesteps. */ stg_usec_t real_time_interval; - stg_usec_t real_time_now; ///< The current real time in microseconds - //stg_usec_t real_time_start; ///< the real time at which this world was created + /** The current real time in microseconds. */ + stg_usec_t real_time_now; /** The last recorded real time, sampled every $timing_interval updates. */ @@ -1547,6 +1540,7 @@ namespace Stg void Accumulate( stg_meters_t x, stg_meters_t y, stg_joules_t amount ); } event_vis; + StripPlotVis output_vis; StripPlotVis stored_vis; @@ -1565,6 +1559,11 @@ namespace Stg /** Energy dissipated */ stg_joules_t dissipated; + + // these are used to visualize the power draw + stg_usec_t last_time; + stg_joules_t last_joules; + stg_watts_t last_watts; static stg_joules_t global_stored; static stg_joules_t global_capacity; @@ -1576,7 +1575,7 @@ namespace Stg ~PowerPack(); /** OpenGL visualization of the powerpack state */ - void Visualize( Camera* cam ) const; + void Visualize( Camera* cam ); /** Print human-readable status on stdout, prefixed with the argument string */ @@ -1816,7 +1815,7 @@ namespace Stg void ClearPts(); } rastervis; - + bool rebuild_displaylist; ///< iff true, regenerate block display list before redraw char* say_string; ///< if non-null, this string is displayed in the GUI @@ -2849,21 +2848,21 @@ namespace Stg public: /** Define a position control method */ typedef enum - { STG_POSITION_CONTROL_VELOCITY, - STG_POSITION_CONTROL_POSITION + { CONTROL_VELOCITY, + CONTROL_POSITION } ControlMode; /** Define a localization method */ typedef enum - { STG_POSITION_LOCALIZATION_GPS, - STG_POSITION_LOCALIZATION_ODOM + { LOCALIZATION_GPS, + LOCALIZATION_ODOM } LocalizationMode; /** Define a driving method */ typedef enum - { STG_POSITION_DRIVE_DIFFERENTIAL, - STG_POSITION_DRIVE_OMNI, - STG_POSITION_DRIVE_CAR + { DRIVE_DIFFERENTIAL, + DRIVE_OMNI, + DRIVE_CAR } DriveMode; private: @@ -2942,14 +2941,14 @@ namespace Stg public: /** Define a actuator control method */ typedef enum - { STG_ACTUATOR_CONTROL_VELOCITY, - STG_ACTUATOR_CONTROL_POSITION + { CONTROL_VELOCITY, + CONTROL_POSITION } ControlMode; /** Define an actuator type */ typedef enum - { STG_ACTUATOR_TYPE_LINEAR, - STG_ACTUATOR_TYPE_ROTATIONAL + { TYPE_LINEAR, + TYPE_ROTATIONAL } ActuatorType; private: @@ -2976,13 +2975,13 @@ namespace Stg virtual void Update(); virtual void Load(); - /** Sets the control_mode to STG_ACTUATOR_CONTROL_VELOCITY and sets + /** Sets the control_mode to CONTROL_VELOCITY and sets the goal velocity. */ void SetSpeed( double speed ); double GetSpeed() const {return goal;} - /** Sets the control mode to STG_ACTUATOR_CONTROL_POSITION and sets + /** Sets the control mode to CONTROL_POSITION and sets the goal pose */ void GoTo( double pose ); diff --git a/libstage/worldgui.cc b/libstage/worldgui.cc index 4d0e770d9..6de8fcd74 100644 --- a/libstage/worldgui.cc +++ b/libstage/worldgui.cc @@ -607,13 +607,6 @@ void WorldGui::onceCb( Fl_Widget* w, WorldGui* wg ) void WorldGui::viewOptionsCb( OptionsDlg* oDlg, WorldGui* wg ) { - // the options dialog expects a std::vector of options (annoyingly) - // std::vector optvec; - // adds each option to the vector - //g_hash_table_foreach( wg->option_table, - // (GHFunc)append_option, - // (void*)&optvec ); - // sort the vector by option label alphabetically //std::sort();// wg->option_table.begin(), wg->option_table.end() );//, sort_option_pointer ); //std::sort();// wg->option_table.begin(), wg->option_table.end() );//, sort_option_pointer ); diff --git a/worlds/simple.world b/worlds/simple.world index 9e3d27f2a..64f57e46b 100644 --- a/worlds/simple.world +++ b/worlds/simple.world @@ -48,7 +48,6 @@ pioneer2dx # ctrl "lasernoise" # uncomment this line to run a laser noise generator ) - ctrl "wander" # report error-free position in world coordinates