Documentation (work in progress?)

Just playing around with 19: Jibo Sees the World GitHub example and wanted to get more information on what getClosestVisualEntity() actually returns.

Reading the documentation I see that an Entity object is returned but I am having trouble finding what properties / methods belong to that class. Maybe a link to that class would help? Also there seems to be label duplication under the Events heading, the links are different but labels are incorrect.

I am not sure if this is the place to post documentation issues/feedback, but there are a few of these issues within the online API reference

Hello Sebastian,

Thank you for your input about the API docs. That section of the documentation is, to an extent, automatically generated as our APIs are updated.

The reason you are seeing duplicates under the Events heading is because there is more than one class that has those events. For example, if you click on the first “cloud” listing it will show the Listener Class that has a cloud event whereas clicking on the second “cloud” listing displays the ListenEmitter class which also has a cloud event.

I can definitely understand how this could be clearer and I have communicated that to our team so that we can take that into account as we work to better the documentation.

In regard to your question about Entity, we have not provided further details in the doc about properties/methods there because the contents of Entity are still in flux and being developed and we want to make sure they are more final before adding them to the docs. That being said, if you would like to take a closer look at what is currently included with Entity I would recommend using adding a console.log(); to our 19-lps sample code you mentioned like in the screenshot below. Again, as we develop the SDK through beta that may change but that would allow you to take a closer look at it.

I hope this is helpful and thank you!

-John

Totally understand that the API is in “flux” just wanted to bring this to your attention since some feedback is better than no feedback :slight_smile:

100% agreed! We love the feedback :slight_smile:

1 Like
I understand that API documnetation is in progress, Can I get an example of PlayAnimation(animPath) API used in code.

I have tried in a ExecuteScript behavior and get;
1)
var animate = require(“jibo”).animate;
var animPath = “some/path/dance.keys”; // path to animation file
var basePath = “some/path”; // base path for texture resolution

animate.createAnimationBuilderFromKeysPath(animPath, basePath, (builder) => {
// add listener
builder.on(animate.AnimationEventType.STOPPED, (eventType, instance, payload) => {
console.log("Animation stopped; was interrupted = " + payload.interrupted);
});

// trigger an instance of the animation
builder.play();

});

and I get the error ‘Uncaught TypeError: Cannot read property ‘length’ of undefined’

var animate = require(“jibo”).animate;
var animPath = “jibo-test-03/animation”;
new PlayAnimation(animPath)

and got the error ‘Uncaught ReferenceError: PlayAnimation is not defined’

What am I missing?

@mark_r80 The builder you create within animate.createAnimationBuilderFromKeysPath only lives within that callback that you’ve sent in. When you leave the callback, it’s gone, which is why you can’t call play on it later.

To use it, you can put something in that callback that stores the builder as a property of some object that will be accessible to your behavior tree later.

I use this in my knock joke skill. Since I have several animations that will be called again and again, I didn’t want to rebuild them every time. I created a class called “Reactions” that has a method to registerAnimationBuilder. I call this within the createAnimationBuilderFromKeysPath, sending in the builder, and it adds the new builder as a property of my Reaction object.

Later, in my skill I set a notepad.builder to be one of the builders stored in the Reaction object, then play it the notepad.builder.play().

If you want to see the code for this, it’s on my github. In particular look at src/knock-knock/reactions.js to see the code for the Reactions class, then the behaviors/attitudes/react.bt for the behavior tree that creates an instance of the Reactions object, then calls it to return a random builder of a certain type that is passed in to reactions.bt from a different behavior tree.

Code is at https://github.com/chrooke/jibo-knock-knock

1 Like

chris, Thank you very much for ‘jibo-knock-knock’. It took me 3 weeks to download it because Windows says it was invalid. Finally figurer out to use 7-zip to open it.

Got a copy to work in my skill. Had to do ‘npm install async’ to get it to work.

mark_r80