keiohta / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
1 stars 0 forks source link

CartPole の URDF を読みこんでダミーアクションを入力する #1

Open keiohta opened 3 years ago

keiohta commented 3 years ago

python上での等価なコード。

import pybullet
import pybullet_data

client = pybullet.DIRECT
pybullet.setAdditionalSearchPath(pybullet_data.getDataPath())

urdf_path = os.path.join(pybullet_data.getDataPath(), "cartpole.urdf")
robot_body_id = client.loadURDF(urdf_path, basePosition=[0, 0, 0])

CART_LINK_IDX = 0

client.setJointMotorControl2(robot_body_id, CART_JOINT_IDX, pybullet.VELOCITY_CONTROL, force=0)
client.stepSimulation()