Performance: Setting navigation goals
Setting navigation goals affects how quickly and smoothly a robot can plan and execute movement, impacting responsiveness and real-time interaction.
goal = PoseStamped() goal.header.frame_id = 'map' goal.pose.position.x = 10 goal.pose.position.y = 10 move_base_client.send_goal(goal) move_base_client.wait_for_result()
goal = PoseStamped() goal.header.frame_id = 'map' goal.pose.position.x = 10 goal.pose.position.y = 10 # Sending goal repeatedly in a tight loop without checking status while True: move_base_client.send_goal(goal)
| Pattern | Planning Requests | CPU Load | Responsiveness | Verdict |
|---|---|---|---|---|
| Repeated goal sending in loop | Many redundant requests | High CPU usage | Low responsiveness due to overload | [X] Bad |
| Single goal send with wait | One request per goal | Low CPU usage | High responsiveness | [OK] Good |
goal.target_pose.header.frame_id = "map" goal.target_pose.pose.position.x = 2.0 goal.target_pose.pose.position.y = 3.0 goal.target_pose.pose.orientation.w = 1.0 client.send_goal(goal) client.wait_for_result()What will the robot do?
goal.target_pose.header.frame_id = "map" goal.target_pose.pose.position.x = 1.0 goal.target_pose.pose.position.y = 2.0 client.send_goal(goal) client.wait_for_result()
Pass the test and this pattern moves unknown