-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnao_joints_control.py
32 lines (22 loc) · 1002 Bytes
/
nao_joints_control.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
import time
import pybullet as p
from qibullet import SimulationManager
from qibullet import PepperVirtual
from qibullet import NaoVirtual
from qibullet import RomeoVirtual
simulation_manager = SimulationManager()
client = simulation_manager.launchSimulation(gui=True, auto_step=False)
robot = simulation_manager.spawnNao(client, spawn_ground_plane=True)
time.sleep(1.0)
joint_parameters = list()
for name, joint in robot.joint_dict.items():
if "Finger" not in name and "Thumb" not in name:
joint_parameters.append((p.addUserDebugParameter(name, joint.getLowerLimit(),
joint.getUpperLimit(),
robot.getAnglesPosition(name)), name))
while True:
for joint_parameter in joint_parameters:
robot.setAngles(joint_parameter[1], p.readUserDebugParameter(joint_parameter[0]), 1.0)
# Step the simulation
simulation_manager.stepSimulation(client)