Parameters for Learning Models - VigneshManoj/ambf GitHub Wiki

Parameters that could be varied while interfacing with Learning Models

The parameters that could be passed while launching AMBF simulator can be found by adding the argument --help
The below factors could be used to help give control over AMBF while interfacing with learning models:

  1. dynamic_loop_freq It helps control the frequency of underlying physics solver loop.
  2. sim_speed_factor It can be used to change the simulation speed (By default equal to 1).
  3. wall_time It denotes the System Clock (Wall Clock) in seconds.
  4. sim_time It denotes the time of the physics simulation (For Real-Time sim_time == wall_time).
  5. fixed_phx_timestep It makes the simulation wait for a given time, before the physics simulation computes the next step.

Another variable that can be used with learning models is:
enable_step_throttling It is a Boolean that can be used to enable/disable physics simulation throttling.

  • The dynamic loop frequency can be used to set the number of smaller iterations the simulation computes for a given unit time step.
    Example: When the dynamic_loop_frequency is set to 1000Hz. It breaks down 1 second into 1000 small parts and the physics solver computes the output 1000 times in 1 second.
  • The wall time is independent of the simulation time. For Real-time applications when a 1000Hz dynamic_loop_frequency is set, it breaks it down into 1000 smaller time iterations.
  • The simulation time denotes the time being followed by the physics simulation which may or may not be equal to wall time. The sim_time would be equal to wall_time unless the sim_speed_factor is changed.
  • The simulation speed factor could be used to make AMBF compute its iterations faster.
    Example: If the sim_speed_factor is set to 2, then the simulation computes all the calculations twice the normal speed.
    If the arguments passed are --p 1000 -s 2 The above arguments denote that the user wants AMBF simulation time step to be twice the unit wall time step. Therefore, a unit simulation time step would be divided into 1000 smaller iterations while computing the physics. And for half an unit time step in wall time, technically the number of iterations computed would be 1000.
  • Step throttling is a special feature added in AMBF to run the simulation based on the rate of messages transmitted by the learning code.
    When the enable_step_throttling is set to True, AMBF will wait until an input is received from the user's code to run the next iteration.
    It could be seen as a way to make AMBF adapt to the user's code data transmission speed. During throttling, the simulation does its calculation based on a parallel thread and continues normal execution once an input is received.
  • The fixed frequency time step can be seen as a buffer. It makes the simulation wait for a given time before the physics simulation computes the next step. While training it’s better to set it to one for speeding up the computation (1 second) and during evaluation it can be set back to the default value.
  • For certain cases, it would be good idea to set enable_step_throttling to False and other times True depending on the application.
    When enable_step_throttling is set to False, AMBF and the user's code runs independently of each other. Therefore, both of the applications are not dependent on each other to proceed to next iteration. When sim_speed_factor is being changed from it's default value, enable_step_throttling should be set to False (otherwise it sim_speed_factor will not make any difference, since AMBF will give control over to user's code for running iterations).
    Example: Arguments passed : -p 100 -t 1 -s 5 and enable_step_throttling is set to False The above commands would make AMBF wait for 1 second to receive all the inputs from the user's code and then compute 100 smaller iterations for a unit simulation time step and would repeat this 5 times before a unit time step is increased in wall time.

Multiple Instances of AMBF

Multiple instances of AMBF could be created by running multiple roscore. Multiple roscore's could be run by specifying the Port Number along with roscore using flag -p.
Example: roscore -p 11315
In each terminal you would like to use the same instance of roscore, you would need to export the ROS_MASTER_URI.
Example: export ROS_MASTER_URI=http://name:11315/
Now, while launching AMBF, you can provide a namespace to each instance of AMBF to help avoid confusion using the flag --ns.
Example:
./ambf_simulator -l 5,22 -p 1000 -t 1 -s 2 --ns /test1/
./ambf_simulator -l 5,22 -p 1000 --ns /test2/

Therefore, one can run multiple trainings at the same moment to help utilize time better.

⚠️ **GitHub.com Fallback** ⚠️