TamuBot Version 3.0: Parker01

IMU Inetegration

OpenEmbedded:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

OpenEmbedded is a cross compiler which we use to build the tamuclient code for the Gumstix. To start a build all you need to do is type, in a terminal window, bitbake –c rebuild [file_name]. All information about bitbake and the .bb files needed to build the package can be found at http://www.gumstix.com/support.html.


A few tips about bitbake:

  1. The recipe (.bb) name can not contain any thing but lowercase letters and numbers. If there is an uppercase letter or underscore character in your recipe name, bitbake will not complete successfully.

  2. Use the same name in the make file as you do in your recipe. If all the names are the same you will not have to worry about the extremely vague errors. If your package name is overlapped, then make the Makefile create overlapped.

  3. If you are running on a slower machine I would recommend that you use a Makefile before you build the package. This way you will not have to waste a couple of minuets waiting on the build to fail due to compiler errors. Making the files first will save you a good deal of time.

================================================================================

IMU 605 Thread:

------------------------------------------------------------------------------------------------------------------------------

This thread has two versions. The version that is working on the TamuBot as of now (July 28, 2008) is a polling style thread. This is due to the SPI thread which is also a polling style thread. Once the SPI thread is converted to an event-driven thread the IMU 605 thread can then be event-driven as well. This event-driven design has already been implemented but not tested. This code has a signal handler which listens for the SIGIO signal. When the event handler receives the SIGIO signal it will read the byte from the FIFO buffer. If this byte is the proper header byte the thread will resume, if not the thread will remain in a state of waiting.

Serial port settings for IMU 605:

     open ([port], O_RDWR | O_EXCL | O_NONBLOCK)

     c_iflag = 0

     c_oflag = 0

     c_cflag = CLOCAL | CREAD | CS8

     c_lflag = 0

     c_cc[ VTIME ] = 0

     c_cc[ VMIN ] = 1

     BAUD: 115200

================================================================================

3DM-GX1 Thread:

------------------------------------------------------------------------------------------------------------------------------

With this current design the IMU 605 must be running or the 3DM-GX1 will be forever waiting. If the user wants to only use the 3DM-GX1 during their experiments, the user will only have to remove the wait on IMU 605 thread command.

Serial port settings for 3DM-GX1:

     open([port], O_RDWR | O_NOCTTY | O_NDELAY)

     c_iflag = IGNPAR

     c_oflag = 0

     c_cflag = B38400 | CS8 | 0 | 0 | 0 | CLOCAL | CREAD

     c_lflag = 0

     BAUD: 38400


================================================================================

Packages:

------------------------------------------------------------------------------------------------------------------------------

Inside the package folder there should be a files folder, which will contain all files except for the recipe (.bb), and the recipe file. After building the package transfer the executable to the Gumstix. After the file is on the Gumstix you can ssh in and run it.

List of Packages: (highlighted packages will not be covered below)

    helloworld

    IMU_test

    Overlapped

    Overlapped_linux

    Rover

    rover_alone

    RoverOld

    sertest

    test

IMU_test

    bitbake –c rebuild imu

files: Errors.h, imu.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h

This package is nothing but a test package for the two IMU. It is currently set up to run the IMU 605. With this package you can send the IMU commands and check the sensors response. In the current version imu.cpp only uses basic serial port commands; none of the other files are actually used. They are only there for testing purposes.

Overlapped

     bitbake –c rebuild overlapped

files: Errors.h, Overlapped.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h

This version is OUT-DATED. This code is what was used to read sensor data from the IMU 605. The current way of getting the data and parsing the data is different from this package. This package is just used as a reference when creating the current design.

Overlapped_linux

    NOT FOR GUMSTIX

files: Errors.h, Overlapped.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h

This version is OUT-DATED. This code is used to test the IMU 605 on the Linux desktop. The only difference in this code is one line in the .bb file. Again this package is not current because it is a test package.

rover_alone

     bitbake –c rebuild tamualone

files: Errors.h, tamuclient.cpp, IMUDataParser.cpp/h, Makefile, mpDataSource.cpp/h, Serial.cpp/h, Crc8.c/h, dcb.h, DumpMem.c/h, fill_txQ.cpp, GetTime.cpp/h, gpio.c/h, i2c.c/h, i2c-api.c/h, i2c-common.h, i2c-dev.h, i2c-io.h, i2c-io-api.c/h, init_sock.cpp/h, Log.h, m3dmgAdapter.c/h, m3dmgErrors.h, m3dmgSerial.h, m3dmgSerialLinux.c, m3dmgUtils.c/h, protocol.c/h, Queue.h, thr_encoder.cpp, thr_imu.cpp, thr_microstrain.cpp

This package does everything the full version does minus the communication to the socket. This allows you to test your code with out the Windows interface. Note: The IMU 605 thread is in a polling style. Here is what the event driven code should look like:

#include <sys/signal>

void signal_handler_imu605(int status);

IMU_thread()

{

        struct sigaction saio;

        //open port

        saio.sa_handler = signal_handler_imu605;

        sigemptyset(&saio.sa_mask);

        saio.sa_flags = 0;

        saio.restorer = NULL;

        sigaction(SIGIO, &saio, NULL);

        fcntl(portNum, F_SETOWN, getpid());

        fcntl(portNum, F_SETFL, FASYNC);

        //loop

        //p_thread wait

        //read and parse data

}

void signal_handler_imu605(int status)

{

        read(portNum, &readChar, 1);

        if (readChar == 0x0BD)

        {

                //signal the thread

        }

}

This event driven code has not been tested due to the encoder thread. However, the SIGIO signal works when the encoder thread is disabled. The above code is not in any packages at this time.

sertest

bitbake –c rebuild sertest

files: sertest.cpp, Makefile

This code is another serial communications test package. The original version of this code can be found on Gumstix’s buildroot website.

test

bitbake –c rebuild test

files: Errors.h, microstrain.cpp, m3dmgAdapter.c/h, m3dmgErrors.h, m3dmgSerial.h, m3dmgSerialLinux.c, m3dmgUtils.c/h

                        This package is a test package for the 3DM-GX1IMU.

================================================================================


Attachments (1)

  • packages.tar.gz - on Jul 31, 2008 12:03 PM by fineb@cs.tamu.edu (version 1)
    686k Download

Comments (1)

fineb@cs.tamu.edu - Jul 31, 2008 12:04 PM

The packages.tar.gz file contains all of the packages needed to test the two IMU, IMU 605 and 3DM-GX1.