Open SKYLEO98 opened 4 months ago
Hi there, you need to set
p.setJointMotorControlArray(model_id,joints_index, p.VELOCITY_CONTROL, forces=np.zeros(num_joints))
to enable torque control which is not enabled by default. Please refer to the documentation for more details here.
Hi there, you need to set
p.setJointMotorControlArray(model_id,joints_index, p.VELOCITY_CONTROL, forces=np.zeros(num_joints))
to enable torque control which is not enabled by default. Please refer to the documentation for more details here.
Thank @yaswanth1701. It was solved following your suggestion. I could not find this decent setting in the online documentation.
That sounds great.
Hello, I am encountering trouble implementing torque_control mode in Pybullet with Franka Panda. The robot could move to the initial position that I imply with position_control mode. However, I tried to run the torque_control mode for moving to swap whole joint range but it did not work. The robot just stays at its initial location. Is there any specifications to imply the torque_control mode in pybullet?
` import os import pybullet as p import pybullet_data import time import math import numpy as np
p.connect(p.GUI) p.setAdditionalSearchPath(pybullet_data.getDataPath()) p.setGravity(0,0,-9.81)
planeId = p.loadURDF("plane.urdf") startPos = [0,0,0] startOrientation = p.getQuaternionFromEuler([0,0,0]) robotPath= "/home/hoan/rl-baselines3-zoo/rl_zoo3/franka_urdf/panda.urdf" robotId = p.loadURDF(robotPath,startPos, startOrientation, useFixedBase=True)
timeStep = 0.001
p.setTimeStep(timeStep)
jointIds = []
maxForce =40
joint_set= [1, -1.53487, -1.67553, 0, -0.0625838, 1.7395, 0.684601] for i in range(6): p.setJointMotorControl2(robotId , i, p.POSITION_CONTROL,joint_set[i]) p.stepSimulation() joint_set= [87, 0, 0, -87, 0, 0, 0]
time.sleep(1) while True: p.configureDebugVisualizer(p.COV_ENABLE_SINGLE_STEP_RENDERING) for i in range(6): p.setJointMotorControl2(bodyIndex = robotId , jointIndex = i, controlMode = p.TORQUE_CONTROL, force = joint_set[i]) p.stepSimulation() time.sleep(1./240.)
`