import poppy_inverse_kinematics.creature as model_creature
import numpy as np
import poppy_inverse_kinematics.meta_creature as meta_creature

# parameters
activate_follow = True

# Create creatures
right_arm = model_creature.creature("torso_right_arm")
left_arm = model_creature.creature("torso_left_arm")
torso = meta_creature.MetaCreature(interface_type="vrep", creature_type="torso")
torso.add_model(right_arm)
torso.add_model(left_arm)

# Set right arm position
target_right = np.array([-0.27, -0.2, 0.5])
# target_right = np.array([-0.1, -0.4, 0.1])
right_arm.target = target_right
right_arm.goto_target()

# Choose left arm target
if activate_follow:
    target_left = right_arm.forward_kinematic() + np.array([0.3, 0, 0])
    left_arm.target = target_left
    left_arm.goto_target()

# Plot result
torso.plot_meta_model()

@@ -133,16 +133,28 @@
 creature
+%0Aimport time
 %0A%0A# para
@@ -182,16 +182,54 @@
 w = True
+%0Ainterface_type = %22robot%22%0Aplot = False
 %0A%0A# Crea
@@ -403,14 +403,22 @@
 ype=
-%22vrep%22
+interface_type
 , cr
@@ -492,16 +492,182 @@
 t_arm)%0A%0A
+# Init pypot robot%0Aif interface_type == %22robot%22:%0A    for m in torso.pypot_object.motors:%0A        m.compliant = False%0A        m.goal_position = 0%0A    time.sleep(10)%0A%0A%0A
 # Set ri
@@ -1022,16 +1022,29 @@
  result%0A
+if plot:%0A    
 torso.pl
@@ -1059,8 +1059,70 @@
 model()%0A
+%0Aif interface_type == %22robot%22:%0A    torso.pypot_object.close()%0A

Improve hand_follow