EZ-Builder Release 2013.07.22.00

Download and install the latest EZ-Builder robot programming software to experience these updates.

Download EZ-Builder
This release contains a rewrite of the EZ-Script compiler for more features, functions, scientific math and compliance. The old compiler allowed you to embed variables within a quoted string ( i.e. "Text: $variable" ). However, that wasn't a compliant syntax to be similar with other programming languages. The new compiler requires the strings to be concatenated (i.e. "Text: " + $variable). This will aid in education and readability.

There is also a slight speed increase in the compiler. And many new functions for Math and Logic.

A really neat add-in is a new control for the Apple Mobile Device App called FNI Co. Sensor Streamer. There is both a free and paid version available. The control can be found under the Misc category of Add Control. The control will set variables to the values of parameters from the application. This includes sensors such as Compass (teslameter), Accelerometer, Gyroscope, GPS (longitude, latitude), and touchscreen. It's a really great app! Download App: https://itunes.apple.com/app/sensor-data-streamer/id608278214?mt=8

Changes:

- New EZ-Script compiler

- New Control: Sensor Streamer Server

- New memory Variable Manager

- File->Open dialog remembers last open location
To Use

1) Load EZ-Builder
2) Select Projects tab from top menu
3) Press Add Control
4) Select MISC tab
5) Add the control "Sensor Streamer Server"

The control will default to port 1111. Configure your Mobile Device to connect to your computer's IP Address. The control will display the Accelerometer, Gyroscope and Compass Direction. The Config menu will allow you to assign sensor values to EZ-Script variables. The Sensor Stream Server will also control servos. This can be configured under the Config menu of the control.

User-inserted image


User-inserted image
Canada
#1  
Now this i Like :D :D :D
Thank You
#3  
DJ and Co.

It's working PERFECTLY!

However the app you configured EZ-Script around is actually named "Sensor Data Streamer" By FNI Co., LTD and costs .99.

To get my correct ip address for the app, I clicked:

Windows Start>typed cmd enter>ipconfig enter
That displays IPv4 address which usually starts with 192.168.1.2 The last two numbers will vary.

Also with a poor wifi connection, if I turn the sample rate up too high it starts to behave erratically. But I don't think that more than 10-20 Hz would be necessary.

I'm glad I didn't buy a gyro and GPS...

Thanks for all you do!
United Kingdom
#4  
Cool, although now I need to fix a bunch of scripts but never mind:)

One quick question (I have not updated yet as I am at work). With the new syntax of "text" + $variable, some of my scripts display $variable1 $variable2 $variable3. If they are decimal would

Code:

Print($variable1 + $variable2)

add the 2 variables together like it does with

Code:

$variable4 = $variable1 + $variable2


Hopefully that makes sense. I'll be trying it as soon as I can but wanted to know before I sit down and fix the scripts.
Synthiam
#5  
What you want to do is (like all languages) is add a blank space...

Code:


$x = 5
$y = 3
print($x + " " + $y)

Outputs: 5 3


Or if you want them beside each other as a string...

Code:


$x = 5
$y = 3
print(ToString($x) + ToString($y))

Outputs: 53
United Kingdom
#6  
Thanks:) Although I don't know what I was thinking (it's early, I've not had my coffee yet) but none of my scripts are like I said anyway but that's good info to have. I guess I should be using the ToString() command more often too

A pre-emptive strike as I know a few of my scripts wont work now, I will fix them as soon as I can. It should be limited to only a handful.:)

And thanks for the update!:)
New Zealand
#7  
Likewise received with thanks DJ and team...

The improved syntax will aid in teaching... appreciated.

@tameion
#8  
There are several similar sensor streaming apps for Android. I will try some out (at least ones that do UDP streaming). I suspect the new feature would work with any of them.

Alan
#9  
Alan, I would be really interrested by your tests with Android apps... please don't hesitate to share your results.:)
#10  
im a little confused on the new compiler. all its changed is where the quotation marks go and has added math funtions? *confused*

The apple device thing will be awesome!
United Kingdom
#11  
@technopro, something like that yes. It's changed the syntax so, when using Print with multiple variables or parts you must separate them with the + character. Math functions have always been part of EZ-Script. If you haven't used Print in scripts much then it probably wont make much difference to you. A quick look through all of my scripts I've written and very few require updating.
United Kingdom
#12  
Loving this addition
Here's a simple script that speaks current location and heading

