Information

Documentation

Get OpenRDK at SourceForge.net. Fast, secure and Free Open Source software downloads

edit SideBar

Your first run with Nao robot: "Hello Nao!"

In this section, we will show how to run some demos with the Aldebaran's Nao robot. These demos works with the NaoQi SDK version 1.0, they are not compatible with earlier versions.

Some of these examples make use of the "simple" TCP interface module, in order to connect to a remote repository using a simple text-based TCP connection. Refer to the section Using the "simple" TCP interface for further details.

Installing OpenRDK NaoQi modules

First of all, download and install on your robot the official "OpenRDK NaoQi modules" package from here. This package is the server side of communication with OpenRDK. On the robot install it with the command:

  root@yournao [0] [~]# opkg-cl install openrdk-naoqi-modules-*.ipk

The package also modifies the /opt/naoqi/modules/lib/autoload.ini file by adding openrdk-naoqi among autoloaded modules.

If you would like tor remove the modules, simply type

  root@yournao [0] [~]# opkg-cl remove openrdk-naoqi-modules

and the modules will be deleted from the /opt/naoqi/modules/lib/autoload.ini too. To complete the installation, reboot your robot.

Now you are ready to go through the examples.

Nao raises his left arm up

The configuration file to use is in data/config/examples and is called ran-demomotion.config. You can open with a text editor to see the relevant modules:

Module joints (naoqijointsmodule): sends joints values to Nao through shared memory and openrdk-naoqi module

  in/motionJoints= @/motion/out/motionJoints   # Joints to send to the Nao
  out/bodyJoints=[VOLATILE]                    # (volatile) Current Joints configuration
  params/gotoTimeFrame=0.100                   # Naoqi gotoBodyAngles time frame
  params/gotoWithSpeedValue=25                 # Naoqi gotoBodyAnglesWithSpeed speed value (0-100)
  params/stiffness=1			       # Naoqi stiffness value (0-1)

Module motion (naomotiondemomodule): sends joints values to joints module

  in/action=LARM UP			       # Action to execute  
  in/bodyJoints=@/joints/out/bodyJoints        # Current Joints configuration
  out/motionJoints=[VOLATILE]                  # (volatile) Joints to send to the Nao

Module tcp (simpletcpinterfacemodule): listens for TCP commands

  params/listeningPort=9876                    # TCP listening port

How to test

Run:

  $ ragent -c ran-demomotion.config

now Nao should raise his left arm up.

Run:

  $ telnet <nao_ip> 9876

and type:

  setValue /motion/in/action LARM DOWN

now Nao should put his left arm down.

Nao vision test

The configuration file is in the same directory as before and is called ra-demovision.config. Here are the relevant modules in the configuration file:

Module camera (video4linuxmodule): image acquisition

  out/image=[VOLATILE]                         # (volatile) Current Image
  params/format=YUYV                           # Image format (YUYV, RGB24, JPEG)
  params/fps=10                                # Camera FPS
  params/iomethod=read                         # IO Method (read, mmap)

Module vision (visiondemomodule): image processing demo, computes average intensity of the image

  in/image=@/camera/out/image                  # Current Image
  out/avg_intensity=[VOLATILE]                 # Avg image intensity

Module tcp (simpletcpinterfacemodule): listens for TCP commands

  params/listeningPort=9876                    # TCP listening port

How to test

Run:

  $ ragent -c ran-demovision.config

now you should read on the screen the average intensity of the image.

If you want to see the binary format of a YUV image, run:

  $ telnet <nao_ip> 9876

Type:

  getImage /camera/out/image rdk

and you get the YUYV image in binary format!

You can also use the utility rdk-simpletcpclient provided by OpenRDK:

  $ rdk-simpletcpclient <nao_ip> 9876

in this way you can also visualize the images with:

  getImage /camera/out/image jpeg

please refer to the section Using the "simple" TCP interface for further information about how to use this interface to the repository.

If you want to see the actual streamed image you can use the ImageGrabbing library running the sample program:

  $ onecam -rdktcpsi 10.10.10.40 9876 yuv

Another option is to use a remote RConsole, as we saw in the Remote RConsole tutorial, running an empty rq.config file on your machine and connecting to the remote repository of the Nao. Both agents need to have synchronized yp.config files with both addresses (use the network interface address, i.e., eth0 or wlan0 address, and not the loopback address 127.0.0.1). After connecting to the remote repository, you can browse through its property tree and find the image: right click on that, choose the viewer and you can look at Nao's vision!

Finally, you can write your own TCP client program.

Nao raises his left arm up when intensity is below a threshold

The configuration file is ran-demospa.config. Here are the relevant modules in the configuration file:

Module camera (video4linuxmodule): image acquisition

  out/image=[VOLATILE]                         # (volatile) Current   
  params/format=YUYV                           # Image format (YUYV, RGB24, JPEG)
  params/fps=10                                # Camera FPS
  params/iomethod=read                         # IO Method (read, mmap)

