INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
SegwayRmpAcfr
|
An ACFR implementation using USB and CAN interfaces.
Note: This driver has been tested on the balancing platform RMP200 and the caster version RMP50.
The segwayrmp
driver provides control of a Segway RMP (Robotic Mobility Platform), which is an robotic version of the Segway HT (Human Transport), a kind of two-wheeled, self-balancing electric scooter. Because of its power, weight, height, and dynamics, the Segway RMP is a potentially dangerous machine. Be very careful with it.
For safety, this Segway will stop (zero-out motion commands) if no new command has been received from the PC in the previous 400ms or so. This is done in Segway firmware and this component does not duplicate this functionality. Thus, if you want to continue moving at a constant velocity, you must continuously send your desired velocities to the Platform2d interface (Teleop component does exactly that).
When controlled through the USB port, the Segway implements an extra level of safety precaution which works as follows. On startup, the Segway black box checks for the presence of a host PC. If the host PC is absent, the Segway disables itself. All of this means that the following startup order must be followed:
If for some reason you did it in the wrong order (e.g. the cable was unplugged), just power cycle the Segway.
The implementation of orca_interface_odometry3d interface does not integrate robot's motion in the vertical direction. The altitude (z coordinate) of is always reported as 0.0.
The USB version of RMP uses a chip from Future Technology Devices Int. (FTDI). Following the Windows demo software from Segway we use a high-level closed-source library from FTDI to communicate with their chip. The Linux and Windows versions of the library have a (nearly) identical API. On linux the library is called libftd2xx.so and it uses the standard low-level libusb.so.
Make sure libusb is installed. In Debian, the easiest is to install the developer package. It's likely that you already have the library and all this package will do is create a couple of symbolic links.
# apt-get install libusb-dev
The Orca component has been tested with libftd2xx.so.0.4.13 and libusb-0.1.so.4 (these are the latest versions tested). Download the libftd2xx library from www.ftdichip.com. Untar and follow the installation instructions in README.dat file. Note an incorrect version number in several places and that the line to add to your fstab
file depends on the distribution and kernel number. The following has been tested in Debian, kernels 2.6.12 and 2.6.15 and Kubuntu, kernel 2.6.20.
none /proc/bus/usb usbfs defaults,devmode=0666 0 0
Tips for troubleshooting: Use usbview (or look at /proc/bus/usb/devices) to check whether the Segway shows up when you plug in the USB. Use dmesg on the console to see whether the mounting is successful.
In addition, copy the header files provided with the distribution to a standard place, e.g.
# cp ftd2xx.h WinTypes.h /usr/local/include/.
On some systems, an additional symbolic link needs to be created for shared libraries to load properly. You'll see an error message at runtime that contains "libftd2xx.so.0: cannot open shared object file".
# ln -s /usr/local/lib/libftd2xx.so.0.4.10 /usr/lib/libftd2xx.so.0
As usual, make sure that both Linux and CMake detect the changes
# ldconfig $ cd <hydro_src> $ rm CMakeCache.txt $ cmake .
You should see the following line in CMake output:
USB Driver for Segway RMP - can be built
Acfr.GainSchedule
(string)Acfr.MaxVelocityScale
(double)Acfr.MaxTurnrateScale
(double)Acfr.MaxAccelerationScale
(double)Acfr.MaxCurrentLimitScale
(double)Acfr.ProductModel
(string)Acfr.RequireSpecificBuildId
(bool)Acfr.RequiredBuildId
(int)Acfr.AllowMoveInTractorMode
(bool)Acfr.AllowMoveInBalanceMode
(bool)Acfr.LogCanDataToFile
(bool)Acfr.CanDataLogFileName
(string)This driver is written to interface with the PCMICA CAN card from peaksystems http://www.peak-system.com/linux . Please read the general description above for the USB driver as some of the information there is directly relevant. The drivers for the peak devices should be downloaded from the website above. Download the driver package *.tar.gz, unzip and follow the installation instructions in Documentation/Installation-en.pdf
. This should work for PCMCIA, USB, PCI cards etc, though only the PCMCIA version has been tested!
The following should work on Debian (last tested with driver version 6.11, kernel 2.6.26)
# apt-get install linux-source linux-headers-[VERSION]-[ARCH] # cd /usr/src/ # ln -s linux-headers-[VERSION]-[ARCH] linux
Now compile and install the driver. We assume here 2.6.25 kernel or newer. Our driver does not work with the netdev interface, so the support for it must be disabled (see webpage for details).
$ cd [PEAK-SRC] $ make NET=NO_NETDEV_SUPPORT # make install
On at least one ubuntu installation it was necessary to make some additional changes in order to run the installs.
# cd /usr/src/; ln -s linux-headers-2.6.17.11-386 linux;
Now back to compiling Orca SRC. As usual, make sure that both Linux and CMake detect the changes
# ldconfig $ rm CMakeCache.txt $ cmake .
You should see the following line in CMake output:
CAN Driver for Segway RMP - can be built
Acfr.CanDevice
(string)Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)