robosuite.controllers.interpolators package
Submodules
robosuite.controllers.interpolators.base_interpolator module
robosuite.controllers.interpolators.linear_interpolator module
- class robosuite.controllers.interpolators.linear_interpolator.LinearInterpolator(ndim, controller_freq, policy_freq, ramp_ratio=0.2, use_delta_goal=False, ori_interpolate=None)
Bases:
robosuite.controllers.interpolators.base_interpolator.Interpolator
Simple class for implementing a linear interpolator.
Abstracted to interpolate n-dimensions
- Parameters
ndim (int) – Number of dimensions to interpolate
controller_freq (float) – Frequency (Hz) of the controller
policy_freq (float) – Frequency (Hz) of the policy model
ramp_ratio (float) –
Percentage of interpolation timesteps across which we will interpolate to a goal position.
- Note
Num total interpolation steps will be equal to np.floor(ramp_ratio * controller_freq / policy_freq) i.e.: how many controller steps we get per action space update
ori_interpolate (None or str) –
If set, assumes that we are interpolating angles (orientation) Specified string determines assumed type of input:
’euler’: Euler orientation inputs ‘quat’: Quaternion inputs
- get_interpolated_goal()
Provides the next step in interpolation given the remaining steps.
NOTE: If this interpolator is for orientation, it is assumed to be receiving either euler angles or quaternions
- Returns
Next position in the interpolated trajectory
- Return type
np.array
- set_goal(goal)
Takes a requested (absolute) goal and updates internal parameters for next interpolation step
- Parameters
np.array – Requested goal (absolute value). Should be same dimension as self.dim
- set_states(dim=None, ori=None)
Updates self.dim and self.ori_interpolate.
Initializes self.start and self.goal with correct dimensions.
- Parameters
ndim (None or int) – Number of dimensions to interpolate
ori_interpolate (None or str) –
If set, assumes that we are interpolating angles (orientation) Specified string determines assumed type of input:
’euler’: Euler orientation inputs ‘quat’: Quaternion inputs