Note the smileys are really close brackets! (tips for removing them appreciated)


Code:

:top
$alt = Round($Altitude,0)
$lat = Round($Latitude,2)
$lon = Round($Longitude,2)
$Mag = Round($MagneticHeading,0)
If ($lon < 1)
$token = "minus"
Else $token = "plus"
endif
Say ("altitude is" + $alt + "Meters")
Say ("location is" + $lat + "latitude")
Say ("by")
Say ($token + $lon + "longitude")
Say ("on a heading of" + $Mag + "degrees")
Sleep (5000)
goto (top)
United Kingdom
#13  
OK so going through some of my scripts...

Battery Monitor
It tells me the following syntax is wrong, should it be wrong? It's an easy fix for the code but a bit of a pain to fix on all scripts.

Code:

  Print("C1 " + Round($cell1,2) + "V")


Also, my ifs with or

Code:

IF ($cell1 > $vmax or $cell2 > $vmax)

throws this error

Code:

28: IF ($cell1 > $vmax or $cell2 > $vmax)
> Error on line 28: Invalid token in expression: [or]


It throws the same error if I put each part in brackets too i.e.

Code:

IF (($cell1 > $vmax) or ($cell2 > $vmax))


And with and.

The example code for IF with AND and OR

Code:

IF (GetServo(D5) > 20 OR ($x >= 3 and $y < 2))
Print("Yup!")
ENDIF

throws

Code:

Start
Error on line 1: Invalid token in expression: [OR (]
Done (00:00:00.0060003)



Ping Roam
This throws an error

Code:

Servo($sweepservo, $sweepcenter)

Code:

Unknown servo Port: $sweepservo

Can I no longer set the servos ports as variables in the head of the code?

I can't check any further on this script as it was written so it would be simple for community members to use and every Servo() command uses a variable for it's port.

Am I missing something?
Synthiam
#14  
Check the latest version:)
United Kingdom
#15  
It can't find what I am looking for when I click download, am I being too impatient?:D

Scrub that, as soon as I posted it I was able to download it.

Ifs with OR and AND work great now:) And I will update so ports are not variables, since that's best practice anyway (I've never been fond of that method anyway).

Thanks for the update:D Time to play (and type lots and lots of code - at least it will force me to finish Ping Roam 1.1.1)
Synthiam
#16  
Ports will work as variables:) It's not something I have liked - but I added that functionality back.
United Kingdom
#17  
Thanks:)

Although I will be updating my scripts to remove the port variables, it's not good practice at the end of the day. It may make it easier for the community to use the scripts but it takes away from them understanding the scripts and how they are put together. And it's mainly the battery monitor and ping roam scripts that use them, both of which are being updated so it's no biggie if you did want to take it out (I have no problems with it - it is the kick up the backside I need to get my head back in to those scripts)
#18  
Is it time to start having specific users (@Rich, @jstarne1) beta test prior to releases? It seems to me that EZ-Builder is getting complex enough that each new release breaks something that a small team of dedicated beta testers would probably identify.

Just a thought. (for a change, I am not volunteering myself. Barely have enough free time to work on production releases let alone Beta...).

Alan
#19  
The Techguru,

I find the releases hot off the press extremely valuable. I find these breaks backwards compatibility issues to be quite rare yet easy to remedy over all. I also keep all previous downloads. Might I suggest if you find something is broke, report it of course, but uninstall that version and reinstall the versions that previously worked with your models?

Bill
United Kingdom
#20  
Just to point out, everything is currently in beta since the revolution release:)