Module vision (visiondemomodule): image processing demo, computes average intensity of the image

  in/image=@/camera/out/image                  # Current Image
  out/avg_intensity=[VOLATILE]                 # Avg image intensity

Module plan (plandemomodule): executes the control action

  in/avg_intensity=@/vision/out/avg_intensity   # Avg intensity value
  out/action=[VOLATILE]			        # (volatile) Action to execute
  out/saytext=[VOLATILE]			# (volatile) Text to say
  param/threshold=70                            # Intensity threshold for LARM UP/DOWN actions

Module motion (naomotiondemomodule): sends joints values to joints module

  in/action=@/plan/out/action                  # Action to execute
  in/bodyJoints=@/joints/out/bodyJoints        # Current Joints configuration
  out/motionJoints=[VOLATILE]                  # (volatile) Joints to send to the Nao

Module joints (naoqijointsmodule): sends joints values to Nao through shared memory and openrdk-naoqi module

  in/motionJoints= @/motion/out/motionJoints   # Joints to send to the Nao
  out/bodyJoints=[VOLATILE]                    # (volatile) Current Joints configuration
  params/gotoTimeFrame=0.100                   # Naoqi gotoBodyAngles time frame
  params/gotoWithSpeedValue=25	               # Naoqi gotoBodyAnglesWithSpeed speed value (0-100)
  params/stiffness=1                           # Naoqi stiffness value (0-1)

Module audio (naoqiaudiomodule): sends text to speech to Naoqi through shared memory

  in/saytext=@/plan/out/saytext		       # Text to say
  params/volume=50                             # Volume (0-100)

Module tcp (simpletcpinterfacemodule): listens for TCP commands

  params/listeningPort=9876                    # TCP listening port

How to test

Run:

  $ ragent -c ran-demospa.config

if the robot sees a dark image, it raises his left arm and says "Left arm up", otherwise it puts his left arm down and says "Left arm down".

Note: stiffness is on only for the left arm.

Nao walks using NaoQi API

The configuration file is rqra-demonaoqi.config. Here are the relevant modules:

Module motion (demomotionnaoqiproxy): walks the robot using NaoQi API

  cmds/connect=                                # (volatile) Connect to NaoQi           
  cmds/emergencyStop=No                        # Nao needs to do an emergency stop.           
  cmds/getup=No                                # Getup the robot                              
  cmds/reloadWalkParams=No                     # Reload walk parameters                       
  cmds/stop=No                                 # Stop walking                                 
  cmds/walk=No                                 # Start walking                                
  in/walkDistance=1.00                         # Walk distance                                
  params/connection/broker=127.0.0.1           # NaoQi broker address                         
  params/connection/brokerPort=0               # NaoQi broker port                            
  params/connection/parentBroker=127.0.0.1     # NaoQi parent broker address                
  params/connection/parentBrokerPort=9559      # NaoQi parent broker port                     
  params/stiffness/body=0.90                   # Global value for body 
  params/walk/extra/LHipRollCompensator=2.50   # Amplitude in degrees of backlash compensation for LHipRoll (0.0 to 15.0 degrees)
  params/walk/extra/RHipRollCompensator=-2.50  # Amplitude in degrees of backlash compensation for RHipRoll (-15.0 to 0.0 degrees)
  params/walk/extra/hipHeight=0.23             # Height of the Hip during Walk Process (0.15 to 0.244 meter)
  params/walk/extra/torsoYOrientation=0.00     # Define the Torso Orientation in degrees along Y axis during Walk Process (-20.0 to 20 degrees)
  params/walk/maxStepHeight=0.02               # Maximum height of a footstep cycloid (0.0 to 0.08 meters)
  params/walk/maxStepLength=0.05               # Maximum length in meters of a footstep (0.0 to 0.09 meters)
  params/walk/maxStepSide=0.02                 # Maximum side length in meters of a footstep 0.0 to 0.06 meters)
  params/walk/maxStepTurn=22.92                # Maximum change in z orientation in radians of a footstep (0.0 to 1.0 radians)
  params/walk/numSamplesPerStep=30             # Number of samples per step
  params/walk/zmpOffsetX=0.01                  # ZMP offset in the forwards direction in meters (0.0 to 0.10 meters)
  params/walk/zmpOffsetY=0.02                  # ZMP offset in the sideways direction in meters (-0.05 to 0.05 meters)

How to test

Run

  $ rconsoleqt -c rqra-demonaoqi.config

Connect to the robot, modifying params/connection/parentBroker to the IP address of your robot (rconsoleqt does not to be run locally to robot).

Change as you wish (carefully) the parameters of walking engine. Change distance: in/walkDistance=<whatever> (m).

Enable walk by clicking on cmds/walk property.

© 2004-2009 RoCoCo Laboratory Powered by PmWiki
Edit - History - Printable View - Recent Changes - Search
Page last modified on February 17, 2009, at 05:04 PM