Challenge - 5 Problems
ROS Action Client Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediateWhat does this ROS action client print when receiving feedback?
Consider a ROS action client that sends a goal and prints feedback messages received from the server. What will be printed if the server sends feedback with progress 50% and then 100%?
ROS
import actionlib from some_msgs.msg import SomeAction, SomeGoal def feedback_cb(feedback): print(f"Progress: {feedback.progress}%") client = actionlib.SimpleActionClient('some_action', SomeAction) client.wait_for_server() goal = SomeGoal() client.send_goal(goal, feedback_cb=feedback_cb) client.wait_for_result()
Attempts:
2 left
💡 Hint
Feedback callbacks are called each time the server sends feedback.
✗ Incorrect
The feedback callback prints the progress value each time feedback is received. The server sends 50% then 100%, so both are printed in order.
❓ state_output
intermediateWhat is the final state of the action client after goal completion?
Given a ROS action client that sends a goal and waits for the result, what will be the state of the client after the server completes the goal successfully?
ROS
import actionlib from some_msgs.msg import SomeAction, SomeGoal client = actionlib.SimpleActionClient('some_action', SomeAction) client.wait_for_server() goal = SomeGoal() client.send_goal(goal) client.wait_for_result() state = client.get_state()
Attempts:
2 left
💡 Hint
Check the meaning of the state codes in actionlib.GoalStatus.
✗ Incorrect
When the server completes the goal successfully, the client state is SUCCEEDED, which corresponds to 3.
📝 Syntax
advancedWhich option correctly sets up a feedback callback in a ROS action client?
Select the code snippet that correctly passes a feedback callback function to the send_goal method of a ROS action client.
Attempts:
2 left
💡 Hint
Check the parameter name expected by send_goal for feedback callbacks.
✗ Incorrect
The correct parameter name is feedback_cb. Passing feedback_cb=feedback_cb correctly assigns the callback function.
🔧 Debug
advancedWhy does this ROS action client not print feedback messages?
This ROS action client code does not print any feedback messages even though the server sends them. What is the cause?
ROS
import actionlib from some_msgs.msg import SomeAction, SomeGoal def feedback_cb(feedback): print(f"Progress: {feedback.progress}%") client = actionlib.SimpleActionClient('some_action', SomeAction) client.wait_for_server() goal = SomeGoal() client.send_goal(goal) client.wait_for_result()
Attempts:
2 left
💡 Hint
Check how the feedback callback is connected to the client.
✗ Incorrect
The feedback callback must be passed as feedback_cb=feedback_cb in send_goal to be called on feedback.
🧠 Conceptual
expertWhat is the role of feedback in a ROS action client-server interaction?
In ROS action communication, what is the main purpose of feedback messages sent from the action server to the client?
Attempts:
2 left
💡 Hint
Think about what feedback means in everyday tasks.
✗ Incorrect
Feedback provides updates during execution, like progress reports, so the client knows how the goal is advancing.
