Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected links that should have been relative instead of absolute.

Communicating with the Kayak

The kayak has two computers installed in the computer box:

Both computers have static ip addresses and automatically log on to the SMART-MUV network hosted by the Cisco router SN:JV200JB13276 in the lab. To connect to the computers, first connect the netbook to the SMART-MUV network.  You need to make sure the netbook is also using a static IP.  To do this, open the available networks tab, and ensure that SMART-MUV is selected.  Then open the Network and Sharing Center and click on the Wireless Network Connection (SMART-MUV).  Open the Properties tab, then select Internet Protocol Version 4 (TCP/IPv4) and open properties.  The Use the following IP address option should be selected.  The following worked in January:

IP address:  192.168.10.55

Subnet Mask:  255.255.255.0

Once it is connected, open Putty to ssh to the ubuntu kayak computer and remote desktop to operate the windows xp computer.

The top computer runs windows xp:

ip address: 192.168.10.12
computer name: laPetiteOrange
username: James
password: orange

The bottom computer runs ubuntu:
ip address: 192.168.10.13

username: orange

password: orange

Logging into Kayak from a Mac

You can log into the windows kayak using windows remote desktop connection, which is a free download for mac from the MIT IST website, or the Microsoft website.  

For the Ubuntu computer:

Wireless:  Make sure you are connected to the SMART-MUV router.  Just like with the netback, you will need to set a static IP address.  This can be done by opening Network Preferences, then selecting Advanced.  Select the TCP/IP tab, and select manually from the Configure IPv4 menu.

IPv4 Address:  192.168.10.54

Subnet Mask: 255.255.255.0

Open the terminal, then from the shell menu select New Remote Connection. Select Secure Shell (ssh):

User: orange

bottom box: ssh orange@192.168.10.13

*Note:  make sure to switch your TCP/IP back to using DHCP or you won't be able to connect to other wifi internet sources*

Ethernet:  Connecting the linux machine over wireless can be really slow, so another option is to use an ethernet cable connect.  Plug the cable into the switch in the kayak control box, which is the blue box below the two computers.  

Open network preferences and select Ethernet.  Select Manually from the Configure IPv4 menu.

IPv4 Address:  192.168.10.54

Subnet Mask: 255.255.255.0

Then ssh into the linux computer just as with wireless.

Running an Experiment

 

Collecting Sensor Data

First, connect to both the ubuntu and windows computers on the kayak.

Pressure data is collected with labview on the windows machine.

All other sensor data is collected with the ubuntu machine. When you are logged in to the ubuntu machine, open the my-moos directory, then the zlogData directory using:

cd my-moos

cd zlogData

Once in the zlogData directory, run the kayak_new.moos process by using:

pAntler kayak_new.moos

Kayak_new.moos runs zLoggerNG, and creates slog files in the zlogData folder.

This starts logging data from all of the sensors (except pressure) and stores them in a single binary file in the current directory named with the starting timestamp.zlog. To stop recording data, type:
control-c

To make sure the process is killed, use killall pAntler, and you should see pAntler: no process found if the process is killed.

Operating the Thruster

The thruster is currently setup to be operated with a radio controller. There are moos applications for computer control of the thruster and even autonomous control, but these have not yet been set up for la petite Orange.

There are matching pairs of crystals (which about .5cm square components with two contacts) for a radio controller and its receiver. The kayak receiver is located in the stern compartment in a waterproof box. The crystal in the receiver must match the crystal in the radio controller for radio control to work. The battery must be plugged in, but the computers need not be booted up to control the thruster.

Retrieving Data

The zlogtool application is used to convert the binary zlog files stored by the zLoggerNG command into ascii data. Running ./zlogtool -h will bring up a description of how to use the application and what options are available. By default, the output is printed to the terminal. To store the data in a text file, add >> fileName.txt at the end of the command.

The storeSensorData application (source code: storeSensorData.cpp) was written to conveniently store data from all zlog files in a directory called "zlogFiles" so that you don't have to manually run zlogtool. Running:
./storeSensorData
will save text files with data from compass and gps, dvl, and imu from any zlog files saved in a directory called "zlogFiles". The text files generated for compass and gps, and dvl can be directly read into matlab with the load function. The imuSave application (source code: imuSave.cpp) was written to further format the imu .txt files so that they can also be directly read into matlab with the load function. Running:
./imuSave
will save imu data from any imu text files output from the storeSensorData application in a directory called "imu" in space-delimited rows. The names of each file will be appended with "FORMATTED"

The data then needs to be transferred out of the kayak. This can be done by opening the computer box and using a usb drive, or with the linux command scp.  ssh into the linux computer from another machine, then use, for example:

scp orange@192.168.10.13:/home/orange/my-moos/zlogData/log_2012-01-12_* ./

To remove Files:

to remove files: rm filename

remove directory: rm -r directory name

Sensor Baud Rates and Outputs

 gps: 19200

 

$GPRMC,094409.0,V,0117.98039,N,10346.55663,E,,,230913,000.2,E*78

$GPGGA,094409.0,0117.98039,N,10346.55663,E,0,00,,,M,,M,,*4C

etc.

 compass: 19200

 

$C161.6P1.9R0.5T34.5*2A

$C161.6P1.9R0.3T34.5*2C

$C161.6P1.9R0.2T34.5*2D

 

IMU: 38400

 

Kayak Control Board: 19200

 

$KASSR,0000,0000,0000*74

$KASDR,03,00*4C

$KASVR,9664,11666,15940,19,21,2998,-32766*69

 

DVL: 9600

 

:SA,   +0.00,   +0.00,  0.00

:TS,11111216054664,35.0, +24.1,   0.0,1532.1,  0

:BI,-32768,-32768,-32768,-32768,V

:BS,-32768,-32768,-32768,V

:BE,-32768,-32768,-32768,V

:BD,        +0.00,        +0.00,        +0.00,   0.00,9739.82

 

To Set Serial Ports:

The kayak has an annoying tendency to reset the serial port assignments, leading to bad data.  The port assignments can be set by using:

 

nano kayak_new.moos

 

Then, find the device that is not giving the correct values and check which port it is assigned to (ex: ttyUSB0).  The port assignment can then be changed, with careful attention needed to ensure proper baud rate.  

 

The output from a port can also be viewed in the terminal using: 

 

cat /dev/ttyUSB#

 

ex:

cat /dev/ttyUSB5

 

The format of the output for the different sensors is given above.  The baud rate can be changed from the command line using:

 

stty -F /dev/ttyUSB# (baud rate)

 

ex:

stty -F /dev/ttyUSB1 19200

Other details

The new_kayak.moos file includes the processes that are executed when the pAntler kayak2.moos command is run. As of January 2012, this file includes commands to collect data in the background from GPS, compass, DVL, and imu. If other processes are to be run in the background, they must be added to the new_kayak.moos file.