Robots and getting computers to work with the physical world is fun; this blog looks at my own personal experimenting and building in this area.
Saturday 2 May 2020
Programming Robots Virtually 3: LEGO EV3
In this series of posts, I am going to look at experimenting with a few tools that allow robots to be simulated, programmed, these are ideally web-based, free and simple to use. In this post,the focus is on one that has been around for a while Makecode for the LEGO Mindstorms EV3 robotics kit available at https://makecode.mindstorms.com/#editor another example of the flexible MakeCode format. A very useful guide to using this coding tool is available at https://makecode.com/blog/lego/05-15-2018
This time it does not give you a built robot but a programmable simulation of the Brick, all the sensors and motors; which it automatically connects together depending on the code (see above). I like this idea it means it is flexible, as well as encouraging thinking about the design and operations of the programs before trying it out physically.
So to experiment with it. I played with a number of elements:
When touch sensor is pressed (looks like a box with a cross on it) drive one of the motors forward, when that sensor is released the motor reverses. Following this I added the ultrasonic sensor (the one that looks like two eyes); when an object is near (controlled in the simulator by moving the slider upwards), the motors B and C rotate 5 times. The code is relatively easy and can be seen below.
Now to play with the brick itself. The first operation, is when it starts add a 'mood' set of wide-open eyes in this case, on the Bricks screen, when the enter button [the central button on the brick], show a happy face on the screen, wait and add a purring sound and write Be Happy on screen. Lastly when Red (a set of pressable colours appears near the sensor) is detected using the colour sensor put an expression on screen and when blue detected put a closed-eyed expression on screen (the code is shown below and all the code at https://makecode.com/_016aUf2YtDx6 might need to change it to blocks by changing a tab at the top of the screen)
Opinion.
I like Makecode anyway, but I think this is another good use of it. There is no installation needed to run the code and simulator and no LEGO has to be bought. If you have a Mindstorms EV3 kit, you can download your code to a physical EV3 robot (or whatever you have built using EV3). I would love to see in the comments what people have done with it as well.
Play with it yourself below:
The code used is available at https://makecode.com/_016aUf2YtDx6
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Thursday 30 April 2020
10 most views post on Robots and Physical Computing Blog- April 2020
- BBC Mirco Bot site https://www.8bitkick.cc/bbc-micro-bot.html - where you tweet @bbcmicrobot and run BBC Basic code on BBC Micro emulator. It returns a video of your code running.
- For a number of years, I have been playing with robots as a means of developing programming/coding skills with students.
- This is the second of a planned occasional series of posts on playing with some of the current AI specific add-on processors for Intenet of things (IoT)
- In this series of posts, I am going to look at experimenting with a few tools that allow robots to be simulated, programmed
- Guest Blogger Hiren Mistry, Nuffield Research Placement Student working at the University of Northampton. How to use a PS3 Controller to...
- I was lucky recently to invited to participate in a podcast on wide-ranging topics
- This is the third of a planned occasional series of posts on playing with some of the current AI specific boards for Intenet of Things
- In a previous post I looked at controlling the Kitronik :Move buggy using Javascript based blocks .
- In a previous post, Adafruit Circuit Playground reacting to music (updated with simulator) using vibrations to change the RGB of pixels .
- This is really part two of a set of post in response to a question from Carl Simmons ( @Activ8Thinking ) concerning building a microbit neura network
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Sunday 26 April 2020
Programming Robots Virtually 2: iRobot Simulator
In this series of posts, I am going to look at experimenting with a few tools that allow robots to be simulated, programmed, ideally web-based, free and simple to use. In this post, I am looking at iRobots recently released free tool that can be used on computers, tablets and phone to program a simulated iRobot Root robot targetted at educational use.
The initial inspiration for looking at this was through an IEEE Spectrum online article; the tool is web-based app and can be found at https://code.irobot.com/#/
In my opinion, it's most interesting feature is the same code can be written in three different ways. The codes below were the same thing (touch the left sensor turns and draws left, similarly for the right sensor; and lastly when front bump sensor touched it moves forward and plays a C) on all three levels. You only need to write it in one and it is usually available in all three levels, potentially good for transitioning between levels of challenge?
Level 2 is a graphical, drag and drop blocks programming language in the same vein as Scratch and makecode
Resources
Learning library https://edu.irobot.com/learning-library is available but you need a code to access some of the resources.
My view so far
If you want a tool to use with very small children using Level 1, through more flexibility using Level 2 to text-based using Level 3. Nice, as the same tool can be used at different levels. It does simulate a real robot iRobot Root coding robot see https://www.irobot.co.uk/root for more details.
This might be of interest
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
The initial inspiration for looking at this was through an IEEE Spectrum online article; the tool is web-based app and can be found at https://code.irobot.com/#/
In my opinion, it's most interesting feature is the same code can be written in three different ways. The codes below were the same thing (touch the left sensor turns and draws left, similarly for the right sensor; and lastly when front bump sensor touched it moves forward and plays a C) on all three levels. You only need to write it in one and it is usually available in all three levels, potentially good for transitioning between levels of challenge?
Level 1 is based around connecting icons together, aimed at young children
Level 2 is a graphical, drag and drop blocks programming language in the same vein as Scratch and makecode
Level 3 is a more traditional text-based programming language currently it is Swift; their website suggest other programming languages may be coming soon.
Resources
Learning library https://edu.irobot.com/learning-library is available but you need a code to access some of the resources.
My view so far
If you want a tool to use with very small children using Level 1, through more flexibility using Level 2 to text-based using Level 3. Nice, as the same tool can be used at different levels. It does simulate a real robot iRobot Root coding robot see https://www.irobot.co.uk/root for more details.
This might be of interest
- VEX Robot simulator and programming environment post : https://robotsandphysicalcomputing.blogspot.com/2020/04/programming-robots-virtually-1-vexcode.html
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Saturday 25 April 2020
Programming Robots Virtually 1 - VEXcode VR
For a number of years, I have been playing with robots as a means of developing programming/coding skills with students. The problem is when classes get larger or it is used as part of an assessment there is very rarely enough robots to satisfy all the students Turner and Hill (2008). So
therefore, the search has been on for a tool that allows robots to be simulated, programmed, ideally web-based, free and simple to use. Lately, a number of interesting tools have arisen. In this series of posts, I am going to look at experimenting with a few of them. In this post, starting by looking at VEXCode VR - available at https://vr.vex.com/.
VEXcode VR https://vr.vex.com/ from VEX Robotics (https://www.vexrobotics.com/) is a simulator and programming tool for their Scratch-like programming tool VEXCode - at the time of writing is free. If you can do Scratch this is a nice next stage, consisting of the simulator (playground) and the programming environment (see below and the video above.)
Playgrounds
These are the simulated environments you can select from, with a two camera-views; downward camera for overhead view and angled camera to give a 3D view (as shown in the video) via buttons on the bottom right hand side of the playground. Also you can toggle, using the third button on the right hand side, the ability to see the status of the various sensors. There are a number of different playgrounds to play with. In this post I am going to use two of them
Example 1: The Square
Using the Grid Map playground and angled camera. I wanted to start with a stand-by; getting the robot to move in a square. The robot moves forward for 30mm and then turns right 90 degrees; and this is repeated 4 times (see below)
So the commands are very scratch-like. I was impressed, the 3D gave a clear view it in action, the commands were intuitive and (yes repeating myself) very easy to transfer to from Scratch.
Example 2: Playing with Sensors a bit
Now for more fun, getting it to react to the environment a bit; by changing the Playground to Castle Crasher you get an environment that has simulated blocks and red perimeter to interact with. As you would hope, there are sensing blocks including LeftBumper and RightBumper - no guesrss for what they do and DownEye which can detect the red line. The code is simple and shown below, based on detecting the block using the bumpers, move to the side and recheck if (shown below) is if a block is in-front and if not go forward. If it finds the red line reverse back and rotates 180 degrees.
As a side project I wondered what would happen if you didn't put code in to detect the red line, how would it cope with falling off the surface; it simulates it quite well showing it falling off which quite fun. One mistake I made initially is accidentally selecting the wrong form of turning action rotating when it should have been a turn.
Overview so far...
If you can already use movement, sensing and control blocks in Scratch, you can do this. Has potential as a source of online activity's, especially as the time of writing in the UK we are 'social-distancing'. In their paper Turner and Hill (2008) also highlighted that robots are a difficult resource to manage for a large class; this kind of option allows simulation and programming of a robot to be tried out without actually having the robot. Most importantly it is fun.
Reference
Turner S and Hill G(2008) "Robots within the Teaching of Problem-Solving" ITALICS vol. 7 No. 1 June 2008 pp 108-119 ISSN 1473-7507 https://doi.org/10.11120/ital.2008.07010108
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
therefore, the search has been on for a tool that allows robots to be simulated, programmed, ideally web-based, free and simple to use. Lately, a number of interesting tools have arisen. In this series of posts, I am going to look at experimenting with a few of them. In this post, starting by looking at VEXCode VR - available at https://vr.vex.com/.
VEXcode VR https://vr.vex.com/ from VEX Robotics (https://www.vexrobotics.com/) is a simulator and programming tool for their Scratch-like programming tool VEXCode - at the time of writing is free. If you can do Scratch this is a nice next stage, consisting of the simulator (playground) and the programming environment (see below and the video above.)
Playgrounds
These are the simulated environments you can select from, with a two camera-views; downward camera for overhead view and angled camera to give a 3D view (as shown in the video) via buttons on the bottom right hand side of the playground. Also you can toggle, using the third button on the right hand side, the ability to see the status of the various sensors. There are a number of different playgrounds to play with. In this post I am going to use two of them
Example 1: The Square
Using the Grid Map playground and angled camera. I wanted to start with a stand-by; getting the robot to move in a square. The robot moves forward for 30mm and then turns right 90 degrees; and this is repeated 4 times (see below)
Example 2: Playing with Sensors a bit
Now for more fun, getting it to react to the environment a bit; by changing the Playground to Castle Crasher you get an environment that has simulated blocks and red perimeter to interact with. As you would hope, there are sensing blocks including LeftBumper and RightBumper - no guesrss for what they do and DownEye which can detect the red line. The code is simple and shown below, based on detecting the block using the bumpers, move to the side and recheck if (shown below) is if a block is in-front and if not go forward. If it finds the red line reverse back and rotates 180 degrees.
As a side project I wondered what would happen if you didn't put code in to detect the red line, how would it cope with falling off the surface; it simulates it quite well showing it falling off which quite fun. One mistake I made initially is accidentally selecting the wrong form of turning action rotating when it should have been a turn.
Overview so far...
If you can already use movement, sensing and control blocks in Scratch, you can do this. Has potential as a source of online activity's, especially as the time of writing in the UK we are 'social-distancing'. In their paper Turner and Hill (2008) also highlighted that robots are a difficult resource to manage for a large class; this kind of option allows simulation and programming of a robot to be tried out without actually having the robot. Most importantly it is fun.
Reference
Turner S and Hill G(2008) "Robots within the Teaching of Problem-Solving" ITALICS vol. 7 No. 1 June 2008 pp 108-119 ISSN 1473-7507 https://doi.org/10.11120/ital.2008.07010108
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Friday 3 April 2020
BBC micro bot - tweeting BBC Basic (updated)
I assume others have been playing with it for a while, but yesterday I can across the BBC Mirco Bot site https://www.8bitkick.cc/bbc-micro-bot.html - where you tweet @bbcmicrobot and run BBC Basic code on BBC Micro emulator. It returns a video of your code running.
For those of us, who either had (I didn't - ahh) or wanted a BBC Micro (that is me) it is a cool thing; combining tweeting and programming on one go.
I had a go yesterday
This was returnedLast try@bbcmicrobot— Dr Scott Turner (@scottturneruon) April 2, 2020
10 REM Area of a circle
20 Radius=5
30 MODE 8
40 FOR loop=1 TO 20
50 MOVE 150,200
60 PLOT 145,Radius*loop,0
70 NEXT
80 RUN
— BBC Micro 🦉 bot (@bbcmicrobot) April 2, 2020
Have a go it is fun.
@bbcmicrobot— Dr Scott Turner (@scottturneruon) April 12, 2020
10 MODE 18
15 FOR i=1 TO 15
20 COLOUR 128+i
30 PRINT TAB(29,10);"Twitterchats Rock "
50 PRINT TAB(36,10);"#LTHEchat #CASChat"
70 NEXT i
— BBC Micro 🦉 bot (@bbcmicrobot) April 12, 2020All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Wednesday 11 March 2020
Podcast physical computing, IoT, Industry 4.0 and others
I was lucky recently to invited to participate in a podcast on wide-ranging topics with Drs Michael Opuku Agyeman and Triantafyllos Kanakis. The discussion roamed around computing, physical aspects of computing, social benefits of technologies, industry 4.0, our research and a whole lot more. Good fun.
The podcast can be found below:
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Tuesday 3 March 2020
Top read post on Blog in Feb 2020
Popular Posts
- One of the things I enjoy is a subscription to Adabox from Adafruit, receiving the box and very soon before that finding out what the main ...
- You can control servos (small ones) from a Micro:Bit directly. Following a link from the David Whale (Twitter @ whaleygeek ) , thank you, t...
- In previous posts ( post 1 , post 2 ) I have raved over the brilliant combination of Mozilla's AFrame and Jerome Etienne's fantastic...
- This is the third of a planned occasional series of posts on playing with some of the current AI specific boards for Intenet of Things ...
- This is really part two of a set of post in response to a question from Carl Simmons ( @Activ8Thinking ) concerning building a micro:bit ...
- In the previous blog posts for this 'series' "It is a good time...." Post 1 looked at the hardware unpinning some of...
- I wanted to contol the CBiS micro:Bit Car via gestures whilst holding another micro:Bit (see Figure 1) I went for: - Button A in combinat...
- The microbit is a great piece of kit, not least of which because of the range of programming languages and tools that can be used with it - ...
- With the sad news that Anki is shutting down ( https://www.vox.com/2019/4/29/18522966/anki-robot-cozmo-staff-layoffs-robotics-toys-boris-sof...
- Guest Blogger Hiren Mistry, Nuffield Research Placement Student working at the University of Northampton. How to use a PS3 Controller to...
Search This Bl
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Subscribe to:
Posts (Atom)
Remote Data Logging with V1 Microbit
In an earlier post https://robotsandphysicalcomputing.blogspot.com/2024/08/microbit-v1-datalogging.html a single microbit was used to log ...