Showing posts with label star wars. Show all posts
Showing posts with label star wars. Show all posts

Saturday, 23 January 2016

Northamptonshire Raspberry Jam - 16th April 2016

 PiJam event on Saturday 16th April 2016, in Newton Building, University of Northampton, NN2 6JB.

This is a free event, open to those who either want to found out more about the Raspberry Pi; want to share with others what they have done with the Pi; or just want to talk with others about them. Most of all (I hope) to have some fun.

The event has been supported by the University of Northampton providing the rooms.

Tickets (Free) are available at: https://www.eventbrite.com/e/northamptonshire-raspberry-jam-tickets-20886649531

Examples of possible 'show and tell ' items include:

-Minecraft running on a Raspberry Pi with movement controlled with gesture control of an Star Wars styled X-Wing




- Raspberry Pi controlling a 'junk robot'



More updates to follow. 

Tickets (Free) are available at: https://www.eventbrite.com/e/northamptonshire-raspberry-jam-tickets-20886649531

If you'd like to find out more about Computing at the University of Northampton go to: www.computing.northampton.ac.uk. All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with

Friday, 8 January 2016

mini-project:Social Network analysis - fun, informative

The second in the occasional series of mini-computing projects by people in Northamptonshire.


Part of this was originally posted at: http://scottjturnerranting.blogspot.co.uk/2015/12/social-network-analysis-fun-and.html

figure 1. #StarWars 30/12/15
Playing with Socioviz (socioviz.net) - a free online tool for looking at influence on twitter. The image to left show connections between tweeters using the hashtag #StarWars on the 30th December 2015 up to 6pm (GMT).

Figure 2 shows the most active tweeters for this hashtag and the most influential based on Retweets and Mentions - the four greatest influencers are picked out in the video below, showing the map evolving (speed-up 20 times).

 

figure 2
To experiment with this a bit more +The Royal Institution  has a long traditional of holding a series of Christmas Lectures  which are now televised, Dr Kevin Fong presented this years. I was curious about who the biggest influencers on twitter were for the hashtag #xmaslectures over the three days of the show. The three biggest influencers came out as  , the presenter, the host organisation and one of the main guests (had to present virtually as he is on the ISS at the time of writing). The figure below shows the centre of the graph were the majority of the connections.

figure 3 #xmaslectures


To read more about this go to the tutorial by Alessandro Zonin https://alessandrozonin.wordpress.com/2015/02/20/socioviz-a-free-social-network-analysis-tool-for-twitter/.


Another example of used it for is plotting a particular tweetchat (based on hashtag) and seeing if there were groupings within the data. There was for this particular chat.
figure 4 plotting a tweetchat


Looking at certain an institution's considerable twitter links (@UniNorthants) below over a one month period (8/12/2015-8/1/2016). Different types of groups and links between groups example shown in figures 6 and 7.
figure 5 organisations twitter connections over a month






figure 6 same organisation just focussing on one group
figure 7 links between groups

All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with

Wednesday, 6 January 2016

mini-project: Gestures controlling a Minecraft X-wing

This post is part of an occasional series of post about Computing projects carried out by people within Northamptonshire. 

This posts looks at combining Raspberry Pi, gesture control and Star Wars in  Minecraft.

figure 1


This post builds on an earlier project to get a simple X-Wing into Minecraft on a Raspberry Pi.  The goal was get Python to build and move the X-Wing. Details of this project can be found here.

In this post the additional of Pirmoroni's Skywriter HAT included to allow movements of a hand to enable the X-Wing to take-off, land, move forward or backward.

It builds on ideas from the book Adventures in Minecraft on using Python and Minecraft with a Raspberry Pi.


figure 2
The Skywriter is a Raspberry Pi HAT (see figure 2) that allows positional information of the hand just above the board to detected. In this project it is detecting flicks of the hand up, down, or across the board to determine the direction of motion (see video above)

Before you start, to use the Skywriter, in the terminal you need to add curl -sSL get.pimoroni.com/skywriter | bash

Now we can start building. To start with we just placed the X-Wing above the player by placing blocks in the shape (roughly) of the X-Wing based around the method MinecraftShape (see Chapter 8 of Adventures in Minecraft ).



figure 3
  • Find the position of the player;
  • To avoid building on top the player the starting position of the X-Wing is set by:
    • add 5 to the x position of the player;
    • add 10 to the y position of the player(The bit I have to keep reminding myself is the y-axis is vertical.);
    • add 5 to the z position of the player;
  • Using these values build using, Wool blocks, the X-Wing - 0 for white, and 14 for red blocks;
  • If a flick starts at the top of the board (or "north") this moves the X-Wing down towards the ground;
  • If a flick starts at the bottom of the board (or "south") this moves the X-Wing vertically up;
  • If a flick starts on the right of the board (or "east") the X-Wing moves backwards horizontally;
  • if a flick starts on the left of the board (or "west") the X-Wing moves forward.
    from mcpi.minecraft import Minecraft
    from mcpi import block
    import mcpi.minecraftstuff as minecraftstuff
    import time
    import skywriter
    import signal

    mc=Minecraft.create()
    xPos=mc.player.getTilePos()
    xPos.x=xPos.x+5
    xPos.y=xPos.y+5
    xPos.z=xPos.z+5

    xWingBlocks=[
    minecraftstuff.ShapeBlock(0,0,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(-1,0,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(-2,0,0,block.WOOL.id,14),
    minecraftstuff.ShapeBlock(-3,0,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(1,0,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(0,1,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(1,1,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(2,0,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(2,1,0,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(1,2,-1,block.WOOL.id,14),
    minecraftstuff.ShapeBlock(1,2,1,block.WOOL.id,14),
    minecraftstuff.ShapeBlock(1,-1,-1,block.WOOL.id,14),
    minecraftstuff.ShapeBlock(1,-1,1,block.WOOL.id,14),
    minecraftstuff.ShapeBlock(1,3,-2,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(1,3,2,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(1,-2,-2,block.WOOL.id,0),
    minecraftstuff.ShapeBlock(1,-2,2,block.WOOL.id,0)]

    xWingShape=minecraftstuff.MinecraftShape(mc,xPos,xWingBlocks)

    @skywriter.flick()
    def flick(start,finish):
      if start=="south":
        for count in range(1,10):
          time.sleep(0.1)
          xWingShape.moveBy(0,1,0)
      if start=="west":
        for count in range(1,10):
          time.sleep(0.1)
          xWingShape.moveBy(-1,0,0)
      if start=="east":
        for count in range(1,10):
          time.sleep(0.1)
          xWingShape.moveBy(1,0,0)
      if start=="north":
        for count in range(1,10):
          time.sleep(0.1)
          xWingShape.moveBy(0,-1,0)
    signal.pause()

    Main text is adapted with permission from a post originally posted on http://robotsandphysicalcomputing.blogspot.co.uk/




    All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with