NAOqi Motion - Overview | API
Starts or stops idle posture control on a chain.
Parameters: |
|
---|
Gets the status of idle posture control on a chain.
Parameters: |
|
---|---|
Returns: | true if idle posture control is active on the chain, false otherwise. |
Starts or stops breathing animation on a chain.
Parameters: |
|
---|
Gets the status of breathing animation on a chain.
Parameters: |
|
---|---|
Returns: | true if breathing is started on the chain, false otherwise. |
Configures the breathing animation.
Parameters: |
|
---|
#include <iostream>
#include <alproxies/almotionproxy.h>
int main(int argc, char **argv)
{
std::string robotIp = "127.0.0.1";
if (argc < 2) {
std::cerr << "Usage: almotion_setBreathConfig robotIp "
<< "(optional default \"127.0.0.1\")."<< std::endl;
}
else {
robotIp = argv[1];
}
AL::ALMotionProxy motion(robotIp);
// Example showing how to change the breathing configuration
// Setting a relaxed configuration: 5 breaths per minute at max amplitude
AL::ALValue breathConfig;
breathConfig.arraySetSize(2);
AL::ALValue tmp;
tmp.arraySetSize(2);
tmp[0] = "Bpm";
tmp[1] = 5.0f;
breathConfig[0] = tmp;
tmp[0] = "Amplitude";
tmp[1] = 1.0f;
breathConfig[1] = tmp;
motion.setBreathConfig(breathConfig);
return 0;
}
# -*- encoding: UTF-8 -*-
import time
import argparse
from naoqi import ALProxy
def main(robotIP, PORT=9559):
motionProxy = ALProxy("ALMotion", robotIP, PORT)
# Example showing how to set breath config
# Fast breathing: 20 Bpm and low Amplitude
motionProxy.setBreathConfig([['Bpm', 20.0], ['Amplitude', 0.0]])
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--ip", type=str, default="127.0.0.1",
help="Robot ip address")
parser.add_argument("--port", type=int, default=9559,
help="Robot port number")
args = parser.parse_args()
main(args.ip, args.port)
This function gets the current breathing configuration.
Returns: | An ALValue of the form [["Bpm", bpm], ["Amplitude", amplitude]]. bpm is the breathing frequency in beats per minute. amplitude is the normalized amplitude of the breathing animation, between 0 and 1. |
---|