Simple control of NAO's arm control

Simple control of NAO's arm control

Turn on/off arm swing when walking

How can I control NAO's arm? A code introduction is given in the official documentation:

arm control

This code shows how to control whether NAO swings his arms when walking, which can be said to be very simple. The difficulty is how to control its arm to be fixed at the angle you want? This requires additional code.

set angle

There is an API in the ALMotion library called angleInterpolationWithSpeed ​​that can be controlled by passing in some parameters, the style is as follows:

motionProxy.angleInterpolation(names, angleLists, targetAngles, maxSpeedFraction)

Where names can be body or joint names, targetAngles is a series of angles in radians, and maxSpeedFraction can control the movement speed by passing in decimals.

Then the question arises. If we want to set the posture for the arm, then we need to pass a value to it, but how to write this list?

hand lift angle

From the picture we can see that there are six joint controls on one arm of NAO, which means that the list we want to pass should have 6 values. After my testing, the order is as follows:

Arm = [LShoudlerPitch,LShoudlerRoll,LElbowYaw,LElbowRoll,LWristYaw,LHandle]

Taking the left arm as an example, we only need to pass in the name of the part, the list of angle values, and the speed:

motionProxy.angleInterpolationWithSpeed("LArm",Arm, 0.1)

But then I found another method that can also control the angle of the arm. Although it is easier to understand than this function, it is a little more troublesome, that is, to set the angle value through the setAngles function. But because of time constraints, I didn't implement it, I hope someone can implement it by themselves.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325650737&siteId=291194637