I am trying to move a Hexapod by providing all joint angles using Remote API in Python. All the 18 joints are already set to "Torque/Force Mode". "Motor enabled" is checked and Control loop is enabled. Below is the Python Code snippet-

Code: Select all

```
def move(self, joint_angles):
vrep.simxPauseCommunication(self.clientID, True)
for i in range(6):
index = 3 * i
vrep.simxSetJointTargetPosition(self.clientID, self.joint_handles[index + 0], joint_angles[index + 0], vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(self.clientID, self.joint_handles[index + 1], joint_angles[index + 1], vrep.simx_opmode_oneshot)
vrep.simxSetJointTargetPosition(self.clientID, self.joint_handles[index + 2], joint_angles[index + 2], vrep.simx_opmode_oneshot)
vrep.simxPauseCommunication(self.clientID, False)
vrep.simxSynchronousTrigger(self.clientID) # move simulation ahead one time step
angles = [10, 0, -10, 0] # define a trajectory
for angle in angles:
joint_angles = [angle * pi / 180] * num_joints
spider.move(joint_angles)
```

*move*function takes all joint angles. It is supposed to set all joint angles and wait for the joints to reach the target position. The simulation time step

*dt*is set to 1 ms using following code-

Code: Select all

`vrep.simxSetFloatingParameter(self.clientID, vrep.sim_floatparam_simulation_time_step, dt, vrep.simx_opmode_oneshot)`

**it seems that simulation runs only for the first angle**which is 10 degree. I want that all the joints to follow input angle trajectory, in which first one angle should be applied to all joints (and wait for the joints to reach the target) and then the second angle should be applied and so on.