Code Monkey home page Code Monkey logo

qiloop's People

Contributors

lugu avatar ng2dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ng2dev

qiloop's Issues

errors are not wrapped

Error messages are hard to reason about since they are hand generated like:

	return fmt.Errorf("call say failed: %s", err)

Go 1.13 provides an helper errors.Wrap which can be used like this:

            return errors.Wrap(err, "say failed")

Please favor errors.Wrap and %w when it makes sense so we would use values for errors like disconnection, authentication failed, remote error...

naoqi 2.1.4 authentication error

Hello,

I was wondering if this library supports v5 nao based on naoqi 2.1.4?
I am running this command and get the following error

  ➜  ~ qiloop --qi-url tcp://192.168.2.9:9559 info --service ALVideoDevice
  message dropped: no handler match: [Type: capability, ID: 2550, Service: 0, Object: 0, Action: 0, Size: 79]
   connect: contact server: contact service: service connection error (ServiceDirectory): service 
   connection error (ServiceDirectory): authentication error: authentication failed: call authenticate 
   failed: can't find service, address: {0.0.8, id:3}

the contents of $HOME/.qiloop-auth.conf exist as expected.
Would you know why this happens?

When registring to a signal, events messages are sent before the reply message.

When registering to a signal, events can be sent before the response.

Instead, after the call message, reply should be sent and then the event messages.

Here is the sequence observed with tcpdump (full capture is attached):

Frame 16: 110 bytes on wire (880 bits), 110 bytes captured (880 bits)
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Transmission Control Protocol, Src Port: 60332, Dst Port: 9559, Seq: 145, Ack: 2465, Len: 44
Data (44 bytes)
qi::Messaging
    Source: 127.0.0.1:60332
    Destination: 127.0.0.1:9559
    Magic: 0x42dead42
    Id: 284
    Size: 16
    Version: 0
    Type: 1
    Type: Call
    Flags: 0
    Service: 1
    Service description: ServiceDirectory
    Object: 1
    Action: 0
    Action description: RegisterEvent
    Data: 0100000056000000414299a819a14c04

Then

Frame 17: 159 bytes on wire (1272 bits), 159 bytes captured (1272 bits)
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Transmission Control Protocol, Src Port: 9559, Dst Port: 60332, Seq: 2465, Ack: 189, Len: 93
Data (93 bytes)
qi::Messaging
    Source: 127.0.0.1:9559
    Destination: 127.0.0.1:60332
    Magic: 0x42dead42
    Id: 284
    Size: 65
    Version: 0
    Type: 5
    Type: Event
    Flags: 0
    Service: 1
    Service description: ServiceDirectory
    Object: 1
    Action: 86
    Data: 010000000200000000000000010000004c414299a819a14c0413000000000000009ec809…

Then:

Frame 19: 102 bytes on wire (816 bits), 102 bytes captured (816 bits)
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Transmission Control Protocol, Src Port: 9559, Dst Port: 60332, Seq: 2558, Ack: 189, Len: 36
Data (36 bytes)
qi::Messaging
    Source: 127.0.0.1:9559
    Destination: 127.0.0.1:60332
    Magic: 0x42dead42
    Id: 284
    Size: 8
    Version: 0
    Type: 2
    Type: Reply
    Flags: 0
    Service: 1
    Service description: ServiceDirectory
    Object: 1
    Action: 0
    Action description: RegisterEvent
    Data: 414299a819a14c04

auth.pcap.gz

replicate FrontTactilTouched python example

I am trying to implement this example of a memory service subscription and a callback function
like referenced in this python example.

import qi

app = qi.Application()
session = qi.Session() 
session.connect("tcp://nao.local:9559") 
memory = session.service("ALMemory")
tts = session.service("ALTextToSpeech")

def on_touched(event):
    # value is 1 when pressed, 0 when released
    if event > 0:
        tts.say("ouch")

subscriber = memory.subscriber("FrontTactilTouched")
subscriber.signal.connect(on_touched)

app.run()

I am trying to understand how to subscribe to that memory service signal through examples/signals/main.go where you subscribe to a serviceAdded callback channel that seems similar to the related functions inside the ALMemoryInterface

interface ALMemory
     	fn subscriber(eventName: str) -> obj
        fn subscribeToEvent(name: str,callbackModule: str,callbackMethod: str)
        fn unsubscribeToEvent(name: str,callbackModule: str)
 end

What I don't understand is that the services.idl file does not contain the subscribe methods for the serviceAdded example - so how is that subscribeServiceAdded method being generated inside bus/services/gen_proxy.go - so that I could run something similar to this:

// Obtain a proxy to the service
alm, err = proxies.ALMemory(nil)
if err != nil {
	panic(err)
}

var unsubscribe func()
var sig chan int 
// subscribe to the signal "FrontTactilTouched" of AlMemory service.
unsubscribe, sig, err = alm.Subscribe("FrontTactilTouched")

Thanks for your help!

use opencv capabilities with go

I found this interesting library ->

 https://github.com/Niraj-Fonseka/recognize

It deploys a python opencv2 grpc server called from a go client.
Should we add this example to qiloop?
What would be the best approach here as nao v5 already has opencv2 pre-installed as well as nao v6 coming with opencv3 from what I have read.

Alternatively, it would be possible to run opencv off Nao and just stream ALVideoDevice into an external opencv lib -> such is described here with a webcam capture example.

 https://medium.com/@fonseka.live/detect-faces-using-golang-and-opencv-fbe7a48db055
 https://gocv.io/

Would be interested in your opinion what might be the best way to marry qiloop and opencv or gocv capabilities.

Thanks for your time.

Motion example fails with: ISerialization error Status Read Past End

when running the motion example, it fails with the error:

panic: call moveTo failed: ISerialization error Status Read Past End

This is likely due to a wrong resolution of the action ID since the ALMotion service have several "moveTo" methods taking various arguments. If this is confirmed, action resolution needs to be improved by checking the signature as well as the method name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.