(self)
return action, dict(qp_sol=qp_sol)
Returns the control ouputs (e.g. positions/torques) for all motors.
Returns the control ouputs (e.g. positions/torques) for all motors.
Returns the control ouputs ( e . g . positions / torques ) for all motors .
def get_action(self):
    """Returns the control ouputs (e.g. positions/torques) for all motors."""
    swing_action = self._swing_leg_controller.get_action()
    # start_time = time.time()
    stance_action, qp_sol = self._stance_leg_controller.get_action()
    # print(time.time() - start_time)
    action = []
    for joint_id in range(self._robot.num_motors):
      if joint_id in swing_action:
        action.extend(swing_action[joint_id])
      else:
        assert joint_id in stance_action
        action.extend(stance_action[joint_id])
    action = np.array(action, dtype=np.float32)

    return action, dict(qp_sol=qp_sol)
def get_action ( self ) : swing_action = self . _swing_leg_controller . get_action ( ) # start_time = time.time() stance_action , qp_sol = self . _stance_leg_controller . get_action ( ) # print(time.time() - start_time) action = [ ] for joint_id in range ( self . _robot . num_motors ) : if joint_id in swing_action : action . extend ( swing_action [ joint_id ] ) else : assert joint_id in stance_action action . extend ( stance_action [ joint_id ] ) action = np . array ( action , dtype = np . float32 ) return action , dict ( qp_sol = qp_sol )