For participants only. Not for public distribution.

Note #37
Field Testing and Vehicle User

Khian Hao Lim
Last revised December 7, 2003 .

Vehicle User

For testing on the bench of separate modules, it is fine to use your own user accounts for running the watchdog or your application directly. To test many programs running together under the watchdog, we should run the watchdog as the vehicle user. This ensures that the right permissions are given to the programs running and makes syncing of binaries on separate machines more convenient. The vehicle user is present on all the machines that will be on the vehicle (gcrear0, gcrear1, gcchassis).

The password for the vehicle user is "vehicle".

This is exactly what will happen for the competition: one of the machines directly boots up, changes to vehicle user and runs the watchdog with the default startfile (see Booting).

Home directories

The vehicle user home directory, /home/vehicle/ on the vehicle machines (gcrear0, gcrear1 and gcchassis) will contain the bin directory where

binaries are found. For clarity, it is recommended that the bin directory only contains binaries that are meant to run on that machine. The /home/vehicle/ directory on gcrear1 (the computer designated to run the watchdog) will contain 2 more directories startfiles and text. The startfiles directory will contain all the startfiles for the different modes of testing and operation. The text directory will contain the logs that are "tee"ed off the stdout and stderr output of the watchdog program. Look in there to look for the printing outputs of your programs.

Field Testing

For field testing, there is a monitor and wireless keyboard (with roll ball) connected to gcrear1. Sshd is running on gcchassis, gcrear0 and gcrear1 and you should be able to ssh to each of the machines if you need to. Note that gcchassis only has root and vehicle user accounts set up. Avoid using the root account on gcchassis. Use the vehicle user account if you need to ssh in.

The wireless 802.11b bridge will be present on the vehicle for testing. The wireless bridge makes the whole vehicle network (industrial hub + gcrear0 + gcrear1 + gcchassis) appear on the wired network in the workshop transparently. If the vehicle is in range of the workshop, the machines in workshop should be able to talk to the vehicle machines. With line of sight, this should be about 100m. Without line of sight, it will be 20 to 30m. Whether in range or out of range, the vehicle machines would be able to talk to each other.

Step by Step for Field Development

  1. Ensure that you are the only one doing the development to prevent confusion. The /home/vehicle/ directory can be accessed and written by all users.
  2. Accounts and the momentics ide is set up on gcrear1 (gcrear0 also) for development. Perform your changes to your directory /home/<username>/sandbox/gc/* on gcrear1 and compile all the programs you made changes for.
  3. Install all the changed binaries to /home/<username>/sandbox/gc/src/qnx/common/bin. You can do this by copying the binaries over there or by doing "make install" in each of the directories where changes have been made if you have set up your project using Momentics IDE.
  4. Now we need to copy the binaries to /home/vehicle/bin/ on the relevant machines. You can copy it yourself or you can run the script         > /home/<username>/sandbox/gc/src/qnx/support/ /net/gcrear1/vehicle/startfiles/<relevant startfile> which would parse the startfile, remove ALL the binaries in /home/vehicle/bin/ on each of the vehicle machines and copy the relevant binaries from  /home/<username>/sandbox/gc/src/qnx/common/bin to /home/vehicle/bin/ on the right machine. Note: is work in progress.
  5. Change user to vehicle by doing "su vehicle" with the password given above.
  6. As vehicle user, run watchdog with the relevant startfile on gcrear1:                                                                                           gcrear1:/home/vehicle/bin/$   ./watchdog ../startfiles/<relevant startfile>
  7. Continue development and testing. Once done and back in the workshop, cvs commit all the relevant source codes in your sandboxes. You should compile the binaries and publish (cvs committing the binaries in /home/<username>/sandbox/gc/src/qnx/common/bin) your binaries if you deem them good for publishing.