FAQ forum
From Maslab 2007
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Where is maslab.jar?
It is installed on your bot at /usr/share/java/maslab.jar; you do not need a separate orc.jar. If you add export CLASSPATH=/usr/share/java/maslab.jar:. to your .bash_profile, then you will not have to specify the CLASSPATH everytime you boot up.
It is also installed in AFS, at /mit/6.186/2006/maslab.jar. Note: if you're having trouble finding it from AFS, then try fs flush and try again.
How do I find my IP address using the OrcPad?
Press A to access the menu, and select the "IP addresses" option. (Note that orcd must be running—make sure that the Orc power is on when you turn on the computer.) Now you can use that IP to SSH into your computer.
OrcPad magic keys
- A
- OrcShell menu (programs run by
orcd, IP address, etc.)—requires computer to be running, plugged in, connected. - A+B
- Orcboard menu (drive mode to test motors, config, etc.)—does NOT require computer.
- A+B+stick
- Orcpad status.
- A+B+stick for 5 seconds
- Calibrate Orcpad joystick.
OrcPad status info
- USB
- Indicates if connected. If you see a
/dev/orcprintline on the computer terminal and USB momentarily come on when you run a program, it means thatorcdis not running, and the program itself is opening the connection. - Four rectangles
- Status of the four motor drivers.
- Check (blinking) plus
- Heartbeat from the orcboard. Blinking circle indicates an error; A+B gives you info (please send staff what it says).
How to use IR sensors?
For short-range (regular) IR sensors of model GP2D12 (should be written on the side of the sensor), use: IRRangeSensor i = IRRangeSensor.makeGP2D12(orc,port); to create it and then i.getRange() to get its value. Do your own testing/calibration as well and do not blindly trust its output as other factors can affect its reliability. Also note that it will get confused if objects are placed within a few cm of it, and you will want to make sure your bot is designed to not allow that to happen.
Driving issues
- Wheels bowing/bending
- Run a white ziptie through the rear two holes in the metal bracket around your motor. This will hold up the motor and make the wheel more level.
- Wobbling
- Make sure that the bracket isn't bending by putting a shim between the motor and the bracket.
- Not moving on carpet
-
- Drive at full power.
- Make sure that the batteries are charged or the power source is plugged in.
- Add friction to the wheels (with rubber bands, sandpaper, etc.).
- Make sure that the set screw is tight. If necessary, add tape on the motor shaft to tight, use a different screw, and make sure you're catching the notch on the shaft (notch with hacksaw if needed).
OrcBoard issues
If your OrcBoard is just not powering up, check the soldering joints between the board and the computer power plug, switches, and battery plug. We recommend filing the part of the computer power plug that plugs into the orcboard so it is easier to take in and out without stressing the solder joints.
Debugging advice
If you are having difficulty debugging your image processing, a good strategy is to have your image processing program mark the features it sees in a copy of the image, and then publish the modified copy to botclient. For example, drawing an X on each ball, sized by an estimate as to how far away the ball is, can facilitate quick determination of what your robot thinks is a ball (or other feature).
JugHub dropping packets
The robot is probably trying to push too many frames per second to an ImageChannel, and some are being lost. It's not a serious issue. You can try publishing images less often.
How to sense motor current
We recently added some patches. Now you should be able to sense the motor current by creating a new AnalogInput(16 + motorport). Also, a getCurrent() method has been added to the Motor class.
Can I mount my battery sideways?
We don't know of any issues with mounting batteries sideways/flat.
Camera white balance issues
If you are having white balance issues with the camera, try running Camera.getFactory() (you can write a test program to do this). It should reset the camera's internal flash to the default. You can also try connecting the camera to a Windows laptop, since the Windows drivers might reset the camera when it gets connected.
Adjusting motor slew rate
Use Motor.setAcceleration().
Using OrcSpy
If you're not running OrcSpy from the bot, you will need to tell it the robot's IP address: java -cp maslab.jar org.orcboard.orcspy.OrcSpy bot-ip
Reducing gyroscope noise
(From Howard Samuels, Analog Devices) One easy way to remove the gyroscope noise injection is to desolder R2 and C10. This takes seconds; it is hard to not to desolder them once you touch them with a soldering iron. If you want to be complete, you can also stop the oscillator by shorting C0. It is easier if you remove it first.
Java performance tuning
We recommend running Java using the following flags:
java -Xincgc -server -Xms128M -Xmx192M
-
-Xincgc - Enable incremental garbage collection. This will avoid periodic long pauses as Java cleans up unused objects from the heap.
-
-server - Enable optimization for long processes, rather than quick startup. This can make your code run faster, although it will slow it down for the first few seconds while Java compiles your code. To avoid problems, we recommend running computationally intensive parts of your code (such as image processing) through hard-coded test cases before the robot starts moving, to allow Java to "warm up."
-
-Xms128M - Set the initial heap size to 128 MB. By default Java starts with a fairly small heap and grows it slowly, forcing more garbage collection than would be necessary.
-
-Xmx192M - Set the maximum heap size to 192 MB. The Edens have 256 MB of memory; limiting the heap size will reduce the risk of swapping.
Also, if you're interested in seeing what functions your code is spending its time in, you can try running with -agentlib:hprof=cpu=samples,depth=8,interval=1,thread=y. This will dump profiling information to a file named java.hprof.txt. You should do this without -server or the profiler will be confused by the extra optimizations.
Running BotClient from Windows
One of the advantages of BotClient is that it is a platform independent program, because it is written in Java. Any Java code can run on any machine as long as there is a Java Virtual Machine designed for that machine. If you have the latest Java Runtime Environment (1.5.0 or greater) installed on your Windows PC, you can run botclient from the command line and it will function just as if you were running it on Athena.
Assuming you have Java 1.5.0 or later installed: (If you are not sure, go Download Java).
To run BotClient on your Windows PC, do the following:
- Copy maslab.jar onto your PC, and remember the path you stored it to. (For advanced users, add the jar to your CLASSPATH environmental variable)
- Click Start, hit Run
- In the box, type :
java -cp "c:/path/to/maslab.jar" maslab.telemetry.botclient.BotClient - Click ok.
The botclient window you are used to should pop up momentarily.
