orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
SegwayRmpAcfrAn ACFR implementation using USB and CAN interfaces.
More... |
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 (orca_component_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!
# apt-get install linux-source linux-headers-[VERSION]-[ARCH] # /usr/src/ # ln -s linux-headers-[VERSION]-[ARCH] linux
Now compile and install the driver.
$ cd [PEAK-SRC] $ make # make install
Note: if you get an error "cp: cannot stat `/etc/modprobe.conf': No such file or directory", just try to install again, it will work on the second try.
cd /usr/src/; ln -s linux-headers-2.6.17.11-386 linux;
-After doing the peak driver 'make install' step. Edit the default shell used in the "pcan_make_devices" script from #!/bin/sh to #!/bin/bash. This file exists under /usr/local/bin .
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)