Пример #1
0
    def reset_dynamic_object(self) -> None:
        """Dynamically resets an object that is dynamically simulated.

        This means that the object representation in the dynamics engine is
        removed, and added again. This can be useful when the set-up of a
        dynamically simulated chain needs to be modified during simulation
        (e.g. joint or shape attachement position/orientation changed).
        It should be noted that calling this on a dynamically simulated object
        might slightly change its position/orientation relative to its parent
        (since the object will be disconnected from the dynamics world in its
        current position/orientation), so the user is in charge of rectifying
        for that.
        """
        sim.simResetDynamicObject(self._handle)
Пример #2
0
    def _set_velocity(handle, lin_velocity=[0, 0, 0], ang_velocity=[0, 0, 0]):
        # reset dynamic object
        sim.simResetDynamicObject(handle)
        
        # shapefloatparam_init_velocity_x
        sim.simSetObjectFloatParameter(handle, sim.sim_shapefloatparam_init_velocity_x, lin_velocity[0])
        # shapefloatparam_init_velocity_y 
        sim.simSetObjectFloatParameter(handle, sim.sim_shapefloatparam_init_velocity_y, lin_velocity[1])
        # shapefloatparam_init_velocity_z  
        sim.simSetObjectFloatParameter(handle, sim.sim_shapefloatparam_init_velocity_z, lin_velocity[2])

        # shapefloatparam_init_velocity_a
        sim.simSetObjectFloatParameter(handle, sim.sim_shapefloatparam_init_velocity_a, ang_velocity[0])
        # shapefloatparam_init_velocity_b
        sim.simSetObjectFloatParameter(handle, sim.sim_shapefloatparam_init_velocity_b, ang_velocity[1])
        # shapefloatparam_init_velocity_g
        sim.simSetObjectFloatParameter(handle, sim.sim_shapefloatparam_init_velocity_g, ang_velocity[2])