Asked — Edited
Resolved Resolved by DJ Sures!

Multiple Ez-Robots

I have a question about the sending data between multiple ez-robots. Basically, my PC will connect two or more ez-robots, how can I receive data from one robot and send data to other robots.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

United Kingdom
#1  

If they are both connected to the same instance of ARC the variables are global to that instance of ARC.

#2  

Good,, thanks! One more question, if my computer is connecting to a Arduino Board via USB, how can I send data from arduino to ev4 then the ev4 can process the data then sends back the data to arduino?

#3  

To elaborate on to what rich said, If your using the same ARC file for both, you can write a script to communicate between the bots.

I.E. You have robot arrive at home base. You would have the robot trigger


$robot1ishome = 1

And the second robot would be using a script to say "ill be right there" like


:loop
IF ($robot1ishome = 1)
sayezb(1, "I'll be right there!")

ELSEIF 
sayezb(1, "Are you there yet?")
Sleep(5000)
ENDIF

Goto(loop)

I can't guarantee the script is totally correct, but it should be close. Use this as an example for writing your own.

As for your arduino question, you can use analog ports on the ez-b connected to data ports on the arduino, and have the arduino send info, or you could also use the i2c or UART ports on the ez-b connected to the corresponding arduino port. Then write a script to have the ez-b read the data.

If you don't want the boards connected but rather communicate over the pc, you could use the sendserial control to send info over the com port, if the arduino can except that.

#4  

I see, in the multiple robots, how can I run a specific robots. Like if I want first robot to do dance, second robot to say "hello", and the third robot to play music.

#5  

When you send a command you can specify which ezb board to send the command to with an optional parameter... I think below is the format...


servo(1.D0,90) #sends a servo move command to ezb board 1
servo(2.D0,90) #sends a servo move command to ezb board 2
#etc

#6  

but this servo() function only moves the servo position, right? How can I call a customized function for different robots.

United Kingdom
#7  

You would need to configure all controls to use the relevant EZ-B. It's an option on all controls other than the Movement Panel (Unfortunately this is the downfall, you can only have 1 Movement Panel per project).

The other way is to run multiple instances of ARC. You would need to send all variables to each instance of ARC though which isn't an easy task (at the moment - the cloud should solve that soon)

#8  

Not quite sure I understand what you are saying... It's not just for servo commands, it's for all commands whether for scripts or controls (Board # options are also available) in most controls as well...)...

Robots are made up of a bunch of scripts and controls right? So build your ez robot project for the first (0) ebz board, then build another robot specifying board #1 then a third robot specifying board #2 and so on...

edit Rich is right, forgot about that... One Movement Panel per project and I think only one speech rec as well... (not quite sure)

#9  

OK, I got it.

Last question, can ev4 read data from serial terminal?

PRO
Synthiam
#10  

Yes, you can read and write to the 3 hardware high speed uarts in ARC or sdk. There is a terminal in ARC for the uarts. Download ARC for free right now.

You can connect to 5 ez robots with the software. You can have Auto Position controls for movements of each robot. You can also code as given example by previous posts.

You can do anything you want with it. Download the software:)

As for your Arduino, you can connect to it - but that's up to you. You will have to write code on your arduino and stuff. That's something I can't help you with. Which is why we made ez robot, so ppl don't have to write complicated code on arduinos to do very little and impress no one:)

#12  

@Richard

Hi, I met another question. I tried to use sayEZB() method to make multiple ez-robots say different sentences in the same ARC. like the first border will say sayEZB("First"), but how to make the second board say sayEZB("Second") ?

PRO
Synthiam
#13  

The SayEZB() only works with the FIRST ezb. This is hardcoded and cannot be changed.