B. The action server is not running or not responding
C. wait_for_result() requires a timeout argument
D. get_result() must be called before wait_for_result()
Solution
Step 1: Understand wait_for_result behavior
wait_for_result() blocks until the server sends a result or the server is unavailable.
Step 2: Identify why it never prints
If the action server is not running or not responding, wait_for_result() blocks forever, so print never executes.
Final Answer:
The action server is not running or not responding -> Option B
Quick Check:
Server missing causes wait block = B [OK]
Hint: No server = wait_for_result blocks forever [OK]
Common Mistakes:
Thinking send_goal needs repeating
Believing wait_for_result needs timeout
Calling get_result too early
5. You want to implement a ROS action for a robot that cleans a room. The cleaning can be paused or stopped anytime, and you want to show progress updates. Which approach best uses ROS actions for this long-running task?
hard
A. Define an action with a goal to start cleaning, send periodic feedback with percent done, and allow preemption to pause or stop
B. Use a service call that blocks until cleaning finishes, then returns success
C. Publish a topic with cleaning commands and ignore feedback
D. Use a timer to run cleaning steps without feedback or control
Solution
Step 1: Identify requirements for the cleaning task
The task is long-running, needs progress updates, and must support pause/stop (preemption).
Step 2: Match ROS communication types to requirements
Actions support goals, feedback, and preemption, making them ideal for this use case. Services block and lack feedback, topics alone don't handle goals or preemption well.
Final Answer:
Define an action with a goal to start cleaning, send periodic feedback with percent done, and allow preemption to pause or stop -> Option A
Quick Check:
Actions fit long tasks with feedback and control = A [OK]
Hint: Use actions for control, feedback, and preemption [OK]
Common Mistakes:
Using services for long tasks needing feedback
Ignoring feedback and control with topics
Not supporting preemption in design
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.