With EZ-Builder being an evolving application I will always expect the possibility of a few bugs somewhere but we can rest easy knowing that those bugs will be squashed:)
Brazil
#21  
Folks, is there a way to display the video (on ControlCommand video player...) on full screen ?
I mean, can I configure that window to play full?
Thanks!
Tevans.
United Kingdom
#22  
You can resize the window but it wont be full screen, you'll still have the ribbon across the top.
#23  
I tried the three most promising Android apps I found for streaming sensor data "Sensor Fusion" and "IMU+GPS Stream" and "wireless IMU" (which doesn't include GPS data but also just streams the raw data without headers, so I thought it might show something), and EZ-Builder doesn't see the packets so is not populating the variables (yes, I opened the port in Windows Firewall). I suspect that the iPhone app has specific header data or labels that DJ programmed for that are different in the Android apps (IMU_GPS and Wireless IMU, at least according to the log files they create just stream raw data with no headers, so you need to know the order the data is coming to know which variable to put it in. Sensor fusion keeps crashing and not writing to the log, so basically useless).

I was not connected to my EZ-B at the time, so if this is like how voice reco used to require the board to be connected for timing, then my test may have been invalid.

I'll try again tomorrow night connected to an EZ-B unless DJ can post some information about what specifically the stream is watching for.

DJ, if you want to add Android support, Sensor Fusion has the cleanest interface, but also crashed on me several times and would not even save data to a log file. IMU+GPS Stream includes the most sensor data but I need to update the target IP address and which sensors I want to stream every time I run it. Wireless IMU only streams three sensors, but is also open source, so could be a good place to start if we want to build a EZ Builder specific app.

Alan
#24  
Good job DJ, the possibility to use the sensor from the Iphone give us an interresting tool to play, I begin to regret having only an Ipod.

DJ, is it possible to make an addition to the Digital panel ? The Set Digital is fine but I'd like to be able to control more I/O. I am currently testing a track platform and it need 4 i/o total to work, 2 for the right motor and two for the left one. I know it's selfish to ask for this but at least it will populate a little bit the Digital window :) I'd like to have one same as the Modified servo Movement Panel...

Thank you for the good work and so many improvement !

André
Synthiam
#25  
Thanks @Andre99, have you thought about using the Script Manager or EZ-Script control? You can toggle the digital ports using the toggle EZ-Script command. Or just use the SET command to turn them on or off programatically
#26  
Hello DJ, for this base I want to be able to control it's position with the keyboard or the mouse because my mower robot will use this type of controls to record the perimeter of my courtward.

I just think I can use a joystick unstead with script, it will be much better, I will be able to have speed control at the same time as direction (for the mower, the other is only on or off). So, will have to wait until tomorrow to purchase a joystick :( The joystick panel is very good, the Variables will be perfect.

The toggle function is to toggle the state of the output of one digital port ? I made a search and was not able to fin any example in the forum, only in EZ-Builder and I can't test it now, my wife is sleeping.:)

Thank you DJ for the good suggestions, I am very happy with my EZ kit and it alway's surprise me with the possibility you have made in it.

André
Synthiam
#27  
Awesome Andre99:) Also, look in the Keyboard Control. You can map EZ-Script to keys. It is found under the Scripting tab:D
#28  
DJ, you are surprising ! This will do the job perfectly, you had just made my day. Look like I will have a lot of fun tomorrow morning.

Just to show you the little thing I test, it's not good looking for now:

User-inserted image


Thank's again DJ
#29  
The example below does not appear to be working in the script control of EZ-Builder.

The first time I run the script control it gives me 0's regardless of the color of the BlinkM. The second time I ran it, it disconnects the EZ-Robot controller in the connection widget.

From the EZ-Builder BlinkM control I was able to read and set values just fine. My BlinkM fades through many colors as a default program. I was able to pick up different values at different times.

Is it a flaw with the example code?

from : https://www.ez-robot.com/Community/Forum/posts.aspx?threadId=3918

Code:


# Shift the bits over
# Set the LSB (first bit) to a 1
# When first bit is a 1 on i2c, that means
# it is a Read Address
$i2cAddress = 0x09

Print("BlinkM Address: " + $i2cAddress)

# Tell BlinkM we want the RGB Values
i2cWrite(0, $i2cAddress, 0x67)

# Receive the RGB Values
$raw = i2cRead(0, AUTO, $i2cAddress , 3)

# Print the number of bytes
Print("Received: " + Length($Raw) + " Bytes" )

# Print the hex value of each byte
PrintHex($Raw)

# Split the array of bytes and assign to each variable
$Red = GetByte($Raw[0])
$Green = GetByte($Raw[1])
$Blue = GetByte($Raw[2])
United Kingdom
#30  
Probably something in the code needs changing, I'll have a look when I get the chance.

Have you tried substituting the $i2caddress variable for the actual address, in this case 0x09?
#31  
Tried putting in the address instead of the variable... still get 0's on the first run and disconnect on the second.

