From c49e54893c4159c6b4a818faaebbcd3d78739449 Mon Sep 17 00:00:00 2001 From: Michael Zechmair Date: Tue, 17 May 2022 14:36:11 +0200 Subject: [PATCH] Disable default position and velocity based motor control of joints --- arm_1dof/robot_arm_1dof.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arm_1dof/robot_arm_1dof.py b/arm_1dof/robot_arm_1dof.py index 3b40c3f..d4d3887 100644 --- a/arm_1dof/robot_arm_1dof.py +++ b/arm_1dof/robot_arm_1dof.py @@ -30,6 +30,16 @@ class RobotArm1Dof: physicsClientId=self._bullet_ctrl.server_id) self._lower_arm_mass = dyn_info[1] + # Disable position and velocity based joint motor controls + pybullet.setJointMotorControlArray(self._body_id, jointIndices=[RobotArm1Dof.SHOULDER_A_JOINT_ID, RobotArm1Dof.ELBOW_JOINT_ID], \ + controlMode=pybullet.POSITION_CONTROL, forces=[0.0, 0.0], \ + physicsClientId=self._bullet_ctrl.server_id) + + pybullet.setJointMotorControlArray(self._body_id, jointIndices=[RobotArm1Dof.SHOULDER_A_JOINT_ID, RobotArm1Dof.ELBOW_JOINT_ID], \ + controlMode=pybullet.VELOCITY_CONTROL, forces=[0.0, 0.0], \ + physicsClientId=self._bullet_ctrl.server_id) + + # Initialize joint/link state storage self._joint_stats = {} self._ee_link_state = None