In RiSESimHW.cc:
///// Note that in MMGetFloatSymbol, the first value is the variable you read in
///// and the second value is the default value if it isn't there.
// update step is loaded from the module manager setting
float update_step
= MMGetFloatSymbol( "mm_update_period", 1000 );
// other step sizes are loaded from cdl settings
float display_step
= MMGetFloatSymbol( "sim_cdl_display_step", 1.0/60.0 * 1e6 );
float integration_step
= MMGetFloatSymbol( "sim_cdl_integration_step", 1e-4 * 1e6 );
float collision_step
= MMGetFloatSymbol( "sim_cdl_collision_step", 1e-4 * 1e6 );
update_step = update_step / 1e6; // put in seconds, not microseconds
display_step = display_step / 1e6;
integration_step = integration_step / 1e6;
collision_step = collision_step / 1e6;
if (integration_step > update_step)
MMWarning("initHardware",
"Integration step should be much smaller than RHexLib update");
sprintf( msg, " Configuration: upd:%f, disp:%f, integ:%f, coll:%f\n",
update_step, display_step, integration_step, collision_step );
MMMessage( msg );
// Set simulation parameters
cdl->updateStep( update_step );
cdl->displayStep( display_step );
cdl->integrationStep( integration_step );
cdl->collisionStep( collision_step );
// hard coded backup limit;
cdl->backupLimit( 0.1 );
In supervisorlearn, in rise_arachi_learn.rc :
# ------------------------------------------------------------
# Simulation parameters for ACCURACY
#
# float mm_update_period = 1000; # 1 KHz
# float sim_cdl_integration_step = 25; # 40 KHz
# float sim_cdl_collision_step = 25;
# float sim_cdl_display_step = 10000; # 100 fps
# ------------------------------------------------------------
# Simulation parameters for SPEED
#
int mm_update_period = 5000; # 200 Hz
float sim_cdl_integration_step = 500; # 2 KHz
float sim_cdl_collision_step =500;
float sim_cdl_display_step = 10000; # 100 fps
==> This computes to dividing everything by 1e6. This equals:
### For SPEED:
cdl->updateStep( 5e-3 ); // mm_update_period. 5e3 * 1e-6 = 5e-3 = 0.005
cdl->displayStep( 1/100 ); // sim_cdl_display_step 10e3 * 1e-6 = 10e-3 = 0.01
cdl->integrationStep( 1e-3 /2 ); // sim_cdl_integration_step 500 * 1e-6 = 0.5e-3 = 0.0005
//pcm->updateStep( ); // not set here, not sure where this is set!
cdl->collisionStep( 1e-3 /2 ); //sim_cdl_collision_step 500 * 1e-6 = 0.5e-3 = 0.0005
cdl->backupLimit( 0.1 ); // hard-coded
### For ACCURACY:
cdl->updateStep( 1e-3 ); // mm_update_period. 1e3 * 1e-6 = 1e-3 = 0.001
cdl->displayStep( 1/100 ); // sim_cdl_display_step 10e3 * 1e-6 = 10e-3 = 0.01
cdl->integrationStep( 25e-6 ); // sim_cdl_integration_step 25 * 1e-6 = 25e-6 = 0.000025
//pcm->updateStep( ); // not set here, not sure where this is set!
cdl->collisionStep( 25e-6 ); //sim_cdl_collision_step 25 * 1e-6 = 25e-6 = 0.000025
cdl->backupLimit( 0.1 ); // hard-coded
==> so, the only difference between SPEED and ACCURACY is in the sim_cdl_integration_step and sim_cdl_collision_step.
// float update_step = MMGetFloatSymbol( "mm_update_period", 1000 );
// float display_step = MMGetFloatSymbol( "sim_cdl_display_step", 1.0/60.0 * 1e6 );
// float integration_step = MMGetFloatSymbol( "sim_cdl_integration_step", 1e-4 * 1e6 );
// float collision_step = MMGetFloatSymbol( "sim_cdl_collision_step", 1e-4 * 1e6 );
In cdlexample.cc:
// Set simulation parameters
cdl->updateStep( 1e-3 );
cdl->displayStep( 1/30.0 );
cdl->integrationStep( 1e-3 /2 );
pcm->updateStep( 1e-3 /2 );
cdl->collisionStep( 1e-3 /2 );
cdl->backupLimit( 0.1 );
-- AlanAsbeck - 16 Mar 2007