To follow along, launch stage demo and rviz using commands from top of Week 4. Navigation Stack. Now go into workspace, rosrun my_nav go_to_goal.py.

DWA

The Dynamic Window Approach considers multiple trajectories that a robot can move in, and generates a range of linear and angular velocities that it can take. The set of possible trajectories is evaluated to see which is the most optimal and then it is chosen to be executed on the robot.

For example, we could have a dynamic window of . We use the optimisation function:

This objective function weighs how close the trajectory is with the desired heading (according to the global planner), how far away it passes by obstacles, and how fast it is. The variables weigh the relative importance of each term. Sigma is a smoothing term which we can ignore for our purposes.

A heuristic is said to be admissible if it never overestimates the cost of reaching the goal.

Roslaunch

We can use roslaunch to launch multiple packages at once. We use http://wiki.ros.org/roslaunch/XML as a reference.

First, create a new folder called launch in your package. Now create *.launch files, such as circle_bringup.launch:

<launch>
    <node pkg="turtlesim" type="turtlesim_node" name="turtlesim" />
    <node pkg="turtle_nav" type="circle.py" name="circle_navigation" />
</launch>

You can also include other launch files and remap topics:

<launch>
    <include file="$(find rosplan_stage_demo)/launch/empty_stage_single_robot.launch" />
    <node pkg="turtle_nav" type="circle.py" name="circle_navigation">
        <remap from="/turtle1/cmd_vel" to="/cmd_vel" />
    </node>
</launch>

Rosbag

Rosbag is a set of tools for debugging, recording and replaying messages.

For example, we can start recording a topic:

rosbag record /turtle1/cmd_vel

It will save to a bag file which we can now play back:

rosbag play 2022-10-26-13-28-04.bag

Rqtplot

We can use rqtplot to visualise variables on a graph: We can start this by running:

rosrun rqt_plot rqt_plot