SoftBank Robotics documentation What's new in NAOqi 2.8?

Using qicli commands

qicli commands allows you to:

  • see information,
  • use methods, and
  • watch signals.a

How to run qicli

Prerequisite

Make sure NAOqi is running.

Running qicli

Two possible methods:

  • Connect on SSH to your robot.

  • Use qicli on your computer and connect remotely on a robot.

    $ ./qicli cmd args --qi-url IPofYourRobot
    

qicli info

qicli info is used to display:

  • a list of services,
  • a detailed list of methods and signals of specific services,
  • information about:
    • method parameters, return type or return type members,
    • signal type,
    • property type or property type members.

With no argument, it lists services:

$ qicli info
> 001 [ServiceDirectory]
  002 [LogManager]
  003 [ALFileManager]
  004 [ALMemory]
  005 [ALLogger]
  ...

This is equivalent to:

$ qicli info --list
$ qicli info -l
$ qicli # Without any argument

With a service name as argument, it gives:

$ qicli info ServiceDirectory
> 001 [ServiceDirectory]
  * Info:
   machine   37814cee-e5a8-4183-9862-65d10460f0e5
   process   3665
   endpoints tcp://127.0.0.1:9559
             tcp://198.18.0.1:9559
             tcp://10.2.1.177:9559
  * Methods:
   100 service            (String)
   101 services          List<> ()
   102 registerService   UInt32 ()
   103 unregisterService Void (UInt32)
   104 serviceReady      Void (UInt32)
   105 updateServiceInfo Void ()
   108 machineId         String ()
  * Signals:
   106 serviceAdded   (UInt32,String)
   107 serviceRemoved (UInt32,String)

There is always 3 parts:

  • Info: general information about service,
  • Methods: list of methods,
  • Signals: list of signals.

The 2 last parts may be empty.

Methods and Signal follow the format:

[id] name    [return_type] ([parameters_types...])

If the name of the service is a bit long, identifiers can be used instead:

$ qicli info ServiceDirectory
$ qicli info 1

Command also accept several services’ names simultaneously:

$ qicli info ServiceDirectory LogManager
> 001 [ServiceDirectory]
    * Info:
     machine   37814cee-e5a8-4183-9862-65d10460f0e5
     process   3665
     endpoints tcp://127.0.0.1:9559
               tcp://198.18.0.1:9559
               tcp://10.2.1.177:9559
    * Methods:
     100 service            (String)
     101 services          List<> ()
     102 registerService   UInt32 ()
     103 unregisterService Void (UInt32)
     104 serviceReady      Void (UInt32)
     105 updateServiceInfo Void ()
     108 machineId         String ()
    * Signals:
     106 serviceAdded   (UInt32,String)
     107 serviceRemoved (UInt32,String)
  002 [LogManager]
    * Info:
     machine   37814cee-e5a8-4183-9862-65d10460f0e5
     process   3665
     endpoints tcp://127.0.0.1:9559
               tcp://198.18.0.1:9559
               tcp://10.2.1.177:9559
    * Methods:
     100 log            Void (LogMessage)
     101 getListener    Object ()
     102 addProvider    Int32 (Object)
     103 removeProvider Void (Int32)
    * Signals:

Globing can also be used:

$ qicli info "LogMa*"
> 002 [LogManager]
    * Info:
     machine   37814cee-e5a8-4183-9862-65d10460f0e5
     process   3665
     endpoints tcp://127.0.0.1:9559
               tcp://198.18.0.1:9559
               tcp://10.2.1.177:9559
    * Methods:
     100 log            Void (LogMessage)
     101 getListener    Object ()
     102 addProvider    Int32 (Object)
     103 removeProvider Void (Int32)
    * Signals:

The parameter can also be the name of a service followed by the name of a member of that service separated by a dot. In this case it displays information about that member.

For example, used with the name of a method, it displays information about its return type and its parameters:

$ qicli info ServiceDirectory.service
> [ServiceDirectory.service]
    100 service ServiceInfo (String)
    return type ServiceInfo
      members
        name      String
        serviceId UInt32
        machineId String
        processId UInt32
        endpoints List<String>
        sessionId String
    parameters
      1: String

Used on a property or a signal, it displays information about its type:

$ qicli info ALMood.valenceLevel
> [ALMood.valenceLevel]
    114 valenceLevel ValueConfidence<float>
      members
        value      Float
        confidence Float
