Difference between revisions of "IKart"

From Wiki for iCub and Friends
Jump to: navigation, search
m (Esdcan driver)
m (Esdcan driver)
Line 106: Line 106:
 
==== Esdcan driver ====
 
==== Esdcan driver ====
  
iKart uses an ESD CAN-USB2 interface to communicate with the motor control board. The driver of the CAN-USB2 interface is contained in the socketcan linux package (further documentation here: http://lxr.linux.no/linux+v2.6.36/Documentation/networking/can.txt). You can verify the installation of the socketcan package from the the kernel module configuration menu (by launching ''make menuconfig'' from the ''/usr/src/linux'' directory). In order to properly work, please be sure that the following kernel modules/options are installed/enabled:
+
iKart uses an ESD CAN-USB2 interface to communicate with the motor control board. The driver of the CAN-USB2 interface is contained in the socketcan linux package (further documentation here: http://lxr.linux.no/linux+v2.6.36/Documentation/networking/can.txt). You should check the installation of the socketcan package from the the kernel module configuration menu (by launching ''make menuconfig'' from the ''/usr/src/linux'' directory). Please be sure that the following kernel modules/options are installed/enabled:
  
 
* networking support
 
* networking support
Line 115: Line 115:
 
**** CAN bit-timing calculation
 
**** CAN bit-timing calculation
  
 +
After compiling the kernel, you can check if the driver modules are correctly loaded by:
 +
* typing ''dmesg'' and searching for a string similar to ''esd_usb2 2-1:1.0: device can0 registered''.
 +
* modprobing the modules ''can'', ''can_raw'', ''can_bcm''.
  
At the end of the boot sequence, the following line contained in ''/etc/rc.local'' initializes the Esdcan driver.
+
Additionally to the kernel modules installation, the can-usb2 driver has to be initialized by the user before using it. This operation is automatically performed at the end of the iKart boot sequence, by a line contained in the ''/etc/rc.local'' script:
  
 
  ip link set can0 up type can bitrate 1000000
 
  ip link set can0 up type can bitrate 1000000

Revision as of 17:29, 3 January 2012

iKart hardware description

iKart overview

Main panel

Internal panel

Battery

Wireless

Hard Disk

Motor control boards

Wheels suspensions

CAN to USB converter

Power supply

Laser scanner

An UTM-30LX Laser Range finder (Hokuyo Ltd) is mounted in front of the iKart. It is powered by a 12V ...................., while the data are transmitted on through a separated USB cable. The range finder is able to detect obstacles up to 30m, with a scan angle of 270 degrees. The maximum refresh rate is 40Hz.

Hokuyo.jpg

Joystick receiver

The joystick receiver is a standard XBox 360 wireless receiver. It is placed on the of the battery and is connected to an internal USB connector. The wireless range is about 10 meters.

XboxWirelessReceiver.jpg

iKart Software

iKart Control

Joystick Control

The joystickCtrl module allows to take the input from a joystick and send it on a yarp port (by default: /joystickCtrl:o). The module takes in input a .ini file in which the user can specify the configuration of the joystick, including axis remapping, different scaling factors, deadbands, etc. A complete list of the available configuration options is reported in the module documentation.

Below is reported default joystick configuration to control the iKart. The joystick configuration is specified in the file: '$ICUB_ROOT/app/joystickCtrl/iKart.ini

Xboxjoystick.JPG

Laser GUI

The laserScannerGUI provides a simple graphical interface in order to visualize the measurements performed by the frontal laser rangefinder. The module receives the measurements from the iKartCtrl module through the /ikart/laser:o yarp port. A list of all the available options (e.g. zoom, refresh rate etc.) is displayed by pressing the key 'h'.

LaserGui.jpg

Battery Manager

The iKartBattteryManager is the module responsible of verifying the status of charge (SoC) of the battery. The module is automatically started from the script /etc/rc.local during the boot sequence (see also ...) and periodically reads the from the /dev/ttyUSB0 serial port the SoC of the battery. The default update rate is 10 seconds. In order to preserve the robot sensible components from dangerous brownouts, the module takes the following actions if the battery is low:

  • The user will be notified with a wall message if the charge of the battery level is lower than 10%.
  • If the battery reaches a critical level (below 5%), the module will start an emergency shutdown procedure, by stopping the iCub and iKart motor interfaces, and turning off the machine, with a two minutes advance notice.

The module executes independently if the yarp server is running or not. If yes, infomation about the SoC of the battery is sent through the /ikart/battery:o port. You can also ask the module to save a timestamped logfile of the performed battery measurements, by specifying the option --logToFile into the startup script (default: off).

Battery Display

The iKartBatteryDisplay is a graphical tool which displays the current SoC of the battery. The module receives the battery info from the iKartBatteryManager module through the /ikart/battery:o yarp port. Since the iKart obviously doesn't have a graphical output, this module will not run on the iKart machine. Instead, the iKartBatteryDisplay is thought to be executed by the user on all the machines remotely connected to the iKart. The provided always-on-top window will remember to the user the remaining autonomy of the robot, so it's a good idea to execute to keep an iKartBatteryDisplay instance always running on each user machine connected to the iKart.

BatteryDisplay.jpg

Starting the iKart with the joystick

There are cases in which you may want to start moving the iKart just after the boot, without connecting to the robot in ssh, starting all the application etc. This joystick start-up is particularly useful if, for example, you turned on the iKart in a room where there is no wireless connection, and you want to move it to another room. In order to command the iKart to perform a joystick start-up, you have to follow the procedure:

  • Turn on the the iKart.
  • Turn on your joystick by pressing the central joystick button.
  • Wait for the beep coming from the iKart, indicating that the boot is finished.
  • At this point you have for 5 seconds the chance, by pressing any button on the joystick (or moving the sticks) to initiate the joystick start-up procedure.

If a the joystick activity has been detected, the iKart will automatically initialize the following processes (and will make automatoically all the required connections):

  • The Yarp server.
  • The iCubInterface required to control the iKart motors.
  • The iKartControl module.
  • The joystickControl module.

You will be now able to move the iKart around usually the joystick as in normal operation.

How the joystick-startup procedure works

The script responsible for the joystick-startup procedure is ikart_start.sh which is originally located under $IKART_ROOT/app/iKart/ikart_boot and copied to $ICUB_BIN during the installation procedure. The scripts executes the joystickCheck module in order to verify if a joystick activity is detect, and executes initializes the yarp server and the control software if so. The ikart_start.sh script is automatically executed from the main boot script /etc/rc.local after the low-level drivers initialization.

Stopping/Restarting the joystick-startup

An analogous script ikart_stop.sh is provided in order to stop all the modules launched by the ikart_start.sh script, when controlling the iKart is no longer required. Currently, there is no way to execute this script using the joystick, so it has to be manually invoked through an ssh connection to iKart. Please also note the yarp server started by the ikart_start.sh script will be not stopped by the ikart_stop.sh script. Finally, remember that the joystick start-up procedure, which is particularly convenient during the boot, can be also manually invoked anytime, by launching the ikart_start.sh script from a console, or through an ssh connection.

Using the iKart

iKart (re)installation

Additional information related to the installation/configuration of iKart software are reported in this section.

Drivers

Esdcan driver

iKart uses an ESD CAN-USB2 interface to communicate with the motor control board. The driver of the CAN-USB2 interface is contained in the socketcan linux package (further documentation here: http://lxr.linux.no/linux+v2.6.36/Documentation/networking/can.txt). You should check the installation of the socketcan package from the the kernel module configuration menu (by launching make menuconfig from the /usr/src/linux directory). Please be sure that the following kernel modules/options are installed/enabled:

  • networking support
    • CAN bus subsystem support
      • Raw CAN Protocol
      • Broadcast Manager CAN Protocol
      • CAN Device Drivers
        • CAN bit-timing calculation

After compiling the kernel, you can check if the driver modules are correctly loaded by:

  • typing dmesg and searching for a string similar to esd_usb2 2-1:1.0: device can0 registered.
  • modprobing the modules can, can_raw, can_bcm.

Additionally to the kernel modules installation, the can-usb2 driver has to be initialized by the user before using it. This operation is automatically performed at the end of the iKart boot sequence, by a line contained in the /etc/rc.local script:

ip link set can0 up type can bitrate 1000000

Joystick driver

iKart uses the xboxdrv userspace driver.

The driver is launched by the following line of the etc/rc.local file:

xboxdrv --silent

Start-up scripts

Yarp and iCub repositories

iKart and ROS

iKart dimensions