def set_control_loop_enabled(self, value: bool) -> None: """Sets whether the control loop is enable. :param value: The new value for the control loop state. """ sim.simSetObjectInt32Parameter( self._handle, sim.sim_jointintparam_ctrl_enabled, value)
def set_motor_enabled(self, value: bool) -> None: """Sets whether the motor is enable. :param value: The new value for the motor state. """ sim.simSetObjectInt32Parameter( self._handle, sim.sim_jointintparam_motor_enabled, value)
def set_dynamic(self, value: bool) -> None: """Set whether the shape is dynamic or not. :param value: The new value of the dynamic state of the shape. """ sim.simSetObjectInt32Parameter(self._handle, sim.sim_shapeintparam_static, not value) self.reset_dynamic_object()
def set_respondable(self, value: bool) -> None: """Set whether the shape is respondable or not. :param value: The new value of the respondable state of the shape. """ sim.simSetObjectInt32Parameter( self._handle, sim.sim_shapeintparam_respondable, value) self.reset_dynamic_object()
def set_entity_to_render(self, entity_to_render: int) -> None: """ Set the entity to render to the Sensor, this can be an object or more usefully a collection. -1 to render all objects in scene. :param entity_to_render: Handle of the entity to render """ sim.simSetObjectInt32Parameter(self._handle, sim.sim_visionintparam_entity_to_render, entity_to_render)
def set_motor_locked_at_zero_velocity(self, value: bool) -> None: """Set if the motor is locked when target velocity is zero. When enabled in velocity mode and its target velocity is zero, then the joint is locked in place. :param value: If the motor should be locked at zero velocity. """ sim.simSetObjectInt32Parameter( self._handle, sim.sim_jointintparam_velocity_lock, value)
def set_perspective_mode(self, perspective_mode: PerspectiveMode) -> None: """ Set the Sensor's perspective mode. :param perspective_mode: The new perspective mode, one of: PerspectiveMode.ORTHOGRAPHIC PerspectiveMode.PERSPECTIVE """ sim.simSetObjectInt32Parameter( self._handle, sim.sim_visionintparam_perspective_operation, perspective_mode.value)
def set_windowed_size(self, resolution: Sequence[int] = (0, 0)) -> None: """Set the size of windowed rendering. :param resolution: The (x, y) resolution of the window. 0 for full-screen. """ sim.simSetObjectInt32Parameter(self._handle, sim.sim_visionintparam_windowed_size_x, resolution[0]) sim.simSetObjectInt32Parameter(self._handle, sim.sim_visionintparam_windowed_size_y, resolution[1])
def set_resolution(self, resolution: List[int]) -> None: """ Set the Sensor's resolution. :param resolution: New resolution [x, y] """ sim.simSetObjectInt32Parameter(self._handle, sim.sim_visionintparam_resolution_x, resolution[0]) sim.simSetObjectInt32Parameter(self._handle, sim.sim_visionintparam_resolution_y, resolution[1]) self.resolution = resolution
def set_intensity_properties(self, cast_shadows=None, spot_exponent=None, spot_cutoff=None, const_atten_factor=None, linear_atten_factor=None, quad_atten_factor=None): """ Set light intensity properties. :param cast_shadows: POV-Ray light casts shadows :param spot_exponent: light spot exponent :param spot_cutoff: light spot cutoff :param const_atten_factor: light constant attenuation factor, currently not supported :param linear_atten_factor: light linear attenuation factor, currently not supported :param quad_atten_factor: light quadratic attenuation factor, currently not supported """ if cast_shadows is not None: sim.simSetObjectInt32Parameter( self._handle, sim.sim_lightintparam_pov_casts_shadows, int(cast_shadows)) if spot_exponent is not None: if spot_exponent % 1 != 0: warnings.warn( 'spot exponent must be an integer, rounding input of {} to {}' .format(spot_exponent, round(spot_exponent))) sim.simSetObjectFloatParameter( self._handle, sim.sim_lightfloatparam_spot_exponent, float(round(spot_exponent))) if spot_cutoff is not None: spot_cutoff = float(spot_cutoff) if spot_cutoff > np.pi / 2: warnings.warn( 'Tried to set spot_cutoff to {}, but the maximum allowed value is pi/2,' 'therefore setting to pi/2'.format(spot_cutoff)) sim.simSetObjectFloatParameter(self._handle, sim.sim_lightfloatparam_spot_cutoff, float(spot_cutoff)) if const_atten_factor is not None: raise Exception( 'CoppeliaSim currently does not support setting attenuation factors' ) # sim.simSetObjectFloatParameter( # self._handle, sim.sim_lightfloatparam_const_attenuation, float(const_atten_factor)) if linear_atten_factor is not None: raise Exception( 'CoppeliaSim currently does not support setting attenuation factors' ) # sim.simSetObjectFloatParameter( # self._handle, sim.sim_lightfloatparam_lin_attenuation, float(linear_atten_factor)) if quad_atten_factor is not None: raise Exception( 'CoppeliaSim currently does not support setting attenuation factors' )
def set_render_mode(self, render_mode: RenderMode) -> None: """ Set the Sensor's rendering mode :param render_mode: The new sensor rendering mode, one of: RenderMode.OPENGL RenderMode.OPENGL_AUXILIARY RenderMode.OPENGL_COLOR_CODED RenderMode.POV_RAY RenderMode.EXTERNAL RenderMode.EXTERNAL_WINDOWED RenderMode.OPENGL3 RenderMode.OPENGL3_WINDOWED """ sim.simSetObjectInt32Parameter(self._handle, sim.sim_visionintparam_render_mode, render_mode.value)
def set_motor_locked_at_zero_velocity(self, value) -> None: for i in range(4): sim.simSetObjectInt32Parameter(self.motorHandles[i], sim.sim_jointintparam_velocity_lock, value)
def set_control_loop_enabled(self, value) -> None: for i in range(4): sim.simSetObjectInt32Parameter(self.motorHandles[i], sim.sim_jointintparam_ctrl_enabled, value)