-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with torque_control mode for franka panda robot #4635
Comments
Hi there, you need to set |
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.)
`
The text was updated successfully, but these errors were encountered: