Adventures in tech 

Home 2D Robot

2D red-and-green Robot by Anna Chiara Bellini

This is a very simple implementation of the 2D robot of homework 1-4

I’d rather put the fun on top, so the documentation, help, notes and whatever is just below (scroll the page)

Updated: I’v patched the Skulpt code so that you can use booleans as integers and that the % operator works correctly for negative left hand operator

If you like this, please leave a comment in my CS373 forum post
and vote my question up to give me some Karma :-)

Update March, 6th 2012: I added a couple of buttons to load either the default homework code, without the implemented functions, or the full code that solves the problem. If you want to just play around with it, press the button next to Load the solved code and you’re done.

Have fun

Anna Chiara

Probability distribution of homework 1.4

This is the grid that you should get for the homework

Testing your code

Paste your Python code in the textarea then press “run” to see the world and the probability distribution.If you print from Python you can see the output below the textarea.If you have defined correctly the two functions:

move(p, U)

and

sense(p, Z)

then the world will show your p in the cell borders: the darker the border, the higher the
probability p[i][j].

Dropping a robot at random

You can also drop a robot at random in the world: press “RANDOM POSITION”.
The robot will drop anywhere in the world and will sense its cell colour, according to “sensor_right”
(which may be wrong according to the value of sensor_right).

The sensed colour is in the “sensor” box near the buttons.

A single cell with an “O” will mark the real robot location, while the cell border colour represents its belief state.

Move the robot with the arrows and see how the belief changes.

Notes:

The Python interpreter is from the project Skulpt, you may refer to their website for info: http://skulpt.org. I’ve patched it a bit so that you can add booleans to integers and that you get consistent results with the % operator.

Disclaimer

This is just a test, it doesn’t mean to be beautiful or bug free or fit for anything but my own study. It’s not a product or a service and is not supported. If you like it, I’m very happy and just vote my post up in the Udacity CS373 forum. Nevertheless, this is my code, you are free to copy, modify and do whatever you like for your own study, but for nothing more than that.

Thanks

3 Responses

  1. As a Newbie, I am always exploring online for articles that can help me. Thank you

  2. Thanks for writing this. Brief question, if you don’t object. Where did you grab your webpage template? I will be establishing a blog and appreciate yours.

    • Anna Chiara

      Hi, sorry for the very late reply! I’ve been off of this blog in the past few months. The blog is based on wordpress, I downloaded the “cyberchimps’ iFeature” theme, but I customized it a little. Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Anna Chiara Bellini 2012-2013