Setting parameters from a launch file lets you easily change values your robot uses without changing code. It helps you customize behavior before running your robot.
You want to set robot speed or sensor thresholds before starting nodes.
You need to share configuration values between multiple nodes.
You want to test different settings without rewriting code.
You want to keep your code clean by separating configuration from logic.
A. The value true should be in quotes: value="true"
B. The param tag should be inside the node tag
C. The node tag is missing the required args attribute
D. The launch tag is missing a closing slash
Solution
Step 1: Check the value attribute format
Boolean values in <param> tags must be strings, so true should be "true" in quotes.
Step 2: Verify tag placement and syntax
The <param> tag can be outside the <node> tag, and the <launch> tag is correctly closed.
Final Answer:
The value true should be in quotes: value="true" -> Option A
Quick Check:
Boolean values need quotes in <param> = C [OK]
Hint: Always put boolean values in quotes in <param> tags [OK]
Common Mistakes:
Leaving boolean values unquoted
Placing <param> tags only inside <node>
Misunderstanding launch tag syntax
5. You want to set a parameter max_retries to 5 only if it is not already set by another launch file. Which launch file tag should you use to achieve this?
hard
A.
B. 5
C.
D.
Solution
Step 1: Understand conditional parameter setting
The <param> tag supports the 'unless' attribute to set a parameter only if it is not already set.
Step 2: Check the options for correct usage
<param unless="max_retries" name="max_retries" value="5" /> uses 'unless="max_retries"' with name and value, which is the correct syntax.
Final Answer:
<param unless="max_retries" name="max_retries" value="5" /> -> Option A
Quick Check:
Use 'unless' attribute to avoid overwriting = A [OK]
Hint: Use 'unless' attribute to set param only if unset [OK]
Common Mistakes:
Omitting the 'name' attribute when using 'unless'
Using <rosparam> without condition
Misplacing 'unless' attribute
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.