Return in the status window when it disconnects.

Code:


Disconnected
Comm Err: Not Connected
BbytesToExpect: 1

Received:
Disconnected
Disconnected
United Kingdom
#32  
Have you checked the wiring of the BlinkM? Some of my I2C devices would cause disconnects when I had bad wires.

I'll try and test it on mine later if I can.
#33  
The BlinkM is in great condition. It works flawlessly with the EZ-Builder BlinkM control connected to the EZ-Robot as well as with the BlinkM Software via an Arduino to program and operate it. It has the header pins soldered to the board and they have good connections.

So far, the only thing I cannot get to work is the example script provided above of which I posted the reference to where I found it in the EZ-Robot forum. My actual project is a I2C compass module that I cannot get working with the EZ-Builder script. But since I am certain my BlinkM is operational, I figured it is better to use to debug my I2C issues.

Since the EZ-Builder BlinkM control works, I'm certain the EZ-Robot and BlinkM work fine. Just trying to figure out the script side.

Thanks so much. I appreciate all you can do to help me figure out how to use I2C with the EZ-Builder script.
#35  
Works great with 2013.07.24.00.

Now I'm looking forward to getting my compass working. Thanks for all the help. EZRobot makes this hobby super fun.
#36  
Hi DJ,
I was trying to write an ezscript using the sensor streamer compass variable for navigation without success.
Would you please publish an example on how to do that?
Nick
#37  
Hi everybody,

@Dj I suppose that since this conversation is 3 years old now there's no hope that there'll be a version of the the current UDP sensors listener that is compatible with either of the Android apps mentioned by @thetechgourou? It's really a pity since the iPhone is a control freak which does not allow for any remote control, nor any customization nor any way to relaunch an app remotely, while Android allows for all these options. Using a GPS, and orientation sensors in general is, in my case, totally meant to work on autonomus robots, not high tech RC cars, so there's no point for me to use an iphone since they will always eventually stop running their sensor and it will not be possible to restart it remotely...

@Alan, btw, the EZbuilder is receiving the data stream from IMU+GPS Stream Android App, if you look into the debug you'll see it prints in loops that the received data is invalid. I think you're right, it might indeed be a matter of headers and raw data. It's really frustrating to see that, basically, my robot will never have any sort of reliable position/direction/orientation reading since on one end my EZ-robot's MPU9150 systematically end up sending inconsistent data, even after calibration attempts : sometimes it works to the perfection, some other times it simply doesn't work any longer (even once plugged to a totally separate controller without any other device connected to it) and, on the other end, my HMC5883, although it sends pretty consistent data, it however systematically crashes the EZBoard due to the inherent totally unreliable nature of i2C on a moving robot with motors and, thus, induction, bumps, etc. (and this is also a pb with the MPU).
Synthiam
#38  
@Elfege, ez-robot has an awesome plugin which allows 3rd party development. Take a look and you can create your own udp listener. Have fun!
#39  
Writing this plugin is absolutely on my (unfortunately lengthy and rarely getting any shorter) to do list. From the research I have done there is plenty of source to steal ^b^b^b^b^b borrow from for IMU listeners. I actually can't believe we have been talking about this for 3 years. It is really something I want to do.

Alan
#40  
@Dj : seriously? You want me to fight my lazyness and not satisfy my capricious Mind?! Hahaha!

Well... ok then, I'll get to work...:)

Thanks for the link I'll look into this as soon as the time is given to me... I have a champagne party to set up for Saturday and so far I only bought tons of champagne... @Alan, @Rich or @Dj, join us if you're in NY! Well celebrate five years (I think) since I started as a complete beginner in the field and now became the guy to whom you say: Hey! program it yourself! " I'm sooo Flattered!:D but beware of the tons of dumb questions that'll come (with the usual spaghettis) once I put my nose Into it!
Synthiam
#41  
Champagne party? Man that would be fun! Classy way to drink:D
#42  
Ok, here we go!

@Dj I read and watched all tutorials available on EZ-ROBOT website and so far creating a new plugin is pretty doable as long as it's within EZ_builder's presets classes.

On the other end writing an UDP listener in C# is also pretty simple.

What I can't figure out is how to make these work together within the same code in Visual Studio... here lies my limit right now.