********* Questions ********* Introduction ============ In this workshop, you will visualize the working of the Navigation Stack to a greater extent and tune it’s parameters to achieve better results for the Turtlebot’s navigation in the given map. This is also followed by an introduction to Action Handling via Python. Task: Visualize Navigation Stack data ===================================================== A number of parameters that are set via the configuration files can be visualised via RViz. Simply look for available topics to subscribe to and ADD them to RViz to get a slightly improved understanding of the Navigation Stack. Additionally, save your RViz configuration for fast reuse and include it to be deployed along with one of the suitable launch files. Task: Python Action Handling ============================= Integrate the following **code segment** into a node suitably to be able to send goals via script to **move_base** for execution. This can be altered suitably to achieve fully autonomous navigation for the Turtlebot. .. code-block:: python from move_base_msgs.msg import MoveBaseActionGoal, MoveBaseActionFeedback ... client = actionlib.SimpleActionClient('move_base',move_base_msgs.msg.MoveBaseAction) client.wait_for_server() ori = tf_conversions.transformations.quaternion_from_euler(0, 0, math.pi) goal = move_base_msgs.msg.MoveBaseGoal() goal.target_pose.pose.position.x = 1 goal.target_pose.pose.orientation.x = self.ori[0] goal.target_pose.pose.orientation.y = self.ori[1] goal.target_pose.pose.orientation.z = self.ori[2] goal.target_pose.pose.orientation.w = self.ori[3] goal.target_pose.header.frame_id = 'base_link' goal.target_pose.header.stamp = rospy.Time.now() client.send_goal(goal) client.wait_for_result() if client.get_state() == actionlib_msgs.msg.GoalStatus.SUCCEEDED: rospy.loginfo("Successfully reached goal") elif client.get_state() == actionlib_msgs.msg.GoalStatus.PREEMPTED: rospy.loginfo(""Goal preempted by user!") else: rospy.logerror("Other execution status of move_base actionclient") An important factor here is the ``frame_id`` of the goal pose. This allows for sending either relative or absolute goals. To send a relative goal one has to send the goal relative to ``base_link``. For absolute goals one has to send the goal relative to the ``map`` frame. If you want to cancel the current motion(goal), simply execute the following in python (after instantiating the actionlib.SimpleActionClient): .. code-block:: python client.cancel_goal() Include this functionality to cancel a goal via an “Emergency Stop” on the joystick.