Пример #1
0
    def get_actual_velocity(self) -> List:
        v_lf = sim.simGetObjectFloatParameter(self.motorHandles[0], 2012)
        v_rf = sim.simGetObjectFloatParameter(self.motorHandles[1], 2012)
        v_lb = sim.simGetObjectFloatParameter(self.motorHandles[2], 2012)
        v_rb = sim.simGetObjectFloatParameter(self.motorHandles[3], 2012)
        #sim.jointfloatparam_velocity (2012)
        vl = (v_lf + v_lb) / 2
        vr = -(v_rf + v_rb) / 2

        return [vl, vr]
Пример #2
0
    def get_mass(self) -> float:
        """Gets the mass of the shape.

        :return: A float representing the mass.
        """
        return sim.simGetObjectFloatParameter(self._handle,
                                              sim.sim_shapefloatparam_mass)
Пример #3
0
    def get_joint_upper_velocity_limit(self) -> float:
        """Gets the joints upper velocity limit.

        :return: The upper velocity limit.
        """
        return sim.simGetObjectFloatParameter(
            self._handle, sim.sim_jointfloatparam_upper_limit)
Пример #4
0
    def get_far_clipping_plane(self) -> float:
        """ Get the Sensor's far clipping plane.

        :return: Near clipping plane (metres)
        """
        return sim.simGetObjectFloatParameter(
            self._handle, sim.sim_visionfloatparam_far_clipping)
Пример #5
0
    def get_orthographic_size(self) -> float:
        """ Get the Sensor's orthographic size.

        :return: The sensor's orthographic size (in metres).
        """
        return sim.simGetObjectFloatParameter(
            self._handle, sim.sim_visionfloatparam_ortho_size)
Пример #6
0
    def get_joint_velocity(self) -> float:
        """Get the current joint velocity.

        :return: Velocity of the joint (linear or angular velocity depending
            on the joint-type).
        """
        return sim.simGetObjectFloatParameter(
            self._handle, sim.sim_jointfloatparam_velocity)
Пример #7
0
    def get_perspective_angle(self) -> float:
        """ Get the Sensor's perspective angle.

        :return: The sensor's perspective angle (in degrees).
        """
        return math.degrees(
            sim.simGetObjectFloatParameter(
                self._handle, sim.sim_visionfloatparam_perspective_angle))
Пример #8
0
    def get_intensity_properties(self):
        """ Gets light intensity properties.

        :return: The light intensity properties cast_shadows, spot_exponent, spot_cutoff, const_atten_factor,
        linear_atten_factor, quad_atten_factor
        """
        cast_shadows = sim.simGetObjectInt32Parameter(
            self._handle, sim.sim_lightintparam_pov_casts_shadows)
        spot_exponent = sim.simGetObjectFloatParameter(
            self._handle, sim.sim_lightfloatparam_spot_exponent)
        spot_cutoff = sim.simGetObjectFloatParameter(
            self._handle, sim.sim_lightfloatparam_spot_cutoff)
        const_atten_factor = sim.simGetObjectFloatParameter(
            self._handle, sim.sim_lightfloatparam_const_attenuation)
        linear_atten_factor = sim.simGetObjectFloatParameter(
            self._handle, sim.sim_lightfloatparam_lin_attenuation)
        quad_atten_factor = sim.simGetObjectFloatParameter(
            self._handle, sim.sim_lightfloatparam_quad_attenuation)
        return bool(cast_shadows), spot_exponent, spot_cutoff, const_atten_factor, linear_atten_factor,\
               quad_atten_factor
Пример #9
0
    def get_bounding_box(self) -> List[float]:
        """Gets the bounding box (relative to the object reference frame).

        :return: A list containing the min x, max x, min y, max y, min z, max z
            positions.
        """
        params = [sim.sim_objfloatparam_objbbox_min_x,
                  sim.sim_objfloatparam_objbbox_max_x,
                  sim.sim_objfloatparam_objbbox_min_y,
                  sim.sim_objfloatparam_objbbox_max_y,
                  sim.sim_objfloatparam_objbbox_min_z,
                  sim.sim_objfloatparam_objbbox_max_z]
        return [sim.simGetObjectFloatParameter(
            self._handle, p) for p in params]
Пример #10
0
    def get_model_bounding_box(self) -> List[float]:
        """Gets the models bounding box (relative to models reference frame).

        :raises: ObjectIsNotModel if the object is not a model.
        :return: A list containing the min x, max x, min y, max y, min z, max z
            positions.
        """
        self._check_model()
        params = [sim.sim_objfloatparam_modelbbox_min_x,
                  sim.sim_objfloatparam_modelbbox_max_x,
                  sim.sim_objfloatparam_modelbbox_min_y,
                  sim.sim_objfloatparam_modelbbox_max_y,
                  sim.sim_objfloatparam_modelbbox_min_z,
                  sim.sim_objfloatparam_modelbbox_max_z]
        return [sim.simGetObjectFloatParameter(
            self._handle, p) for p in params]