ALRobotPosture

Overview | API


What it does

ALRobotPosture module allows you to make the robot go to different predefined postures.

You can choose between ALRobotPostureProxy::goToPosture() and ALRobotPostureProxy::applyPosture().

How it works

The robot detects in which posture it is, computes a path from its current posture to its target posture, and applies it.

It is possible to choose the speed for the posture to be applied.

Definitions

Posture

A posture for a robot is a (unique) configuration of its joints and of inertial sensor.

As a posture is defined by a list of real numbers (i.e. floats) there is an infinite number of postures.

Predefined postures

Here is the list of the Predefined Postures names:

  • Crouch,
  • LyingBack,
  • LyingBelly,
  • Sit,
  • SitRelax,
  • Stand,
  • StandInit,
  • StandZero.

Some postures (like Sit or Lying) are not available for all types of robot (see NAO - Body type).

Posture family

As the number of possible postures is infinite, postures are grouped in Posture families in order to ease the interpretation of the current posture.

For example, the posture family Sitting contains the postures SitRelax and Sit as well as all the approaching postures.

Here is the list of posture families:

Using ALRobotPostureProxy::getPostureFamilyList() you can find out what are the available posture families on your robot. It is a subset of the set bellow.

Posture Family Description
“Standing” the weight is supported by the feet and the torso is upright.
“Sitting” the buttock is in contact with the ground and the torso is upright.
“SittingOnChair” the buttock is in contact with a chair (10cm high) and the torso is upright.
“LyingBelly” stretched and facing down.
“LyingBack” stretched and facing up.
“LyingLeft” stretched and facing to its right side.
“LyingRight” stretched and facing to its left side.
“Belly” facing down with the trunk lifted.
“Back” facing back with the trunk lifted.
“Left” leaning toward the left and touching the ground with its hand.
“Right” leaning toward the right and touching the ground with its hand.

Getting started

Python example

alrobotposture.py


# -*- encoding: UTF-8 -*-

import sys

from naoqi import ALProxy


def main(robotIP):

    try:
        postureProxy = ALProxy("ALRobotPosture", robotIP, 9559)
    except Exception, e:
        print "Could not create proxy to ALRobotPosture"
        print "Error was: ", e

    postureProxy.goToPosture("StandInit", 1.0)
    postureProxy.goToPosture("SitRelax", 1.0)
    postureProxy.goToPosture("StandZero", 1.0)
    postureProxy.goToPosture("LyingBelly", 1.0)
    postureProxy.goToPosture("LyingBack", 1.0)
    postureProxy.goToPosture("Stand", 1.0)
    postureProxy.goToPosture("Crouch", 1.0)
    postureProxy.goToPosture("Sit", 1.0)

    print postureProxy.getPostureFamily()


if __name__ == "__main__":
    robotIp = "127.0.0.1"

    if len(sys.argv) <= 1:
        print "Usage python alrobotposture.py robotIP (optional default: 127.0.0.1)"
    else:
        robotIp = sys.argv[1]

    main(robotIp)