def set_joint_target_velocity(self, velocity: float) -> None: """Sets the intrinsic target velocity of a non-spherical joint. This command makes only sense when the joint mode is torque/force mode: the dynamics functionality and the joint motor have to be enabled (position control should however be disabled). :param velocity: Target velocity of the joint (linear or angular velocity depending on the joint-type). """ sim.simSetJointTargetVelocity(self._handle, velocity)
def set_velocity(self, lf, rf, lb, rb) -> None: v = [lf, rf, lb, rb] # sim.simSetJointForce(self._handle,100) for i in range(2): sim.simSetJointForce(self.motorHandles[2 * i], self.joint_force) sim.simSetJointTargetVelocity(self.motorHandles[2 * i], v[2 * i]) for i in range(2): sim.simSetJointForce(self.motorHandles[2 * i + 1], self.joint_force) sim.simSetJointTargetVelocity(self.motorHandles[2 * i + 1], -v[2 * i + 1])
def set_torque(self, lf, rf, lb, rb) -> None: t = [lf, rf, lb, rb] for i in range(2): if t[2 * i] > 0: sim.simSetJointForce(self.motorHandles[2 * i], t[2 * i]) sim.simSetJointTargetVelocity( self.motorHandles[2 * i], 1000000000000000) #unreachable value else: sim.simSetJointForce(self.motorHandles[2 * i], -t[2 * i]) sim.simSetJointTargetVelocity( self.motorHandles[2 * i], -1000000000000000) #unreachable value for i in range(2): if t[2 * i + 1] > 0: sim.simSetJointForce(self.motorHandles[2 * i + 1], t[2 * i + 1]) sim.simSetJointTargetVelocity( self.motorHandles[2 * i + 1], -1000000000000000) #unreachable value else: sim.simSetJointForce(self.motorHandles[2 * i + 1], -t[2 * i + 1]) sim.simSetJointTargetVelocity( self.motorHandles[2 * i + 1], 1000000000000000) #unreachable value