def update(self):
        """ Synchronization update loop.

        At each update all motor position are read from vrep and set to the motors. The motors target position are also send to v-rep.

        """
        # Read all the angle limits
        h, _, l, _ = self.io.call_remote_api('simxGetObjectGroupData',
                                             remote_api.sim_object_joint_type,
                                             16,
                                             streaming=True)
        limits4handle = {hh: (ll, lr) for hh, ll, lr in zip(h, l[::2], l[1::2])}

        for m in self.motors:
            tmax = torque_max[m.model]

            # Read values from V-REP and set them to the Motor
            p = round(
                rad2deg(self.io.get_motor_position(motor_name=self._motor_name(m))), 1)
            m.__dict__['present_position'] = p

            l = 100. * self.io.get_motor_force(motor_name=self._motor_name(m)) / tmax
            m.__dict__['present_load'] = l

            m.__dict__['_load_fifo'].append(abs(l))
            m.__dict__['present_temperature'] = 25 + \
                round(2.5 * sum(m.__dict__['_load_fifo']) / len(m.__dict__['_load_fifo']), 1)

            ll, lr = limits4handle[self.io._object_handles[self._motor_name(m)]]
            m.__dict__['lower_limit'] = rad2deg(ll)
            m.__dict__['upper_limit'] = rad2deg(ll) + rad2deg(lr)

            # Send new values from Motor to V-REP
            p = deg2rad(round(m.__dict__['goal_position'], 1))
            self.io.set_motor_position(motor_name=self._motor_name(m), position=p)

            t = m.__dict__['torque_limit'] * tmax / 100.

            if m.__dict__['compliant']:
                t = 0.

            self.io.set_motor_force(motor_name=self._motor_name(m), force=t)
Synchronization update loop.

        At each update all motor position are read from vrep and set to the motors. The motors target position are also send to v-rep.