This launch file starts two nodes: the turtlesim simulator and a teleoperation node to control the turtle with the keyboard. Both run together automatically.
A. Node name cannot be 'node1'; use 'node' instead.
B. Attribute 'exec' is wrong; use 'type' instead.
C. Missing closing tag for <launch>.
D. Package name 'my_pkg' is invalid; must be 'pkg'.
Solution
Step 1: Identify incorrect attribute in node tag
The attribute 'exec' is not valid; ROS launch files use 'type' to specify executable.
Step 2: Correct the attribute to fix the launch file
Replace 'exec' with 'type' to properly start the node.
Final Answer:
Attribute 'exec' is wrong; use 'type' instead. -> Option B
Quick Check:
Use 'type' attribute for node executable = C [OK]
Hint: Use 'type' not 'exec' for node executable in launch files [OK]
Common Mistakes:
Confusing 'exec' with 'type' attribute
Forgetting to close launch tags
Changing node names unnecessarily
5. You want to start two nodes and set a shared parameter using one launch file. Which approach best automates this startup?
hard
A. Start each node manually in separate terminals and set parameters individually.
B. Use a script to start nodes but set parameters only after nodes run.
C. Write separate launch files for each node and run them one after another.
D. Create a launch file that includes both nodes and sets the parameter once.
Solution
Step 1: Understand launch file purpose
Launch files automate starting multiple nodes and setting parameters together.
Step 2: Evaluate options for automation
Create a launch file that includes both nodes and sets the parameter once. uses one launch file to start both nodes and set parameter once, saving time and avoiding errors.
Step 3: Compare with other options
Options A, C, and D require manual steps or multiple files, less efficient and error-prone.
Final Answer:
Create a launch file that includes both nodes and sets the parameter once. -> Option D
Quick Check:
One launch file for all nodes and params = B [OK]
Hint: Use one launch file to start all nodes and set shared params [OK]
Common Mistakes:
Running nodes manually instead of using launch files
Splitting nodes into multiple launch files unnecessarily
Setting parameters after nodes start causing delays
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.