Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Learn how to program a simple robot (TJBot) to move its arm, recognize objects, flash a light, speak, and more. You can build simple apps to control TJBot by using Node.js or even Node-RED. If you don’t want to purchase the TJBot, you use a simulator instead.
This course is for all those do-it-yourself Node.js or Node-RED programmers who want to learn IoT basics. You can purchase the TJBot if you don’t already have one or run it in a simulator, so no purchase necessary! You’ll use artificial intelligence services (Watson) to program the robot to recognize objects and color, translate speech to text, recognize and translate languages, and analyze emotional tones in text. You should have basic programming experience with either Node.js or Node-RED. Experience with programming IoT devices is not required.
You must have a Pay-As-You-Go or subscription IBM Cloud account. For this course, you can program the physical TJBot or use a simulator that will mimic the actions, speech, and sounds of the robot. If you use the simulator, you need only a web browser. If you want to use the physical robot, you can create the same project files on the Raspberry Pi and run the Node.js application. TJBot can be programmed in Node-RED, Swift, Python, and Node.js.
This course will use a Node.js simulator that mirrors the real bot to make it accessible to everyone. This code can be copied over to the Raspberry Pi and run as-is with little modification.
Quick labs
Question: What does the see method return? Select all that apply.
Question: Which of these statements are true about TJBot? Select all that apply.
Question: What programming languages are supported by the TJBot libraries mentioned in this course? Select all that apply.
Question: Which one of these Watson services does not have a corresponding method in the TJBot library.
Question: Which method can be passed a duration value to specify how long the LED light should stay on?
Complex labs
Question: In which order do these methods described in the course make the most logical sense?
Question: Review the following Node.js code. What does the value of the variable response contain?
var TJBot = require("tjbot");
var tj = new TJBot(
["camera"],
{},
{
visual_recognition: {
apikey: ""
}
});
tj.see(function(response) {
console.log(response);
});
Question: Which number points in the following Node.js code (#1, #2, #3, #4) should be corrected so that TJBot can say “Hello World” in English? Select all that apply.
var TJBot = require("tjbot");
var tj = new TJBot(
["microphone"], // #1
{
robot: {
gender: "female" // #2
},
speak: {
language: "fr-FR" // #3
}
},
{
text_to_speech: { // #4
username: "cf63b1f3-ef18-4628-86c8-6b1871e076b9",
password: "MWNwz3qcdIab"
}
});
tj.speak("Hello World");
Question: Review the following Node.js code. Which number points (#1, #2, #3, #4) in the following code should be corrected to make TJBot take a picture and speak out what is seen? Select all that apply.
var TJBot = require("tjbot");
var tj = new TJBot(
["speaker"], // #1
{
robot: {
gender: "female" // #2
},
speak: {
language: "en-US" // #3
}
},
{ // #4
text_to_speech: {
username: "cf63b1f3-ef18-4628-86c8-6b1871e076b9",
password: "MWNwz3qcdIab"
}
});
tj.see(function(response) {
tj.speak("I see "+response.map(i => i.class).join(", "));
});
Question: Which of the following blocks will speak out the phrase “Hello World” followed by pulsing the LED light the color green?
CODE BLOCK 1:
tj.speak("hello world").then(function() {
tj.pulse("green", 1);
});
CODE BLOCK 2:
tj.speak("hello world");
tj.pulse("green", 1);
CODE BLOCK 3:
tj.speak("hello world").then(function() {
tj.pulse(1, "green");
});
CODE BLOCK 4:
tj.pulse("green", 1);
tj.speak("hello world");
Final Exam
Question: What is the best way to determine whether a model is available in the Watson Language Translator service?
Question: The TJBot capabilities can be extended both physically and in code by using third-party libraries or by writing custom code.
Question: The converse method can be used to do which tasks? Select all that apply.
Question: TJBot can recognize the verbal emotions by using the method analyzeTone.
Question: Which methods can be chained together with the converse method? Select all that apply.
Question: What is the correct order of the following three arguments that are passed to the TJBot constructor?
1. Hardware, a JavaScript array of strings, i.e. speaker, microphone, camera
2. A JavaScript object with Watson service credentials
3. A JavaScript object with configuration settings like the language to speak
Question: Jane wrote this code in Node.js, but the code is not working as expected. Which number points in the code identify the code that should be corrected? Select all that apply.
var TJBot = require("tjbot");
var tj = new TJBot(
["speaker"], // #1
{
listen: {
language: "en-US" // #2
}
},
{
speech_to_text: {
username: "", // #3
password: "" // #4
}
});
tj.listen(function(text) {
console.log(text);
});
tj.stopListening(); // #5
Question: Select all the core hardware that is supported by TJBot by default.
Question: What is the variable workspaceId used for in the following code?
var TJBot = require("tjbot");
var tj = new TJBot(
["microphone","speaker"],
{
robot: {
gender: "male"
},
speak: {
language: "en-US"
}
},
{
speech_to_text: {
username: "",
password: ""
},
conversation: {
username: "",
password: ""
},
text_to_speech: {
username: "cf63b1f3-ef18-4628-86c8-6b1871e076b9",
password: "MWNwz3qcdIab"
}
}
);
var workspaceId = "";
function processText(text) {
console.log(text);
tj.stopListening();
tj.converse(workspaceId, text, response => {
console.log(response);
tj.speak(response.object.output.text.join(" ")).then(function(){
tj.listen(processText);
});
});
}
tj.listen(processText);
Question: Review the following code. Then, review the code blocks. Select the code block number that you must change to add in the placeholder labeled TODO to complete this program?
var TJBot = require("tjbot");
var tj = new TJBot(
["camera","speaker"],
{
robot: {
gender: "male"
},
speak: {
language: "en-US"
}
},
{
// TODO: answer the question
text_to_speech: {
username: "",
password: ""
}
});
tj.see(function(objects) {
console.log(objects);
var text = "T J Bot sees " + objects.map(item => item["class"]).join(", ");
console.log(text);
tj.speak(text);
});
CODE BLOCK 1
visual_recognition: {
username: "",
password: ""
},
CODE BLOCK 2
visual_recognition: {
apikey: ""
},
CODE BLOCK 3
No code changes are required. This program will run correctly without any changes.
We hope you know the correct answers to Building Robots with TJBot If Queslers helped you to find out the correct answers then make sure to bookmark our site for more Course Quiz Answers.
If the options are not the same then make sure to let us know by leaving it in the comments below.
In our experience, we suggest you enroll in this and gain some new skills from Professionals completely free and we assure you will be worth it.
This course is available on Cognitive Class for free, if you are stuck anywhere between quiz or graded assessment quiz, just visit Queslers to get all Quiz Answers and Coding Solutions.
More Courses Quiz Answers >>
Building Cloud Native and Multicloud Applications Quiz Answers
Accelerating Deep Learning with GPUs Quiz Answers
Blockchain Essentials Cognitive Class Quiz Answers
Deep Learning Fundamentals Cognitive Class Quiz Answers
Hadoop 101 Cognitive Class Answers