Loading ...
Sorry, an error occurred while loading the content.

intellibrain data transfer

Expand Messages
  • fergus
    hi, i have a data gathered from the CMUcam...the data are process in the computer...the equivalent action of that will be deliver in the
    Message 1 of 8 , Jul 7, 2010
    • 0 Attachment
      hi, i have a data gathered from the CMUcam...the data are process in the computer...the equivalent action of that will be deliver in the intellibrain-bot...here's the question, is it possible to input data to the robot from a computer? can i use the serial cable or the so called Bluetooth device?...i really need your help...thank you
    • Judane James
      Yes you can..
      Message 2 of 8 , Jul 8, 2010
      • 0 Attachment
        Yes you can..

      • fergus
        ahh...i mean transfer data in real time...while the robot is moving it will also receiving a new data...how?
        Message 3 of 8 , Jul 9, 2010
        • 0 Attachment
          ahh...i mean transfer data in real time...while the robot is moving it will also receiving a new data...how?

          --- In intellibrain@yahoogroups.com, Judane James <jujames84@...> wrote:
          >
          > Yes you can..
          >
        • Judane James
          Ok so you can use the COM Port class... (you will have to download javax.com class and install it on the PC you are using.... then declare the class in you
          Message 4 of 8 , Jul 9, 2010
          • 0 Attachment
            Ok so you can use the COM Port class... (you will have to download javax.com class and install it on the PC you are using.... then declare the class in you program...you can assign numbers to the output.write(); statement.

            --- On Fri, 7/9/10, fergus <aquarius_1727@...> wrote:

            From: fergus <aquarius_1727@...>
            Subject: [intellibrain] Re: intellibrain data transfer
            To: intellibrain@yahoogroups.com
            Date: Friday, July 9, 2010, 4:07 PM

             
            ahh...i mean transfer data in real time...while the robot is moving it will also receiving a new data...how?

            --- In intellibrain@yahoogroups.com, Judane James <jujames84@...> wrote:
            >
            > Yes you can..
            >


          • Paul King
            ... In the java program running on the robot, you need to open the intellibrain s serial port and read and write ASCII data via some protocol that you devise.
            Message 5 of 8 , Jul 9, 2010
            > ahh...i mean transfer data in real time...while the robot is moving it
            > will also receiving a new data...how?
            In the java program running on the robot, you need to open the intellibrain's serial port and read and write ASCII data via some protocol that you devise.  Then, on your PC, you need to exit the RoboJDE environment (so that it releases the serial port), and have a separate program running that you develop, which opens the serial port and reads and writes ASCII data using your same protocol above.  That program can be written in any language.
             
            The pyrorobotics library (www.pyrorobotics.org) is a program written in python for the PC that has a driver for communicating with the Intellibrain.  There is a separate Java driver program that you load onto the Intellibrain to handle the other side of the communication.  This is just an example.
             
            I have attached here my modified (improved, better documented, more flexible) version of the intellibrain-side Java driver for pyrorobotics.  This Java code will show you how to open a serial port and gives an example command-based protocol, for example if the PC sends "D 10,10", the robot will drive with left and right wheels at 10% of maximum speed. You can use any terminal program to open a connection to the serial port and type these commands while the IB is running this Java program.  It's just like using an "AT-style" serial modem. Each command received by the robot is displayed on its LCD screen for easier debugging.
             
            To understand the program, look at main() first (at the end of the file).  To see all the supported commands, look at the method run().
             
            Pieces of this program could be pulled out and adapted to whatever your application is, including sending data back.  This program sends data back via polling.  The PC sends "Y" for "read sonar range finder", and the robot replies with "y, 20" indicating that the object is 10 cm away.
             
            This protocol is good because it uses very few extraneous characters (the baudrate is slow and the Intellibrain Java VM has a very slow execution rate, so it cannot process data at the full speed that the serial port can deliver it except in very special circumstances). The actual single-letter command names appear to have their origin with the Khepera project, a research robotics project in Switzerland.  The IB driver seems to have copied the Khepera's protocol.
             
            Good luck!
             
            Paul
             
             
             
            ----- Original Message -----
            From: fergus
            Sent: Friday, July 09, 2010 9:07 AM
            Subject: [intellibrain] Re: intellibrain data transfer

             

            ahh...i mean transfer data in real time...while the robot is moving it will also receiving a new data...how?

            --- In intellibrain@yahoogroups.com, Judane James <jujames84@...> wrote:
            >
            > Yes you can..
            >

          • pkinghu88
            ... [I sent a reply to this yesterday, but apparently it didn t go through because I attached some sample code. So here is my reply again without the sample
            Message 6 of 8 , Jul 10, 2010
            • 0 Attachment
              > ahh...i mean transfer data in real time...while the robot
              > is moving it will also receiving a new data...how?

              [I sent a reply to this yesterday, but apparently it didn't go through because I attached some sample code. So here is my reply again without the sample code. Maybe I'll send the sample code inline as its own message following this.]

              In the java program running on the robot, you need to open the intellibrain's serial port and read and write ASCII data via some protocol that you devise. Then, on your PC, you need to exit the RoboJDE environment (so that it releases the serial port), and have a separate program running that you develop, which opens the serial port and reads and writes ASCII data using your same protocol above. That program can be written in any language.

              The pyrorobotics library (www.pyrorobotics.org) is a program written in python for the PC that has a driver for communicating with the Intellibrain. There is a separate Java driver program that you load onto the Intellibrain to handle the other side of the communication. This is just an example.

              I have attached here my modified (improved, better documented, more flexible) version of the intellibrain-side Java driver for pyrorobotics. This Java code will show you how to open a serial port and gives an example command-based protocol, for example if the PC sends "D 10,10", the robot will drive with left and right wheels at 10% of maximum speed. You can use any terminal program to open a connection to the serial port and type these commands while the IB is running this Java program. It's just like using an "AT-style" serial modem. Each command received by the robot is displayed on its LCD screen for easier debugging.

              To understand the program, look at main() first (at the end of the file). To see all the supported commands, look at the method run().

              Pieces of this program could be pulled out and adapted to whatever your application is, including sending data back. This program sends data back via polling. The PC sends "Y" for "read sonar range finder", and the robot replies with "y, 20" indicating that the object is 10 cm away.

              This protocol is good because it uses very few extraneous characters (the baudrate is slow and the Intellibrain Java VM has a very slow execution rate, so it cannot process data at the full speed that the serial port can deliver it except in very special circumstances). The actual single-letter command names appear to have their origin with the Khepera project, a research robotics project in Switzerland. The IB driver seems to have copied the Khepera's protocol.

              Good luck!

              Paul
            • jujames84
              ... ok so... to read from the COM Port you need the javax.com files (you will have to search google for them they are no longer available on sun java
              Message 7 of 8 , Jul 10, 2010
              • 0 Attachment
                --- In intellibrain@yahoogroups.com, Judane James <jujames84@...> wrote:
                >
                > Yes you can..
                >

                ok so... to read from the COM Port you need the javax.com files (you will have to search google for them they are no longer available on sun java website...

                a simple read port class...


                import java.io.InputStream;
                import javax.comm.CommPortIdentifier;
                import javax.comm.SerialPort;

                public class readCOM extends Thread
                {
                public void run()
                {
                CommPortIdentifier portId1;
                InputStream inputStream;
                SerialPort serialPort1;
                try
                {
                portId1 = CommPortIdentifier.getPortIdentifier(comPort);
                serialPort1 = (SerialPort) portId1.open("ComControl", 2000);
                serialPort1.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);

                inputStream = serialPort1.getInputStream();
                }
                }catch(Exception e)
                {
                e.printStackTrace();
                }
                }



                To write create a write class...and then call the class from main by declaring it.


                import java.io.OutputStream;
                import javax.comm.CommPortIdentifier;
                import javax.comm.SerialPort;

                public class writeCOM
                {
                CommPortIdentifier pid;
                SerialPort serial;
                java.io.OutputStream outstream;
                String comPort = "COM5";
                private int data;

                public void writeToPort() throws Exception
                {
                CommPortIdentifier pid = CommPortIdentifier.getPortIdentifier(comPort);
                serial=(SerialPort)pid.open("WriteControl",1000);
                serial.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                serial.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
                outstream=serial.getOutputStream();

                }

                }



                Ok my write class is a little weird but if you are calling it from your main it works....
              • fergus
                tnx...it helps a lot...
                Message 8 of 8 , Jul 11, 2010
                • 0 Attachment
                  tnx...it helps a lot...

                  --- In intellibrain@yahoogroups.com, "jujames84" <jujames84@...> wrote:
                  >
                  >
                  >
                  > --- In intellibrain@yahoogroups.com, Judane James <jujames84@> wrote:
                  > >
                  > > Yes you can..
                  > >
                  >
                  > ok so... to read from the COM Port you need the javax.com files (you will have to search google for them they are no longer available on sun java website...
                  >
                  > a simple read port class...
                  >
                  >
                  > import java.io.InputStream;
                  > import javax.comm.CommPortIdentifier;
                  > import javax.comm.SerialPort;
                  >
                  > public class readCOM extends Thread
                  > {
                  > public void run()
                  > {
                  > CommPortIdentifier portId1;
                  > InputStream inputStream;
                  > SerialPort serialPort1;
                  > try
                  > {
                  > portId1 = CommPortIdentifier.getPortIdentifier(comPort);
                  > serialPort1 = (SerialPort) portId1.open("ComControl", 2000);
                  > serialPort1.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                  >
                  > inputStream = serialPort1.getInputStream();
                  > }
                  > }catch(Exception e)
                  > {
                  > e.printStackTrace();
                  > }
                  > }
                  >
                  >
                  >
                  > To write create a write class...and then call the class from main by declaring it.
                  >
                  >
                  > import java.io.OutputStream;
                  > import javax.comm.CommPortIdentifier;
                  > import javax.comm.SerialPort;
                  >
                  > public class writeCOM
                  > {
                  > CommPortIdentifier pid;
                  > SerialPort serial;
                  > java.io.OutputStream outstream;
                  > String comPort = "COM5";
                  > private int data;
                  >
                  > public void writeToPort() throws Exception
                  > {
                  > CommPortIdentifier pid = CommPortIdentifier.getPortIdentifier(comPort);
                  > serial=(SerialPort)pid.open("WriteControl",1000);
                  > serial.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                  > serial.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
                  > outstream=serial.getOutputStream();
                  >
                  > }
                  >
                  > }
                  >
                  >
                  >
                  > Ok my write class is a little weird but if you are calling it from your main it works....
                  >
                Your message has been successfully submitted and would be delivered to recipients shortly.