$ qicli info ALMood.currentFocusedUserMood
> [ALMood.currentFocusedUserMood]
    112 currentFocusedUserMood (String)
    signal type(s)
      1: String

This syntax can also be chained to get information about a member submember:

$ qicli info ALMood.personStateFromUserSession.bodyLanguageState
> [ALMood.personStateFromUserSession.bodyLanguageState]
    BodyLanguageState
      members
        ease BodyLanguageEase
$ qicli info ALMood.personStateFromUserSession.bodyLanguageState.ease
> [ALMood.personStateFromUserSession.bodyLanguageState.ease]
    BodyLanguageEase
      members
        level      Float
        confidence Float
  • Extra options:

    --show-doc
    

    Show documentation for methods, signals and properties.

    --hidden
    

    Show hidden services, methods, signals and properties.

    --raw-signature
    

    Show the raw signature.

    -z
    

    Prints the result in a parseable format

qicli call

This command allows you to call service’s methods ans signals.

Returned values follow json format.

$ qicli call ALFileManager.ping
> ALFileManager.ping: true

More complex return values can also be returned.

$ qicli call ALMemory.getEventList
> ALMemory.getEventList: [ "/Preferences", "ALAnimatedSpeech/EndOfAnimatedSpeech", "ALAudioSourceLocalization/SoundLocated", "ALAudioSourceLocalization/SoundsLocated", ...]

Where

[ ... ] is a list in json.

Identifiers can also be used instead of names:

$ qicli call 4.123
> ALMemory.getEventList: [ "/Preferences", "ALAnimatedSpeech/EndOfAnimatedSpeech", "ALAudioSourceLocalization/SoundLocated", "ALAudioSourceLocalization/SoundsLocated", ...]

Several arguments can be given:

$ qicli call ServiceDirectory.service PackageManager
> ServiceDirectory.service: [ "PackageManager", 41, "4fd62363-f74d-4c6d-81d1-c1b9304c77d2", 3840, [ "tcp://10.0.252.216:34510", "tcp://127.0.0.1:34510" ], "0967f415-db38-43a4-b5a9-7ac70539891d" ]

Complex arguments (list, objects) of methods must be given in JSON with option –json.

Warning

JSON and terminals do not work well together.

$ qicli call --json ALMemory.insertListData "[[\"foo\",true],[\"bar\",1]]"
> ALMemory.insertListData: null

In order to call a hidden method, add –hidden

  • Extra options:

    --method arg
    

    Method’s name.

    --arg arg
    

    Method’s args.

    --bench arg
    

    Bench the call time using given iteration count.

    --continue**
    

    Continue on error.

qicli watch

Qicli watch is used to see when a signal is triggered.

For example, to get information each time a package is installed on your robot, use:

$ qicli watch PackageManager.onPackageInstalled
  • Extra options:

    -s [ --signal ] arg
    

    Service’s name.

    -t [ --time ]
    

    Print time.

    --hidden
    

    Watch hidden signals if they match the given pattern.

    --continue
    

    Continue on error.

    --almemory
    

    Watch ALMemory events.

qicli log-view

Qicli log-view is used to display logs.

$ qicli log-view
  • Extra options:

    -v [ --verbose ]
    

    Set maximum logs verbosity shown to verbose.

    -d [ --debug ]
    

    Set maximum logs verbosity shown to debug.

    -l [ --level ]
    

    arg (=4) Change the log minimum level: [0-6] (default:4). This option accept the same arguments’ format than –qi-log-level.

    -f [ --filters ] arg
    

    Set log filtering options. This option accepts the same arguments’ format than –qi-log-filters.

qicli log-send

Qicli log-send is used to send logs.

for sending a message:

$ qicli log-send hello

This is equivalent to:

$ qicli log-send --message hello
$ qicli log-send -m hello

To send a message with your own Message’s category (default: “qicli.qilog.logsend”):

$ qicli log-send --category MyCategory -m MyMessage
$ qicli log-send -c MyCategory -m MyMessage
  • Extra options:

    -v [ --verbose ]
    

    Set message verbosity to verbose.

    -d [ --debug ]
    

    Set message verbosity to debug.

    -l [ --level ] arg (=4)
    

    Change the log minimum level: [0-6] (default:4). This option accepts the same arguments’ format than –qi-log-level.