Assignment 3: Obstacle Avoidance

Python Only

In assignment03/src/assignment03/ fill in the bodies for three functions.
  1. def to_vector(x, y)
    Converts a point in xy coordinates to a vector with polar coordinates. Returns a tuple of the angle (in radians) followed by the magnitude/radius.
  2. def add_vectors(v1, v2, scale=1.0, power=1.0)
    Add two vectors together with scaling factor and power. Vectors are angle, magnitude tuples. The radius should be raised to the power specified. The resulting vector should then be scaled by the scale factor.

    This gives you the ability to express Hooke's and Coulomb's laws.

  3. get_command(pose, vector)
    Given a pose (x,y,theta) and vector, translate to velocity command. There is not necessarily one correct answer to this.

ROS Python

In assignment03/src/, write a node that subscribes to laser messages (/base_scan) poses (geometry_msgs/PoseStamped on topic (/move_base_simple/goal) and odometry (Odometry msgs on topic /odom) and publishes velocity commands (Twist messages on /cmd_vel). The robot should attempt to move itself toward the current goal using the potential fields model.

You should also set up parameters for the power and scaling factors for laser readings and the goal. You will have to tune these parameters to get the desired behavior.

Testing Your Code

There is a new package, navigation_worlds which has several worlds to test your navigation functions in. You should first test your goal seeking behavior with empty.launch. You can then move onto more complicated scenarios with dodge.launch and zig.launch. You specify the goal by selecting the "2D Nav Goal" button in RViz, and clicking and dragging at the goal pose you want. This also allows you to specify an orientation, which you do NOT need to account for in this lab.

Due Date: March 30, 2015, 11:59pm CST.