Recent changes to this wiki: (Note that diffs will appear in the atom feed, but not on this page.)
Fix locations of beacons.
diff --git a/assignments/2011/assign1.pdf b/assignments/2011/assign1.pdf index 748333e..4e8f505 100644 Binary files a/assignments/2011/assign1.pdf and b/assignments/2011/assign1.pdf differ
Add note about pictures.
diff --git a/assignments/2011/beacons.mdwn b/assignments/2011/beacons.mdwn index f14ce82..9bc7ee7 100644 --- a/assignments/2011/beacons.mdwn +++ b/assignments/2011/beacons.mdwn @@ -1,4 +1,6 @@ COMP3431 Assignment Beacons =========================== +Note: pictures were not taken with the beacons in the correct field locations. + [[beacon-small.jpg]][[beacon-medium.jpg]][[beacon-large.jpg]]
Move beacon pictures to another page.
diff --git a/assignments.mdwn b/assignments.mdwn index e0755b5..de31355 100644 --- a/assignments.mdwn +++ b/assignments.mdwn @@ -10,10 +10,7 @@ HomeWork Assignments Large Assignments ----------------- -[[Robotics Assignment_1|assignments/2011/assign1.pdf]] - * [[Large Beacon|assignments/2011/beacon-large.jpg]] - * [[Medium Beacon|assignments/2011/beacon-medium.jpg]] - * [[Small Beacon|assignments/2011/beacon-small.jpg]] +[[Robotics Assignment_1|assignments/2011/assign1.pdf]] and [[Beacon Pictures|assignments/2011/beacons]] <!-- Assignments 1 and 3 are practical assignments on the AIBOs and will be marked in lab. The second assignment is a written assignment. diff --git a/assignments/2011/beacons.mdwn b/assignments/2011/beacons.mdwn new file mode 100644 index 0000000..f14ce82 --- /dev/null +++ b/assignments/2011/beacons.mdwn @@ -0,0 +1,4 @@ +COMP3431 Assignment Beacons +=========================== + +[[beacon-small.jpg]][[beacon-medium.jpg]][[beacon-large.jpg]]
Add links to beacon pictures
diff --git a/assignments.mdwn b/assignments.mdwn index 739380f..e0755b5 100644 --- a/assignments.mdwn +++ b/assignments.mdwn @@ -11,6 +11,9 @@ Large Assignments ----------------- [[Robotics Assignment_1|assignments/2011/assign1.pdf]] + * [[Large Beacon|assignments/2011/beacon-large.jpg]] + * [[Medium Beacon|assignments/2011/beacon-medium.jpg]] + * [[Small Beacon|assignments/2011/beacon-small.jpg]] <!-- Assignments 1 and 3 are practical assignments on the AIBOs and will be marked in lab. The second assignment is a written assignment.
Add pictures of the beacons for the assignment.
diff --git a/assignments/2011/beacon-large.jpg b/assignments/2011/beacon-large.jpg new file mode 100644 index 0000000..1eecdef Binary files /dev/null and b/assignments/2011/beacon-large.jpg differ diff --git a/assignments/2011/beacon-medium.jpg b/assignments/2011/beacon-medium.jpg new file mode 100644 index 0000000..16ad357 Binary files /dev/null and b/assignments/2011/beacon-medium.jpg differ diff --git a/assignments/2011/beacon-small.jpg b/assignments/2011/beacon-small.jpg new file mode 100644 index 0000000..e378aa7 Binary files /dev/null and b/assignments/2011/beacon-small.jpg differ
Add robotics assignment sheet - as announced in class long ago.
diff --git a/assignments.mdwn b/assignments.mdwn index e344ea8..739380f 100644 --- a/assignments.mdwn +++ b/assignments.mdwn @@ -10,8 +10,12 @@ HomeWork Assignments Large Assignments ----------------- +[[Robotics Assignment_1|assignments/2011/assign1.pdf]] + +<!-- Assignments 1 and 3 are practical assignments on the AIBOs and will be marked in lab. The second assignment is a written assignment. * [[Assignment_1|assignments/2010/3431-assign1.pdf]] * [[Assignment_2|assignments/2010/3431-assign2.pdf]] * [[Assignment_3|assignments/2010/3431-assign3.pdf]] +--> diff --git a/assignments/2011/assign1.pdf b/assignments/2011/assign1.pdf new file mode 100644 index 0000000..748333e Binary files /dev/null and b/assignments/2011/assign1.pdf differ
Update tekkotsu URL
diff --git a/aibo/GettingStarted.txt b/aibo/GettingStarted.txt
index 0e8d238..63bf0da 100644
--- a/aibo/GettingStarted.txt
+++ b/aibo/GettingStarted.txt
@@ -1,61 +1,121 @@
-= Getting Started =
-
-=== IMPORTANT NOTES ===
-Remember this, before you checkout, try anything, or do anything. Do NOT run any of the scripts below as root. It will most likely erase your linux kernel, at best, or erase your entire partition, at worst.
-
-=== Getting OPEN-R ===
-If you need to get openr, you can check out this page: http://www.cs.cmu.edu/~tekkotsu/openr-install.html
-
-There is an older version of the openr stuff on the CSE filesystem at ~robocup/public_ftp/Openr-stuff-1.1.5-r3.tgz
-
-=== Checkout ===
-
-To build and install code on the AIBO ERS-7 robots check out a working copy from the [wiki:SubversionRepository Subversion Repository] and change to the trunk/robot directory, then:
-
-I suggest checking out https://roborouter.cse.unsw.edu.au/svn/robocup/branches/pre-bremen/ into a temp directory on the local machine.
-
-=== Enviroment Variables ===
-
-Make sure you set the following enviroment variables:
- * Add "ROBOCUP_DIR" to your profile script. This should be set to the trunk directory of you checkout.
- * Add "bin" to your path. This can be set as "$ROBOCUP_DIR/bin" once the above step has been performed.
- * Add "robot/bin" to your path. This can be set as "$ROBOCUP_DIR/robot/bin" once the first step has been performed.
-
- * Add the following to .bashrc in your home directory.
-{{{
-export ROBOCUP_DIR=/path/to/robocup/dir
-export PATH=$PATH:${ROBOCUP_DIR}/bin:${ROBOCUP_DIR}/robot/bin
-export DISTCC_HOSTS='localhost benji dogmatix gibson fluffy'
-}}}
-=== Make ===
-
-Type "make". This will build the C++ code and do some configuration stuff.
-
-=== Spip ===
-
-Type
-{{{
-spip playerModule IP_postfix [playerNum] [teamNum]
-}}}
-
-For example,
-{{{
-spip pForward 142
-}}}
-
-Choose IP addresses of the form 1TP where "T" is the team number, and "P" is the player number (usually 1 - 4).
-
-=== ins ===
-
-"ins" to install the rUNSWift code on the stick. If this does not work try using "os" (which re-loads the Aperios OS onto the stick).
-
-=== Boot ===
-
-Install the memory stick and a battery into an ERS-7 AIBO and turn it on. After it boots (about 30 seconds) you should be able to telnet to the robot on port 59000.
-
-See [wiki:TroubleshootingRobots Troubleshooting Robots] and [wiki:BuildingDevelopmentEnvironment Building Development Environment]
-
-=== Notes ===
-
-On some systems (particularly OSX), coverage.py is not found by pychecker - you need to copy this into somewhere that pychecker can find this. On OSX, this is:
-"/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.x/" where x is your version of python (there should be only one folder there anyway)
\ No newline at end of file
+= Getting Started =
+
+
+
+=== IMPORTANT NOTES ===
+
+Remember this, before you checkout, try anything, or do anything. Do NOT run any of the scripts below as root. It will most likely erase your linux kernel, at best, or erase your entire partition, at worst.
+
+
+
+=== Getting OPEN-R ===
+
+If you need to get openr, you can check out this page: http://tekkotsu.org/openr-install.html
+
+
+
+There is an older version of the openr stuff on the CSE filesystem at ~robocup/public_ftp/Openr-stuff-1.1.5-r3.tgz
+
+
+
+=== Checkout ===
+
+
+
+To build and install code on the AIBO ERS-7 robots check out a working copy from the [wiki:SubversionRepository Subversion Repository] and change to the trunk/robot directory, then:
+
+
+
+I suggest checking out https://roborouter.cse.unsw.edu.au/svn/robocup/branches/pre-bremen/ into a temp directory on the local machine.
+
+
+
+=== Enviroment Variables ===
+
+
+
+Make sure you set the following enviroment variables:
+
+ * Add "ROBOCUP_DIR" to your profile script. This should be set to the trunk directory of you checkout.
+
+ * Add "bin" to your path. This can be set as "$ROBOCUP_DIR/bin" once the above step has been performed.
+
+ * Add "robot/bin" to your path. This can be set as "$ROBOCUP_DIR/robot/bin" once the first step has been performed.
+
+
+
+ * Add the following to .bashrc in your home directory.
+
+{{{
+
+export ROBOCUP_DIR=/path/to/robocup/dir
+
+export PATH=$PATH:${ROBOCUP_DIR}/bin:${ROBOCUP_DIR}/robot/bin
+
+export DISTCC_HOSTS='localhost benji dogmatix gibson fluffy'
+
+}}}
+
+=== Make ===
+
+
+
+Type "make". This will build the C++ code and do some configuration stuff.
+
+
+
+=== Spip ===
+
+
+
+Type
+
+{{{
+
+spip playerModule IP_postfix [playerNum] [teamNum]
+
+}}}
+
+
+
+For example,
+
+{{{
+
+spip pForward 142
+
+}}}
+
+
+
+Choose IP addresses of the form 1TP where "T" is the team number, and "P" is the player number (usually 1 - 4).
+
+
+
+=== ins ===
+
+
+
+"ins" to install the rUNSWift code on the stick. If this does not work try using "os" (which re-loads the Aperios OS onto the stick).
+
+
+
+=== Boot ===
+
+
+
+Install the memory stick and a battery into an ERS-7 AIBO and turn it on. After it boots (about 30 seconds) you should be able to telnet to the robot on port 59000.
+
+
+
+See [wiki:TroubleshootingRobots Troubleshooting Robots] and [wiki:BuildingDevelopmentEnvironment Building Development Environment]
+
+
+
+=== Notes ===
+
+
+
+On some systems (particularly OSX), coverage.py is not found by pychecker - you need to copy this into somewhere that pychecker can find this. On OSX, this is:
+
+"/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.x/" where x is your version of python (there should be only one folder there anyway)
Correct path to homework 1
diff --git a/assignments.mdwn b/assignments.mdwn index 822d9f7..e344ea8 100644 --- a/assignments.mdwn +++ b/assignments.mdwn @@ -5,7 +5,7 @@ Due dates for all assignments are shown on the assignment and [[calendar]]. HomeWork Assignments -------------------- - * [[Homework_1|assignments/2011/3431-homework1.pdf]] + * [[Homework_1|assignments/2011/Homework1.pdf]] Large Assignments -----------------
Add a quick note about H and beacon IDs.
diff --git a/assignments/2011/Homework1.pdf b/assignments/2011/Homework1.pdf index 608cc2b..382a975 100644 Binary files a/assignments/2011/Homework1.pdf and b/assignments/2011/Homework1.pdf differ
Add first assignment 2011.
diff --git a/assignments.mdwn b/assignments.mdwn index 5ceb5ae..822d9f7 100644 --- a/assignments.mdwn +++ b/assignments.mdwn @@ -1,12 +1,17 @@ -There are three assignments distributed throughout the semester. +There are five assignments distributed throughout the semester. Three large assignments and two small, 'homework', assignments. The large assignments are worth 15% each, the smaller ones 5% each. -Assignments 1 and 3 are the same as 2007 in all ways except the due date. -These two assignments are practical assignments on the AIBOs and will be marked in lab. +Due dates for all assignments are shown on the assignment and [[calendar]]. -The second assignment is a written assignment. +HomeWork Assignments +-------------------- -Due dates for all assignments are shown on the [[lecture plan]]. + * [[Homework_1|assignments/2011/3431-homework1.pdf]] - * [[Assignment_1|assignments/2007/assign1-2007.pdf]] - * [[Assignment_2|assignments/2009/assign2.pdf]] - * [[Assignment_3|assignments/2009/assign3.pdf]] +Large Assignments +----------------- + +Assignments 1 and 3 are practical assignments on the AIBOs and will be marked in lab. The second assignment is a written assignment. + + * [[Assignment_1|assignments/2010/3431-assign1.pdf]] + * [[Assignment_2|assignments/2010/3431-assign2.pdf]] + * [[Assignment_3|assignments/2010/3431-assign3.pdf]] diff --git a/assignments/2011/Homework1.pdf b/assignments/2011/Homework1.pdf new file mode 100644 index 0000000..608cc2b Binary files /dev/null and b/assignments/2011/Homework1.pdf differ
diff --git a/pioneer/stage.mdwn b/pioneer/stage.mdwn index f42a428..b9150b0 100644 --- a/pioneer/stage.mdwn +++ b/pioneer/stage.mdwn @@ -38,7 +38,7 @@ Drive the simulated robot around using the keyboard and look at what the simulat Look at the rxgraph output and note that the `teleop_twist_keyboard` node is publishing commands on the `/cmd_vel` topic the same way the joystick was last week. (If someone wants to write a better keyboard teleop, that would be cool.) -You can also use `rostopic /base_scan` to see the simulated laser output. +You can also use `rostopic echo /base_scan` to see the simulated laser output. Making your own world ---------------------
Add a few edits.
diff --git a/pioneer/stage.mdwn b/pioneer/stage.mdwn
index bbf92b4..f42a428 100644
--- a/pioneer/stage.mdwn
+++ b/pioneer/stage.mdwn
@@ -14,6 +14,8 @@ Get teleop_twist_keyboard:
cd teleop_twist_keyboard
rosmake
+(That is a local cache of code available here: <http://brown-ros-pkg.googlecode.com/>.)
+
Start a Simulation
------------------
@@ -41,7 +43,7 @@ You can also use `rostopic /base_scan` to see the simulated laser output.
Making your own world
---------------------
- Look at the stage documentation for world files at <http://playerstage.sourceforge.net/doc/Stage-3.2.1/group__model__position.html>. Build your own simple world with a couple of circular pillars of different sizes and a robot with a laser on it. The example world files that come with stage are also useful. Note that an object's shape is specified by a bitmap. A bitmap of a circle is available at <http://www.cse.unsw.edu.au/~cs3431/Circle.png>.
+ Look at the stage documentation for world files at <http://playerstage.sourceforge.net/doc/Stage-3.2.1/group__model__position.html>. Build your own simple world with a couple of circular pillars of different sizes and a robot with a laser on it. The example world files that come with stage are also useful (e.g the `/opt/ros/diamondback/stacks/simulator_stage/stage/world/willow-erratic.world` file used above). Note that an object's shape is specified by a bitmap. A bitmap of a circle is available at <http://www.cse.unsw.edu.au/~cs3431/Circle.png>.
Drive around your world.
Add notes for using stage with ROS.
diff --git a/pioneer/stage.mdwn b/pioneer/stage.mdwn new file mode 100644 index 0000000..bbf92b4 --- /dev/null +++ b/pioneer/stage.mdwn @@ -0,0 +1,47 @@ +Start core ROS processes +------------------------ + +* Start roscore +* Start rxgraph + +Make a robot teleop process +--------------------------- + +Get teleop_twist_keyboard: + + cd ~/ros_workspace + git clone http://www.cse.unsw.edu.au/~cs3431/teleop_twist_keyboard.git + cd teleop_twist_keyboard + rosmake + +Start a Simulation +------------------ + + rosrun stage stageros `rospack find stage`/world/willow-erratic.world + +Note this is using one of the simulated worlds that comes with ROS. Details on the ROS integration of stage are on the ros wiki: <http://www.ros.org/wiki/stage>. That page lists the ROS topics published and subscribed to. The `.world` file describes the world to simulate. + +Start a visualisation: (the simulation is showing us the 'real world' - this visualisation will show us what the robot's sensors see.) + + rosrun rviz rviz + +note that you cannot see anything. I am assuming in these notes that you last started rvis using the config file `/opt/ros/diamondback/stacks/laser_drivers/sicktoolbox_wrapper/sick_test.vcg`. If not, then use the file menu to open that config. + +The robot's laser and the simulation's laser have slightly different names. +In global options, change the `Fixed frame` and `Target frame` each from `/laser` to `/base_laser_link`. In the laser scan section, change the `Topic` from `/scan` to `/base_scan`. Remember from the tutorials that ROS allows you to rename things on the command line. We could also have copied and edited the `sick_test.vcg` config file. + +You should now see the laser scan in rviz. + +Drive the simulated robot around using the keyboard and look at what the simulated laser sees. + +Look at the rxgraph output and note that the `teleop_twist_keyboard` node is publishing commands on the `/cmd_vel` topic the same way the joystick was last week. (If someone wants to write a better keyboard teleop, that would be cool.) + +You can also use `rostopic /base_scan` to see the simulated laser output. + +Making your own world +--------------------- + + Look at the stage documentation for world files at <http://playerstage.sourceforge.net/doc/Stage-3.2.1/group__model__position.html>. Build your own simple world with a couple of circular pillars of different sizes and a robot with a laser on it. The example world files that come with stage are also useful. Note that an object's shape is specified by a bitmap. A bitmap of a circle is available at <http://www.cse.unsw.edu.au/~cs3431/Circle.png>. + +Drive around your world. +
diff --git a/pioneer/shell.mdwn b/pioneer/shell.mdwn
index 7d4e2c8..72030e5 100644
--- a/pioneer/shell.mdwn
+++ b/pioneer/shell.mdwn
@@ -24,3 +24,5 @@ Assuming you are running `roscore` on your workstation (which may or may not be
CLIENT_IP="${SSH_CLIENT%% *}"
export ROS_MASTER_URI="http://${CLIENT_IP}:11311/"
+
+Since ROS_MASTER_URI is http, anybody can access it. This means that "a) anyone can read you sensors and b) anyone can write to your actuators) -- Will. Useful if everyone's testing their laser code on the robot or when the assignment is being marked!
diff --git a/pioneer/sick.mdwn b/pioneer/sick.mdwn
index d70aa9d..d83b2a1 100644
--- a/pioneer/sick.mdwn
+++ b/pioneer/sick.mdwn
@@ -22,4 +22,6 @@ You can view the laser output on your terminal with the command:
rosrun rviz rviz -d `rospack find sicktoolbox_wrapper`/sick_test.vcg
+In the default view, the sensor seems to be positioned at the intersection between the lines second from the left and second from the bottom.
+
Thanks to the [ROS wiki sicktoolbox_wrapper docs](http://www.ros.org/wiki/sicktoolbox_wrapper/Tutorials/UsingTheSicklms).
diff --git a/pioneer/teleop.mdwn b/pioneer/teleop.mdwn index f29db49..b2851ed 100644 --- a/pioneer/teleop.mdwn +++ b/pioneer/teleop.mdwn @@ -15,7 +15,7 @@ Set up your [[shell]] variables. Lines beginning with 'D:' are commands for the * Play with joystick. * Note which button is which and which axis is which. -* `rosparam set /run_button 4` +* `rosparam set /run_button 0` * `rosparam set /deadman_button 0` * `rosparam set /axis_vx 1` * `rosparam set /axis_vw 0`
diff --git a/Pioneer.mdwn b/Pioneer.mdwn index f6f6969..296d204 100644 --- a/Pioneer.mdwn +++ b/Pioneer.mdwn @@ -4,7 +4,9 @@ This page holds links useful for the COMP3431/9431 use of the Pioneer robots. * We will be using [ROS](http://www.ros.org/), so the [ROS wiki](http://www.ros.org/wiki/) will be useful. * The [COMP4411 wiki](http://cgi.cse.unsw.edu.au/~cs4411/wiki/) has a useful [Pioneer guide](http://cgi.cse.unsw.edu.au/~cs4411/wiki/index.php?title=ActivMedia_Pioneer_Guide). -Currently the robots wills and bass are set up to use ROS. +Currently the robots wills and bass are set up to use ROS. SSH in using: + +ssh z<studentid>@[wills|bass].cse.unsw.edu.au Here are current Pioneer pages in the COMP3431 wiki:
removed
diff --git a/pioneer/ssh.mdwn b/pioneer/ssh.mdwn deleted file mode 100644 index 00ae9e8..0000000 --- a/pioneer/ssh.mdwn +++ /dev/null @@ -1 +0,0 @@ -hsdgfjsdgh
diff --git a/Pioneer.mdwn b/Pioneer.mdwn index 142d646..f6f6969 100644 --- a/Pioneer.mdwn +++ b/Pioneer.mdwn @@ -9,5 +9,3 @@ Currently the robots wills and bass are set up to use ROS. Here are current Pioneer pages in the COMP3431 wiki: [[!inline pages="pioneer/*" archive="yes" feeds="no" sort="title"]] - -[[pioneer/ssh]]
diff --git a/pioneer/ssh.mdwn b/pioneer/ssh.mdwn new file mode 100644 index 0000000..00ae9e8 --- /dev/null +++ b/pioneer/ssh.mdwn @@ -0,0 +1 @@ +hsdgfjsdgh
diff --git a/Pioneer.mdwn b/Pioneer.mdwn index f6f6969..142d646 100644 --- a/Pioneer.mdwn +++ b/Pioneer.mdwn @@ -9,3 +9,5 @@ Currently the robots wills and bass are set up to use ROS. Here are current Pioneer pages in the COMP3431 wiki: [[!inline pages="pioneer/*" archive="yes" feeds="no" sort="title"]] + +[[pioneer/ssh]]
Adding side reading about particle filters from UW's lab
diff --git a/notes/BayesianLocalisationII.mdwn b/notes/BayesianLocalisationII.mdwn
index 6189001..fe2fa28 100644
--- a/notes/BayesianLocalisationII.mdwn
+++ b/notes/BayesianLocalisationII.mdwn
@@ -40,3 +40,6 @@ Representations for Probability distributions:
* e.g. P(x, y, theta) split into P(x, y) and P(theta | x, y)
* Much smaller tables, cannot represent correlations
+
+
+<em>Interesting Side Reading:</em> The particle filter example of the robot in the hallway with rooms was done by University of Washington. Here's the page where they have that (and other examples) of work done in their lab with particle filters: <a href="http://www.cs.washington.edu/ai/Mobile_Robotics/mcl/">http://www.cs.washington.edu/ai/Mobile_Robotics/mcl/</a> (lots of links to papers, info, and animations showing particle filters)
fix spacing so that verbatim sections display ok
diff --git a/pioneer/sick.mdwn b/pioneer/sick.mdwn
index 7089127..d70aa9d 100644
--- a/pioneer/sick.mdwn
+++ b/pioneer/sick.mdwn
@@ -7,15 +7,19 @@ First we need to tell ROS how to talk to the laser:
rosparam set sicklms/baud 38400
The robot `wills` has a laser that behaves differently to the other robots. It must be started up 30 seconds before you want to use it. You can start it by executing the command
+
exec 3>/dev/ttyS2
When you run that command some LEDs on `wills`'s laser will turn on. Wait until the green one comes on, then continue. To turn the laser off again, you can either log out of that shell or execute the command
+
exec 3>&-
Once the laser is warmed up, you can start the ROS laser driver with the command:
+
rosrun sicktoolbox_wrapper sicklms
You can view the laser output on your terminal with the command:
+
rosrun rviz rviz -d `rospack find sicktoolbox_wrapper`/sick_test.vcg
Thanks to the [ROS wiki sicktoolbox_wrapper docs](http://www.ros.org/wiki/sicktoolbox_wrapper/Tutorials/UsingTheSicklms).
Add pages on how to drive the robot using ROS and get data from the SickLMS.
diff --git a/Pioneer.mdwn b/Pioneer.mdwn
new file mode 100644
index 0000000..f6f6969
--- /dev/null
+++ b/Pioneer.mdwn
@@ -0,0 +1,11 @@
+This page holds links useful for the COMP3431/9431 use of the Pioneer robots.
+
+ * The [RoboLab Wiki](http://robolab.ai.cse.unsw.edu.au/wiki/) is a useful resource.
+ * We will be using [ROS](http://www.ros.org/), so the [ROS wiki](http://www.ros.org/wiki/) will be useful.
+ * The [COMP4411 wiki](http://cgi.cse.unsw.edu.au/~cs4411/wiki/) has a useful [Pioneer guide](http://cgi.cse.unsw.edu.au/~cs4411/wiki/index.php?title=ActivMedia_Pioneer_Guide).
+
+Currently the robots wills and bass are set up to use ROS.
+
+Here are current Pioneer pages in the COMP3431 wiki:
+
+[[!inline pages="pioneer/*" archive="yes" feeds="no" sort="title"]]
diff --git a/pioneer.mdwn b/pioneer.mdwn
deleted file mode 100644
index 98dd6bd..0000000
--- a/pioneer.mdwn
+++ /dev/null
@@ -1,7 +0,0 @@
-This page holds links useful for the COMP3431/9431 use of the Pioneer robots.
-
- * The [RoboLab Wiki](http://robolab.ai.cse.unsw.edu.au/wiki/) is a useful resource.
- * We will be using [ROS](http://www.ros.org/), so the [ROS wiki](http://www.ros.org/wiki/) will be useful.
- * The [COMP4411 wiki](http://cgi.cse.unsw.edu.au/~cs4411/wiki/) has a useful [Pioneer guide](http://cgi.cse.unsw.edu.au/~cs4411/wiki/index.php?title=ActivMedia_Pioneer_Guide).
-
-Currently the robots wills and bass are set up to use ROS.
diff --git a/pioneer/shell.mdwn b/pioneer/shell.mdwn
new file mode 100644
index 0000000..7d4e2c8
--- /dev/null
+++ b/pioneer/shell.mdwn
@@ -0,0 +1,26 @@
+Using ROS requires various environment variables to be set. The `~/.bashrc` file contains shell commands that will be executed whenever a new shell is started. This can be used to set the appropriate environment variables.
+
+Workstation
+-----------
+
+The following snippet of shellscript will set environment variables to use ROS on an ubuntu system:
+
+ if [ -r /opt/ros/diamondback/setup.bash ] ; then
+ source /opt/ros/diamondback/setup.bash
+ fi
+
+ export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH
+
+This assumes that you are using the standard ROS packages for ubuntu, and that you have all your local ROS development in the `ros_workspace` directory. This code is slightly more complex than some other versions; it will not error if ROS is not installed.
+
+Robot
+-----
+
+Assuming you are running `roscore` on your workstation (which may or may not be a good assumption), you will need to set up environment variables on the robot to tell ROS apps started there where to find the core. The following code sets up those variables automatically so that they point back to the machine you ssh'd in from. This is only correct if a) you used ssh to connect, and b) you connected from the machine running `roscore`.
+
+ source /opt/ros/diamondback/setup.bash
+ export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH
+
+ CLIENT_IP="${SSH_CLIENT%% *}"
+
+ export ROS_MASTER_URI="http://${CLIENT_IP}:11311/"
diff --git a/pioneer/sick.mdwn b/pioneer/sick.mdwn
new file mode 100644
index 0000000..7089127
--- /dev/null
+++ b/pioneer/sick.mdwn
@@ -0,0 +1,21 @@
+Starting the Sick LMS laser
+---------------------------
+
+First we need to tell ROS how to talk to the laser:
+
+ rosparam set sicklms/port /dev/ttyS2
+ rosparam set sicklms/baud 38400
+
+The robot `wills` has a laser that behaves differently to the other robots. It must be started up 30 seconds before you want to use it. You can start it by executing the command
+ exec 3>/dev/ttyS2
+
+When you run that command some LEDs on `wills`'s laser will turn on. Wait until the green one comes on, then continue. To turn the laser off again, you can either log out of that shell or execute the command
+ exec 3>&-
+
+Once the laser is warmed up, you can start the ROS laser driver with the command:
+ rosrun sicktoolbox_wrapper sicklms
+
+You can view the laser output on your terminal with the command:
+ rosrun rviz rviz -d `rospack find sicktoolbox_wrapper`/sick_test.vcg
+
+Thanks to the [ROS wiki sicktoolbox_wrapper docs](http://www.ros.org/wiki/sicktoolbox_wrapper/Tutorials/UsingTheSicklms).
diff --git a/pioneer/teleop.mdwn b/pioneer/teleop.mdwn
new file mode 100644
index 0000000..f29db49
--- /dev/null
+++ b/pioneer/teleop.mdwn
@@ -0,0 +1,54 @@
+Will's Teleop Notes
+-------------------
+
+Set up your [[shell]] variables. Lines beginning with 'D:' are commands for the desktop, lines beginning with 'R:' are commands for the robot.
+
+* D: `roscore`
+* check ROS_MASTER_URI on the robot
+* D: `rxgraph` (note: only updates when you mouse over something on the graph)
+* D: `rosrun p2os_dashboard p2os_dashboard`
+* R: `rosrun p2os_driver p2os`
+* note battery level indicator.
+* note gear is red - robot will not run (this is a good thing)
+* D: `rosrun joy joy_node`
+* D: `rostopic echo /joy`
+* Play with joystick.
+* Note which button is which and which axis is which.
+
+* `rosparam set /run_button 4`
+* `rosparam set /deadman_button 0`
+* `rosparam set /axis_vx 1`
+* `rosparam set /axis_vw 0`
+* `rosparam set /axis_vy 3`
+* `rosparam set /max_vw_run 3`
+
+The following commands are options:
+
+* `rosparam set /max_vx_run 1`
+* `rosparam set /max_vx 0.8`
+* `rosparam set /max_vw 2`
+
+Now start the translator from joystick to robot velocity commands:
+
+* `rosrun p2os_teleop p2os_teleop`
+* `rostopic echo /cmd_vel`
+
+At this stage we're going to start actually moving the robot. *It is important that you don't drag anything behind the robot. Disconnect all cables.*
+
+* Now unplug the robot
+* note the battery level drops in the p2os dashboard - batteries are old.
+* click on gear an enable the robot.
+
+* Now you should be able to drive the robot with the joystick
+
+Now we'll look into those motion commands:
+
+* Kill teleop
+* `rostopic pub -1 /cmd_vel geometry_msgs/Twist -- '[0.3, 0.0, 0.0]' '[0.0, 0.0, 0.5]'`
+
+Now we'll turn the robot back off:
+
+* click on the gear to disable the robot
+* reconnect the power to the robot
+
+Thanks to the [ROS wiki p2os docs](http://www.ros.org/wiki/p2os/Tutorials/Getting%20Started%20with%20p2os).
Useful links for the Pioneers
diff --git a/pioneer.mdwn b/pioneer.mdwn new file mode 100644 index 0000000..98dd6bd --- /dev/null +++ b/pioneer.mdwn @@ -0,0 +1,7 @@ +This page holds links useful for the COMP3431/9431 use of the Pioneer robots. + + * The [RoboLab Wiki](http://robolab.ai.cse.unsw.edu.au/wiki/) is a useful resource. + * We will be using [ROS](http://www.ros.org/), so the [ROS wiki](http://www.ros.org/wiki/) will be useful. + * The [COMP4411 wiki](http://cgi.cse.unsw.edu.au/~cs4411/wiki/) has a useful [Pioneer guide](http://cgi.cse.unsw.edu.au/~cs4411/wiki/index.php?title=ActivMedia_Pioneer_Guide). + +Currently the robots wills and bass are set up to use ROS.
Add a link to the new Pioneer page
diff --git a/sidebar.mdwn b/sidebar.mdwn index c7bc7af..bc6cbdd 100644 --- a/sidebar.mdwn +++ b/sidebar.mdwn @@ -7,3 +7,4 @@ Quick Links - [[Assignments]] - [[Site_Map|Map]] - [[aibo]] + - [[Pioneer]]
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index e9d17da..8f193cb 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -41,6 +41,7 @@
* Definition of a history sequence
* The history sequence is a series of observations (o) and actions (a)
* e.g. o<sub>1</sub>a<sub>1</sub>o<sub>2</sub>a<sub>2</sub>o<sub>3</sub>a<sub>3</sub>
+ * Then you can also include the reward as part of this sequence, either as part of the observation/action or separate (? not sure)
* Many assumptions/constraints to make things tractable
* My approach:
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index 2611722..e9d17da 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -17,7 +17,7 @@
* Representation
* How the world is represented in your agent
* The agent cannot understand anything that is in this representation
- * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
+ * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
* Agents building = system building
* KISS ( Keep It Simple & Stupid)
@@ -33,13 +33,14 @@
* Overview of Agent in world
* Sense/Act cycle (+reward)
- * Consider the agent and world to be 2 separate entities
- * Information passes between these 2 entities (information interface)
- * The agent senses things going on in the world, and then it carries out an action upon the world
- * Observations and actions can also have a quality, called a "reward", associated with them
- * This reward can be for the instantaneous, i.e. for the current observation/action, or accumulated (simplified explanation)
+ * Consider the agent and world to be 2 separate entities
+ * Information passes between these 2 entities (information interface)
+ * The agent senses things going on in the world, and then it carries out an action upon the world
+ * Observations and actions can also have a quality, called a "reward", associated with them
+ * This reward can be for the instantaneous, i.e. for the current observation/action, or accumulated (simplified explanation)
* Definition of a history sequence
- *
+ * The history sequence is a series of observations (o) and actions (a)
+ * e.g. o<sub>1</sub>a<sub>1</sub>o<sub>2</sub>a<sub>2</sub>o<sub>3</sub>a<sub>3</sub>
* Many assumptions/constraints to make things tractable
* My approach:
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index 8dee02e..2611722 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -9,11 +9,11 @@
* Plagiarism policy
* 4 main things we focus on:
* Systems
- * Code reviews
- * Version control
+ * Code reviews
+ * Version control
* Search/Dynamic Programming
* Bayes
- * Subjective probability
+ * Subjective probability
* Representation
* How the world is represented in your agent
* The agent cannot understand anything that is in this representation
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index 3ddc9b4..8dee02e 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -15,9 +15,9 @@
* Bayes
* Subjective probability
* Representation
- * How the world is represented in your agent
- * The agent cannot understand anything that is in this representation
- * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
+ * How the world is represented in your agent
+ * The agent cannot understand anything that is in this representation
+ * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
* Agents building = system building
* KISS ( Keep It Simple & Stupid)
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index b7ca586..3ddc9b4 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -9,15 +9,15 @@
* Plagiarism policy
* 4 main things we focus on:
* Systems
- * Code reviews
- * Version control
+ * Code reviews
+ * Version control
* Search/Dynamic Programming
* Bayes
- * Subjective probability
+ * Subjective probability
* Representation
- * How the world is represented in your agent
- * The agent cannot understand anything that is in this representation
- * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
+ * How the world is represented in your agent
+ * The agent cannot understand anything that is in this representation
+ * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
* Agents building = system building
* KISS ( Keep It Simple & Stupid)
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index 098dc6d..b7ca586 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -7,8 +7,17 @@
* Aiming at top of class
* Discussion in class - need to take own notes - almost problem based learning
* Plagiarism policy
- * Systems, search, Bayes
- * Representation is important
+ * 4 main things we focus on:
+ * Systems
+ * Code reviews
+ * Version control
+ * Search/Dynamic Programming
+ * Bayes
+ * Subjective probability
+ * Representation
+ * How the world is represented in your agent
+ * The agent cannot understand anything that is in this representation
+ * e.g. In Robocup, the field is 2D, so the robots cannot comprehend the ball being in the air
* Agents building = system building
* KISS ( Keep It Simple & Stupid)
@@ -24,7 +33,13 @@
* Overview of Agent in world
* Sense/Act cycle (+reward)
+ * Consider the agent and world to be 2 separate entities
+ * Information passes between these 2 entities (information interface)
+ * The agent senses things going on in the world, and then it carries out an action upon the world
+ * Observations and actions can also have a quality, called a "reward", associated with them
+ * This reward can be for the instantaneous, i.e. for the current observation/action, or accumulated (simplified explanation)
* Definition of a history sequence
+ *
* Many assumptions/constraints to make things tractable
* My approach:
Fix copy/paste character weirdness
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index f12ef17..fc6536f 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -8,9 +8,9 @@ Introduction to Bayesian Statistics
* [[!wikipedia Cox's_theorem]]
* There are other ways of defining probability like objects, but they're either equivalent under a transform, or weird in some way.
* Cox had three desiderata:
- * Divisibility and comparability – The plausibility of a statement is a real number and is dependent on information we have related to the statement.
- * Common sense – Plausibilities should vary sensibly with the assessment of plausibilities in the model.
- * Consistency – If the plausibility of a statement can be derived in many ways, all the results must be equal.
+ * Divisibility and comparability - The plausibility of a statement is a real number and is dependent on information we have related to the statement.
+ * Common sense - Plausibilities should vary sensibly with the assessment of plausibilities in the model.
+ * Consistency - If the plausibility of a statement can be derived in many ways, all the results must be equal.
* Probability theory basics (Another view of this is on p14 of Probabilistic Robotics)
* Divide the possible worlds into sets
* Assign each set of possible worlds a number representing how likely the true world is in that set (could use [[!wikipedia Measure_theory]] here)
Add desiderata for Cox's theorem
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index e3d2e1b..f12ef17 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -7,6 +7,10 @@ Introduction to Bayesian Statistics
* Bayesian Statistics are a way of numerically representing subjective uncertainty
* [[!wikipedia Cox's_theorem]]
* There are other ways of defining probability like objects, but they're either equivalent under a transform, or weird in some way.
+ * Cox had three desiderata:
+ * Divisibility and comparability – The plausibility of a statement is a real number and is dependent on information we have related to the statement.
+ * Common sense – Plausibilities should vary sensibly with the assessment of plausibilities in the model.
+ * Consistency – If the plausibility of a statement can be derived in many ways, all the results must be equal.
* Probability theory basics (Another view of this is on p14 of Probabilistic Robotics)
* Divide the possible worlds into sets
* Assign each set of possible worlds a number representing how likely the true world is in that set (could use [[!wikipedia Measure_theory]] here)
Update notes on assessment breakdown.
diff --git a/index.mdwn b/index.mdwn index f1f7fb1..2f7d8e8 100644 --- a/index.mdwn +++ b/index.mdwn @@ -84,14 +84,15 @@ There is no set text for this course. However, the following books are recommend Assignments ----------- -There are five assignments in this course; three large assignments worth 15% each, and two small assignments worth 5% each. Details of the large assignments are in the [[assignment|assignments]] sheets. There will be two assignments on real robots and one written assignment. The robotics assignments also have a written component. +There are two large assignments worth 15% each, and some small homeworks worth 20% in total. Details of the large assignments are in the [[assignment|assignments]] sheets. The two large assignments utilise real robots and also have a written report component. These numbers are sometimes adjusted during the course in consultation with the students. + Due dates are on the calendar section of the web page. Assessment ---------- - - Assignments: 55% - - Final exam: 45% + - Assignments: 50% + - Final exam: 50% Lectures and Assignments are similar between COMP3431 and COMP9431 students. Units of credit: This is a 6 UOC course
Add Malcolm's planning slides.
diff --git a/news/Links.mdwn b/news/Links.mdwn index 1cf392b..e3a77da 100644 --- a/news/Links.mdwn +++ b/news/Links.mdwn @@ -1,6 +1,7 @@ Hi all, + I've had a few people ask me about links to various things. There are two easy ways to find things in this wiki: the 'RecentChanges' link at the top of each page lists recent changes to the wiki :). The 'Site Map' in the 'Quick Links' box on the right hand side lists every page in the wiki. :) -Having said that, the notes from the overview lecture in the last week of class are [[here|other/syllabus-2010]], the RL notes are [[here|slides/2010/MLSS-RL.pdf]], and the sample exam is [[here|other/s-exam.pdf]]. +Having said that, the notes from the overview lecture in the last week of class are [[here|other/syllabus-2010]], the RL notes are [[here|slides/2010/MLSS-RL.pdf]], and the sample exam is [[here|other/s-exam.pdf]]. Malcolm's planning slides are [[here|slides/2008/malcolmr-planning]]. Will :-}
Pointers to recently added documents
diff --git a/news/Links.mdwn b/news/Links.mdwn new file mode 100644 index 0000000..1cf392b --- /dev/null +++ b/news/Links.mdwn @@ -0,0 +1,6 @@ +Hi all, + I've had a few people ask me about links to various things. There are two easy ways to find things in this wiki: the 'RecentChanges' link at the top of each page lists recent changes to the wiki :). The 'Site Map' in the 'Quick Links' box on the right hand side lists every page in the wiki. :) + +Having said that, the notes from the overview lecture in the last week of class are [[here|other/syllabus-2010]], the RL notes are [[here|slides/2010/MLSS-RL.pdf]], and the sample exam is [[here|other/s-exam.pdf]]. + +Will :-}
Add a new sample exam.
diff --git a/other/s-exam.pdf b/other/s-exam.pdf new file mode 100644 index 0000000..e4531dd Binary files /dev/null and b/other/s-exam.pdf differ
Exam details
diff --git a/news/Exam_2010.mdwn b/news/Exam_2010.mdwn new file mode 100644 index 0000000..5d57c25 --- /dev/null +++ b/news/Exam_2010.mdwn @@ -0,0 +1 @@ +Just so everyone is aware. The exam is scheduled for the evening of Tuesday 2nd November, 17:45 - 21:00 (5:45pm - 9:00pm). It will be held in K17_B02. It will be open book, calculator, notes, laptop, internet. The rule is no communication with another person.
Comments on Assignment 2
diff --git a/news/Assignment_2_notes_2010.mdwn b/news/Assignment_2_notes_2010.mdwn new file mode 100644 index 0000000..4175f06 --- /dev/null +++ b/news/Assignment_2_notes_2010.mdwn @@ -0,0 +1,11 @@ +Hi all, + + I've had some people ask some questions about assignment 2 this year. Here are the answers so that everyone is on the same page: + +* Goals: will they be there or not? I have no strong opinion either way. I'm leaning towards them being there, but if that causes a problem for someone's localisation then I'll reconsider. I would like it consistant - I don't want to be taking them on and off the field for each team's run. +* Beacons: Let's have them in the same positions as assignment 1. You are allowed to use your solution to assignment 1 in assignment 2, so you should have reasonable localisation. +* Usage of functions: In previous years the early assignments already had you implementing ball tracking and grabbing, so I didn't allow use of the built-in code. This year I'm happy for you to re-use the grab. I'd prefer if you implemented your own ball tracking (but look at the code that is there). I'm happy to talk about this in the review lecture tomorrow. +* Start location: I'll start you pointing across the centre-line. It will not be to far from the centre line. I don't start timing until you cross the centre line (unless your robot seems to be completely confused, in which case I'll ask you to re-start it). +* Stopping criterion: I'll stop timing when the ball crosses the centre-line even it if then proceeds to go out. I've had close calls before - It matters if the ball goes out just before or just after it crosses the centre line. + +Will
Re-add slides.
diff --git a/slides/2010/MLSS-RL.pdf b/slides/2010/MLSS-RL.pdf new file mode 100644 index 0000000..0f48dac Binary files /dev/null and b/slides/2010/MLSS-RL.pdf differ
Slides too big for the quota limits on the class account - moving elsewhere
diff --git a/slides/2010/MLSS-RL.pdf b/slides/2010/MLSS-RL.pdf deleted file mode 100644 index 0f48dac..0000000 Binary files a/slides/2010/MLSS-RL.pdf and /dev/null differ
Add RL slides and overview notes from today's lecture.
diff --git a/other/syllabus-2010.mdwn b/other/syllabus-2010.mdwn
new file mode 100644
index 0000000..5f15242
--- /dev/null
+++ b/other/syllabus-2010.mdwn
@@ -0,0 +1,179 @@
+Course Syllabus COMP3431 - 2010
+===============================
+
+Introduction
+
+ Definition of a sense/act agent (reward?)
+ Concept of an agent making decisions based on its history
+ Limitations on Worlds (Markov, Deterministic, Partially Observable, Continuous, ...)
+
+ Introduction to probabilities
+ - sets of possible outcomes, each associated with a number
+ - numbers must be consistent with set operations (Venn Diagram)
+ - For discrete sets, can associate numbers with each element
+ - For continuous sets, associate 'densities' with each element (derivative of a probability)
+ - Probabilities > 0
+ - Probabilities sum to 1
+
+ Conditioning
+ P(x|y) = P(x&y)/P(y)
+
+ Bayes Rule
+ - Applies to individual probabilities
+ - Know how to derive
+
+ Probability functions
+ - If you do the same thing pairwise to all elements of a set, you can think of it as applying to the functions. e.g.
+ forall x, f(x) * g(y) = (f*g)(x)
+ x * x^2 = x^3
+
+Bayes Rule applied to tracking
+ - Motion model P(s'|s,a)
+ - Observation model P(o|s)
+ - tables
+
+Representations of probability distributions
+ - Closed form formulae (e.g. normal/gaussian, uniform, poisson, exponential)
+ - Samples from distribution
+ - Tabular
+
+Combining distributions
+ - Independent distributions (factored representations)
+ - Multi-dimensional distributions: f(x,y) = g(x)*h(y)
+ - Conditionally independent distributions
+ - P(x,y|q) = P(x|q).P(y|q)
+
+ - Covariance matrix if normal distribution independent dimensions
+
+Kalman filters
+ - Use a Normal distribution for Bayesian tracking
+ - Didn't derive the math.
+ - Only works with linear motion and observation models
+ - Extended Kalman Filters (EKF)
+ - Use the tangent approximation (taylor epxansion)
+ - requires matrices of derivatives (to get multi-dim slope)
+
+Particle Filters
+ - Motion update
+ - Sample from the motion model
+ - Observation update
+ - Weight the particles by the P(o|s) (s == particle)
+ - Resample with replacement (use cumulative distribution)
+
+Unscented Kalman filters mentioned (UKF)
+ - Would use these instead of EKF - but I didn't really describe in detail
+ - Use particles instead of deriviaitves to handle non-linear models.
+
+Simultaneous Localisation and Mapping (SLAM)
+ - e.g. localise robots on robocup field, but someone has moved the beacons
+ - Move the unknowns into the state space
+ - e.g. state space was x,y,theta -> x,y,theta, x_b, y_b
+ - We end up with locations correllated
+ - arbitrarily assign location 0,0 to the start location
+
+Other tricks with tracking
+ - Correlation allows finding ball speed from two separate observations
+ - Briefly talked about Distributed kalman filters
+ - Replicate the filter across the robots
+ - Each sends its observations and actions to the others
+ - Observations can be bunched up (do gaussian multiplication locally (Kalman filter) and just send result)
+ - Must reset Kalman filter on send so that no information is sent twice
+
+
+Action/Planning
+
+Introduce the POMDP definition
+
+ - Cut back to MDP (assume fully obs)
+ - Assume known models
+ - Defined optimality criteria
+ - Discounted Reward (most common)
+ - Undiscounted Reward
+ - Fixed Finite horizon
+ - Receding horizon
+ - Average Reward
+ - Bellman Equation (dynamic programming)
+ Q(s,a) = r(s,a) + \gamma \sum_{s' \in S} P(s'|s,a)V(s')
+ V(s) = Q(s, \pi(s))
+ \pi(s) = argmax_a Q(s,a)
+
+ - Updates can happen in any order as long as you do each one often enough
+
+ - Policy iteration as a solution method
+ - Prioritized Sweeping
+ - use a priority Queue to choose update order
+ - Increase priority of children by |Delta V|
+
+ - How to build a model (fully observable)
+ - Given a history s1, a1, r=6, s4, a3, r=-3, s1, a2, r=10, ....
+ - break this up into <s, a, r, s'> tuples
+ - Keep counts (and sum of reward for each s,a) - use ratios of counts as probabilities
+
+Exploration/Exploitation tradeoff
+ - n-armed bandits example
+ - have to keep exploring
+ - e-greedy (choose a random action e% of the time)
+ - Boltzman exploration p(a) = e^{Q(s,a)/t} / (Sum_{a'} Q(s,a')/t)
+ - give each action a weight of e^{Q(s,a)/t} and normalise to get P
+
+Model Free learning
+ - Q(s,a) = (1-\alpha)Q(s,a) + \alpha[r + \gamma V(s')]
+
+Stochastic forward search
+ - Expectimax (like a minimax search, but with expectation for 'opponent')
+
+Policy Gradient
+ - Sample 100 trajectories into the future
+ - Find expected reward
+ - Choose policy that maximises expected reward
+ - Use optimisation techniques to optimise policy
+
+ - Discrete policy and make it differentiable by...
+ - turn it into a stochastic policy (for each state keep P of each action)
+
+Discreization techniques for continuous problems
+
+RRTs
+
+Plan space vs state space search
+
+Planning
+ - State space planning
+ - Plan space planning
+ - partial order (least-commitment) planning
+ - Understand Precond/Adds/deletes (STRIPS representation)
+ - Understand total order plan
+ - Understand partial order plan
+ - What is a threat?
+ - A link and a plan step.
+ - The plan step COULD be ordered after the start and before the end of the link
+ - The plan step has a post-condition (Add || delete) that COULD contradict the link predicate
+ - How do I resolve them?
+ - resolutions mean making the 'COULD's not match
+ - bind variable to stop potential match
+ - add a temporal constraint so that the step appears before or after the link
+
+POMDPs (re-introduced Partial Observability)
+ - Assume we know model (learning model in POMDPs is current research)
+ - Belief state (= probability distribution over state space)
+
+Optimistion
+ - Simulated Annealing (move using Boltzmann exploration)
+ - Simplex method (There are two algoirthms with this name - we covered the one NOT used for linear programming.)
+ - Golden section search for 1D optimisation
+ - Brent's method for 1D optimsiation (magic mixture of Golden section search and parabolic interpolation)
+ - Conjugate gradients
+ - Gradient methods (gradient does NOT point at minimum)
+ - Powell's method for using 1D search
+ - Note: ways to you can get zig-zag
+ - cycle through basis function
+ - at minima in one dimension, gradient is perpendicular to that direction
+ - In steep valley simple gradient methods and just oscillate across the valley
+ - If certain conditions apply
+ - Convex
+ - Not too flat
+ - gradient doesn't change too quickly
+ - Then, simple downhill with step proportional to gradient can work optimally
+
+
+
diff --git a/slides/2010/MLSS-RL.pdf b/slides/2010/MLSS-RL.pdf
new file mode 100644
index 0000000..0f48dac
Binary files /dev/null and b/slides/2010/MLSS-RL.pdf differ
Add assignment 2
diff --git a/assignments/2010/assign2.pdf b/assignments/2010/assign2.pdf new file mode 100644 index 0000000..54c1915 Binary files /dev/null and b/assignments/2010/assign2.pdf differ
Jayen made me do this change!
diff --git a/aibo/comp3431/GettingStarted.mdwn b/aibo/comp3431/GettingStarted.mdwn index 91c22f6..7d9a6c3 100644 --- a/aibo/comp3431/GettingStarted.mdwn +++ b/aibo/comp3431/GettingStarted.mdwn @@ -50,7 +50,7 @@ If you are the person hosting the central storage for your team, you do not need ### Building the robot binaries -Change into the trunk/robot directory and type 'make'. +Change into the trunk/robot directory and type 'make', and then into the trunk/bin directory and do the same. If you get a lot of `distcc` errors, then either configure distcc, or stop the system from using it. To turn off distcc, edit `robot/Makefile.config`. Comment out the `distcc` line to turn this:
Add a pointer to homework 2 solution
diff --git a/news/Will__39__s_Solution_to_Homework_2.mdwn b/news/Will__39__s_Solution_to_Homework_2.mdwn new file mode 100644 index 0000000..dde230a --- /dev/null +++ b/news/Will__39__s_Solution_to_Homework_2.mdwn @@ -0,0 +1,3 @@ +... is at <http://www.cse.unsw.edu.au/~cs3431/robotModel.py> or `~cs3431/public_html/robotModel.py`. + +it will be there until assignment 1 is due.
Interesting Talk announcement
diff --git a/news/Robots_in_War_talk_2010.mdwn b/news/Robots_in_War_talk_2010.mdwn new file mode 100644 index 0000000..ac1c20a --- /dev/null +++ b/news/Robots_in_War_talk_2010.mdwn @@ -0,0 +1,9 @@ +Sydney Opera House & St James Ethics Centre is presenting The Festival of Dangerous Ideas on October 2-3 2010 which will feature key local and international thought leaders (Geoffrey Robertson QC, Famed American criminal lawyer, Alan Dershowitz, SMH Foreign Correspondent Paul McGeough, BBC Broadcaster Tariq Ali, and many more) who will present their dangerous ideas on art, climate change, economics, justice and more big issues along with things that matter in everyday life, with an edge. + +As part of the Festival of Dangerous Ideas, Peter W. Singer in "Wired for War: How Human Soldiers are Being Replaced by Machines" explores the increasing use of autonomous robotics in warfare and the ethical, political and legal implications of this revolution. For more information, visit <http://www.sydneyoperahouse.com/whatson/pw_singer.aspx>. + +Singer is Director of the 21st Century Defense Initiative at Washingtons Brookings Institution and served as coordinator of the Obama-2008 campaigns defense policy task force. To watch Singer on The Daily Show, please visit - <http://www.thedailyshow.com/watch/thu-january-29-2009/p-w--singer> + + Would you be able to include some information on the event in an email/newsletter to your fellow staff or students? I can organise an e-card to be sent out to you that can be forwarded if this makes things easier. We also have programs on the Festival that I can send out to you (boxes of 100 or so). + +To find out more on the Festival, please visit <http://www.sydneyoperahouse.com/ideas>
note that angles are not measured in centimetres.
diff --git a/news/Assignment_1_2010_Notes.mdwn b/news/Assignment_1_2010_Notes.mdwn index a73ada6..745494e 100644 --- a/news/Assignment_1_2010_Notes.mdwn +++ b/news/Assignment_1_2010_Notes.mdwn @@ -3,7 +3,7 @@ Hi all, I've also updated the base robot code you are allowed to use. It no longer crashes when the matrix library is used (I've added a cut-down matrix library to the default python code). I've also added a function to the robots, VisionLink.getMotionDelta(). To get these changes you will need to `git pull` to update your code (or git clone an entirely new trunk). I've only updated the main branch - if you're using one of the other git branches then you'll want to merge in my changes. - The getMotionDelta() function returns a tuple (fwd,left,turn,count), where fwd,left and turn would be measured in centimetres if the robot was correctly calibrated (which may or may not be the case), and count is a count :). These numbers represent what the walking module thinks it has done since the last vision frame (i.e. the last time the python behaviours were called). The count may not be useful, but I put it in for completeness - it represents the number of updates that the motion module has done since behaviours were last called, all those updates are added to give the other three numbers. + The getMotionDelta() function returns a tuple (fwd,left,turn,count), where fwd,left and turn would be measured in centimetres (for distances, not sure of the angular units) if the robot was correctly calibrated (which may or may not be the case), and count is a count :). These numbers represent what the walking module thinks it has done since the last vision frame (i.e. the last time the python behaviours were called). The count may not be useful, but I put it in for completeness - it represents the number of updates that the motion module has done since behaviours were last called, all those updates are added to give the other three numbers. Cheers,
Announce updated support code for the first assignment.
diff --git a/news/Assignment_1_2010_Notes.mdwn b/news/Assignment_1_2010_Notes.mdwn new file mode 100644 index 0000000..a73ada6 --- /dev/null +++ b/news/Assignment_1_2010_Notes.mdwn @@ -0,0 +1,10 @@ +Hi all, + I've just updated the assignment 1 sheet with the due date we agreed in class just before the break: The lab of week 9. + + I've also updated the base robot code you are allowed to use. It no longer crashes when the matrix library is used (I've added a cut-down matrix library to the default python code). I've also added a function to the robots, VisionLink.getMotionDelta(). To get these changes you will need to `git pull` to update your code (or git clone an entirely new trunk). I've only updated the main branch - if you're using one of the other git branches then you'll want to merge in my changes. + + The getMotionDelta() function returns a tuple (fwd,left,turn,count), where fwd,left and turn would be measured in centimetres if the robot was correctly calibrated (which may or may not be the case), and count is a count :). These numbers represent what the walking module thinks it has done since the last vision frame (i.e. the last time the python behaviours were called). The count may not be useful, but I put it in for completeness - it represents the number of updates that the motion module has done since behaviours were last called, all those updates are added to give the other three numbers. + +Cheers, + +Will :-}
Add assignment due date announced in lectures to the assignment sheet.
diff --git a/assignments/2010/assign1.pdf b/assignments/2010/assign1.pdf index 6e62a19..215cd99 100644 Binary files a/assignments/2010/assign1.pdf and b/assignments/2010/assign1.pdf differ
Add license and pointer to original source.
diff --git a/assignments/2010/Homework2src/matrices.py b/assignments/2010/Homework2src/matrices.py index 4d4b799..720af79 100644 --- a/assignments/2010/Homework2src/matrices.py +++ b/assignments/2010/Homework2src/matrices.py @@ -1,4 +1,35 @@ -# TODO: interpret list as vectors (for multiplication) +# This is a cut-down and hacked version of the mpmath matrix and linear algebra code +# See http://code.google.com/p/mpmath for the full source +# The license is as follows: + +# Copyright (c) 2005-2010 Fredrik Johansson and mpmath contributors +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# a. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# b. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# c. Neither the name of mpmath nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. import math from copy import copy
Add a cut down version of mpmath, matrices.py, that is an attempt to get something that will work on the AIBOs.
diff --git a/assignments/2010/Homework2src/matrices.py b/assignments/2010/Homework2src/matrices.py
new file mode 100644
index 0000000..4d4b799
--- /dev/null
+++ b/assignments/2010/Homework2src/matrices.py
@@ -0,0 +1,1275 @@
+# TODO: interpret list as vectors (for multiplication)
+
+import math
+from copy import copy
+
+rowsep = '\n'
+colsep = ' '
+
+zero = 0.0
+one = 1.0
+eps = 2.2204460492503131e-16
+inf = 1e300*1e300
+ninf = -inf
+nan = inf-inf
+absmin = absmax = abs
+
+class matrix(object):
+ """
+ Numerical matrix.
+
+ Specify the dimensions or the data as a nested list.
+ Elements default to zero.
+ Use a flat list to create a column vector easily.
+
+ By default, only mpf is used to store the data. You can specify another type
+ using force_type=type. It's possible to specify None.
+ Make sure force_type(force_type()) is fast.
+
+ Creating matrices
+ -----------------
+
+ Matrices in mpmath are implemented using dictionaries. Only non-zero values
+ are stored, so it is cheap to represent sparse matrices.
+
+ The most basic way to create one is to use the ``matrix`` class directly.
+ You can create an empty matrix specifying the dimensions:
+
+ >>> from mpmath import *
+ >>> mp.dps = 15
+ >>> matrix(2)
+ matrix(
+ [['0.0', '0.0'],
+ ['0.0', '0.0']])
+ >>> matrix(2, 3)
+ matrix(
+ [['0.0', '0.0', '0.0'],
+ ['0.0', '0.0', '0.0']])
+
+ Calling ``matrix`` with one dimension will create a square matrix.
+
+ To access the dimensions of a matrix, use the ``rows`` or ``cols`` keyword:
+
+ >>> A = matrix(3, 2)
+ >>> A
+ matrix(
+ [['0.0', '0.0'],
+ ['0.0', '0.0'],
+ ['0.0', '0.0']])
+ >>> A.rows
+ 3
+ >>> A.cols
+ 2
+
+ You can also change the dimension of an existing matrix. This will set the
+ new elements to 0. If the new dimension is smaller than before, the
+ concerning elements are discarded:
+
+ >>> A.rows = 2
+ >>> A
+ matrix(
+ [['0.0', '0.0'],
+ ['0.0', '0.0']])
+
+ Internally ``mpmathify`` is used every time an element is set. This
+ is done using the syntax A[row,column], counting from 0:
+
+ >>> A = matrix(2)
+ >>> A[1,1] = 1 + 1j
+ >>> A
+ matrix(
+ [['0.0', '0.0'],
+ ['0.0', '(1.0 + 1.0j)']])
+
+ You can use the keyword ``force_type`` to change the function which is
+ called on every new element:
+
+ >>> matrix(2, 5, force_type=int)
+ matrix(
+ [[0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0]])
+
+ A more comfortable way to create a matrix lets you use nested lists:
+
+ >>> matrix([[1, 2], [3, 4]])
+ matrix(
+ [['1.0', '2.0'],
+ ['3.0', '4.0']])
+
+ If you want to preserve the type of the elements you can use
+ ``force_type=None``:
+
+ >>> matrix([[1, 2.5], [1j, mpf(2)]], force_type=None)
+ matrix(
+ [[1, 2.5],
+ [1j, '2.0']])
+
+ Convenient advanced functions are available for creating various standard
+ matrices, see ``zeros``, ``ones``, ``diag``, ``eye``, ``randmatrix`` and
+ ``hilbert``.
+
+ Vectors
+ .......
+
+ Vectors may also be represented by the ``matrix`` class (with rows = 1 or cols = 1).
+ For vectors there are some things which make life easier. A column vector can
+ be created using a flat list, a row vectors using an almost flat nested list::
+
+ >>> matrix([1, 2, 3])
+ matrix(
+ [['1.0'],
+ ['2.0'],
+ ['3.0']])
+ >>> matrix([[1, 2, 3]])
+ matrix(
+ [['1.0', '2.0', '3.0']])
+
+ Optionally vectors can be accessed like lists, using only a single index::
+
+ >>> x = matrix([1, 2, 3])
+ >>> x[1]
+ mpf('2.0')
+ >>> x[1,0]
+ mpf('2.0')
+
+ Other
+ .....
+
+ Like you probably expected, matrices can be printed::
+
+ >>> print randmatrix(3) # doctest:+SKIP
+ [ 0.782963853573023 0.802057689719883 0.427895717335467]
+ [0.0541876859348597 0.708243266653103 0.615134039977379]
+ [ 0.856151514955773 0.544759264818486 0.686210904770947]
+
+ Use ``nstr`` or ``nprint`` to specify the number of digits to print::
+
+ >>> nprint(randmatrix(5), 3) # doctest:+SKIP
+ [2.07e-1 1.66e-1 5.06e-1 1.89e-1 8.29e-1]
+ [6.62e-1 6.55e-1 4.47e-1 4.82e-1 2.06e-2]
+ [4.33e-1 7.75e-1 6.93e-2 2.86e-1 5.71e-1]
+ [1.01e-1 2.53e-1 6.13e-1 3.32e-1 2.59e-1]
+ [1.56e-1 7.27e-2 6.05e-1 6.67e-2 2.79e-1]
+
+ As matrices are mutable, you will need to copy them sometimes::
+
+ >>> A = matrix(2)
+ >>> A
+ matrix(
+ [['0.0', '0.0'],
+ ['0.0', '0.0']])
+ >>> B = A.copy()
+ >>> B[0,0] = 1
+ >>> B
+ matrix(
+ [['1.0', '0.0'],
+ ['0.0', '0.0']])
+ >>> A
+ matrix(
+ [['0.0', '0.0'],
+ ['0.0', '0.0']])
+
+ Finally, it is possible to convert a matrix to a nested list. This is very useful,
+ as most Python libraries involving matrices or arrays (namely NumPy or SymPy)
+ support this format::
+
+ >>> B.tolist()
+ [[mpf('1.0'), mpf('0.0')], [mpf('0.0'), mpf('0.0')]]
+
+
+ Matrix operations
+ -----------------
+
+ You can add and subtract matrices of compatible dimensions::
+
+ >>> A = matrix([[1, 2], [3, 4]])
+ >>> B = matrix([[-2, 4], [5, 9]])
+ >>> A + B
+ matrix(
+ [['-1.0', '6.0'],
+ ['8.0', '13.0']])
+ >>> A - B
+ matrix(
+ [['3.0', '-2.0'],
+ ['-2.0', '-5.0']])
(Diff truncated)
Show the actions from test1.out imported into main.py (as main1.py). Show the output of this program using Will's model.
Also changed some of main1.py to transpose some matrices when printing.
Note: main1.out was generated on wagner.cse.unsw.edu.au, whereas test?.out were generated on Will's Mac. There are slight differences in the low order digits, but only in the low order digits.
Also changed some of main1.py to transpose some matrices when printing.
Note: main1.out was generated on wagner.cse.unsw.edu.au, whereas test?.out were generated on Will's Mac. There are slight differences in the low order digits, but only in the low order digits.
diff --git a/assignments/2010/Homework2src/main1.out b/assignments/2010/Homework2src/main1.out new file mode 100644 index 0000000..680db07 --- /dev/null +++ b/assignments/2010/Homework2src/main1.out @@ -0,0 +1,347 @@ +[0.0] +[0.0] +[0.0] +[1000000.0 0.0 0.0] +[ 0.0 1000000.0 0.0] +[ 0.0 0.0 1000000.0] +step: 0 +A: [1.0 0.0 0.0] +mu: [1.0 0.0 0.0] +Sig: [1000000.0121 0.0 0.0] +[ 0.0 2000000.0001 1000000.0] +[ 0.0 1000000.0 1000000.00761544] +O: [2.0 2.20548920717302 1.02685549688771] +mu: [0.966224314925604 0.0510759471469014 0.0565677550147176] +Sig: [ 444444.468595655 -222222.232677859 222222.207842762] +[-222222.232677859 111111.118332737 -111111.103672155] +[ 222222.207842762 -111111.103672155 111111.130002608] +step: 1 +A: [0.0 0.0 1.5707963267949] +mu: [0.966224314925604 0.0510759471469014 1.62736408180962] +Sig: [ 444444.468695655 -222222.232677859 222222.207842762] +[-222222.232677859 111111.118432737 -111111.103672155] +[ 222222.207842762 -111111.103672155 111111.189707622] +O: [2.0 2.08776684562391 0.0367503387694498] +mu: [5.56521212785308 -2.25154045794208 -2.81327741071494] +Sig: [6.21073147670814 -3.20135767205136 3.15983176528783] +[ -3.201357671846 1.65159975141438 -1.62905679255442] +[ 3.159831766459 -1.62905679327709 1.62437991124174] +step: 2 +A: [1.0 0.0 0.0] +mu: [4.6186251934081 -2.57398917562917 -2.81327741071494] +Sig: [ 8.42824313827935 -7.20984026686392 3.68361098470441] +[-7.20984026753415 6.19252315439635 -3.16667359311075] +[ 3.68361098587557 -3.16667359383341 1.6319953467364] +O: [2.0 1.30546553784744 0.0354396553196523] +mu: [1.30867538928726 0.0639561047957282 2.35427143166093] +Sig: [ 0.0160052042531767 0.0035207323802643 -0.00350794089473753] +[ 0.00352073237992271 0.00678763377155474 -0.00437060946642285] +[-0.00350794090229325 -0.00437060947135229 0.0148167444429691] +step: 3 +A: [0.0 1.0 0.0] +mu: [0.600210108705179 -0.641789562006241 2.35427143166093] +Sig: [ 0.0313326927727031 0.00826303628506798 0.00694891229200009] +[ 0.0082630362935583 0.0332183116453285 -0.0148677584755239] +[0.00694891228444437 -0.0148677584804534 0.0224321799376368] +O: [2.0 1.82405607288538 -0.76987498391962] +mu: [1.18505568314295 0.277249767436519 2.03335015794979] +Sig: [ 0.0196379489758271 -0.00857747858271706 0.0108080739257064] +[-0.0085774785821743 0.00715002096900016 -0.00628480736255088] +[ 0.0108080739243408 -0.00628480736234491 0.0161224369528934] +step: 4 +A: [0.0 0.0 3.14159265358979] +mu: [1.18505568314295 0.277249767436519 -1.10824249564001] +Sig: [ 0.0197379489758271 -0.00857747858271706 0.0108080739257064] +[-0.0085774785821743 0.00725002096900016 -0.00628480736255088] +[ 0.0108080739243408 -0.00628480736234491 0.177265052020062] +O: [4.0 3.71918454905722 0.35916207728466] +mu: [0.0427794184200498 1.04029623621889 -1.28095087506445] +Sig: [ 0.00648856141219543 9.0082939958871e-5 -0.0022779741897681] +[ 9.00829400344796e-5 0.00153773561003328 -0.000271743792200168] +[-0.00227797418980405 -0.000271743792176269 0.0101334419353158] +step: 5 +A: [1.0 0.0 0.0] +mu: [0.328583545177695 0.0820081787287139 -1.28095087506445] +Sig: [ 0.0125085603516752 -0.00133259824270777 0.00743278219811524] +[-0.00133259824266534 0.0133299366887273 0.00262443573117208] +[ 0.00743278219807929 0.00262443573119598 0.0177488774299836] +O: [4.0 2.83717093252977 0.509587721653303] +mu: [0.218400304314012 0.175543284932885 -1.35534013918806] +Sig: [0.00567311757450888 0.00288494415088853 0.00136885801824754] +[ 0.0028849441508963 0.00467276282262506 0.000830792807315782] +[0.00136885801824265 0.000830792807317589 0.00730937894113886] +step: 6 +A: [0.0 0.0 1.5707963267949] +mu: [0.218400304314012 0.175543284932885 0.215456187606841] +Sig: [0.00577311757450888 0.00288494415088853 0.00136885801824754] +[ 0.0028849441508963 0.00477276282262506 0.000830792807315782] +[0.00136885801824265 0.000830792807317589 0.0670143932193339] +O: [2.0 2.41183680434247 0.53917963642527] +mu: [0.297130736126005 0.245904772465879 0.254791232482482] +Sig: [ 0.0022964238220168 -0.000209240963610941 0.000649390150931913] +[-0.000209240963609069 0.00201082785990495 -0.00045230619856063] +[ 0.000649390150930445 -0.000452306198560148 0.016321512105382] +step: 7 +A: [1.0 0.0 0.0] +mu: [1.26484667137471 0.497948158940774 0.254791232482482] +Sig: [ 0.0143436026468924 -0.000520859446866513 -0.00346433903249956] +[-0.00052085944686594 0.0172824043229258 0.0153422811531721] +[-0.00346433903250103 0.0153422811531726 0.0239369476000497] +O: [2.0 1.66711158360596 0.730797774257105] +mu: [1.23468161671867 0.520827696255568 0.301109712311073] +Sig: [ 0.00853126386314703 -0.00319240981949692 -0.00215786764271661] +[-0.00319240981949683 0.00299865546791587 0.00189433289202438] +[-0.00215786764271748 0.00189433289202475 0.00852673264313714] +step: 8 +A: [0.0 0.0 1.5707963267949] +mu: [1.23468161671867 0.520827696255568 1.87190603910597] +Sig: [ 0.00863126386314703 -0.00319240981949692 -0.00215786764271661] +[-0.00319240981949683 0.00309865546791587 0.00189433289202438] +[-0.00215786764271748 0.00189433289202475 0.0682317469213322] +O: [1.0 3.65944512645249 0.552953138159899] +mu: [1.30148058146752 0.491595818035254 2.06646481780849] +Sig: [ 0.0025069005587943 -0.000392804777211198 3.61844681477456e-5] +[-0.000392804777211172 0.00181721709341861 0.000612087398416846] +[ 3.6184468147675e-5 0.000612087398416864 0.0206379230591015] +step: 9 +A: [1.0 0.0 0.0] +mu: [0.825860785206729 1.37124677688476 2.06646481780849] +Sig: [ 0.0212271434404548 0.00266549105811527 -0.0181179843394531] +[0.00266549105811534 0.0152889960991988 -0.00920371736219881] +[-0.0181179843394532 -0.00920371736219879 0.0282533585537692] +O: [1.0 3.00581078503927 0.995072035841047] +mu: [0.92965565553422 1.38277532799598 1.96902999499167] +Sig: [ 0.00282471004179055 0.00180847169191755 -0.00213649802818296] +[ 0.00180847169191756 0.0112270074778272 -0.00407686826539698] +[-0.00213649802818297 -0.004076868265397 0.00959894324528406] +step: 10 +A: [0.0 0.0 1.5707963267949] +mu: [0.92965565553422 1.38277532799598 -2.74335898539301] +Sig: [ 0.00292471004179055 0.00180847169191755 -0.00213649802818296] +[ 0.00180847169191756 0.0113270074778272 -0.00407686826539698] +[-0.00213649802818297 -0.004076868265397 0.0693039575234791] +O: [3.0 4.50728688290551 0.261805025687585] +mu: [0.935341270384988 1.4002336165967 -2.58796122758266] +Sig: [ 0.00217032189117729 -0.000430045693959754 -0.000571291186749187] +[-0.000430045693959751 0.00468395144122861 0.000385438883396026] +[-0.000571291186749187 0.000385438883396025 0.01418554530438] +step: 11 +A: [1.0 0.0 0.0] +mu: [0.0847204653733211 0.874453961150326 -2.58796122758266] +Sig: [ 0.0142737567484661 -0.000718898946528527 0.0068871799357066] +[-0.000718898946528524 0.0177095906551085 -0.0116810810829452] +[ 0.0068871799357066 -0.0116810810829452 0.0218009807990477] +O: [3.0 3.60140886761014 0.327424469090921] +mu: [0.127122577936236 0.8920142859466 -2.56044744851921] +Sig: [ 0.00754591474216475 -0.00327103045372133 0.0022921549167216] +[-0.00327103045372133 0.00527094891089965 -0.00218115705145578] +[ 0.0022921549167216 -0.00218115705145578 0.00764265648654105] +step: 12 +A: [0.0 0.0 1.5707963267949] +mu: [0.127122577936236 0.8920142859466 -0.989651121724306] +Sig: [ 0.00764591474216475 -0.00327103045372133 0.0022921549167216] +[-0.00327103045372133 0.00537094891089965 -0.00218115705145578] +[ 0.0022921549167216 -0.00218115705145578 0.0673476707647361] +O: [4.0 3.45773283042284 -0.3466393945184] +mu: [0.127621923681754 0.897006703153196 -0.685947605554977] +Sig: [ 0.00382134001066318 0.000187610878859931 -0.000798151354694874] +[ 0.000187610878859932 0.0022246405310769 -0.000422127213471347] +[-0.000798151354694874 -0.000422127213471346 0.0071545621961312] +step: 13 +A: [1.0 0.0 0.0] +mu: [0.90144109870602 0.263600132012065 -0.685947605554977] +Sig: [ 0.0129662229166453 -0.00307234539934939 0.00373359535397254] +[-0.00307234539934939 0.0107699109314008 0.0051142102027987] +[ 0.00373359535397254 0.0051142102027987 0.0147699976907989] +O: [4.0 2.32291804386225 -0.273044948290182] +mu: [0.970210202273367 0.11458538452172 -0.782369886965885] +Sig: [0.00649798531396565 0.00161557971088686 0.00138829324791036] +[0.00161557971088686 0.00265830892784731 0.00104557637938538] +[0.00138829324791036 0.00104557637938539 0.00686090361123846] +step: 14 +A: [0.0 0.0 1.5707963267949] +mu: [0.970210202273367 0.11458538452172 0.788426439829015] +Sig: [0.00659798531396565 0.00161557971088686 0.00138829324791036] +[0.00161557971088686 0.00275830892784731 0.00104557637938538] +[0.00138829324791036 0.00104557637938539 0.0665659178894335] +O: [2.0 2.31262603676486 0.50151016284571] +mu: [0.868281501628455 0.0391474063317963 0.579407264119163] +Sig: [ 0.00364926053417053 -0.000416043453064886 0.00138081786128267] +[-0.000416043453064886 0.0013243378193574 -0.000330379361760887] +[ 0.00138081786128267 -0.000330379361760887 0.0116468783121624] +step: 15 +A: [1.0 0.0 0.0] +mu: [1.70506883803587 0.586675445456899 0.579407264119163] +Sig: [ 0.0141313262671596 0.00108208724320698 -0.0049961745829043] +[0.00108208724320698 0.0126241628743129 0.0094155809185348] +[-0.0049961745829043 0.0094155809185348 0.0192623138068301] +O: [2.0 1.69775480024422 1.12880497304794] +mu: [1.69687494244945 0.353528329358028 0.364552724074575] +Sig: [ 0.00852716565909757 -0.00113308861874784 -0.0016820022901842] +[-0.00113308861874784 0.00154204557262375 0.000972243523184495] +[ -0.0016820022901842 0.000972243523184494 0.00798210065376863] +step: 16 +A: [0.0 0.0 1.5707963267949] +mu: [1.69687494244945 0.353528329358028 1.93534905086948] +Sig: [ 0.00862716565909757 -0.00113308861874784 -0.0016820022901842] +[-0.00113308861874784 0.00164204557262375 0.000972243523184495] +[ -0.0016820022901842 0.000972243523184494 0.0676871149319637] +O: [1.0 3.9788483645699 0.51451826623176] +mu: [1.6498342953937 0.363810029375045 2.13015703463001] +Sig: [ 0.00309876817347135 -2.51712861781355e-6 0.000103551969450242] +[-2.51712861781358e-6 0.00141019665877774 0.000432262644942406] +[0.000103551969450242 0.000432262644942406 0.019658440014951] +step: 17 (Diff truncated)
Further clarification.
diff --git a/news/Homework_2_2010_notes.mdwn b/news/Homework_2_2010_notes.mdwn index 7e0c117..5fce7bb 100644 --- a/news/Homework_2_2010_notes.mdwn +++ b/news/Homework_2_2010_notes.mdwn @@ -1,5 +1,5 @@ Hi all, - People seem to be getting worried by `observationSample()`. You shouldn't worry too much about this function as it is only used by the test harness to generate observations, and not by any of the filters. It needs to pick a beacon to return the observation to - I chose the beacon with least angle relative to the robot in my implementation. + People seem to be getting worried by `observationSample()`. You shouldn't worry too much about this function as it is only used by the test harness to generate observations, and not by any of the filters. It needs to pick a beacon to return the observation to - I chose the beacon with least angle relative to the robot in my implementation. You could pick randomly if you like. `expectedObservation()` has also generated some questions. Unlike `observationSample()`, `expectedObservation()` is passed an observation. From this you can get the beacon ID. You can then generate the expected observation for that particular beacon.
Comments on homework 2
diff --git a/news/Homework_2_2010_notes.mdwn b/news/Homework_2_2010_notes.mdwn new file mode 100644 index 0000000..7e0c117 --- /dev/null +++ b/news/Homework_2_2010_notes.mdwn @@ -0,0 +1,6 @@ +Hi all, + People seem to be getting worried by `observationSample()`. You shouldn't worry too much about this function as it is only used by the test harness to generate observations, and not by any of the filters. It needs to pick a beacon to return the observation to - I chose the beacon with least angle relative to the robot in my implementation. + + `expectedObservation()` has also generated some questions. Unlike `observationSample()`, `expectedObservation()` is passed an observation. From this you can get the beacon ID. You can then generate the expected observation for that particular beacon. + +Will :-}
Add the changes from in class today.
Update main.py so it uses a different formal ao List.
Update test.py to output its actions and observations in this new format.
Replace the test output (I also fixed a bug in my motion model, so these have changed anyway.)
Update main.py so it uses a different formal ao List.
Update test.py to output its actions and observations in this new format.
Replace the test output (I also fixed a bug in my motion model, so these have changed anyway.)
diff --git a/assignments/2010/Homework2src/filter.py b/assignments/2010/Homework2src/filter.py index d88ccce..2794e07 100644 --- a/assignments/2010/Homework2src/filter.py +++ b/assignments/2010/Homework2src/filter.py @@ -38,8 +38,9 @@ def observationUpdate(obs): R = observationNoiseCoVar(mean, obs) # print "H:", H # print "R:", R - y = normaliseObsAngles(obs - expectedObservation(mean, obs)) # y = obs - H * mean + # y = obs - expectedObservation(mean, obs) + y = normaliseObsAngles(obs - expectedObservation(mean, obs)) # print "y:", y S = H * Sigma * H.T + R # print "S:", S diff --git a/assignments/2010/Homework2src/main.py b/assignments/2010/Homework2src/main.py index 57aaeda..a3a69de 100644 --- a/assignments/2010/Homework2src/main.py +++ b/assignments/2010/Homework2src/main.py @@ -1,7 +1,17 @@ from mpmath import * import filter -aoList=[[0,0],[0,1],[1,2],[1,4],[-2,7],[3,8],[-4,12],[1,12],[0,13],[0,14],[0,15]] +aoList=[[matrix([[0]]), matrix([[0]])], + [matrix([[0]]), matrix([[1]])], + [matrix([[1]]), matrix([[2]])], + [matrix([[1]]), matrix([[4]])], + [matrix([[-2]]), matrix([[7]])], + [matrix([[3]]), matrix([[8]])], + [matrix([[-4]]), matrix([[12]])], + [matrix([[1]]), matrix([[12]])], + [matrix([[0]]), matrix([[13]])], + [matrix([[0]]), matrix([[14]])], + [matrix([[0]]), matrix([[15]])]] filter.setInitialStateUniform() @@ -11,8 +21,8 @@ print filter.getSigma() step = 0 for ao in aoList: - a = ao[0] * matrix([[1]]) - o = ao[1] * matrix([[1]]) + a = ao[0] + o = ao[1] print "step:", step diff --git a/assignments/2010/Homework2src/model.py b/assignments/2010/Homework2src/model.py index bb5c56c..d457fa6 100644 --- a/assignments/2010/Homework2src/model.py +++ b/assignments/2010/Homework2src/model.py @@ -59,6 +59,10 @@ def observationProbability(state, obs): "Return the probability, or probability density as appropriate, of the supplied observation assuming we're in the supplied state" return rand.mv_normal_val(expectedObservation(state, obs), observationNoiseCoVar(state, obs), obs) +def observationSample(state): + "Return a sample observation for this state." + return rand.mv_normal_sample(expectedObservation(state, None), observationNoiseCoVar(state, None)) + def normaliseStateAngles(state): "Make sure any angles in the state are between -pi and +pi" for i in []: # list angles in the state here diff --git a/assignments/2010/Homework2src/test.py b/assignments/2010/Homework2src/test.py index 93110a5..640fa72 100644 --- a/assignments/2010/Homework2src/test.py +++ b/assignments/2010/Homework2src/test.py @@ -16,6 +16,8 @@ step = 0 state = matrix([0,0,0]) +aoList = [] + for a in aList: print "True State:", state.T @@ -29,6 +31,8 @@ for a in aList: # sample an observation given that location obs = observationSample(state) + aoList = aoList + [[am, obs]] + # Now use that action and observation to track the robot filter.motionUpdate(am) @@ -46,3 +50,5 @@ for a in aList: step = step + 1 +# output an aoList ready for main.py +print "aoList: ", aoList diff --git a/assignments/2010/Homework2src/test1.out b/assignments/2010/Homework2src/test1.out index 715b14b..dd05587 100644 --- a/assignments/2010/Homework2src/test1.out +++ b/assignments/2010/Homework2src/test1.out @@ -9,340 +9,527 @@ True State: [0.0 0.0 0.0] A: [1.0 0.0 0.0] mu: [1.0 0.0 0.0] Sig: [1000000.0121 0.0 0.0] -[ 0.0 1000000.0001 0.0] -[ 0.0 0.0 1000000.00761544] -O: [4.0 2.3282117241155 -0.99383361903067] -mu: [0.921020365116264 0.0635300228941811 -0.0944292456874564] -Sig: [ 666666.6777055 333333.337731233 -333333.325562911] -[ 333333.337731233 166666.671108651 -166666.662781455] -[-333333.325562911 -166666.662781455 166666.695445295] -True State: [0.831550009268448 -0.00209220837062398 -0.0618699018109107] +[ 0.0 2000000.0001 1000000.0] +[ 0.0 1000000.0 1000000.00761544] +O: [2.0 2.20548920717302 1.02685549688771] +mu: [0.966224314925608 0.0510759471469045 0.0565677550147171] +Sig: [ 444444.468595655 -222222.232677859 222222.207842762] +[-222222.232677859 111111.118332737 -111111.103672155] +[ 222222.207842762 -111111.103672155 111111.130002608] +True State: [1.08467111437262 -0.00113319600822562 0.0475383384048247] A: [0.0 0.0 1.5707963267949] -mu: [0.921020365116264 0.0635300228941811 1.47636708110744] -Sig: [ 666666.6778055 333333.337731233 -333333.325562911] -[ 333333.337731233 166666.671208651 -166666.662781455] -[-333333.325562911 -166666.662781455 166666.755150309] -O: [2.0 2.26246724922387 -0.406681831257457] -mu: [0.87315928961857 0.0387351912556168 1.46213161614695] -Sig: [ 0.00508391179713368 -0.000150387001311701 0.00145718049520418] -[-0.00015038696233882 0.00146555838110724 -0.000359879972708357] -[ 0.00145718047493331 -0.000359879980915294 0.0146665247789219] -True State: [0.840252746487984 0.0105187873919663 1.61791477393166] +mu: [0.966224314925608 0.0510759471469045 1.62736408180961] +Sig: [ 444444.468695655 -222222.232677859 222222.207842762] +[-222222.232677859 111111.118432737 -111111.103672155] +[ 222222.207842762 -111111.103672155 111111.189707622] +O: [2.0 2.08776684562391 0.0367503387694498] +mu: [5.56521212785083 -2.25154045793991 -2.81327741071465] +Sig: [ 6.21073147656021 -3.20135767197741 3.15983176521346] +[-3.20135767183994 1.65159975141135 -1.62905679255099] +[ 3.15983176616293 -1.62905679312905 1.62437991109375] +True State: [1.08855216589523 -0.00860108430721535 1.16072915564956] A: [1.0 0.0 0.0] -mu: [0.981610273988926 1.03283698885438 1.46213161614695] -Sig: [0.00532505118926447 0.00114334882085541 0.00145718049520418] -[ 0.0011433488598283 0.0134244189889765 -0.000359879972708357] -[0.00145718047493331 -0.000359879980915294 0.0222819602735896] -O: [2.0 1.41137283157012 -1.09822356421531] -mu: [0.962215460321182 1.05025807746714 1.6353419077451] -Sig: [ 0.00341366601927566 -0.00269547344680257 0.00202516539660582] -[-0.00269547344167317 0.00468210486668719 -0.00228577803914718] -[ 0.0020251653880526 -0.00228577803473475 0.0130043189917863] -True State: [0.78103323817233 1.17773184426188 1.67014425921659] +mu: [4.61862519340595 -2.57398917562729 -2.81327741071465] +Sig: [ 8.42824313799865 -7.20984026662719 3.68361098458277] +[-7.20984026720208 6.19252315411674 -3.16667359296708] +[ 3.68361098553223 -3.16667359354514 1.63199534658841] +O: [2.0 1.30546553784744 0.0354396553196523] +mu: [1.30867538926018 0.0639561047810351 2.35427143174752] +Sig: [ 0.0160052042539916 0.00352073238069298 -0.00350794089481427] +[ 0.00352073238037585 0.006787633771788 -0.00437060946646179] +[-0.00350794090492493 -0.00437060947273097 0.0148167444433586] +True State: [1.45809947737413 0.854283064774877 1.13752362885891] A: [0.0 1.0 0.0] -mu: [-0.0357021967622948 0.985757304750657 1.6353419077451] -Sig: [ 0.0289075771024096 -0.00105412871707522 0.00202516539660582] -[-0.00105412871194582 0.00488819378355329 -0.00228577803914718] -[ 0.0020251653880526 -0.00228577803473475 0.0206197544864541] -O: [1.0 1.98369583729015 1.24604022827485] -mu: [-0.24757393943686 1.02852795149005 1.53022411116644] -Sig: [0.00339035814762512 0.00187503501422398 7.14961360545705e-5] -[0.00187503501456104 0.00421887906319938 -0.000456660176491981] -[7.14961367232148e-5 -0.000456660174226783 0.0127374356723873] -True State: [-0.257281285535259 1.05827323150953 1.59278145492053] +mu: [0.600210108739209 -0.64178956208228 2.35427143174752] +Sig: [ 0.031332692770445 0.00826303628390437 0.00694891229310716] +[0.00826303629517474 0.0332183116471524 -0.0148677584749333] +[0.00694891228299649 -0.0148677584812025 0.0224321799380263] +O: [2.0 1.82405607288538 -0.76987498391962] +mu: [1.18505568311455 0.277249767450277 2.03335015797709] +Sig: [ 0.0196379489752767 -0.00857747858210535 0.0108080739256422] +[-0.00857747858138638 0.00715002096850194 -0.00628480736216565] +[ 0.0108080739236858 -0.00628480736180292 0.0161224369530893] +True State: [0.321464823551677 1.36881967652676 1.09555804607993] A: [0.0 0.0 3.14159265358979] -mu: [-0.24757393943686 1.02852795149005 -1.61136854242335] -Sig: [0.00349035814762512 0.00187503501422398 7.14961360545705e-5] -[0.00187503501456104 0.00431887906319938 -0.000456660176491981] -[7.14961367232148e-5 -0.000456660174226783 0.173880050739556] -O: [4.0 3.78083244850053 0.738387263490104] -mu: [-0.248778530640755 1.0319153885385 -1.66383344403587] -Sig: [ 0.00343076658446237 0.00209032449277562 -0.000927672895264757] -[ 0.00209032449299712 0.00341988427235953 -0.000902143351714228] -[-0.000927672895196151 -0.000902143351461687 0.0214513890963745] -True State: [-0.253423466738276 1.06496826503062 -1.47730458637562] +mu: [1.18505568311455 0.277249767450277 -1.10824249561271] +Sig: [ 0.0197379489752767 -0.00857747858210535 0.0108080739256422] +[-0.00857747858138638 0.00725002096850194 -0.00628480736216565] +[ 0.0108080739236858 -0.00628480736180292 0.177265052020258] +O: [4.0 3.71918454905722 0.35916207728466] +mu: [0.0427794184080703 1.04029623620002 -1.28095087506237] +Sig: [ 0.00648856141230659 9.00829400335453e-5 -0.00227797418977042] +[ 9.00829401339289e-5 0.00153773561005057 -0.000271743792239603] +[-0.00227797418981956 -0.000271743792207271 0.010133441935633] +True State: [0.322204830657822 1.36555168149971 -1.62741814612092] (Diff truncated)
Announce updated homework
diff --git a/news/Homework_2_2010_update_1.mdwn b/news/Homework_2_2010_update_1.mdwn new file mode 100644 index 0000000..3d52559 --- /dev/null +++ b/news/Homework_2_2010_update_1.mdwn @@ -0,0 +1,8 @@ +Hi all, + I've updated the source files for Homework 2 to fix a bug or two. There are now some extra functions for you to implement. These will be easy if you understand what is going on. I've also updated the homework sheet to clarify a few things: there is now a 'notes' section at the end of the assignment that may help. + +I've also added a new python file `test.py`. This file can be run using `python test.py`. It uses the motionSample and (not suppled) observationSample functions to generate a series of motions and observations with the correct mean and variance from a list of supplied actions. The actions given would move the robot in a square (like the first lab), but noise in the execution of those actions leads the robot to only approximate that shape. Test.py uses a kalman filter to track the actual location as the robot walks around. I've also included the output for five different runs of this program. + +I'm giving a general extension on this Homework until Friday. I'm very sorry for the bugs. :( + +Will
Clarify a few points in Homework2.
diff --git a/assignments/2010/Homework2.pdf b/assignments/2010/Homework2.pdf index 94cf8b7..22902df 100644 Binary files a/assignments/2010/Homework2.pdf and b/assignments/2010/Homework2.pdf differ
Fix up the observation probability code to use the new expectedObservation function.
diff --git a/assignments/2010/Homework2src/model.py b/assignments/2010/Homework2src/model.py index 4e41e9a..bb5c56c 100644 --- a/assignments/2010/Homework2src/model.py +++ b/assignments/2010/Homework2src/model.py @@ -57,7 +57,7 @@ def expectedObservation(state, obs): def observationProbability(state, obs): "Return the probability, or probability density as appropriate, of the supplied observation assuming we're in the supplied state" - return rand.mv_normal_val(observationMatrix(state)*state, observationNoiseCoVar(state), obs) + return rand.mv_normal_val(expectedObservation(state, obs), observationNoiseCoVar(state, obs), obs) def normaliseStateAngles(state): "Make sure any angles in the state are between -pi and +pi"
Modify test to output covariance. Add some sample output.
diff --git a/assignments/2010/Homework2src/test.py b/assignments/2010/Homework2src/test.py index 6386d58..93110a5 100644 --- a/assignments/2010/Homework2src/test.py +++ b/assignments/2010/Homework2src/test.py @@ -33,14 +33,14 @@ for a in aList: filter.motionUpdate(am) print "mu:",filter.getMean().T - # print "Sig:",filter.getSigma() + print "Sig:",filter.getSigma() print "O:", obs.T filter.observationUpdate(obs) print "mu:",filter.getMean().T - # print "Sig:",filter.getSigma() + print "Sig:",filter.getSigma() #print "Chol",cholesky(filter.getSigma()) diff --git a/assignments/2010/Homework2src/test1.out b/assignments/2010/Homework2src/test1.out new file mode 100644 index 0000000..715b14b --- /dev/null +++ b/assignments/2010/Homework2src/test1.out @@ -0,0 +1,348 @@ +Initial filter mean and covariance: +[0.0] +[0.0] +[0.0] +[1000000.0 0.0 0.0] +[ 0.0 1000000.0 0.0] +[ 0.0 0.0 1000000.0] +True State: [0.0 0.0 0.0] +A: [1.0 0.0 0.0] +mu: [1.0 0.0 0.0] +Sig: [1000000.0121 0.0 0.0] +[ 0.0 1000000.0001 0.0] +[ 0.0 0.0 1000000.00761544] +O: [4.0 2.3282117241155 -0.99383361903067] +mu: [0.921020365116264 0.0635300228941811 -0.0944292456874564] +Sig: [ 666666.6777055 333333.337731233 -333333.325562911] +[ 333333.337731233 166666.671108651 -166666.662781455] +[-333333.325562911 -166666.662781455 166666.695445295] +True State: [0.831550009268448 -0.00209220837062398 -0.0618699018109107] +A: [0.0 0.0 1.5707963267949] +mu: [0.921020365116264 0.0635300228941811 1.47636708110744] +Sig: [ 666666.6778055 333333.337731233 -333333.325562911] +[ 333333.337731233 166666.671208651 -166666.662781455] +[-333333.325562911 -166666.662781455 166666.755150309] +O: [2.0 2.26246724922387 -0.406681831257457] +mu: [0.87315928961857 0.0387351912556168 1.46213161614695] +Sig: [ 0.00508391179713368 -0.000150387001311701 0.00145718049520418] +[-0.00015038696233882 0.00146555838110724 -0.000359879972708357] +[ 0.00145718047493331 -0.000359879980915294 0.0146665247789219] +True State: [0.840252746487984 0.0105187873919663 1.61791477393166] +A: [1.0 0.0 0.0] +mu: [0.981610273988926 1.03283698885438 1.46213161614695] +Sig: [0.00532505118926447 0.00114334882085541 0.00145718049520418] +[ 0.0011433488598283 0.0134244189889765 -0.000359879972708357] +[0.00145718047493331 -0.000359879980915294 0.0222819602735896] +O: [2.0 1.41137283157012 -1.09822356421531] +mu: [0.962215460321182 1.05025807746714 1.6353419077451] +Sig: [ 0.00341366601927566 -0.00269547344680257 0.00202516539660582] +[-0.00269547344167317 0.00468210486668719 -0.00228577803914718] +[ 0.0020251653880526 -0.00228577803473475 0.0130043189917863] +True State: [0.78103323817233 1.17773184426188 1.67014425921659] +A: [0.0 1.0 0.0] +mu: [-0.0357021967622948 0.985757304750657 1.6353419077451] +Sig: [ 0.0289075771024096 -0.00105412871707522 0.00202516539660582] +[-0.00105412871194582 0.00488819378355329 -0.00228577803914718] +[ 0.0020251653880526 -0.00228577803473475 0.0206197544864541] +O: [1.0 1.98369583729015 1.24604022827485] +mu: [-0.24757393943686 1.02852795149005 1.53022411116644] +Sig: [0.00339035814762512 0.00187503501422398 7.14961360545705e-5] +[0.00187503501456104 0.00421887906319938 -0.000456660176491981] +[7.14961367232148e-5 -0.000456660174226783 0.0127374356723873] +True State: [-0.257281285535259 1.05827323150953 1.59278145492053] +A: [0.0 0.0 3.14159265358979] +mu: [-0.24757393943686 1.02852795149005 -1.61136854242335] +Sig: [0.00349035814762512 0.00187503501422398 7.14961360545705e-5] +[0.00187503501456104 0.00431887906319938 -0.000456660176491981] +[7.14961367232148e-5 -0.000456660174226783 0.173880050739556] +O: [4.0 3.78083244850053 0.738387263490104] +mu: [-0.248778530640755 1.0319153885385 -1.66383344403587] +Sig: [ 0.00343076658446237 0.00209032449277562 -0.000927672895264757] +[ 0.00209032449299712 0.00341988427235953 -0.000902143351714228] +[-0.000927672895196151 -0.000902143351461687 0.0214513890963745] +True State: [-0.253423466738276 1.06496826503062 -1.47730458637562] +A: [1.0 0.0 0.0] +mu: [-0.341681485881996 0.0362402201690964 -1.66383344403587] +Sig: [ 0.00363433809357304 0.00320033847999767 -0.000927672895264757] +[ 0.00320033848021917 0.0154163127632489 -0.000902143351714228] +[-0.000927672895196151 -0.000902143351461687 0.0290668245910422] +O: [4.0 2.8134616543544 0.742487661385862] +mu: [-0.316994097433798 -0.212795430542274 -1.54485110764316] +Sig: [ 0.00357761488466703 0.00374768385603591 -0.00126636209446369] +[ 0.00374768385611478 0.00852520077083916 -0.00186342998599113] +[-0.00126636209443255 -0.0018634299859041 0.015930814260573] +True State: [-0.15347810512572 -0.0860177009751519 -1.41747266731947] +A: [0.0 0.0 1.5707963267949] +mu: [-0.316994097433798 -0.212795430542274 0.0259452191517369] +Sig: [ 0.00367761488466703 0.00374768385603591 -0.00126636209446369] +[ 0.00374768385611478 0.00862520077083916 -0.00186342998599113] +[-0.00126636209443255 -0.0018634299859041 0.0756358285387678] +O: [2.0 2.974585129297 0.363224439640467] +mu: [-0.227255728283064 -0.0595691096850417 0.28237299799246] +Sig: [ 0.00156045633222631 0.000259376529155562 0.000109570712627512] +[0.000259376529175055 0.00286162171080481 -0.000541039060589406] +[0.000109570712626058 -0.000541039060586789 0.0193749693873355] +True State: [-0.171529917124624 -0.0867536149256249 0.360062653536876] +A: [1.0 0.0 0.0] +mu: [0.733141213336206 0.219066341268983 0.28237299799246] +Sig: [ 0.0127288037578861 0.00347058414823097 0.000109570712627512] +[ 0.00347058414825047 0.00389327428514504 -0.000541039060589406] +[0.000109570712626058 -0.000541039060586789 0.0269904048820033] +O: [2.0 2.16439272557975 0.969013637191675] +mu: [0.758659724250196 0.225789559808266 0.12807975301051] +Sig: [ 0.00424656004823843 -0.000808358892310971 0.00114947121078631] +[-0.000808358892307575 0.00171180923180607 -0.000579693572743263] +[ 0.00114947121078489 -0.000579693572743122 0.0130182414947128] +True State: [0.771024914681431 0.244842595293533 0.243893255343895] +A: [0.0 0.0 1.5707963267949] +mu: [0.758659724250196 0.225789559808266 1.69887607980541] +Sig: [ 0.00434656004823843 -0.000808358892310971 0.00114947121078631] +[-0.000808358892307575 0.00181180923180607 -0.000579693572743263] +[ 0.00114947121078489 -0.000579693572743122 0.0727232557729077] +O: [1.0 3.40227489101855 0.773047467233735] +mu: [0.823917563221082 0.198807569576528 1.77674433761267] +Sig: [ 0.00216546276155481 7.67668197415382e-5 0.000403524390151265] +[ 7.67668197430101e-5 0.00144849353973803 0.000181078278036941] +[0.000403524390151402 0.000181078278036871 0.0215040673487849] +True State: [0.776454356341132 0.239116567040435 1.7707930609266] +A: [1.0 0.0 0.0] +mu: [0.619422334526141 1.17767513030219 1.77674433761267] +Sig: [ 0.00276728234426277 -0.00232531812857031 0.000403524390151265] +[-0.00232531812856883 0.0130466739570301 0.000181078278036941] +[0.000403524390151402 0.000181078278036871 0.0291195028434526] +O: [1.0 2.67456411543163 0.944331544609306] +mu: [0.588993429443677 1.22864410664005 1.83206828797914] +Sig: [ 0.00133437098083953 0.000305902330713258 0.000257294066533375] +[0.000305902330713776 0.00812717115743032 0.00149575617055209] +[0.000257294066533505 0.00149575617055213 0.0166473353651475] +True State: [0.591272461254821 1.21668262119092 1.7399840993943] +A: [0.0 0.0 1.5707963267949] +mu: [0.588993429443677 1.22864410664005 -2.88032069240555] +Sig: [ 0.00143437098083953 0.000305902330713258 0.000257294066533375] +[0.000305902330713776 0.00822717115743032 0.00149575617055209] +[0.000257294066533505 0.00149575617055213 0.0763523496433423] +O: [3.0 4.12271881407131 0.645486802512443] +mu: [0.587203655253792 1.21850773447463 -2.89083767753929] +Sig: [ 0.00130697477833849 -0.000424746762128476 -0.000213883397211597] +[-0.000424746762128254 0.00397481732076884 0.000671862544055074] +[-0.000213883397211556 0.000671862544055107 0.0176052697196894] +True State: [0.594662097630835 1.22813258536505 -2.89178987166436] +A: [1.0 0.0 0.0] +mu: [-0.381521706275941 0.970372340124919 -2.89083767753929] +Sig: [ 0.0126681206911894 0.00245975383306851 -0.000213883397211597] +[ 0.00245975383306873 0.00481367140791789 0.000671862544055074] +[-0.000213883397211556 0.000671862544055107 0.0252207052143571] +O: [3.0 3.43551022062781 0.910884027977924] +mu: [-0.3484053563521 0.994242804241945 -2.93391746154153] +Sig: [ 0.00706060926325698 -0.00119455070343116 -0.00122281898049108] +[-0.00119455070343109 0.00240741716988011 0.000545960550749819] +[-0.00122281898049108 0.000545960550749835 0.0136513948467545] +True State: [-0.39510204385165 0.985351803602463 -2.92717193780827] +A: [0.0 0.0 1.5707963267949] +mu: [-0.3484053563521 0.994242804241945 -1.36312113474664] +Sig: [ 0.00716060926325698 -0.00119455070343116 -0.00122281898049108] +[-0.00119455070343109 0.00250741716988011 0.000545960550749819] +[-0.00122281898049108 0.000545960550749835 0.0733564091249494] +O: [4.0 3.74035450668261 0.391236854739829] +mu: [-0.311151976705028 0.975968649836826 -1.31523583611367] +Sig: [ 0.00410900964728187 0.000345813202470046 -0.000836200955877464] +[ 0.000345813202470072 0.00172389987131513 -0.000242742478605569] +[-0.000836200955877467 -0.000242742478605562 0.0144316394227535] +True State: [-0.388658634847673 0.968484917709966 -1.38220608207707] +A: [1.0 0.0 0.0] +mu: [-0.0583642414606726 0.00844688733738275 -1.31523583611367] +Sig: [ 0.00497582931636151 -0.00258911841923229 -0.000836200955877464] +[ -0.00258911841923226 0.0130570802022355 -0.000242742478605569] +[-0.000836200955877467 -0.000242742478605562 0.0220470749174212] +O: [4.0 2.9361341689153 0.641688670596323] +mu: [-0.0819075445822486 0.0519075251622832 -1.36886011651941] +Sig: [ 0.00296881550829493 0.00149374046703281 -0.000892987677145977] +[ 0.00149374046703281 0.00467264317294226 -0.0010672687987894] +[-0.000892987677145978 -0.0010672687987894 0.0108163394500484] +True State: [-0.173002914386758 -0.0661556159671238 -1.35953636551045] +A: [0.0 0.0 1.5707963267949] +mu: [-0.0819075445822486 0.0519075251622832 0.201936210275485] +Sig: [ 0.00306881550829493 0.00149374046703281 -0.000892987677145977] +[ 0.00149374046703281 0.00477264317294226 -0.0010672687987894] +[-0.000892987677145978 -0.0010672687987894 0.0705213537282433] +O: [2.0 3.00181903432046 0.379706612429137] +mu: [-0.143059227542314 -0.0272540217891838 0.344376691796881] +Sig: [ 0.00176694775457381 -0.000229982027248823 0.000297330302236322] +[-0.000229982027248822 0.00246705679770499 -0.000608407602900921] +[ 0.000297330302236321 -0.000608407602900922 0.0158961927378624] +True State: [-0.171572560972909 -0.0736396465805787 0.300818842816728] (Diff truncated)
Make sure there is some 'left' in the test run.
diff --git a/assignments/2010/Homework2src/test.py b/assignments/2010/Homework2src/test.py index 04eb869..6386d58 100644 --- a/assignments/2010/Homework2src/test.py +++ b/assignments/2010/Homework2src/test.py @@ -3,7 +3,7 @@ import filter from math import pi from robotModel import motionSample, observationSample -aList=[[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2]] +aList=[[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,1,0],[0,0,pi],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2]] # filter.setInitialStateGaussian(matrix([0,0,0]), eye(3)*0.001) filter.setInitialStateUniform()
Update source for homework2.
diff --git a/assignments/2010/Homework2src/filter.py b/assignments/2010/Homework2src/filter.py index 5a5d410..d88ccce 100644 --- a/assignments/2010/Homework2src/filter.py +++ b/assignments/2010/Homework2src/filter.py @@ -1,4 +1,5 @@ -from model import motionMatrix, motionConst, motionNoiseCoVar, observationMatrix, observationNoiseCoVar, getStateDimensions, getObservationDimensions +from model import motionMatrixF, motionMatrixB, motionNoiseCoVar, observationMatrix, observationNoiseCoVar, getStateDimensions, getObservationDimensions, expectedObservation, expectedMotionResult, normaliseStateAngles, normaliseObsAngles +#from robotModel import motionMatrixF, motionMatrixB, motionNoiseCoVar, observationMatrix, observationNoiseCoVar, getStateDimensions, getObservationDimensions, expectedObservation, expectedMotionResult, normaliseStateAngles, normaliseObsAngles from mpmath import * import rand @@ -37,7 +38,8 @@ def observationUpdate(obs): R = observationNoiseCoVar(mean, obs) # print "H:", H # print "R:", R - y = obs - H * mean + y = normaliseObsAngles(obs - expectedObservation(mean, obs)) + # y = obs - H * mean # print "y:", y S = H * Sigma * H.T + R # print "S:", S @@ -47,14 +49,15 @@ def observationUpdate(obs): # print "KH:", (K*H) # print "I - KH:", (eye(mean.rows) - K * H) Sigma = (eye(mean.rows) - K * H)*Sigma + mean = normaliseStateAngles(mean) def motionUpdate(action): global mean global Sigma - F = motionMatrix(mean, action) - B = motionConst(mean, action) + F = motionMatrixF(mean, action) + B = motionMatrixB(mean, action) Q = motionNoiseCoVar(mean, action) # print "F:", F # print "Q:", Q - mean = F * mean + B + mean = normaliseStateAngles(expectedMotionResult(mean, action)) Sigma = F * Sigma * F.T + Q diff --git a/assignments/2010/Homework2src/model.py b/assignments/2010/Homework2src/model.py index 7f1e864..4e41e9a 100644 --- a/assignments/2010/Homework2src/model.py +++ b/assignments/2010/Homework2src/model.py @@ -21,21 +21,26 @@ def getStateDimensions(): def getObservationDimensions(): return 1 -def motionMatrix(state, action): +def motionMatrixF(state, action): "Return the F matrix (using wikipedia notation)" return matrix([[1.0, 1.0],[0.0,1.0]]) -def motionConst(state, action): +def motionMatrixB(state, action): "Return the B matrix (using wikipedia notation)" - return matrix([0.0,1.0])*action + return matrix([0.0,1.0]) def motionNoiseCoVar(state, action): "Return the Q matrix (using wikipedia notation)" return eye(2) + matrix([[0,0],[0,1]]) * action[0] +def expectedMotionResult(state, action): + "Return the expected state after executing an action in a state" + # for a linear filter: F.x + B.u + return motionMatrixF(state, action) * state + motionMatrixB(state, action) * action + def motionSample(state, action): "Return a sample from the motion model if the agent started in the supplied state and performed the supplied action" - return rand.mv_normal_sample(motionMatrix(state, action) * state + motionConst(state, action), motionNoiseCoVar(state, action)) + return rand.mv_normal_sample(expectedMotionResult(state, action), motionNoiseCoVar(state, action)) def observationMatrix(state, obs): "Return the H matrix (using wikipedia notation)" @@ -45,6 +50,31 @@ def observationNoiseCoVar(state, obs): "Return the R matrix (using wikipedia notation)" return eye(1) +def expectedObservation(state, obs): + "Return the mean observation for a given state" + # Note, an observation is given. If there is a discrete component to the observation, then match the supplied observation + return observationMatrix(state, obs)*state + def observationProbability(state, obs): "Return the probability, or probability density as appropriate, of the supplied observation assuming we're in the supplied state" return rand.mv_normal_val(observationMatrix(state)*state, observationNoiseCoVar(state), obs) + +def normaliseStateAngles(state): + "Make sure any angles in the state are between -pi and +pi" + for i in []: # list angles in the state here + while state[i] > math.pi: + state[i] = state[i] - 2*math.pi + while state[i] < -math.pi: + state[i] = state[i] + 2*math.pi + return state + +def normaliseObsAngles(obs): + "Make sure any angles in the observation are between -pi and +pi" + for i in []: # list angles in the observation here + while obs[i] > math.pi: + obs[i] = obs[i] - 2*math.pi + while obs[i] < -math.pi: + obs[i] = obs[i] + 2*math.pi + return obs + + diff --git a/assignments/2010/Homework2src/rand.py b/assignments/2010/Homework2src/rand.py index 2a34f7c..5b1ad02 100644 --- a/assignments/2010/Homework2src/rand.py +++ b/assignments/2010/Homework2src/rand.py @@ -3,7 +3,8 @@ import math import random def mv_normal_sample(mean, Sigma): - "Generate a sample from the unit spherical gaussian and then distort it into the right space." + "Generate a sample from a multivariate gaussian with mean vector `mean', and covariance matrix `Sigma'." + # generate a sample from the unit spherical gaussian and then distort it into the right space. # Check dimensions match if (mean.cols != 1): @@ -32,6 +33,7 @@ def mv_normal_sample(mean, Sigma): return result def mv_normal_val(mean, Sigma, x): + "Calculate the value of a multivariate gaussian with mean vector `mean' and covariance matrix `Sigma' at point `x'." N = mean.rows norm = math.sqrt(det(2.0*math.pi*Sigma)) diff --git a/assignments/2010/Homework2src/test.py b/assignments/2010/Homework2src/test.py new file mode 100644 index 0000000..04eb869 --- /dev/null +++ b/assignments/2010/Homework2src/test.py @@ -0,0 +1,48 @@ +from mpmath import * +import filter +from math import pi +from robotModel import motionSample, observationSample + +aList=[[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0, 0, pi/2],[1, 0, 0],[0,0,pi/2],[1,0,0],[0,0,pi/2],[1,0,0],[0,0,pi/2]] + +# filter.setInitialStateGaussian(matrix([0,0,0]), eye(3)*0.001) +filter.setInitialStateUniform() + +print "Initial filter mean and covariance:" +print filter.getMean() +print filter.getSigma() + +step = 0 + +state = matrix([0,0,0]) + +for a in aList: + + print "True State:", state.T + + am = matrix(a) + + print "A:", am.T + + # sample a 'true' location for the robot given the selected action + state = motionSample(state, am) + # sample an observation given that location + obs = observationSample(state) + + # Now use that action and observation to track the robot + filter.motionUpdate(am) + + print "mu:",filter.getMean().T + # print "Sig:",filter.getSigma() + + print "O:", obs.T + + filter.observationUpdate(obs) + + print "mu:",filter.getMean().T + # print "Sig:",filter.getSigma() + + #print "Chol",cholesky(filter.getSigma()) + + step = step + 1 +
Announce bug and extension - no details as yet
diff --git a/news/Homework_2_2010_bug.mdwn b/news/Homework_2_2010_bug.mdwn new file mode 100644 index 0000000..3be67e1 --- /dev/null +++ b/news/Homework_2_2010_bug.mdwn @@ -0,0 +1,5 @@ +Sigh, + + I've found a bug in Homework 2. I'll release some changes later today. Because of this I'm going to extend the assignment until Friday. More details coming... + +Will
Add robot assignment 1 sheet. No due date yet.
diff --git a/assignments/2010/assign1.pdf b/assignments/2010/assign1.pdf new file mode 100644 index 0000000..6e62a19 Binary files /dev/null and b/assignments/2010/assign1.pdf differ
Link to homework 2
diff --git a/news/Homework_2_2010_released.mdwn b/news/Homework_2_2010_released.mdwn new file mode 100644 index 0000000..8c4d99d --- /dev/null +++ b/news/Homework_2_2010_released.mdwn @@ -0,0 +1 @@ +As noted yesterday in lectures, Homework 2 has been released. It is available as [[assignments/2010/Homework2.pdf]]. This homework is due by the start of Wednesday lecture in week 7 (1 September). I've put the mpmath library in with the python files for the homework.
Fixes for homework2.
diff --git a/assignments/2010/Homework2.pdf b/assignments/2010/Homework2.pdf index 1bde364..94cf8b7 100644 Binary files a/assignments/2010/Homework2.pdf and b/assignments/2010/Homework2.pdf differ diff --git a/assignments/2010/Homework2src/filter.py b/assignments/2010/Homework2src/filter.py index a46224d..5a5d410 100644 --- a/assignments/2010/Homework2src/filter.py +++ b/assignments/2010/Homework2src/filter.py @@ -33,8 +33,8 @@ def getSigma(): def observationUpdate(obs): global mean global Sigma - H = observationMatrix(mean) - R = observationNoiseCoVar(mean) + H = observationMatrix(mean, obs) + R = observationNoiseCoVar(mean, obs) # print "H:", H # print "R:", R y = obs - H * mean diff --git a/assignments/2010/Homework2src/model.py b/assignments/2010/Homework2src/model.py index 4d5cea0..7f1e864 100644 --- a/assignments/2010/Homework2src/model.py +++ b/assignments/2010/Homework2src/model.py @@ -1,6 +1,20 @@ from mpmath import * import rand +# Matrices are labelled in the notation from +# http://en.wikipedia.org/wiki/Kalman_filter#Underlying_dynamic_system_model + +# If using a implementing a non-linear motion or observation model, then for those +# functions which return a matrix, you'll need to find a linear approximation to the +# true model. This linear approximation is usually found by using the tangent line to +# the non-linear function. The slope of a tangent line to a function is the derivative of +# the function at that point. +# See http://en.wikipedia.org/wiki/Kalman_filter#Extended_Kalman_filter or, for example, +# http://www.acsu.buffalo.edu/~terejanu/files/tutorialEKF.pdf + +# For a system with more than one dimension, this means: +# <complete this comment> + def getStateDimensions(): return 2 @@ -8,22 +22,29 @@ def getObservationDimensions(): return 1 def motionMatrix(state, action): + "Return the F matrix (using wikipedia notation)" return matrix([[1.0, 1.0],[0.0,1.0]]) def motionConst(state, action): + "Return the B matrix (using wikipedia notation)" return matrix([0.0,1.0])*action def motionNoiseCoVar(state, action): + "Return the Q matrix (using wikipedia notation)" return eye(2) + matrix([[0,0],[0,1]]) * action[0] def motionSample(state, action): + "Return a sample from the motion model if the agent started in the supplied state and performed the supplied action" return rand.mv_normal_sample(motionMatrix(state, action) * state + motionConst(state, action), motionNoiseCoVar(state, action)) -def observationMatrix(state): +def observationMatrix(state, obs): + "Return the H matrix (using wikipedia notation)" return matrix([[1,0]]) -def observationNoiseCoVar(state): +def observationNoiseCoVar(state, obs): + "Return the R matrix (using wikipedia notation)" return eye(1) def observationProbability(state, obs): + "Return the probability, or probability density as appropriate, of the supplied observation assuming we're in the supplied state" return rand.mv_normal_val(observationMatrix(state)*state, observationNoiseCoVar(state), obs) diff --git a/assignments/2010/Homework2src/mpmath/README-LICENSE b/assignments/2010/Homework2src/mpmath/README-LICENSE new file mode 100644 index 0000000..614b098 --- /dev/null +++ b/assignments/2010/Homework2src/mpmath/README-LICENSE @@ -0,0 +1,32 @@ +This directory is taken from the mpmath library. The complete library is available here: <http://code.google.com/p/mpmath/> + +The license on mpmath is as follows: + +Copyright (c) 2005-2010 Fredrik Johansson and mpmath contributors + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + c. Neither the name of mpmath nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/assignments/2010/Homework2src/mpmath/__init__.py b/assignments/2010/Homework2src/mpmath/__init__.py new file mode 100644 index 0000000..3d02f47 --- /dev/null +++ b/assignments/2010/Homework2src/mpmath/__init__.py @@ -0,0 +1,416 @@ +__version__ = '0.15' + +from usertools import monitor, timing + +from ctx_fp import FPContext +from ctx_mp import MPContext +from ctx_iv import MPIntervalContext + +fp = FPContext() +mp = MPContext() +iv = MPIntervalContext() + +fp._mp = mp +mp._mp = mp +iv._mp = mp +mp._fp = fp +fp._fp = fp +mp._iv = iv +fp._iv = iv +iv._iv = iv + +# XXX: extremely bad pickle hack +import ctx_mp as _ctx_mp +_ctx_mp._mpf_module.mpf = mp.mpf +_ctx_mp._mpf_module.mpc = mp.mpc + +make_mpf = mp.make_mpf +make_mpc = mp.make_mpc + +extraprec = mp.extraprec +extradps = mp.extradps +workprec = mp.workprec +workdps = mp.workdps +autoprec = mp.autoprec +maxcalls = mp.maxcalls +memoize = mp.memoize + +mag = mp.mag + +bernfrac = mp.bernfrac + +qfrom = mp.qfrom +mfrom = mp.mfrom +kfrom = mp.kfrom +taufrom = mp.taufrom +qbarfrom = mp.qbarfrom +ellipfun = mp.ellipfun +jtheta = mp.jtheta +kleinj = mp.kleinj + +qp = mp.qp +qhyper = mp.qhyper +qgamma = mp.qgamma +qfac = mp.qfac + +nint_distance = mp.nint_distance + +plot = mp.plot +cplot = mp.cplot +splot = mp.splot + +odefun = mp.odefun + +jacobian = mp.jacobian +findroot = mp.findroot +multiplicity = mp.multiplicity + +isinf = mp.isinf +isnan = mp.isnan +isnormal = mp.isnormal +isint = mp.isint +almosteq = mp.almosteq +nan = mp.nan +rand = mp.rand + +absmin = mp.absmin +absmax = mp.absmax + +fraction = mp.fraction + +linspace = mp.linspace (Diff truncated)
Add the second homework assignment.
diff --git a/assignments/2010/Homework2.pdf b/assignments/2010/Homework2.pdf new file mode 100644 index 0000000..1bde364 Binary files /dev/null and b/assignments/2010/Homework2.pdf differ
Add source for homework 2
diff --git a/assignments/2010/Homework2src/filter.py b/assignments/2010/Homework2src/filter.py new file mode 100644 index 0000000..a46224d --- /dev/null +++ b/assignments/2010/Homework2src/filter.py @@ -0,0 +1,60 @@ +from model import motionMatrix, motionConst, motionNoiseCoVar, observationMatrix, observationNoiseCoVar, getStateDimensions, getObservationDimensions +from mpmath import * +import rand + +largeNum = 10e5 + +mean = zeros(getStateDimensions(),1) +Sigma = eye(getStateDimensions()) + +def setInitialStateUniform(): + global mean + global Sigma + + mean = zeros(getStateDimensions(),1) + Sigma = eye(getStateDimensions())*largeNum + +def setInitialStateGaussian(lmean, lSigma): + global mean + global Sigma + mean = lmean.copy() + Sigma = lSigma.copy() + +def getMean(): + global mean + global Sigma + return mean + +def getSigma(): + global mean + global Sigma + return Sigma + +def observationUpdate(obs): + global mean + global Sigma + H = observationMatrix(mean) + R = observationNoiseCoVar(mean) + # print "H:", H + # print "R:", R + y = obs - H * mean + # print "y:", y + S = H * Sigma * H.T + R + # print "S:", S + K = Sigma * H.T * inverse(S) + # print "K:", K + mean = mean + K*y + # print "KH:", (K*H) + # print "I - KH:", (eye(mean.rows) - K * H) + Sigma = (eye(mean.rows) - K * H)*Sigma + +def motionUpdate(action): + global mean + global Sigma + F = motionMatrix(mean, action) + B = motionConst(mean, action) + Q = motionNoiseCoVar(mean, action) + # print "F:", F + # print "Q:", Q + mean = F * mean + B + Sigma = F * Sigma * F.T + Q diff --git a/assignments/2010/Homework2src/main.py b/assignments/2010/Homework2src/main.py new file mode 100644 index 0000000..57aaeda --- /dev/null +++ b/assignments/2010/Homework2src/main.py @@ -0,0 +1,36 @@ +from mpmath import * +import filter + +aoList=[[0,0],[0,1],[1,2],[1,4],[-2,7],[3,8],[-4,12],[1,12],[0,13],[0,14],[0,15]] + +filter.setInitialStateUniform() + +print filter.getMean() +print filter.getSigma() + +step = 0 + +for ao in aoList: + a = ao[0] * matrix([[1]]) + o = ao[1] * matrix([[1]]) + + print "step:", step + + print "A:", a + + filter.motionUpdate(a) + + print "mu:",filter.getMean() + print "Sig:",filter.getSigma() + + print "O:", o + + filter.observationUpdate(o) + + print "mu:",filter.getMean() + print "Sig:",filter.getSigma() + + #print "Chol",cholesky(filter.getSigma()) + + step = step + 1 + diff --git a/assignments/2010/Homework2src/model.py b/assignments/2010/Homework2src/model.py new file mode 100644 index 0000000..4d5cea0 --- /dev/null +++ b/assignments/2010/Homework2src/model.py @@ -0,0 +1,29 @@ +from mpmath import * +import rand + +def getStateDimensions(): + return 2 + +def getObservationDimensions(): + return 1 + +def motionMatrix(state, action): + return matrix([[1.0, 1.0],[0.0,1.0]]) + +def motionConst(state, action): + return matrix([0.0,1.0])*action + +def motionNoiseCoVar(state, action): + return eye(2) + matrix([[0,0],[0,1]]) * action[0] + +def motionSample(state, action): + return rand.mv_normal_sample(motionMatrix(state, action) * state + motionConst(state, action), motionNoiseCoVar(state, action)) + +def observationMatrix(state): + return matrix([[1,0]]) + +def observationNoiseCoVar(state): + return eye(1) + +def observationProbability(state, obs): + return rand.mv_normal_val(observationMatrix(state)*state, observationNoiseCoVar(state), obs) diff --git a/assignments/2010/Homework2src/rand.py b/assignments/2010/Homework2src/rand.py new file mode 100644 index 0000000..2a34f7c --- /dev/null +++ b/assignments/2010/Homework2src/rand.py @@ -0,0 +1,44 @@ +from mpmath import * +import math +import random + +def mv_normal_sample(mean, Sigma): + "Generate a sample from the unit spherical gaussian and then distort it into the right space." + + # Check dimensions match + if (mean.cols != 1): + return None + N = mean.rows + if (N != Sigma.rows): + return None + if (Sigma.rows != Sigma.cols): + return None + + # generate a list of random gaussians + # i.e. a sample from the unit spherical gaussian + rand = [] + for i in xrange(N): + rand = rand + [random.gauss(0, 1)] # Note: '+' here is list concatenation + + rand = matrix(rand) # turn list into a column vector + + # figure out the transform for the matrix + L = cholesky(Sigma) + + # add the mean and the transformed sample to get a sample + # from our desired gaussian + result = mean + (L * rand) + + return result + +def mv_normal_val(mean, Sigma, x): + N = mean.rows + + norm = math.sqrt(det(2.0*math.pi*Sigma)) + delta = x - mean + valmat = delta.T * inverse(Sigma) * delta + if (valmat.rows != 1) or (valmat.cols != 1): + return None + e = math.exp(-0.5*valmat[0,0]) + + return e/norm
diff --git a/aibo/comp3431/UsefulPython.txt b/aibo/comp3431/UsefulPython.txt index 5fe6a7e..e46ab49 100644 --- a/aibo/comp3431/UsefulPython.txt +++ b/aibo/comp3431/UsefulPython.txt @@ -499,5 +499,12 @@ Action.walk(0,0,100,"ssd",Action.SkellipticalWalkWT,Action.GrabDribbleMWT)#like #Action.walk(0,100,0,"ssd",Action.SkellipticalWalkWT,Action.GrabTurnOnlyMWT)#bit too heavy rotation +#Track the pink-on-yellow beacon + +vPinkOnYellow = Global.createNullVisualObject() + +vPinkOnYellow.setVals(*VisionLink.getVisualObject(Constant.vobPinkOnYellowBeacon)) + + }}}
Comment on Bayesian tracking
diff --git a/news/Homework_1_notes_B.mdwn b/news/Homework_1_notes_B.mdwn
new file mode 100644
index 0000000..e6aaad5
--- /dev/null
+++ b/news/Homework_1_notes_B.mdwn
@@ -0,0 +1,12 @@
+Hi all,
+
+ This pseudo-code description of Bayesian tracking (without a motion model) might help some people:
+
+ P(o|m) = observation probability distribution
+ P(m) = initial prior
+ While not done {
+ Calculate P(m|o) using P(m), P(o|m) and Bayes' rule (and trick where we normalise instead of calculating P(o))
+ P(m) = P(m|o) # move on to next timestep
+ }
+
+Will
diff --git a/aibo.mdwn b/aibo.mdwn index 7bb7bc6..97de381 100644 --- a/aibo.mdwn +++ b/aibo.mdwn @@ -9,6 +9,8 @@ I just added a new page on [[aibo/comp3431/GettingStarted]]. The Robocup 2006 rules are available on the [RoboCup SPL web site](http://www.tzi.de/4legged/pub/Website/Downloads/Rules2006.pdf) and [[locally|/papers/Rules2006.pdf]]. +The current field follows the [2010 rulebook](http://www.tzi.de/spl/pub/Website/Downloads/Rules2010.pdf) (except the minimum green boundary). + There are notes from the previous COMP3431 class wiki: [[!inline pages="aibo/comp3431/*" archive="yes" feeds="no" sort="title"]]
diff --git a/aibo/RoboCupLabNetwork.txt b/aibo/RoboCupLabNetwork.txt index 18b0f2e..d6ab2c2 100644 --- a/aibo/RoboCupLabNetwork.txt +++ b/aibo/RoboCupLabNetwork.txt @@ -1,20 +1,27 @@ -= RoboCup Lab Network = - -The K17 level 3 robotics lab has a private network for !RoboCup development. - -The private network is in the 192.168.0.xxx address space. Sabretooth is also accessible externally as roborouter.cse.unsw.edu.au, so you can ssh tunnel to the private network, or view the SubversionRepository over SSL. - -The network is both wired and wireless. The development computers are wired to the network. The wireless network is available for laptops and for the dogs to communicate. The wireless network is 802.11b with an SSID of "RUNSWIFT" and is not WEP but is MAC address filtered. Ask someone to put you on the list. - -IP addresses are allocated as follows: - * 0 .. ~50: DHCP (laptops etc) - * 100 .. 200: AIBOs (set with spip) - * 200 .. : development computers - * 200: sabretooth (aka roborouter.cse.unsw.edu.au) - * 201: dogmatix - * 202: benji - * 203: gibson - * 204: orangutan - * 205: gorilla - * 206: simpson - * 207: fluffy += RoboCup Lab Network = + + + +The K17 level 3 robotics lab has a private network for !RoboCup development. + + + +The private network is in the 192.168.0.xxx address space. odie is also accessible externally as roborouter.cse.unsw.edu.au, so you can ssh tunnel to the private network. + + + +The network is both wired and wireless. The development computers are wired to the network. The wireless network is available for laptops and for the dogs to communicate. The wireless network is 802.11b with an SSID of "RUNSWIFT" and is not WEP. + + + +IP addresses are allocated as follows: + + * 0 .. ~50: DHCP (laptops etc) + + * 50 .. 100: development computers + + * 100 .. 110: Naos + + * 110 .. 200: Reserved + + * 200 .. : AIBOs (set with spip)
Help for homework 1
diff --git a/news/Homework_1_notes.mdwn b/news/Homework_1_notes.mdwn
new file mode 100644
index 0000000..61a53d1
--- /dev/null
+++ b/news/Homework_1_notes.mdwn
@@ -0,0 +1,11 @@
+Homework 1 hints
+--------------
+
+I've just answered some questions about the homework, and in the interest of fairness, here are the answers for everyone.
+
+ * In question 2.3 onwards (the questions about the coin) the discussion is asking about probability densities rather than probability distributions. For the purposes of Bayes' rule you can treat them the same way. The only distinction is that when normalising a probability density you integrate rather than summing. Similar to probability distributions, probability densities must integrate to 1.
+ * In question 2.9 you should note that the probabilities are all combined using multiplication. This means that everything is either independent or conditionally independent.
+ * If x is normally distributed, then the probability that x is between a and b is [[!teximg code="P(a < x < b) = \int_{x = a}^b \mathcal{N}(\mu, \sigma^2, x) dx"]].
+ * If two probability distributions are independent then this integral decomposes nicely. If x and y are conditionally independent, [[!teximg code="P(x,y|z)=P(x|z)P(y|z)"]], then the probability x is between a and b and y is between c and d decomposes: [[!teximg code="\int_{x = a}^b \int_{y = c}^d P(x,y|z) dy dx = \int_{x = a}^b P(x|z) dx \int_{y = c}^d P(y|z) dy"]].
+ * P( A or B ) = P(A) + P(B) - P(A intersects B). When A and B are disjoint (they can't both be true at the same time) then P(A intersects B) is 0 and so P( A or B ) = P(A) + P(B).
+ * Also, I've come across a small bug in the question (an 'off by 1' error) which means that the probabilities would be rather small if you worked them out. I'm going to leave the question as it is however - the mathematics is the same, even if we're now talking about somewhat improbable events.
diff --git a/aibo/autoreload.mdwn b/aibo/autoreload.mdwn
index 871048c..b799979 100644
--- a/aibo/autoreload.mdwn
+++ b/aibo/autoreload.mdwn
@@ -8,6 +8,8 @@ to use the branch that autoreloads any python file in the PyCode directory.
git pull
git merge origin/autoReloadPyCode
+ cd $ROBOCUP_DIR/robot
+ make
ins
to trigger the reload:
Homework 1 released
diff --git a/news/Homework1_2010_released.mdwn b/news/Homework1_2010_released.mdwn new file mode 100644 index 0000000..54a8e21 --- /dev/null +++ b/news/Homework1_2010_released.mdwn @@ -0,0 +1,6 @@ +Homework 1 for 2010 has been released. + +It is available here: [[/assignments/2010/Homework1.pdf]] +It is due at the start of next Wednesday's lecture. + +As this is the first year we've had these small homeworks, please talk to me if you have any questions! I want feedback.
Add the first homework assignment.
diff --git a/assignments/2010/Homework1.pdf b/assignments/2010/Homework1.pdf new file mode 100644 index 0000000..1ba9504 Binary files /dev/null and b/assignments/2010/Homework1.pdf differ
Stuff - intermediate commit to render some notes.
diff --git a/index.mdwn b/index.mdwn
index 1be02e5..f1f7fb1 100644
--- a/index.mdwn
+++ b/index.mdwn
@@ -84,18 +84,16 @@ There is no set text for this course. However, the following books are recommend
Assignments
-----------
-There are three assignments in this course. Details are in the [[assignment|assignments]] sheets. There will be two assignments on real robots and one written assignment. The robotics assignments also have a written component.
-Due dates are on the calendar section of the web page. Each assignment is worth equal marks.
+There are five assignments in this course; three large assignments worth 15% each, and two small assignments worth 5% each. Details of the large assignments are in the [[assignment|assignments]] sheets. There will be two assignments on real robots and one written assignment. The robotics assignments also have a written component.
+Due dates are on the calendar section of the web page.
Assessment
----------
- - Assignments: 45%
- - Quiz about Week 9: 10%
+ - Assignments: 55%
- Final exam: 45%
-Lectures and Assignments are similar between COMP3431 and COMP9431 students. I am required to make the the COMP9431 course 'harder' than COMP3431, and hence the exam is more in-depth for COMP9431. As I noted above, both courses are difficult.
-
+Lectures and Assignments are similar between COMP3431 and COMP9431 students.
Units of credit: This is a 6 UOC course
Calendar
diff --git a/lecture_plan.mdwn b/lecture_plan.mdwn
index ecba413..3d60d5a 100644
--- a/lecture_plan.mdwn
+++ b/lecture_plan.mdwn
@@ -9,6 +9,31 @@ See also the course [[calendar]].
Course Overview
Agent/Planning systems
+#### [[notes/Introduction_to_Bayesian_statistics]]
+#### [[notes/BayesianPrediction]]
+
+ What is a (Bayesian) probability?
+ What is Bayes' Rule?
+ How can you use Bayes' Rule to do sequence prediction?
+
+### Week 2 - 26/7
+
+#### [[notes/Utility_Theory]]
+#### [[notes/Bayesian_Agents]]
+
+ Representation
+ Simple probability distributions
+ Observability assumptions
+
+#### Lab (Level 3)
+
+ Intro to rUNSWift agent
+ Subversion
+ Compiling
+ Running
+ Base Station
+
+
#### [[notes/AIBO-Overview]]
rUNSWift overview
@@ -22,7 +47,7 @@ See also the course [[calendar]].
Flow Control between objects
Interfaces between objects
-### Week 2 - 26/7
+
#### [[notes/RobotVision]]
@@ -40,13 +65,6 @@ See also the course [[calendar]].
Non-Commutable Rotations
Recorded motions
-#### Lab (Level 3)
-
- Intro to rUNSWift agent
- Subversion
- Compiling
- Running
- Base Station
### Week 3 - 2/8
diff --git a/notes/BayesianLocalisationII.mdwn b/notes/BayesianLocalisationII.mdwn
index 6729902..6189001 100644
--- a/notes/BayesianLocalisationII.mdwn
+++ b/notes/BayesianLocalisationII.mdwn
@@ -19,7 +19,6 @@ Representations for Probability distributions:
* Basically the initial distribution is of the same class as the transition model (eg both gaussian)
* Normal (Gaussian) Distribution:
-
* [[!teximg code="f(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{-\frac{( x - \mu )^2}{2 \sigma^2}}"]]
* In multi-dimensions, mean becomes a vector and co-variance (measure of spread) becomes a matrix
diff --git a/notes/Introduction.mdwn b/notes/Introduction.mdwn
index 14c825d..098dc6d 100644
--- a/notes/Introduction.mdwn
+++ b/notes/Introduction.mdwn
@@ -7,7 +7,7 @@
* Aiming at top of class
* Discussion in class - need to take own notes - almost problem based learning
* Plagiarism policy
- * Systems, search, bayes
+ * Systems, search, Bayes
* Representation is important
* Agents building = system building
@@ -18,11 +18,18 @@
* Only as strong as weakest link
* Trade-offs between approaches
- * Approximation:
- * Take a machine learning course
+ * Perception:
* Bayes' Rule
+ * (and Take a machine learning course)
* Overview of Agent in world
+ * Sense/Act cycle (+reward)
+ * Definition of a history sequence
+
+ * Many assumptions/constraints to make things tractable
+ * My approach:
+ * Introduce the general theory
+ * Give specific examples, some simple, some complex
* Types of systems:
@@ -66,10 +73,3 @@
* Linear plan
* Telioreactive plan
-
- * Representation: (See [Chomsky Hierarchy](http://en.wikipedia.org/wiki/Chomsky_hierarchy) of Languages)
- * Raw states
- * Decomposed state space ( have list of variables - a coordinate system )
- * Propositional calculus (boolean set of variables)
- * First order (Predicate) calculus (relations)
- * Turing complete
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index c582c0a..e3d2e1b 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -31,12 +31,12 @@ Introduction to Bayesian Statistics
* Of those two worlds, X = 2 in one of them
* [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \;\&\; Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
* When talking about continuous worlds, where probability is defined over bounded sets, e.g. 1.1 < x < 1.2, we'll define the *probability density function* as the derivative of the probability. e.g. If I don't know exactly where I am, but I know I'm near x = 1.1, I might define a probability density x = Normal(1.1, 1). I need to integrate this over a range of x to get an actual probability. (The [Normal or Gaussian Distribution](http://en.wikipedia.org/wiki/Normal_distribution) is a probability density function that we'll see a fair bit.)
+ * Another way to consider this: Imagine we wanted to represent a probability distribution over contiguous sets of real numbers in [0,1]. We'll discretize the 0,1 line into *N* sections of width [[!teximg code="\Delta = \frac{1}{N}"]]. If we just stored the probability mass in each of these sections, then as [[!teximg code="N \rightarrow \infty"]], and [[!teximg code="\Delta \rightarrow 0"]] the probabilities, *P*, all drop to 0 - useless. So what we'll store is [[!teximg code="\frac{P}{\Delta}"]]. Now, as the buckets get smaller, that cancels and we end up with reasonable numbers. But these numbers are not probabilities, they are probability densities.
* If you have a distribution that does not sum/integrate to 1, it is usually possible to renormalise it. (This is using the term normalise similarly to the way vectors can be normalised to length of 1 (but we don't use the L2 norm to do so).) First the sum or integral over the entire space is calculated, and then the entire distribution is scaled by that value so that it now sums to one. This fails if the original sum was unbounded.
* *Normalisation* is a separate concept from the *Normal* or *Gaussian* distribution.
* If a probability distribution has a parameter that can meaningfully be summed (e.g. a numeric parameter is ok, an alphabetic on less so), then we can calculate an *expected value* for that parameter. [[!teximg code="E_{x} P = \sum_{x} x P(x)"]]
* To *marginalise* a variable, means to sum over all values of that variable. e.g. If we have a probability distribution defined with two variables, x and y, and we consider the probability of sets whose definition does not refer to x, e.g. (1.0 < y < 2.0), then those sets implicitly include all values of x.
-
Example Sets
------------
diff --git a/notes/Markov_Decision_Processes.mdwn b/notes/Markov_Decision_Processes.mdwn
new file mode 100644
index 0000000..0cf8bed
--- /dev/null
+++ b/notes/Markov_Decision_Processes.mdwn
@@ -0,0 +1,16 @@
+Partially Observable Markov Decision Processes
+==============================================
+
+Earlier we talked about models. Then I gave a vague definition about a model giving a probability distribution over observations and rewards at any given point in time. Now it's time to make that more concrete. I'm going to introduce something very similar to Partially Observable Markov Decision Processes (but slightly different).
+
+Let's assume that our model is a stochastic finite state machine. There will
+be six parts to this, [[!teximg code="<S, A, O, T, R, V>"]]. S is a finite set of states. A is a finite set of actions. O is a finite set of observations. Then we get the functions; T defines the probability distribution over next states given a state and an action. R defines the probability distribution over rewards given a state and an action, and V defines a probability distribution over observations given a state.
+
+e.g. imagine a 10 x 10 gridworld. That defines 100 states. We have four actions: N, S, E and W that, as we'll see, move us in the usual compass directions. We have 16 observations that correspond to 4 bits noting whether a wall is immediately North, South, East or West of the current state. T is the part of the model that tells us how the actions actually work. For any state without a wall in the given direction, we move in that direction with the appropriate action 90% of the time. 6% of the time (2% each) we move in one of the other directions, and 4% of the time we don't move. If there is a wall in a given direction, then trying to move in that direction leaves you where you are. The observation function, V, tells us which walls are immediately next to the current state, but has a 5% chance of flipping each bit. The reward is 1 in middle four squares in the room, and 0 elsewhere. There is a reward of -1 if you step into a wall.
+
+ * Discussion: Are walls part of the state? Why/Why not?
+
+Tracking the state
+-------------------
+
+In the section on [[BayesianPrediction]], models had to
diff --git a/notes/Representing_Probability_Distributions_I.mdwn b/notes/Representing_Probability_Distributions_I.mdwn
new file mode 100644
index 0000000..1aa296a
--- /dev/null
+++ b/notes/Representing_Probability_Distributions_I.mdwn
@@ -0,0 +1,75 @@
+Representing Probability Distributions
+======================================
+
+ * Note: this stuff can be viewed two ways
+ * Ways to combine simple distributions into complex distributions
+ * Ways to decompose complex distributions into simple distributions
+
+ * Remember: all probability distributions are just functions from sets to real numbers.
+ * Almost all probability distributions are functions from individual elements of the sets to real numbers.
+
+Three broad classes
(Diff truncated)
Remove old team name and reword
diff --git a/aibo/comp3431/GettingStarted.mdwn b/aibo/comp3431/GettingStarted.mdwn
index f8d8436..91c22f6 100644
--- a/aibo/comp3431/GettingStarted.mdwn
+++ b/aibo/comp3431/GettingStarted.mdwn
@@ -28,7 +28,7 @@ Note: if you modify .bashrc you'll have to re-open your terminal for changes to
### Setting up a git repository for a team
-Login one of the workstations in robolab by the username of one of your team members (e.g: group07)
+Login one of the workstations in robolab by the username of one of your team members
Make your team's bare repository with:
@@ -38,11 +38,11 @@ Now the other member can login to any of the workstations (or on their own lapto
git clone [username]@robolab.ai.cse.unsw.edu.au:git_repository trunk
-[username] is the account that you choose to keep the repository (e.g: group07)
+[username] is the account that you choose to keep the repository
#### Notes:
-You (group07) doesn't need to specify group07@robolab..., it's easier to do:
+If you are the person hosting the central storage for your team, you do not need to specify your own username in the git URL. You can do:
* check out from your own repository:
Note restart for login scripts to take effect
diff --git a/aibo/comp3431/GettingStarted.mdwn b/aibo/comp3431/GettingStarted.mdwn
index 47a64fb..f8d8436 100644
--- a/aibo/comp3431/GettingStarted.mdwn
+++ b/aibo/comp3431/GettingStarted.mdwn
@@ -24,6 +24,8 @@ You'll need to edit the login scripts to set some environment variables. Login
export ROBOCUP_DIR=~/trunk
export PATH=$PATH:${ROBOCUP_DIR}/bin:${ROBOCUP_DIR}/robot/bin
+Note: if you modify .bashrc you'll have to re-open your terminal for changes to take effect. If you modify your .profile, then you'll need to log out and log back in for changes to take effect.
+
### Setting up a git repository for a team
Login one of the workstations in robolab by the username of one of your team members (e.g: group07)
Remove old pointer to setup script
diff --git a/aibo/comp3431/GettingStarted.mdwn b/aibo/comp3431/GettingStarted.mdwn index ce75ac0..47a64fb 100644 --- a/aibo/comp3431/GettingStarted.mdwn +++ b/aibo/comp3431/GettingStarted.mdwn @@ -3,28 +3,6 @@ Getting Started with the rUNSWift AIBO system An older version of these notes is in [[aibo/GettingStarted]]. -### Automated Script for Setup - -**This script has not been updated for use with git** - -An auto setup script can be run from: - - /home/group09/public/cs3431_setup - -Notes: - -* Your existing ~/trunk directory will be deleted -* trunk will be checked out to ~/trunk -* Assumes your .bashrc does not already contain the required environmental variables -* Will compile code -* Provides a step by step guide to building/setting up a memory stick -* Will always setup a pForward - -There is another script that just performs compilation and memory stick copying in: - - /home/group09/public/new_stick - - ### Getting the code Use [git](http://git-scm.com/) to check out the code.
More
diff --git a/notes/BayesianPrediction.mdwn b/notes/BayesianPrediction.mdwn
index 142bb00..531e6cf 100644
--- a/notes/BayesianPrediction.mdwn
+++ b/notes/BayesianPrediction.mdwn
@@ -4,21 +4,35 @@ Bayesian Prediction
Background
----------
-Make sure you understand the [[Introduction_to_Bayesian_statistics]] first. Now we'll derive 'Bayes Rule'.
+Make sure you understand the [[Introduction_to_Bayesian_statistics]] first. Now we'll derive "Bayes' Rule".
* Venn diagram
- * [[!teximg code="P(A|B) = \frac{P(A \& B)}{P(B)}"]], and [[!teximg code="P(B|A) = \frac{P(A \& B)}{P(A)}"]], so [[!teximg code="P(A|B)P(B) = P(B|A)P(A)"]] and therefor [[!teximg code="P(A|B) = P(A)P(B|A)/P(B)"]]
+ * [[!teximg code="P(A|B) = \frac{P(A \& B)}{P(B)}"]], and [[!teximg code="P(B|A) = \frac{P(A \& B)}{P(A)}"]], so [[!teximg code="P(A|B)P(B) = P(B|A)P(A)"]] and therefor [[!teximg code="P(A|B) = \frac{P(A)P(B|A)}{P(B)}"]]
* Note that the above mathematics is true when A is a set of worlds or models and hence P(A) is a probability. It also holds when A is defined over a continuous space and so P(A) is a density rather than a probability.
* If the set A is parameterised, then we can do this for a whole function at the same time. e.g. Assume A stood for "Location is x", and B stood for "the last observation was O" (see diagram p 199 of Probabilistic Robotics)
* Then for each value of x, P(Location is x | last observation was O) = P(Location is x (regardless of the last observation)) P(last observation was O | Location was x) / P(last observation would have been O)
* Note that P(last observation would have been O) is a constant - ignore it for the moment.
* Note that P(Location is x | last observation was O), P(Location is x (regardless of the last observation)) and P(last observation was O | Location was x) are all functions of x - we could do the calculation for each value of x in parallel.
- * If [[!teximg code="f_1(x) = C_1e^(x-\mu_1)^2"]] and [[!teximg code="f_2(x) = C_2e^{(x-\mu_2)^2}"]] then [[!teximg code="f_1(x) \times f_2(x) = C_1e^{(x-\mu_1)^2} \times C_2e^(x-\mu_2)^2 = C_1C_2e^{(x-\mu_1)^2+(x-\mu_2)^2}"]]
+ * If [[!teximg code="f_1(x) = C_1e^{(x-\mu_1)^2}"]] and [[!teximg code="f_2(x) = C_2e^{(x-\mu_2)^2}"]] then [[!teximg code="f_1(x) \times f_2(x) = C_1e^{(x-\mu_1)^2} \times C_2e^{(x-\mu_2)^2} = C_1C_2e^{(x-\mu_1)^2+(x-\mu_2)^2}"]]
Prediction
----------
* The goal of Bayesian prediction is to predict the next observation from a sequence of such observations.
* We assume a class of models, *M*, which includes the true model, *t*.
+ * Each model will define the probability of each observation at each timestep.
* Define a probability distribution over those models; our subjective probability that each model is the true model.
- *
\ No newline at end of file
+ * Initially this could be a uniform distribution, or some sort of complexity prior (See [[!wikipedia Occam's_razor]]) that makes more complex models less likely
+ * At any point there are two obvious ways to make a prediction about the next observation:
+ * Choose the most likely model and predict what it predicts, or (this is fast)
+ * Use a weighted sum of the predictions of all the models. (this is more accurate)
+ * Note that models might make different predictions at different times.
+ * When we see an observation, we need to then update the probability distribution over the models given that distribution. Bayes' rule is used.
+ * [[!teximg code="P(m|o_t) = \frac{P(m)P(o_t|m)}{P(o_t)}"]], but the observation probability is a constant, so [[!teximg code="P(m|o_t) \propto P(m)P(o_t|m)"]], and you can renormalise to return that to a probability distribution.
+
+Examples
+--------
+
+ * Rocks of different types
+ * Lights flashing at different speeds
+
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index 258a7e6..c582c0a 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -5,11 +5,11 @@ Introduction to Bayesian Statistics
* Perception is inherently subjective
* If you get a different response from your sensors to someone else, then you'll believe something different from them.
* Bayesian Statistics are a way of numerically representing subjective uncertainty
- * [Cox's Theorem](http://en.wikipedia.org/wiki/Cox's_theorem)
+ * [[!wikipedia Cox's_theorem]]
* There are other ways of defining probability like objects, but they're either equivalent under a transform, or weird in some way.
* Probability theory basics (Another view of this is on p14 of Probabilistic Robotics)
* Divide the possible worlds into sets
- * Assign each set of possible worlds a number representing how likely the true world is in that set (could use [Measure theory](http://en.wikipedia.org/wiki/Measure_theory) here)
+ * Assign each set of possible worlds a number representing how likely the true world is in that set (could use [[!wikipedia Measure_theory]] here)
* We could think in terms of 'individual worlds' rather than sets of worlds, but that leads to problems with continuous spaces. We'll do this for discrete spaces though.
* No set of worlds has a negative probability; [[!teximg code="\forall X, P(X) \geq 0"]]
* The empty set has probability 0; [[!teximg code="P(\emptyset) = 0"]]
@@ -17,7 +17,7 @@ Introduction to Bayesian Statistics
* Other sets may also have probability 0
* The probability of the universal set is 1
* In a discrete universe, if we sum the probabilities of all the worlds then we get 1
- * In a continuous universe, the [Lebesgue integral](http://en.wikipedia.org/wiki/Lebesgue_integration) of the probabilities on the sets of worlds is 1
+ * In a continuous universe, use of [[!wikipedia Lebesgue_integration]] on the probabilities on the sets of worlds should give 1
* For *disjoint* sets A and B, [[!teximg code="P(A \; \text{or} \; B) = P( A \cup B ) = P( A ) + P( B )"]]
* When talking about a space possible worlds, we often use parameters to define individual worlds or sets of worlds
* e.g. If we have three possible corresponding to X = 1, 2 and 3, then we might write [[!teximg code="P(X = 2) = 0.2"]] to say the probability of the second world is 0.2.
@@ -31,6 +31,11 @@ Introduction to Bayesian Statistics
* Of those two worlds, X = 2 in one of them
* [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \;\&\; Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
* When talking about continuous worlds, where probability is defined over bounded sets, e.g. 1.1 < x < 1.2, we'll define the *probability density function* as the derivative of the probability. e.g. If I don't know exactly where I am, but I know I'm near x = 1.1, I might define a probability density x = Normal(1.1, 1). I need to integrate this over a range of x to get an actual probability. (The [Normal or Gaussian Distribution](http://en.wikipedia.org/wiki/Normal_distribution) is a probability density function that we'll see a fair bit.)
+ * If you have a distribution that does not sum/integrate to 1, it is usually possible to renormalise it. (This is using the term normalise similarly to the way vectors can be normalised to length of 1 (but we don't use the L2 norm to do so).) First the sum or integral over the entire space is calculated, and then the entire distribution is scaled by that value so that it now sums to one. This fails if the original sum was unbounded.
+ * *Normalisation* is a separate concept from the *Normal* or *Gaussian* distribution.
+ * If a probability distribution has a parameter that can meaningfully be summed (e.g. a numeric parameter is ok, an alphabetic on less so), then we can calculate an *expected value* for that parameter. [[!teximg code="E_{x} P = \sum_{x} x P(x)"]]
+ * To *marginalise* a variable, means to sum over all values of that variable. e.g. If we have a probability distribution defined with two variables, x and y, and we consider the probability of sets whose definition does not refer to x, e.g. (1.0 < y < 2.0), then those sets implicitly include all values of x.
+
Example Sets
------------
Bits and pieces
diff --git a/notes/BayesianLocalisationI.mdwn b/notes/BayesianLocalisationI.mdwn
index 0928e98..9d48300 100644
--- a/notes/BayesianLocalisationI.mdwn
+++ b/notes/BayesianLocalisationI.mdwn
@@ -10,4 +10,4 @@ Introduction to Bayesian localisation
* Sensor Model
* P(Sensor Output | world state)
- * Rock type example
\ No newline at end of file
+ * Rock type example
diff --git a/notes/BayesianPrediction.mdwn b/notes/BayesianPrediction.mdwn
index c3867f1..142bb00 100644
--- a/notes/BayesianPrediction.mdwn
+++ b/notes/BayesianPrediction.mdwn
@@ -13,7 +13,7 @@ Make sure you understand the [[Introduction_to_Bayesian_statistics]] first. Now
* Then for each value of x, P(Location is x | last observation was O) = P(Location is x (regardless of the last observation)) P(last observation was O | Location was x) / P(last observation would have been O)
* Note that P(last observation would have been O) is a constant - ignore it for the moment.
* Note that P(Location is x | last observation was O), P(Location is x (regardless of the last observation)) and P(last observation was O | Location was x) are all functions of x - we could do the calculation for each value of x in parallel.
- * If [[!teximg code="f_1(x) = C_1e^(x-\mu_1)^2"]] and [[!teximg code="f_2(x) = C_2e^{(x-\mu_2)^2}"]] then [[!teximg code="f_1(x) \cross f_2(x) = C_1e^{(x-\mu_1)^2} \cross C_2e^(x-\mu_2)^2 = C_1C_2e^{(x-\mu_1)^2+(x-\mu_2)^2}"]]
+ * If [[!teximg code="f_1(x) = C_1e^(x-\mu_1)^2"]] and [[!teximg code="f_2(x) = C_2e^{(x-\mu_2)^2}"]] then [[!teximg code="f_1(x) \times f_2(x) = C_1e^{(x-\mu_1)^2} \times C_2e^(x-\mu_2)^2 = C_1C_2e^{(x-\mu_1)^2+(x-\mu_2)^2}"]]
Prediction
----------
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index c6bf3af..258a7e6 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -17,7 +17,7 @@ Introduction to Bayesian Statistics
* Other sets may also have probability 0
* The probability of the universal set is 1
* In a discrete universe, if we sum the probabilities of all the worlds then we get 1
- * In a continuous universe, the [Lebesgue integral](http://en.wikipedia.org/wiki/Lebesgue_integration) of the probabilities on the worlds is 1
+ * In a continuous universe, the [Lebesgue integral](http://en.wikipedia.org/wiki/Lebesgue_integration) of the probabilities on the sets of worlds is 1
* For *disjoint* sets A and B, [[!teximg code="P(A \; \text{or} \; B) = P( A \cup B ) = P( A ) + P( B )"]]
* When talking about a space possible worlds, we often use parameters to define individual worlds or sets of worlds
* e.g. If we have three possible corresponding to X = 1, 2 and 3, then we might write [[!teximg code="P(X = 2) = 0.2"]] to say the probability of the second world is 0.2.
@@ -30,6 +30,7 @@ Introduction to Bayesian Statistics
* P(X=2,Y=2), P(X=3,Y=2)
* Of those two worlds, X = 2 in one of them
* [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \;\&\; Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
+ * When talking about continuous worlds, where probability is defined over bounded sets, e.g. 1.1 < x < 1.2, we'll define the *probability density function* as the derivative of the probability. e.g. If I don't know exactly where I am, but I know I'm near x = 1.1, I might define a probability density x = Normal(1.1, 1). I need to integrate this over a range of x to get an actual probability. (The [Normal or Gaussian Distribution](http://en.wikipedia.org/wiki/Normal_distribution) is a probability density function that we'll see a fair bit.)
Example Sets
------------
Start the Bayesian Prediction notes
diff --git a/notes/BayesianPrediction.mdwn b/notes/BayesianPrediction.mdwn
new file mode 100644
index 0000000..c3867f1
--- /dev/null
+++ b/notes/BayesianPrediction.mdwn
@@ -0,0 +1,24 @@
+Bayesian Prediction
+===================
+
+Background
+----------
+
+Make sure you understand the [[Introduction_to_Bayesian_statistics]] first. Now we'll derive 'Bayes Rule'.
+
+ * Venn diagram
+ * [[!teximg code="P(A|B) = \frac{P(A \& B)}{P(B)}"]], and [[!teximg code="P(B|A) = \frac{P(A \& B)}{P(A)}"]], so [[!teximg code="P(A|B)P(B) = P(B|A)P(A)"]] and therefor [[!teximg code="P(A|B) = P(A)P(B|A)/P(B)"]]
+ * Note that the above mathematics is true when A is a set of worlds or models and hence P(A) is a probability. It also holds when A is defined over a continuous space and so P(A) is a density rather than a probability.
+ * If the set A is parameterised, then we can do this for a whole function at the same time. e.g. Assume A stood for "Location is x", and B stood for "the last observation was O" (see diagram p 199 of Probabilistic Robotics)
+ * Then for each value of x, P(Location is x | last observation was O) = P(Location is x (regardless of the last observation)) P(last observation was O | Location was x) / P(last observation would have been O)
+ * Note that P(last observation would have been O) is a constant - ignore it for the moment.
+ * Note that P(Location is x | last observation was O), P(Location is x (regardless of the last observation)) and P(last observation was O | Location was x) are all functions of x - we could do the calculation for each value of x in parallel.
+ * If [[!teximg code="f_1(x) = C_1e^(x-\mu_1)^2"]] and [[!teximg code="f_2(x) = C_2e^{(x-\mu_2)^2}"]] then [[!teximg code="f_1(x) \cross f_2(x) = C_1e^{(x-\mu_1)^2} \cross C_2e^(x-\mu_2)^2 = C_1C_2e^{(x-\mu_1)^2+(x-\mu_2)^2}"]]
+
+Prediction
+----------
+
+ * The goal of Bayesian prediction is to predict the next observation from a sequence of such observations.
+ * We assume a class of models, *M*, which includes the true model, *t*.
+ * Define a probability distribution over those models; our subjective probability that each model is the true model.
+ *
\ No newline at end of file
Fix spacing in tex formula
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index 3f07dfb..c6bf3af 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -43,5 +43,5 @@ At this stage I haven't said anything about *how to use* probability distributio
* A multi-dimensional set of options (with a fixed dimensionality): I am between 170 and 171 cm tall, and you are between 180 and 181 cm tall.
* A variable-dimensional world. e.g. consider a 'stretch of road' to contain a number of cars. Each car has a position and a velocity. We can now consider sets of stretches of road. e.g. all stretches of road with a car between 10 and 11m from the end of the road.
* If we consider an agent, then its *history* of length *n* will be a sequence of action, observation pairs: [[!teximg code="h = a_1o_1a_2o_2a_3o_3\ldots{}a_no_n"]]. We could consider sets of histories, e.g. the set of histories where I had a feeling of just having woken up, I opened my eyes, I saw the ceiling, I looked down, and saw my bedroom, then ...
- * We can define what a valid logical formula is. Then we can consider sets of formulae, e.g. [[!teximg code="\mathrm{tasty}(p_1) \textrm{and} \mathrm{tasty}(p_2) \textrm{and} \mathrm{tasty}(p_3) \textrm{and} \forall_{p \in \mathrm{Pumkins}} \mathrm{tasty}(p)"]] (See <http://dx.doi.org/10.1007/s10472-009-9136-7>)
+ * We can define what a valid logical formula is. Then we can consider sets of formulae, e.g. [[!teximg code="\mathrm{tasty}(p_1) \; \textrm{and} \; \mathrm{tasty}(p_2) \; \textrm{and} \; \mathrm{tasty}(p_3) \; \textrm{and} \; \forall_{p \in \mathrm{Pumkins}} \; \mathrm{tasty}(p)"]] (See <http://dx.doi.org/10.1007/s10472-009-9136-7>)
* We could consider sets of Haskell programs. e.g. Sets of lazy Haskell functions of type [[!teximg code="\mathrm{history} \rightarrow \mathrm{boolean}"]] that don't return false when given a specific history.
Add examples of probability spaces.
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index 4c2e2a3..3f07dfb 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -30,3 +30,18 @@ Introduction to Bayesian Statistics
* P(X=2,Y=2), P(X=3,Y=2)
* Of those two worlds, X = 2 in one of them
* [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \;\&\; Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
+
+Example Sets
+------------
+
+At this stage I haven't said anything about *how to use* probability distributions. Let's just have a look at the sorts of things we can place probability distributions over.
+
+ * A small discrete set of options: This is either i) an apple pie, or ii) a peach pie.
+ * A continuous set of options: I am *x* cm tall, where *x* is a real number.
+ * Note that in practice you need to talk about ranges to define sets on continuous spaces: e.g. what is the probability I'm between 170 and 171cm tall.
+ * When talking about the numbers we integrate to get probabilities, we call them *probability densities*. As these are usually functions of some variable, they are also often called *probability density functions*.
+ * A multi-dimensional set of options (with a fixed dimensionality): I am between 170 and 171 cm tall, and you are between 180 and 181 cm tall.
+ * A variable-dimensional world. e.g. consider a 'stretch of road' to contain a number of cars. Each car has a position and a velocity. We can now consider sets of stretches of road. e.g. all stretches of road with a car between 10 and 11m from the end of the road.
+ * If we consider an agent, then its *history* of length *n* will be a sequence of action, observation pairs: [[!teximg code="h = a_1o_1a_2o_2a_3o_3\ldots{}a_no_n"]]. We could consider sets of histories, e.g. the set of histories where I had a feeling of just having woken up, I opened my eyes, I saw the ceiling, I looked down, and saw my bedroom, then ...
+ * We can define what a valid logical formula is. Then we can consider sets of formulae, e.g. [[!teximg code="\mathrm{tasty}(p_1) \textrm{and} \mathrm{tasty}(p_2) \textrm{and} \mathrm{tasty}(p_3) \textrm{and} \forall_{p \in \mathrm{Pumkins}} \mathrm{tasty}(p)"]] (See <http://dx.doi.org/10.1007/s10472-009-9136-7>)
+ * We could consider sets of Haskell programs. e.g. Sets of lazy Haskell functions of type [[!teximg code="\mathrm{history} \rightarrow \mathrm{boolean}"]] that don't return false when given a specific history.
Fix up smilie weirdness.
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
index 2ea2da8..4c2e2a3 100644
--- a/notes/Introduction_to_Bayesian_statistics.mdwn
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -18,7 +18,7 @@ Introduction to Bayesian Statistics
* The probability of the universal set is 1
* In a discrete universe, if we sum the probabilities of all the worlds then we get 1
* In a continuous universe, the [Lebesgue integral](http://en.wikipedia.org/wiki/Lebesgue_integration) of the probabilities on the worlds is 1
- * For *disjoint* sets A and B, [[!teximg code="P(A \text{or} B) = P(A \cup B) = P(A) + P(B)"]]
+ * For *disjoint* sets A and B, [[!teximg code="P(A \; \text{or} \; B) = P( A \cup B ) = P( A ) + P( B )"]]
* When talking about a space possible worlds, we often use parameters to define individual worlds or sets of worlds
* e.g. If we have three possible corresponding to X = 1, 2 and 3, then we might write [[!teximg code="P(X = 2) = 0.2"]] to say the probability of the second world is 0.2.
* You'll sometimes see X referred to as a 'random variable'. This isn't very meaningful when talking about Bayesian statistics.
@@ -29,4 +29,4 @@ Introduction to Bayesian Statistics
* Y = 2 in two of those worlds
* P(X=2,Y=2), P(X=3,Y=2)
* Of those two worlds, X = 2 in one of them
- * [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \& Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
+ * [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \;\&\; Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
Add an introduction to probability theory.
diff --git a/notes/Introduction_to_Bayesian_statistics.mdwn b/notes/Introduction_to_Bayesian_statistics.mdwn
new file mode 100644
index 0000000..2ea2da8
--- /dev/null
+++ b/notes/Introduction_to_Bayesian_statistics.mdwn
@@ -0,0 +1,32 @@
+Introduction to Bayesian Statistics
+===================================
+
+ * Perception is inherently uncertain
+ * Perception is inherently subjective
+ * If you get a different response from your sensors to someone else, then you'll believe something different from them.
+ * Bayesian Statistics are a way of numerically representing subjective uncertainty
+ * [Cox's Theorem](http://en.wikipedia.org/wiki/Cox's_theorem)
+ * There are other ways of defining probability like objects, but they're either equivalent under a transform, or weird in some way.
+ * Probability theory basics (Another view of this is on p14 of Probabilistic Robotics)
+ * Divide the possible worlds into sets
+ * Assign each set of possible worlds a number representing how likely the true world is in that set (could use [Measure theory](http://en.wikipedia.org/wiki/Measure_theory) here)
+ * We could think in terms of 'individual worlds' rather than sets of worlds, but that leads to problems with continuous spaces. We'll do this for discrete spaces though.
+ * No set of worlds has a negative probability; [[!teximg code="\forall X, P(X) \geq 0"]]
+ * The empty set has probability 0; [[!teximg code="P(\emptyset) = 0"]]
+ * We assume that the 'true world' is in our set
+ * Other sets may also have probability 0
+ * The probability of the universal set is 1
+ * In a discrete universe, if we sum the probabilities of all the worlds then we get 1
+ * In a continuous universe, the [Lebesgue integral](http://en.wikipedia.org/wiki/Lebesgue_integration) of the probabilities on the worlds is 1
+ * For *disjoint* sets A and B, [[!teximg code="P(A \text{or} B) = P(A \cup B) = P(A) + P(B)"]]
+ * When talking about a space possible worlds, we often use parameters to define individual worlds or sets of worlds
+ * e.g. If we have three possible corresponding to X = 1, 2 and 3, then we might write [[!teximg code="P(X = 2) = 0.2"]] to say the probability of the second world is 0.2.
+ * You'll sometimes see X referred to as a 'random variable'. This isn't very meaningful when talking about Bayesian statistics.
+ * We'll use | to mean 'given' as in [[!teximg code="P(X = 2 | Y = 2) = 0.66"]].
+ * [[!teximg code="P(A | B) = \frac{P(A \& B)}{P(B)}"]]
+ * Imagine we had 6 worlds
+ * P(X = 1, Y = 1) = 0.1, P(X=2, Y=1)=0.1, P(X=2,Y=2)=0.2, P(X=2,Y=3)=0.3, P(X=3,Y=2)=0.1, P(X=3,Y=3)=0.1, P(X=4,Y=3)=0.1
+ * Y = 2 in two of those worlds
+ * P(X=2,Y=2), P(X=3,Y=2)
+ * Of those two worlds, X = 2 in one of them
+ * [[!teximg code="P(X = 2 | Y = 2) = \frac{P(X = 2 \& Y = 2)}{P(Y=2)} = \frac{0.2}{0.3} = \frac{2}{3}"]]
Update dates in lecture plan for 2010.
Rename notes files by topic rather than lecture number.
Add link to CSE Calendars to calendar page.
Rename notes files by topic rather than lecture number.
Add link to CSE Calendars to calendar page.
diff --git a/calendar.mdwn b/calendar.mdwn
index 1cbc1dd..2ef9d91 100644
--- a/calendar.mdwn
+++ b/calendar.mdwn
@@ -1,7 +1,7 @@
Robot Software Architectures Calendar
=====================================
-I have a [Google Calendar](http://www.google.com/calendar/) with relevant details for this class. The [ics file](http://www.google.com/calendar/ical/n3h9l9ndqch3j6dj41gagf9oqo%40group.calendar.google.com/public/basic.ics) is available if you want to subscribe.
+I have a [Google Calendar](http://www.google.com/calendar/) with relevant details for this class. The [ics file](http://www.google.com/calendar/ical/n3h9l9ndqch3j6dj41gagf9oqo%40group.calendar.google.com/public/basic.ics) is available if you want to subscribe. I also highly recommend the set of [CSE calendars](http://www.cse.unsw.edu.au/people/studentoffice/calendar/) which include the UNSW academic calendar and a calendar that tells you UNSW week numbers.
<iframe src="http://www.google.com/calendar/embed?src=n3h9l9ndqch3j6dj41gagf9oqo%40group.calendar.google.com&ctz=Australia/Sydney" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
diff --git a/lecture_plan.mdwn b/lecture_plan.mdwn
index f05af1e..ecba413 100644
--- a/lecture_plan.mdwn
+++ b/lecture_plan.mdwn
@@ -1,17 +1,15 @@
-Dates for Semester 2, 2009.
+Dates for Semester 2, 2010.
-*These are in the process of being updated for Semester 2 2010*.
See also the course [[calendar]].
+### Week 1 - 19/7
-### Week 1 - 20/7
-
-#### [[notes/Lecture1A]]
+#### [[notes/Introduction]]
Course Overview
Agent/Planning systems
-#### [[notes/Lecture1B]]
+#### [[notes/AIBO-Overview]]
rUNSWift overview
Aperios
@@ -24,16 +22,16 @@ See also the course [[calendar]].
Flow Control between objects
Interfaces between objects
-### Week 2 - 27/7
+### Week 2 - 26/7
-#### [[notes/Lecture2A]]
+#### [[notes/RobotVision]]
Robot Vision
Colour segmentation
Blobbing
High level concepts
-#### [[notes/Lecture2B]]
+#### [[notes/Kinematics]]
Motion (low level)
Head Control
@@ -50,15 +48,15 @@ See also the course [[calendar]].
Running
Base Station
-### Week 3 - 3/8
+### Week 3 - 2/8
-#### [[notes/Lecture3A]]
+#### [[notes/BayesianLocalisationI]]
Tracking
Bayesian Localization I
Tabular representation
-#### [[notes/Lecture3B]]
+#### [[notes/BayesianLocalisationII]]
Tracking
Bayesian Localization II
@@ -71,16 +69,16 @@ See also the course [[calendar]].
Assignment 1 out at end of lab (Tracking & Life Saver)
Assignment 3 out at end of lab (Grab Ball - get to other half of field)
-### Week 4 - 10/8
+### Week 4 - 9/8
-#### [[notes/Lecture4A]]
+#### [[notes/BayesianLocalisationIII]]
Finish Tracking
Information form Kalman Filters
SLAM
Expectation Maximisation if time
-#### [[notes/Lecture4B]]
+#### [[notes/Walking]]
Motion (Walking)
Walking
@@ -93,9 +91,9 @@ See also the course [[calendar]].
Go To Point
Experiments with tracking (odom/obs, bad mean/var)
-### Week 5 - 17/8
+### Week 5 - 16/8
-#### [[notes/Lecture5A]]
+#### [[notes/AIBO_Behaviour_and_Comms]]
Wireless
UDP vs TCP
@@ -104,7 +102,7 @@ See also the course [[calendar]].
Hierarchies
Software Engineering and State
-#### [[notes/Lecture5B]]
+#### [[notes/Agent_Architectures]]
Agent Architectures
Engineered (subsumption)
@@ -116,16 +114,16 @@ See also the course [[calendar]].
Work on Assignment 1
-### Week 6 - 24/8
+### Week 6 - 23/8
-#### [[notes/Lecture6A]]
+#### [[notes/SearchI]]
Introduction to Search
BFS/DFS
A*
Islands
-#### [[notes/Lecture6B]]
+#### [[notes/SearchII]]
Further search - heuristics
Mixing Search and Heuristics (Korf)
@@ -135,16 +133,16 @@ See also the course [[calendar]].
Assignment 1 graded in lab
-### Week 7 - 31/8
+### Week 7 - 30/8
-#### [[notes/Lecture7A]]
+#### [[notes/Overview_and_Models]]
Reinforcemnt Learning
Style of problem
Optimality criteria
Exploration/Exploitation trade-off
-#### [[notes/Lecture7B]]
+#### [[notes/PlaningI]]
Planning
State Space search
@@ -153,11 +151,11 @@ See also the course [[calendar]].
A*/Islands/Heuristics
-### Mid Semester Break - 7/9
+### Mid Semester Break - 6/9
-### Week 8 - 14/9
+### Week 8 - 13/9
-#### [[notes/Lecture8A]]
+#### [[notes/MDP]]
Markov Decision Processes
Formal definition
@@ -168,7 +166,7 @@ See also the course [[calendar]].
Q-learning
Adaptive Heuristic Critic
-#### [[notes/Lecture8B]]
+#### [[notes/PlanningII]]
Planning
Plan space planning
@@ -177,15 +175,15 @@ See also the course [[calendar]].
Work on Assignment 3
-### Week 9 21/9
+### Week 9 20/9
-#### [[notes/Lecture9A]]
+#### [[notes/Discretization]]
Applying discrete search to continuous problems
Obstacle expansion
Different representations
-#### [[notes/Lecture9B]]
+#### [[notes/OptimizationI]]
(Diff truncated)
Add another link to the calendar.
diff --git a/lecture_plan.mdwn b/lecture_plan.mdwn index 78c31b9..f05af1e 100644 --- a/lecture_plan.mdwn +++ b/lecture_plan.mdwn @@ -1,6 +1,8 @@ Dates for Semester 2, 2009. *These are in the process of being updated for Semester 2 2010*. +See also the course [[calendar]]. + ### Week 1 - 20/7
Add a link to the calendar
diff --git a/index.mdwn b/index.mdwn index 2553bca..1be02e5 100644 --- a/index.mdwn +++ b/index.mdwn @@ -98,6 +98,11 @@ Lectures and Assignments are similar between COMP3431 and COMP9431 students. I Units of credit: This is a 6 UOC course +Calendar +-------- + +The course [[calendar]] is available online. + Plagiarism ----------
Add link to Google Calendar.
diff --git a/calendar.mdwn b/calendar.mdwn new file mode 100644 index 0000000..1cbc1dd --- /dev/null +++ b/calendar.mdwn @@ -0,0 +1,7 @@ +Robot Software Architectures Calendar +===================================== + +I have a [Google Calendar](http://www.google.com/calendar/) with relevant details for this class. The [ics file](http://www.google.com/calendar/ical/n3h9l9ndqch3j6dj41gagf9oqo%40group.calendar.google.com/public/basic.ics) is available if you want to subscribe. + +<iframe src="http://www.google.com/calendar/embed?src=n3h9l9ndqch3j6dj41gagf9oqo%40group.calendar.google.com&ctz=Australia/Sydney" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe> +
Test change
diff --git a/lecture_plan.mdwn b/lecture_plan.mdwn index 2c169e8..78c31b9 100644 --- a/lecture_plan.mdwn +++ b/lecture_plan.mdwn @@ -1,4 +1,6 @@ -Dates for Semester 2, 2009. *These are in the process of being updated for Semester 2 2010*. +Dates for Semester 2, 2009. + +*These are in the process of being updated for Semester 2 2010*. ### Week 1 - 20/7
diff --git a/lecture_plan.mdwn b/lecture_plan.mdwn index f6acf2d..2c169e8 100644 --- a/lecture_plan.mdwn +++ b/lecture_plan.mdwn @@ -1,4 +1,4 @@ -Dates for Semester 2, 2009. +Dates for Semester 2, 2009. *These are in the process of being updated for Semester 2 2010*. ### Week 1 - 20/7
diff --git a/aibo/autoreload.mdwn b/aibo/autoreload.mdwn
index 1bd582e..871048c 100644
--- a/aibo/autoreload.mdwn
+++ b/aibo/autoreload.mdwn
@@ -4,6 +4,13 @@ to use the branch that autoreloads your python player. note that it only reload
git merge origin/autoReloadPlayer
ins
+to use the branch that autoreloads any python file in the PyCode directory.
+
+ git pull
+ git merge origin/autoReloadPyCode
+ ins
+
to trigger the reload:
- dog_upload_python <ip suffix> <p player name .py>
+ cd $ROBOCUP_DIR/robot/PyCode
+ dog_upload_python <ip suffix> <filename.py>