Nao Robot Learning Notes 1

Source: Internet
Author: User

The NAO robot has been in the lab for several months, and has been familiar with the platform and is ready to implement a soccer robot function on this platform. In the study of the relevant

Records are mainly familiar with the NAO of some of the scattered things, decided to organize and write out.

Some examples of Python are small programs that get the value of the device, the sensor value, and so on:

1, view NAO each sensor and joint value:

From NAOqi import alproxy memproxy = Alproxy ("Almemory", "192.168.1.139", 9559) print Memproxy.getdata ("device/ Subdevicelist/lshoulderpitch/position/sensor/value ") Print Memproxy.getdata (" Device/subdevicelist/inertialsensor /gyrx/sensor/value ") Print Memproxy.getdata (" Device/subdevicelist/inertialsensor/gyry/sensor/value ") print Memproxy.getdata ("Device/subdevicelist/inertialsensor/gyrref/sensor/value")

The API used is almemory. The robot is equipped with a two-axis gyroscope, located in the center of the body. It consists of 3 sub devices and a reference value. These sensors provide a rotational speed around the x and y axes of the robot.

2, control the single joint Action routines:

Import NAOqi from NAOqi import alproxy motion = Alproxy ("Almotion", "192.168.1.139", 9559) names = "Headyaw" #各个关节的名称可以在sdk说 The document found anglelists = [1.0,0.0] #关节要转动的角度 timelists = [1.0,2.0] #到达指定角度的指定时间 isabsoulte = True #true代表绝对角度 motion.angleinter Polation (Names,anglelists,timelists,isabsoulte)

How to create your own remote execution module:

First of all, use the module_generator.py in the software package to produce some cmake-related, and some program framework and header files or something. If nothing changes, a module is generated by default. Specific ways to adapt: in the resulting several files, open cmake.list will be inside the other two files, respectively, is a header file a main.cpp file deleted. Then use CMake to generate vcproj engineering, compile, run/work. This creates a remote execution module of its own. Without having to call again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.